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
IdYesURLURL parameter for the Id which is used to find and return a target group

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 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
targetGroupIdNoQuery - LongThis is a URL query parameter for the Target Group Id which is used to search the Target Groups.
targetGroupCodeNoQuery - String

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

Equals ignore case search

targetGroupNameNoQuery - String

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

Contains ignore case search

groupCodeNoQuery - String

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

Equals ignore case search

subGroupCodeNoQuery - String

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

Equals ignore case search

isActiveNoQuery - Boolean

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

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

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

Sample JSON Output
[
	{
		"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
descriptionStringNoDescription of the Target Group.
targetsList<TargetDataObjects>No

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

workflowPropertySetsList<PropertySetDataObjects>No

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

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

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.

targetGroupCodeStringYes

The 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.

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

Sample JSON Input
{
	"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.

Sample JSON Output
{
	"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
IdURLYesURL parameter for the Id which is used to find and update a Target Group.
descriptionStringNoDescription of the Target Group.
targetsList<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.

workflowPropertySetsList<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.

targetGroupIdStringNoThe Target Group Id in the request is ignored.
targetGroupNameStringYesName of the Target Group.
isActiveBooleanNo

Whether or not this Target Group is active.

Defaults to true if nothing is passed.

pluginOperationPropertySetsList<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.

targetGroupCodeStringYesThe 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.

Response Codes

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

Example

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

Current Target Group
{
	"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,

Sample JSON Input
{
	"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.

Sample JSON Output
{
	"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
IdURLYesURL parameter for the Id which is used to find and update an Target Group.
descriptionStringNoDescription of the Target Group.
targetsList<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.

workflowsPropertySetsList<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.

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

List of the Plugin 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.

targetGroupCodeStringNoThe 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.

Response Codes

HTTP Code
Description
200Target Group was found and patched
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 11104 and had the following attributes

Current Target Group
{
	"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 PATCH request at the following URL

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

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

Sample JSON Input
{
	"description": "PATCH example description",
	"targetGroupCode": "PATCHEXAMPLECODE"
}

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

Only the fields present in the PATCH JSON will modify the original JSON Target Group object. All other fields will remain unchanged.

Sample JSON Output
{
	"description": "PATCH example description",
	"targets": [],
	"workflowPropertySets": [],
	"targetGroupId": 11104,
	"targetGroupName": "Example Name",
	"isActive": false,
	"pluginOperationPropertySets": [],
	"targetGroupCode": "PATCHEXAMPLECODE",
	"groupCode": "Group",
	"subGroupCode": "Sub Group",
	"isDeploymentTarget": false
}