Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Base URL for Instance REST API

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

Jump To:

Instances can be accessed and modified through this API using four services: Instance API, Instance API, Instance API, and Instance API. These four services allow for the retrieval, creation, complete update, and partial update of Instances.

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

Attributes
Type
Description
DescriptionStringDescription of the Instance
EnvironmentsList<Long>List of the Environment Ids that are associated with this instance
WorkflowsList<Long>List of the workflow ids that are associated with this instance
Instance IdStringThe unique id of the instance. The id is made when making the instance, and it is returned in the JSON.
Instance NameStringName of the instance
isActiveBooleanWhether or not this instance is active.
PluginsList<Plugin>List of the plugin ids that are associated with this instance
Instance CodeStringThe code of the Instance
Group CodeStringThe group code of the instance
Sub Group CodeStringThe sub group code of the instance
isDeploymentTargetBooleanWhether or not this instance is a deployment target.

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.

API URL

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

Parameters

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

Response Codes

HTTP Code
Description
200Instance was found and returned
400Bad request
401Unauthorized
500Unexpected internal server error

Example

If we had an Instance in our database with an Id of 11004 with the following attributes

Instance - 11004
{
	"description": "GET example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 11004,
	"instanceName": "GET Example Name",
	"isActive": true, "plugins": [],
	"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/topology/instance/11004

The GET request would return the following JSON Instance object

Instance GET Return JSON
{
	"description": "GET example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 11004,
	"instanceName": "GET Example Name",
	"isActive": true, "plugins": [],
	"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 in the form of JSON objects based on the query parameters code, name, group code, and sub group code. 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.


API URL

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

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

code={code}

name={name}

groupcode={groupcode}

subgroupcode={subgroupcode}

Examples:
To Specify the code parameter only:

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

To Specify the code and group code parameters:

http://host:port/flexdeploy/rest/topology/instance?code={code}&groupcode={groupcode}

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

http://host:port/flexdeploy/rest/topology/instance?name={name}&groupcode={groupcode}&subgroupcode={subgroupcode}


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

Parameters

Parameter
Required
Type
Description
CodeNoURLThis is a URL query parameter for the code which is used to search the instances.
NameNoURLThis is a URL query parameter for the name which is used to search the instances.
Group CodeNoURLThis is a URL query parameter for the group code which is used to search the instances.
Sub Group CodeNoURLThis is a URL query parameter for the sub group code which is used to search the instances.

Response Codes

HTTP Code
Description
200Instances were found and returned
400Bad request
401Unauthorized
500Unexpected internal server error

Example

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

Sample JSON Output
[
	{
		"description": "GET example description",
		"environments": [10001],
		"workflows": [10001],
		"instanceId": 10000,
		"instanceName": "GET Example Name",
		"isActive": true,
		"plugins": [{"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, 
		"plugins": [], 
		"instanceCode": "GETEXAMPLECODE2", 
		"groupCode": "group", 
		"subGroupCode": "GET example 2 sub group", 
		"isDeploymentTarget": true
	}
]

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/topology/instance

Parameters

Attributes
Type
Required
Description
DescriptionStringNoDescription of the Instance
EnvironmentsList<Long>NoList of the Environment Ids that are associated with this instance
WorkflowsList<Long>NoList of the workflow ids that are associated with this instance
Instance IdStringNoThe unique id of the instance. The id is made when making the instance, and it is returned in the JSON.
Instance NameStringYesName of the instance
isActiveBooleanNo*Whether or not this instance is active.
PluginsList<Plugin>NoList of the plugin ids that are associated with this instance
Instance CodeStringYesThe code of the Instance
Group CodeStringNoThe group code of the instance
Sub Group CodeStringNoThe sub group code of the instance
isDeploymentTargetBooleanNo*Whether or not this instance is a deployment target.

*defaults to true if nothing is passed

Response Codes

HTTP Code
Description
201Instance was created successfully
400Bad request
401Unauthorized
404Instance not found
500Unexpected internal server error

Example

If the POST receives the following JSON instance object,

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

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

API URL

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

Parameters

Attributes
Type
Required
Description
IdURLYesURL parameter for the Id which is used to find and update an instance
DescriptionStringNoDescription of the Instance
EnvironmentsList<Long>NoList of the Environment Ids that are associated with this instance
WorkflowsList<Long>NoList of the workflow ids that are associated with this instance
Instance IdStringNoThe instance Id in the request is ignored
Instance NameStringYesName of the instance
isActiveBooleanNo*Whether or not this instance is active.
PluginsList<Plugin>NoList of the plugin ids that are associated with this instance
Instance CodeStringYesThe code of the Instance
Group CodeStringNoThe group code of the instance
Sub Group CodeStringNoThe sub group code of the instance
isDeploymentTargetBooleanNo*Whether or not this instance is a deployment target.

*defaults to true if nothing is passed

Response Codes

HTTP Code
Description
200Instance was found and updated
400Bad request
401Unauthorized
404Instance not found
500Unexpected internal server error

Example

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

Current Instance
{
	"description": "Example description",
	"environments": [],
	"workflows": [],
	"instanceId": 11104,
	"instanceName": "Example Name",
	"isActive": false,
	"plugins": [],
	"instanceCode": "EXAMPLECODE",
	"groupCode": "Group",
	"subGroupCode": "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,

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

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

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

API URL

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

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

Parameters

Attributes
Type
Required
Description
IdURLYesURL parameter for the Id which is used to find and update an instance
DescriptionStringNoDescription of the Instance
EnvironmentsList<Long>NoList of the Environment Ids that are associated with this instance
WorkflowsList<Long>NoList of the workflow ids that are associated with this instance
Instance IdStringNoThe instance Id in the request is ignored
Instance NameStringNoName of the instance
isActiveBooleanNoWhether or not this instance is active.
PluginsList<Plugin>NoList of the plugin ids that are associated with this instance
Instance CodeStringNoThe code of the Instance
Group CodeStringNoThe group code of the instance
Sub Group CodeStringNoThe sub group code of the instance
isDeploymentTargetBooleanNoWhether or not this instance is a deployment target.

Response Codes

HTTP Code
Description
200Instance was found and patched
400Bad request
401Unauthorized
404Instance not found
500Unexpected internal server error

Example

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

Current Instance
{
	"description": "Example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 11104,
	"instanceName": "Example Name",
	"isActive": false,
	"plugins": [],
	"instanceCode": "EXAMPLECODE",
	"groupCode": "Group",
	"subGroupCode": "Sub Group",
	"isDeploymentTarget": false
}

When we run a PATCH request at the following URL

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

And the PATCH request receives the following JSON instance object,

Sample JSON Input
{
	"description": "PATCH example description",
	"environments": null,
	"workflows": null,
	"instanceId": null,
	"instanceName": null,
	"isActive": null,
	"plugins": null,
	"instanceCode": "PATCHEXAMPLECODE",
	"groupCode": null,
	"subGroupCode": null,
	"isDeploymentTarget": null
}

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

Sample JSON Output
{
	"description": "PATCH example description",
	"environments": [11001],
	"workflows": [],
	"instanceId": 11104,
	"instanceName": "Example Name",
	"isActive": false,
	"plugins": [],
	"instanceCode": "PATCHEXAMPLECODE",
	"groupCode": "Group",
	"subGroupCode": "Sub Group",
	"isDeploymentTarget": false
}

Back to Top











  • No labels