Instances can be accessed and modified through this API using four services: GET, POST, PUT, and PATCH. These four services allow for the retrieval, creation, complete update, and partial update of Instances.
Authentication - Use Basic Authentication for this API.
GET
There are two implementations of GET. One will find an Instance with the given Id and return the JSON representation of the Instance. The other will find a list of Instances matching the parameters supplied to it.
GET by ID
This GET service will find an Instance with the given Id and return the JSON representation of the object.
API URL
http://host:port/flexdeploy/rest/v1/topology/instance/{Id}
Request
Parameter | Required | Type | Description |
---|---|---|---|
Id | Yes | URL | URL parameter for the Id which is used to find and return an instance |
Response
Attributes | Type | Description |
---|---|---|
description | String | Description of the Target Group. |
environments | List<Long> | List of the Environment Ids that are associated with this Target Group. |
workflows | List<Long> | List of the workflow ids that are associated with this Target Group. |
instanceId | String | The unique id of the Target Group. The id is made when making the Target Group, and it is returned in the JSON. |
instanceName | String | Name of the Target Group. |
isActive | Boolean | Whether or not this Target Group is active. |
pluginOperations | List<PluginOperation> | List of the plugin operations that are associated with this Target Group. |
instanceCode | String | The code of the Target Group. |
groupCode | String | The group code of the Target Group. |
subGroupCode | String | The sub group code of the Target Group. |
isDeploymentTarget | Boolean | Whether or not this instance is a deployment target. |
A plugin operation, relative to an instance, is defined by the following two fields.
Attributes | Type | Description |
---|---|---|
pluginId | Long | The plugin ID |
operation | String | The name of the plugin operation |
Response Codes
HTTP Code | Description |
---|---|
200 | Instance was found and returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Instance not found |
500 | Unexpected internal server error |
Example
If we had an Instance in our database with an Id of 11004 with the following attributes
{ "description": "GET example description", "environments": [11001], "workflows": [], "instanceId": 11004, "instanceName": "GET Example Name", "isActive": true, "pluginOperations": [], "instanceCode": "GETEXAMPLECODE", "groupCode": "GET example group", "subGroupCode": "GET example sub group", "isDeploymentTarget": false }
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/topology/instance/11004
The GET request would return the following JSON Instance object
{ "description": "GET example description", "environments": [11001], "workflows": [], "instanceId": 11004, "instanceName": "GET Example Name", "isActive": true, "pluginOperations": [], "instanceCode": "GETEXAMPLECODE", "groupCode": "GET example group", "subGroupCode": "GET example sub group", "isDeploymentTarget": false }
GET by Query Parameters
This GET service will return a list of Instances in the form of JSON objects based on the query parameters instanceCode, instanceName, groupCode, and subGroupCode. Instances 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 Instances. The instanceName parameter returns instances that contain the specified parameter. The other parameters must be equal to the instance.
API URL
http://host:port/flexdeploy/rest/v1/topology/instance?
Append the following character sequences to the above URL to specify Query parameters.
Use '&' between successive query parameters:
instanceCode={instanceCode}
instanceName={instanceName}
groupCode={groupCode}
subGroupCode={subGroupCode}
Examples:
To Specify the code parameter only:
http://host:port/flexdeploy/rest/v1/topology/instance?instanceCode={instanceCode}
To Specify the code and group code parameters:
http://host:port/flexdeploy/rest/v1/topology/instance?instanceCode={instanceCode}&groupCode={groupCode}
To Specify the name, group code, and sub group code parameters:
http://host:port/flexdeploy/rest/v1/topology/instance?instanceName={instanceName}&groupCode={groupCode}&subGroupCode={subGroupCode}
The query parameters are not case sensitive. Searching by instanceName=NAME is the same as searching by instanceName=name.
Request
Parameter | Required | Type | Description |
---|---|---|---|
instanceCode | No | Query - String | This is a URL query parameter for the instance code which is used to search the instances. Equals ignore case search |
instanceName | No | Query - String | This is a URL query parameter for the instance name which is used to search the instances. Contains ignore case search |
groupCode | No | Query - String | This is a URL query parameter for the group code which is used to search the instances. Equals ignore case search |
subGroupCode | No | Query - String | This is a URL query parameter for the sub group code which is used to search the instances. Equals ignore case search |
Response
Attributes | Type | Description |
---|---|---|
description | String | Description of the Target Group. |
environments | List<Long> | List of the Environment Ids that are associated with this Target Group. |
workflows | List<Long> | List of the workflow ids that are associated with this Target Group. |
instanceId | String | The unique id of the Target Group. The id is made when making the Target Group, and it is returned in the JSON. |
instanceName | String | Name of the Target Group. |
isActive | Boolean | Whether or not this Target Group is active. |
pluginOperations | List<PluginOperation> | List of the plugin operations that are associated with this Target Group. |
instanceCode | String | The code of the Target Group. |
groupCode | String | The group code of the Target Group. |
subGroupCode | String | The sub group code of the Target Group. |
isDeploymentTarget | Boolean | Whether or not this instance is a deployment target. |
A plugin operation, relative to an instance, is defined by the following two fields.
Attributes | Type | Description |
---|---|---|
pluginId | Long | The plugin ID |
operation | String | The name of the plugin operation |
Response Codes
HTTP Code | Description |
---|---|
200 | Search successful and results returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
500 | Unexpected internal server error |
Example
Output when the Group Code was made "Group" through http://host:port/flexdeploy/rest/v1/topology/instance?groupCode=Group
POST
The POST service will create a new instance with the same attributes as the given JSON object. It returns the JSON representation of the Instance that was just created with an updated ID attribute.
API URL
http://host:port/flexdeploy/rest/v1/topology/instance
Request
Attributes | Type | Required | Description |
---|---|---|---|
description | String | No | Description of the Instance |
environments | List<Long> | No | List of the Environment Ids that are associated with this instance. All provided environments will be associated with instance. |
workflows | List<Long> | No | List of the workflow ids that are associated with this instance. All provided workflows will be associated with instance. |
instanceId | String | No | The unique id of the instance. The id is made when making the instance, and it is returned in the JSON. |
instanceName | String | Yes | Name of the instance |
isActive | Boolean | No | Whether or not this instance is active. Defaults to true if nothing is passed. |
pluginOperations | List<Plugin> | No | List of the plugin operations that are associated with this instance All provided plugin operations will be associated with instance. Plugin contains pluginId and operation attributes. |
instanceCode | String | Yes | The code of the Instance |
groupCode | String | No | The group code of the instance |
subGroupCode | String | No | The sub group code of the instance |
isDeploymentTarget | Boolean | No | Whether or not this instance is a deployment target. Defaults to true if nothing is passed. |
Response
Attributes | Type | Description |
---|---|---|
description | String | Description of the Target Group. |
environments | List<Long> | List of the Environment Ids that are associated with this Target Group. |
workflows | List<Long> | List of the workflow ids that are associated with this Target Group. |
instanceId | String | The unique id of the Target Group. The id is made when making the Target Group, and it is returned in the JSON. |
instanceName | String | Name of the Target Group. |
isActive | Boolean | Whether or not this Target Group is active. |
pluginOperations | List<PluginOperation> | List of the plugin operations that are associated with this Target Group. |
instanceCode | String | The code of the Target Group. |
groupCode | String | The group code of the Target Group. |
subGroupCode | String | The sub group code of the Target Group. |
isDeploymentTarget | Boolean | Whether or not this instance is a deployment target. |
A plugin operation, relative to an instance, is defined by the following two fields.
Attributes | Type | Description |
---|---|---|
pluginId | Long | The plugin ID |
operation | String | The name of the plugin operation |
Response Codes
HTTP Code | Description |
---|---|
201 | Instance was created successfully |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
500 | Unexpected internal server error |
Example
If the POST receives the following JSON instance object,
the following Instance will be created in the database. Notice the updated Instance Id field.
PUT
This PUT service will update all attributes of an Instance with the given Id based on the attributes of the supplied JSON object.
API URL
http://host:port/flexdeploy/rest/v1/topology/instance/{Id}
Request
Attributes | Type | Required | Description |
---|---|---|---|
Id | URL | Yes | URL parameter for the Id which is used to find and update an instance |
description | String | No | Description of the Instance |
environments | List<Long> | No | List of the Environment Ids that are associated with this instance. If currently associated environment(s) are not in input list those environments will be unassigned from this instance. i.e. at the end of successful request, instance will have mapped environments matching to input request. |
workflows | List<Long> | No | List of the workflow ids that are associated with this instance. If currently associated workflows(s) are not in input list those workflows will be unassigned from this instance. i.e. at the end of successful request, instance will have mapped workflows matching to input request. |
instanceId | String | No | The instance Id in the request is ignored |
instanceName | String | Yes | Name of the instance |
isActive | Boolean | No | Whether or not this instance is active. Defaults to true if nothing is passed. |
pluginOperations | List<Plugin> | No | List of the plugins that are associated with this instance. If currently associated plugin operation(s) are not in input list those plugin operations will be unassigned from this instance. i.e. at the end of successful request, instance will have mapped plugin operations matching to input request. Plugin contains pluginId and operation attributes. |
instanceCode | String | Yes | The code of the Instance |
groupCode | String | No | The group code of the instance |
subGroupCode | String | No | The sub group code of the instance |
isDeploymentTarget | Boolean | No | Whether or not this instance is a deployment target. Defaults to true if nothing is passed. |
Response
Attributes | Type | Description |
---|---|---|
description | String | Description of the Target Group. |
environments | List<Long> | List of the Environment Ids that are associated with this Target Group. |
workflows | List<Long> | List of the workflow ids that are associated with this Target Group. |
instanceId | String | The unique id of the Target Group. The id is made when making the Target Group, and it is returned in the JSON. |
instanceName | String | Name of the Target Group. |
isActive | Boolean | Whether or not this Target Group is active. |
pluginOperations | List<PluginOperation> | List of the plugin operations that are associated with this Target Group. |
instanceCode | String | The code of the Target Group. |
groupCode | String | The group code of the Target Group. |
subGroupCode | String | The sub group code of the Target Group. |
isDeploymentTarget | Boolean | Whether or not this instance is a deployment target. |
A plugin operation, relative to an instance, is defined by the following two fields.
Attributes | Type | Description |
---|---|---|
pluginId | Long | The plugin ID |
operation | String | The name of the plugin operation |
Response Codes
HTTP Code | Description |
---|---|
200 | Instance was found and updated |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Instance not found |
500 | Unexpected internal server error |
Example
If we had an instance in our database with an Id of 11104 and had the following attributes
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/v1/topology/instance/11104
And the PUT request receives the following JSON instance object,
The PUT request would then update the Instance with Id 11104 and return the following JSON Instance object.
PATCH
This PATCH service will update the information of the Instance of the specified Id with the non-null parameters of the JSON. The parameters that are null will not be changed in the Instance.
API URL
http://host:port/flexdeploy/rest/v1/topology/instance/{Id}
The only required attribute is the Instance Id in the URL.
Request
Attributes | Type | Required | Description |
---|---|---|---|
Id | URL | Yes | URL parameter for the Id which is used to find and update an instance |
description | String | No | Description of the Instance |
environments | List<Long> | No | List of the environment ids that will be added to the instance. If input environment(s) is not already associated it will be associated to instance but existing environment assignment that are not in PATCH request will not be unassigned. i.e. input list is considered as append to existing assignments. |
workflows | List<Long> | No | List of the workflow ids that will be added to the instance. If input workflow(s) is not already associated it will be associated to instance but existing workflow assignment that are not in PATCH request will not be unassigned. i.e. input list is considered as append to existing assignments. |
instanceId | String | No | The instance Id in the request is ignored |
instanceName | String | No | Name of the instance |
isActive | Boolean | No | Whether or not this instance is active. |
plugins | List<Plugin> | No | List of the plugins that will be added to the instance. If input plugin(s) is not already associated it will be associated to instance but existing plugin assignment that are not in PATCH request will not be unassigned. i.e. input list is considered as append to existing assignments. |
instanceCode | String | No | The code of the Instance |
groupCode | String | No | The group code of the instance |
subGroupCode | String | No | The sub group code of the instance |
isDeploymentTarget | Boolean | No | Whether or not this instance is a deployment target. |
Response
Attributes | Type | Description |
---|---|---|
description | String | Description of the Target Group. |
environments | List<Long> | List of the Environment Ids that are associated with this Target Group. |
workflows | List<Long> | List of the workflow ids that are associated with this Target Group. |
instanceId | String | The unique id of the Target Group. The id is made when making the Target Group, and it is returned in the JSON. |
instanceName | String | Name of the Target Group. |
isActive | Boolean | Whether or not this Target Group is active. |
pluginOperations | List<PluginOperation> | List of the plugin operations that are associated with this Target Group. |
instanceCode | String | The code of the Target Group. |
groupCode | String | The group code of the Target Group. |
subGroupCode | String | The sub group code of the Target Group. |
isDeploymentTarget | Boolean | Whether or not this instance is a deployment target. |
A plugin operation, relative to an instance, is defined by the following two fields.
Attributes | Type | Description |
---|---|---|
pluginId | Long | The plugin ID |
operation | String | The name of the plugin operation |
Response Codes
HTTP Code | Description |
---|---|
200 | Instance was found and patched |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Instance not found |
500 | Unexpected internal server error |
Example
If we had an instance in our database with an Id of 11104 and had the following attributes
When we run a PATCH request at the following URL
http://host:port/flexdeploy/rest/v1/topology/instance/11104
And the PATCH request receives the following JSON instance object,
The PATCH request would then update the instance with Id 11104 and return the following JSON instance object.