Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Available from 5.6.0.1

...

Request

Parameter
Required
Type
Description
IdYesURLURL parameter for the Id which is used to find and return a Resource Type

Response Codes

HTTP Code
Description
200Resource Type was found and returned
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Resource Type not found
500Unexpected internal server error

Example

If we a Resource Type in our database with an Id of 20405 20408 and the following attributes

When we run a GET request at the following URL

http://host:port/flexdeploy/rest/v2/administration/resourcetype/2040520408

The GET request would return the following JSON Resource Type object

Code Block
themeEclipse
titleResource type GET Return JSON
{
    "description": "Postman test data1",
    "ownerType": "Workflow",
    "isActiveresourceTypeName": true "Get Example Name",
    "resourceTypeNameisActive": "Postmantrue,
Resource Type Test REST 1"createdOn": 1629882360332,
    "versionNumber": 1,
    "createdBy": "fdadmin",
    "resourceTypeId": 20408,
    "updatedBy": "fdadmin",
    "updatedOn": 204051629882360332
}

GET by Query Parameters

This GET service will return a list of Resource Types in the form of JSON objects based on the query parameters resourceTypeId, resourceTypeName, ownerType, and isActive. Resource Types are only returned if they match ALL of the specified query parameters. If no query parameters are given this request will return the entire list of Resource Types. The resourceTypeName parameter returns Resource Types that contain the specified parameter. The other parameters must be equal to the Resource Types.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v2/administration/resourcetype?

Append the following character sequences to the above URL to specify Query parameters.
Use '&' between successive query parameters: 

resourceTypeId={resourceTypeId}

resourceTypeName={resourceTypeName}

isActive={isActive}

ownerType={ownerType}

Examples:
To Specify the code parameter only:

http://host:port/flexdeploy/rest/v2/administration/resourcetype?resourceTypeId={resourceTypeId}

To Specify the code and group code parameters:

http://host:port/flexdeploy/rest/v2/resourcetype?resourceTypeId={resourceTypeId}&resourceTypeName={resourceTypeName}

To Specify the name, group code, and sub group code parameters:

http://host:port/flexdeploy/rest/v2/resourcetype?resourceTypeId={resourceTypeId}&resourceTypeName={resourceTypeName}&ownerType={ownerType}


Tip

The query parameters are not case sensitive. Searching by resourceTypeName=NAME is the same as searching by resourceTypeName=name.

...

Output when querying by isActive through http://host:port/flexdeploy/rest/v2/administration/resourcetype?isActive=false

Code Block
titleSample JSON Output
collapsetrue
[
    {
        "description": "Postman Updated descriptiontest data 1 updated",
        "ownerType": null,
        "isActiveresourceTypeName": false "Get Example Name updated1",
        "resourceTypeNameisActive": "Postman Resource Type Test REST 1 patched" false,
        "createdOn": 1629882360332,
        "versionNumber": 31,
        "createdBy": "fdadmin",
        "resourceTypeId": 20408,
20401       }
]

POST

...

 "updatedBy": "fdadmin",
        "updatedOn": 1629883055449
    }
]

POST

The POST service will create a new Resource Type with the same attributes as the given JSON object. It returns the JSON representation of the Resource type that was just created with an updated ID attribute.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v2/administration/security/resourcetype

Request

Attributes
Type
Required
Description
resourceTypeNameStringYesName of Resource Type
isActiveBooleanNo

Whether or not this Resource Type is active.

descriptionStringNo

Description of the Resource Type.

ownerTypeStringNo
Owner Type value of the Resource Type.

...

Code Block
collapse
titleSample JSON Inputtrue
{
    "description": "Postman test data1",
    "ownerType": "Workflow",
    "isActive": true,
    "resourceTypeName": "PostmanGet Resource Type Test REST 1",Example Name"
}

the following Resource Type will be created in the database. Notice the updated Resource Type Id field.

