Versions Compared

Key

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

AnchorTopTop

Info
titleBase URL for Instance REST API

http://host:port/flexdeploy/rest/topology/instance

Jump To:

...

Overview:

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.

You can find more information about the REST API functions on the Topology REST API page.  

Each function returns a JSON Instance object. An Instance object has these attributes:

...

Attributes

...

Type

...

Description

...

*unless otherwise stated

**defaults to true if nothing is passed

Back to Top

...

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.

Info
titleAPI URL

http://host:port/flexdeploy/rest/topology/instance/{Id}

Parameters

...

Parameter

...

Required

...

Type

...

Description

...

titleGET by ID Example

Example

...

Target Groups 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 Target Groups.

Include Page
REST V1 Authentication
REST V1 Authentication

Table of Contents
maxLevel2

GET

There are two implementations of GET. One will find a Target Group with the given Id and return the JSON representation of the Target Group. The other will find a list of Target Groups matching the parameters supplied to it.

GET by ID

This GET service will find a Target Group with the given Id and return the JSON representation of the object.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/topology/instance/{Id}

Request

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

Include Page
REST V1 Target Group Response
REST V1 Target Group Response

Response Codes

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

Example

If we had a Target Group in our database with an Id of 11004 with the following attributes

Instance
Code Block
themeEclipse
title
Target Group - 11004
{
	"description": "GET example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 11004,
	"instanceName": "GET Example Name",
	"isActive": true, "
plugins
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

Instance
Code Block
themeEclipse
title
Target Group GET Return JSON
{
	"description": "GET example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 11004,
	"instanceName": "GET Example Name",
	"isActive": true, "
plugins
pluginOperations": [],
	"instanceCode": "GETEXAMPLECODE",
	"groupCode": "GET example group",
	"subGroupCode": "GET example sub group",
	"isDeploymentTarget": false
}

Back to Top

GET by Query Parameters

This GET service will return a list of Instances Target Groups in the form of JSON objects based on the query parameters codeinstanceCode, nameinstanceName, group codegroupCode, and sub group code. Instances subGroupCode. Target Groups 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 Target Groups that contain the specified parameter. The other parameters must be equal to the Target Group.

Info
titleAPI 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: 

codeinstanceCode={codeinstanceCode}

nameinstanceName={nameinstanceName}

groupcodegroupCode={groupcodegroupCode}

subgroupcodesubGroupCode={subgroupcodesubGroupCode}

Examples:
To Specify the code parameter only:

http://host:port/flexdeploy/rest/v1/topology/instance?codeinstanceCode={codeinstanceCode}

To Specify the code and group code parameters:

http://host:port/flexdeploy/rest/v1/topology/instance?codeinstanceCode={codeinstanceCode}&groupcodegroupCode={groupcodegroupCode}

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

http://host:port/flexdeploy/rest/v1/topology/instance?nameinstanceName={nameinstanceName}&groupcodegroupCode={groupcodegroupCode}&subgroupcodesubGroupCode={subgroupcodesubGroupCode}


Tip

The query parameters are not case sensitive. Searching by

...

instanceName=NAME is the same as searching by

...

instanceName=name.

...

Request

Parameter
Required
Type
Description
Code
instanceCodeNo
URL
Query - String

This is a URL query parameter for the instance code which is used to search the

instances.Name

Target Groups.

Equals ignore case search

instanceNameNo
URL
Query - String

This is a URL query parameter for the instance name which is used to search the

instances

Target Groups.

Group Code

Contains ignore case search

groupCodeNo
URL
Query - String

This is a URL query parameter for the group code which is used to search the

instances.Sub Group Code

Target Groups.

Equals ignore case search

subGroupCodeNo
URL
Query - String

This is a URL query parameter for the sub group code which is used to search the

instances

Target Groups.

Example Output

...

Equals ignore case search

Include Page
REST V1 Target Group Response
REST V1 Target Group Response

Response Codes

HTTP Code
Description
200Search successful and results returned
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
500Unexpected internal server error

Example

Output when the Group Code was made "Group" through http://host:port/flexdeploy/rest/v1/topology/instance?

...

groupCode=Group

Code Block
titleSample JSON Output
collapsetrue
[
	{
		"description": "GET example description",
		"environments": [10001],
		"workflows": [10001],
		"instanceId": 10000,
		"instanceName": "GET Example Name",
		"isActive": true,
		"pluginspluginOperations": [{"propertySetName":"pluginName","ownerId":12345}],
		"instanceCode": "GETEXAMPLECODE",
		"groupCode": "Group",
		"subGroupCode": "GET example sub group",
		"isDeploymentTarget": false
	},
	{ 
		"description": "GET example 2 description", 
		"environments": [10001, 10002, 10003], 
		"workflows": [10001, 10002, 10003], 
		"instanceId": 10012, 
		"instanceName": "GET Example 2 Name", 
		"isActive": true, 
		"pluginspluginOperations": [], 
		"instanceCode": "GETEXAMPLECODE2", 
		"groupCode": "group", 
		"subGroupCode": "GET example 2 sub group", 
		"isDeploymentTarget": true
	}
]

Back to Top

...

POST

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

If the POST receives the following JSON instance object,

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/topology/instance

Expand
titlePOST Example
Code Block
titleSample JSON Input
collapsetrue
{
	"description": "POST example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 1,
	"instanceName": "POST Example Name",
	"isActive": true,
	"plugins": [],
	"instanceCode": "POSTEXAMPLECODE",
	"groupCode": "POST example group",
	"subGroupCode": "POST example sub group",
	"isDeploymentTarget": false
}

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

Code Block
titleSample JSON Output
collapsetrue
{
	"description": "POST example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 11004,
	"instanceName": "POST Example Name",
	"isActive": true,
	"plugins": [],
	"instanceCode": "POSTEXAMPLECODE",
	"groupCode": "POST example group",
	"subGroupCode": "POST example sub group",
	"isDeploymentTarget": false
}

Back to Top

...

PUT

This PUT service will update all attributes of an Instance with the given Id based on the attributes of the supplied JSON object.

Info
titleAPI URL

http://host:port/flexdeploy/rest/topology/instance/{Id}

...

titlePUT Example

Example

If we had an instance in our database with an Id of 11104 and had the following attributes

...

Request

Attributes
Type
Required
Description
descriptionStringNoDescription of the Target Group
environmentsList<Long>No

List of the Environment Ids that are associated with this Target Group.

All provided environments will be associated with Target Group.

workflowsList<Long>No

List of the workflow ids that are associated with this Target Group.

All provided workflows will be associated with Target Group.

instanceIdStringNoThe unique id of the Target Group. The id is made when creating the Target Group, and it is returned in the JSON.
instanceNameStringYesName of the Target Group
isActiveBooleanNo

Whether or not this Target Group is active.

Defaults to true if nothing is passed.

pluginOperations

List<Plugin>

No

List of the plugin operations that are associated with this Target Group

All provided plugin operations will be associated with Target Group.

Plugin contains pluginId and operation attributes.

instanceCodeStringYesThe code of the Target Group.
groupCodeStringNoThe group code of the Target Group.
subGroupCodeStringNoThe sub group code of the Target Group.
isDeploymentTargetBooleanNo

Whether or not this Target Group is a deployment target.

Defaults to true if nothing is passed.

Include Page
REST V1 Target Group Response
REST V1 Target Group Response

Response Codes

HTTP Code
Description
201Target Group was created successfully
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
500Unexpected internal server error

Example

If the POST receives the following JSON instance object,

Code Block
titleSample JSON Input
collapsetrue
{
	"description": "

...

POST example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 

...

1,
	"instanceName": "POST Example Name",
	"isActive": 

...

true,
	"

...

pluginOperations": [],
	"instanceCode": "

...

POSTEXAMPLECODE",
	"groupCode": "

...

POST example group",
	"subGroupCode": "

...

POST example sub group",
	"isDeploymentTarget": false
}

When we run a PUT request at the following URL

http://host:port/flexdeploy/rest/topology/instance/11104

And the PUT request receives the following JSON instance object,

...

the following Target Group will be created in the database. Notice the updated Instance Id field.

Code Block
titleSample JSON Output
collapsetrue
{
	"description": "

...

POST example description",
	"environments": [11001],
	"workflows": [

...

],
	"instanceId": 

...

11004,
	"instanceName": "

...

POST Example Name",
	"isActive": true,
	"

...

pluginOperations": [],
	"instanceCode": "

...

POSTEXAMPLECODE",
	"groupCode": "

...

POST example group",
	"subGroupCode": "

...

POST example sub group",
	"isDeploymentTarget": 

...

false
}

PUT

The PUT request would then update the Instance with Id 11104 and return the  following JSON Instance object.

Code Block
titleSample JSON Output
collapsetrue
{
	"description": "PUT description",
	"environments": [11001],
	"workflows": [11104],
	"instanceId": 11104,
	"instanceName": "PUT Name",
	"isActive": true,
	"plugins": [],
	"instanceCode": "PUTCODE",
	"groupCode": "PUT group",
	"subGroupCode": "PUT sub group",
	"isDeploymentTarget": true
}

Back to Top

...

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.

Info
titleAPI URL

http://host:port/flexdeploy/rest/topology/instance/{Id}

Tip

The only required attribute is the Instance Id in the URL.

...

titlePATCH Example

Example

...

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

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/topology/instance/{Id}

Request

Attributes
Type
Required
Description
IdURLYesURL parameter for the Id which is used to find and update a Target Group.
descriptionStringNoDescription of the Target Group.
environmentsList<Long>No

List of the Environment Ids that are associated with this Target Group. If currently associated environment(s) are not in input list those environments will be unassigned from this Target Group.

i.e. at the end of successful request, Target Group will have mapped environments matching to input request.

workflowsList<Long>No

List of the workflow ids that are associated with this Target Group. If currently associated workflows(s) are not in input list those workflows will be unassigned from this Target Group.

i.e. at the end of successful request, Target Group will have mapped workflows matching to input request.

instanceIdStringNoThe instance Id in the request is ignored
instanceNameStringYesName of the Target Group
isActiveBooleanNo

Whether or not this Target Group is active.

Defaults to true if nothing is passed.

pluginOperationsList<Plugin>No

List of the plugins that are associated with this Target Group. If currently associated plugin operation(s) are not in input list those plugin operations will be unassigned from this Target Group.

i.e. at the end of successful request, Target Group will have mapped plugin operations matching to input request.

Plugin contains pluginId and operation attributes.

instanceCodeStringYesThe code of the Target Group.
groupCodeStringNoThe group code of the Target Group.
subGroupCodeStringNoThe sub group code of the Target Group.
isDeploymentTargetBooleanNo

Whether or not this Target Group is a deployment target.

Defaults to true if nothing is passed.

Include Page
REST V1 Target Group Response
REST V1 Target Group Response

Response Codes

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

Example

If we had a Target Group in our database with an Id of 11104 and had the following attributes

Code Block
titleCurrent Target Group
collapsetrue
{
	"description": "Example description",
	"environments": [],
	"workflows": [],
	"instanceId": 11104,
	"instanceName": "Example Name",
	"isActive": false,
	"pluginOperations": [],
	"instanceCode": "EXAMPLECODE",
	"groupCode": "Group",
	"subGroupCode": "Sub Group",
	"isDeploymentTarget": false
}

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,

Code Block
titleSample JSON Input
collapsetrue
{
	"description": "PUT description",
	"environments": [11001],
	"workflows": [11104],
	"instanceId": 1,
	"instanceName": "PUT Name",
	"isActive": true,
	"pluginOperations": [],
	"instanceCode": "PUTCODE",
	"groupCode": "PUT group",
	"subGroupCode": "PUT sub group",
	"isDeploymentTarget": true
}

The PUT request would then update the Target Group with Id 11104 and return the  following JSON Instance object.

Code Block
titleSample JSON Output
collapsetrue
{
	"description": "PUT description",
	"environments": [11001],
	"workflows": [11104],
	"instanceId": 11104,
	"instanceName": "PUT Name",
	"isActive": true,
	"pluginOperations": [],
	"instanceCode": "PUTCODE",
	"groupCode": "PUT group",
	"subGroupCode": "PUT sub group",
	"isDeploymentTarget": true
}

PATCH

This PATCH service will update the information of the Target Group of the specified Id with the non-null parameters of the JSON. The parameters that are null will not be changed in the Instance.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/topology/instance/{Id}


Tip

The only required attribute is the Target Group Id in the URL.

Request

Attributes
Type
Required
Description
IdURLYesURL parameter for the Id which is used to find and update a Target Group.
descriptionStringNoDescription of the Target Group.
environmentsList<Long>No

List of the environment ids that will be added to the Target Group.

If input environment(s) is not already associated it will be associated to Target Group 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.

workflowsList<Long>No

List of the workflow ids that will be added to the Target Group.

If input workflow(s) is not already associated it will be associated to Target Group 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.

instanceIdStringNoThe instance Id in the request is ignored
instanceNameStringNoName of the Target Group
isActiveBooleanNoWhether or not this Target Group is active.
pluginsList<Plugin>No

List of the plugins that will be added to the Target Group.

If input plugin(s) is not already associated it will be associated to the Target Group 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.

instanceCodeStringNoThe code of the Target Group.
groupCodeStringNoThe group code of the Target Group.
subGroupCodeStringNoThe sub group code of the Target Group.
isDeploymentTargetBooleanNoWhether or not this Target Group is a deployment target.

Include Page
REST V1 Target Group Response
REST V1 Target Group Response

Response Codes

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

Example

If we had a Target Group in our database with an Id of 11104 and had the following attributes

Code Block
titleCurrent

...

Target Group
collapsetrue
{
	"description": "Example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 11104,
	"instanceName": "Example Name",
	"isActive": false,
	"

...

pluginOperations": [],
	"instanceCode": "EXAMPLECODE",
	"groupCode": "Group",
	"subGroupCode": "Sub Group",
	"isDeploymentTarget": false
}

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,

Code Block
titleSample JSON Input
collapsetrue
{
	"description": "PATCH example description",
	"environments": null,
	"workflows": null,
	"instanceId": null,
	"instanceName": null,
	"isActive": null,
	"

...

pluginOperations": null,
	"instanceCode": "PATCHEXAMPLECODE",
	"groupCode": null,
	"subGroupCode": null,
	"isDeploymentTarget": null
}

The PATCH request would then update the

...

Target Group with Id 11104 and return the following JSON instance object.

Code Block
titleSample JSON Output
collapsetrue
{
	"description": "PATCH example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 11104,
	"instanceName": "Example Name",
	"isActive": false,
	"

...

pluginOperations": [],
	"instanceCode": "PATCHEXAMPLECODE",
	"groupCode": "Group",
	"subGroupCode": "Sub Group",
	"isDeploymentTarget": false
}

...