Target Group API v2

Target Group API v2

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.

Terminology Change

The new v2 Target Group API replaces the Instance API from v1.  The API has renamed Instance to Target Group, and Environment Instance to Target.  The topology screens still refer to the old terminology, but will be updated in a future release as part of the new user experience.

Authentication - Use Basic Authentication for this API.

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.

API URL

http://host:port/flexdeploy/rest/v2/topology/targetgroup/{Id}

Request

Parameter

Required

Type

Description

Parameter

Required

Type

Description

Id

Yes

URL

URL parameter for the Id which is used to find and return a target group

Response Codes

HTTP Code

Description

HTTP Code

Description

200

Target Group was found and returned

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

404

Target Group not found

500

Unexpected internal server error

Example

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

Target Group - 11004
{ "description": "GET example description", "targets": [], "workflowPropertySets": [], "targetGroupId": 11004, "targetGroupName": "GET Example Name", "isActive": true, "pluginOperationPropertySets": [], "targetGroupCode": "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/v2/topology/targetgroup/11004

The GET request would return the following JSON Target Group object

Target Group GET Return JSON
{ "description": "GET example description", "targets": [], "workflowPropertySets": [], "targetGroupId": 11004, "targetGroupName": "GET Example Name", "isActive": true, "pluginOperationPropertySets": [], "targetGroupCode": "GETEXAMPLECODE", "groupCode": "GET example group", "subGroupCode": "GET example sub group", "isDeploymentTarget": false }

GET by Query Parameters

This GET service will return a list of Target Groups in the form of JSON objects based on the query parameters targetGroupId, targetGroupCode, targetGroupName, groupCode, and 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 Target Groups. The targetGroupName parameter returns Target Groups that contain the specified parameter. The other parameters must be equal to the Target Group.

API URL

http://host:port/flexdeploy/rest/v2/topology/targetgroup?

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

targetGroupId = {targetGroupId}

targetGroupCode={targetGroupCode}

targetGroupName={targetGroupName}

groupCode={groupCode}

subGroupCode={subGroupCode}

Examples:
To Specify the code parameter only:

http://host:port/flexdeploy/rest/v2/topology/targetgroup?targetGroupCode={targetGroupCode}

To Specify the code and group code parameters:

http://host:port/flexdeploy/rest/v2/topology/targetgroup?targetGroupCode={targetGroupCode}&groupCode={groupCode}

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

http://host:port/flexdeploy/rest/v2/topology/targetgroup?targetGroupName={targetGroupName}&groupCode={groupCode}&subGroupCode={subGroupCode}

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

Request

Parameter

Required

Type

Description

Parameter

Required

Type

Description

targetGroupId

No

Query - Long

This is a URL query parameter for the Target Group Id which is used to search the Target Groups.

targetGroupCode

No

Query - String

This is a URL query parameter for the Target Group code which is used to search the Target Groups.

Equals ignore case search

targetGroupName

No

Query - String

This is a URL query parameter for the Target Group name which is used to search the Target Groups.

Contains ignore case search

groupCode

No

Query - String

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

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

Equals ignore case search

isActive

No

Query - Boolean

This is a URL query parameter for the isActive Boolean which is used to search the Target Groups.

isDeploymentTarget

No

Query - Boolean

This is a URL query parameter for the isDeploymentTarget Boolean which is used to search the Target Groups.

Response Codes

HTTP Code

Description

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 after sending a GET request while querying by Group Code "Group" through http://host:port/flexdeploy/rest/v2/topology/targetgroup?groupCode=Group

[ { "description": "GET example description", "targets": [], "workflowPropertySets": [], "targetGroupId": 10000, "targetGroupName": "GET Example Name", "isActive": true, "pluginOperationPropertySets": [], "targetGroupCode": "GETEXAMPLECODE", "groupCode": "Group", "subGroupCode": "GET example sub group", "isDeploymentTarget": false }, { "description": "GET example 2 description", "targets": [], "workflowPropertySets": [], "targetGroupId": 10012, "targetGroupName": "GET Example 2 Name", "isActive": true, "pluginOperationPropertySets": [], "targetGroupCode": "GETEXAMPLECODE2", "groupCode": "group", "subGroupCode": "GET example 2 sub group", "isDeploymentTarget": true } ]

POST

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

API URL

http://host:port/flexdeploy/rest/v2/topology/targetgroup

Request

Attributes

Type

Required

Description

Attributes

Type

Required

Description

description

String

No

Description of the Target Group.

targets

List<TargetDataObjects>

No

List of the Target Data Objects which are associated with this Target Group.

workflowPropertySets

List<PropertySetDataObjects>

No

List of the Workflow Property Sets that are associated with this Target Group.

targetGroupId

String

No

The unique id of the Target Group. The id is made when making the Target Group, and it is returned in the JSON.

targetGroupName

String

Yes

Name of the Target Group.

isActive

Boolean

No

Whether or not this Target Group is active.

Defaults to true if nothing is passed.

pluginOperationPropertySets

 

No

List of the Plugin Operation Property Sets that are associated with this Target Group.

targetGroupCode

String

Yes

The code of the Target Group.

groupCode

String

No

The group code of the Target Group.

subGroupCode

String

No

The sub group code of the Target Group.

isDeploymentTarget

Boolean

No

Whether or not this Target Group is a deployment target.

Defaults to true if nothing is passed.

Response Codes

HTTP Code

Description

HTTP Code

Description

201

Target Group 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 Target Group object,

{ "description": "POST example description", "targets": [], "workflowPropertySets": [], "targetGroupId": 1, "targetGroupName": "POST Example Name", "isActive": true, "pluginOperationPropertySets": [], "targetGroupCode": "POSTEXAMPLECODE", "groupCode": "POST example group", "subGroupCode": "POST example sub group", "isDeploymentTarget": false }

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

{ "description": "POST example description", "environments": [], "workflowPropertySets": [], "targetGroupId": 11004, "targetGroupName": "POST Example Name", "isActive": true, "pluginOperationPropertySets": [], "targetGroupCode": "POSTEXAMPLECODE", "groupCode": "POST example group", "subGroupCode": "POST example sub group", "isDeploymentTarget": false }

PUT

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

API URL

http://host:port/flexdeploy/rest/v2/topology/targetgroup/{Id}

Request

Attributes

Type

Required

Description

Attributes

Type

Required

Description

Id

URL

Yes

URL parameter for the Id which is used to find and update a Target Group.

description

String

No

Description of the Target Group.

targets

List<TargetDataObject>

No

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

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

workflowPropertySets

List<PropertySetDataObject>

No

List of the Workflow Property Sets that are associated with this Target Group. If currently associated Property Set(s) are not in input list those Property Sets will be unassigned from this Target Group.

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

targetGroupId

String

No

The Target Group Id in the request is ignored.

targetGroupName

String

Yes

Name of the Target Group.

isActive

Boolean

No

Whether or not this Target Group is active.

Defaults to true if nothing is passed.

pluginOperationPropertySets

List<PropertySetDataObject>

No

List of the Plugin Operation Property Sets that are associated with this Target Group. If currently associated Property Set(s) are not in input list those Property Sets will be unassigned from this Target Group.

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

targetGroupCode

String

Yes

The code of the Target Group.

groupCode

String

No

The group code of the Target Group.

subGroupCode

String

No

The sub group code of the Target Group.

isDeploymentTarget

Boolean

No

Whether or not this Target Group is a deployment target.

Defaults to true if nothing is passed.

Response Codes

HTTP Code

Description

HTTP Code

Description

200

Target Group was found and updated

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

404

Target Group not found

500

Unexpected internal server error

Example

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

{ "description": "Example description", "targets": [], "workflowPropertySets": [], "targetGroupId": 11104, "targetGroupName": "Example Name", "isActive": false, "pluginOperationPropertySets": [], "targetGroupCode": "EXAMPLECODE", "groupCode": "Group", "subGroupCode": "Sub Group", "isDeploymentTarget": false }

When we run a PUT request at the following URL

http://host:port/flexdeploy/rest/v2/topology/targetgroup/11104

And the PUT request receives the following JSON Target Group object,

{ "description": "PUT description", "targets": [], "workflowPropertySets": [], "targetGroupId": 1, "targetGroupName": "PUT Name", "isActive": true, "pluginOperationPropertySets": [], "targetGroupCode": "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 Target Group object.

{ "description": "PUT description", "targets": [], "workflowPropertySets": [], "targetGroupId": 11104, "targetGroupName": "PUT Name", "isActive": true, "pluginOperationPropertySets": [], "targetGroupCode": "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 Target Group.

API URL

http://host:port/flexdeploy/rest/v2/topology/targetgroup/{Id}

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

Request

Attributes

Type

Required

Description

Attributes

Type

Required

Description

Id

URL

Yes

URL parameter for the Id which is used to find and update an Target Group.

description

String

No

Description of the Target Group.

targets

List<TargetDataObject>

No

List of the Target Data Objects that will be added to the Target Group.

If input targets(s) is not already associated, it will be associated to Target Group but existing Target assignment that are not in PATCH request will not be unassigned.

i.e. input list is considered as append to existing assignments.

workflowsPropertySets

List<PropertySetDataObject>

No

List of the Workflow Property Sets that will be added to the Target Group.

If input Property Set(s) is not already associated, it will be associated to Target Group but existing Property Set assignment that are not in PATCH request will not be unassigned.

i.e. input list is considered as append to existing assignments.

targetGroupId

String

The following macros are not currently supported in the footer:
  • style