Code Block
titleSample JSON Output
collapsetrue
{
	{
    "description": "Postman test data1",
  	  "ownerType": "Workflow",
    	"isActiveresourceTypeName": true,
	"resourceTypeName "Get Example Name",
    "isActive": "Postmantrue,
Resource Type Test REST 1"createdOn": 1629882360332,
   	 "versionNumber": 1,
	    "createdBy": "fdadmin",
    "resourceTypeId": 20408,
    "updatedBy": "fdadmin",
    "updatedOn": 1629882360332
}

PUT

This PUT service will update all attributes of a Resource Types with the given Id based on the attributes of the supplied JSON object.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v2/administration/resourcetype/{Id}

Request

Attributes
Type
Required
Description
IdURLYesURL parameter for the Id which is used to find and update a Resource Type.
resourceTypeNameStringYesName of Resource Type.
isActiveBooleanNo

Whether or not this Resource Type is active.

Defaults to true if nothing is passed.

ownerTypeStringNo

Owner Type value of the Resource Type.

Response Codes

HTTP Code
Description
200Resource Type was found and updated
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Resource Type not found
500Unexpected internal server error

Example

If we had an Resource Type in our database with an Id of 20408 and had the following attributes

Code Block
collapse
titleCurrent Resource Typetrue
{
    "description": "Postman test data1",
    "ownerType": "Workflow",
    "isActiveresourceTypeName": true,"Get   Example Name",
    "resourceTypeNameisActive": "Postmantrue,
Resource Type Test REST 1"createdOn": 1629882360332,
    "versionNumber": 1,
    "createdBy": "fdadmin",
    "resourceTypeId": 20408,
    "updatedBy": "fdadmin",
    "updatedOn": 1629882360332
}

When we run a PUT request at the following URL

http://host:port/flexdeploy/rest/v2/administration/resourcetype/20408

And the PUT request receives the following JSON Resource Type object,

Code Block
titleSample JSON Inputcollapsetrue
{
    "description": "Postman test data 1 updated",
	"ownerType": """",
	"isActive":false,
	"resourceTypeName": "PostmanGet Resource Type Test REST 1 Example Name updated"
}

The PUT request would then update the Resource Type with Id 20408 and return the following JSON Resource Type object.

{ "description
Code Block
titleSample JSON Output
collapsetrue
{
    "description": "Postman test data 1 updated",
    "ownerType": "",
    "resourceTypeName": "PostmanGet testExample data 1Name updated",
    "ownerTypeisActive": false,
    "createdOn": 1629882360332,
    "isActiveversionNumber": true2,
    "resourceTypeNamecreatedBy": "fdadmin"Postman,
Resource Type Test REST 1 updated""resourceTypeId": 20408,
    "versionNumberupdatedBy": 2"fdadmin",
    "resourceTypeIdupdatedOn": 204081629882746226
}

PATCH

This PATCH service will update the information of the Resource Type of the specified Id with the non-null parameters of the JSON. The parameters that are null or missing will not be changed in the Resource Type.

...

{
Code Block
titleCurrent Resource Type
collapsetrue
{
    "description": "Postman test data1",
    "ownerType": "Workflow",
    "resourceTypeName": "Get Example Name 1",
    "descriptionisActive": "Postman test data1"true,
    "ownerTypecreatedOn": "Workflow"1629882360332,
    "isActiveversionNumber": true1,
    "resourceTypeNamecreatedBy": "fdadmin"Postman,
Resource Type Test REST 1"resourceTypeId": 20408,
    "versionNumberupdatedBy": 1"fdadmin",
    "resourceTypeIdupdatedOn": 204081629882360332
}

When we run a PATCH request at the following URL

...

Code Block
titleCurrent Resource Typecollapsetrue
{
    "resourceTypeName": "Postman Resource Type Test REST 1 "Get Example Name patched"
}

The PATCH request would then update the Resource Type with Id 20408 and return the following JSON Resource Type object.

...

Code Block
collapse
titleSample JSON Outputtrue
{
    "description": "Postman test data 1 updated"{
    "description": "Postman test data 1",
    "ownerType": "Workflow",
    "resourceTypeName": "Get Example Name patched",
    "isActive": true,
    "ownerTypecreatedOn": "Workflow"1629882360332,
    "isActiveversionNumber": true2,
    "resourceTypeNamecreatedBy": "fdadmin"Postman,
Resource Type Test REST 1 patched""resourceTypeId": 20408,
    "versionNumberupdatedBy": 2"fdadmin",
    "resourceTypeIdupdatedOn": 204081629882779169
}


DELETE

This DELETE service will find the Resource Type with the given Id and deletes it. 

...