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

Version 1 Next »

Environment Instances can be accessed and modified through this API using three services: GET, PUT, and PATCH. These three services allow for the retrieval, complete update, and partial update of environment instances.

Base URL for Environment REST API

http://host:port/flexdeploy/rest/topology/environmentinstance/{environmentId}/{instanceId}

Each function returns a JSON environment instance object. The environment object has these attributes:

AttributesTypeDescription
environmentIdLongThe environment id of the environment instance
instanceIdLongThe instance id of the environment instance
isActiveBooleanWhether or not the environment instance is active
endPointsList<EndPoint>List of endpoint ids and their associated resource type ids
propertiesList<Property>List of property names and their values

Back to Top



GET

This GET service will find an environment instance with the given environment id and instance id. It returns the JSON representation of the environment instance. 

API URL

http://host:port/flexdeploy/rest/topology/environmentinstance/{environmentId}/{instanceId}

Parameters

Parameter

Type

Required

Description

environmentId

URLYesURL parameter for the environment Id which is used to find and return an environment instance
instanceIdURLYesURL parameter for the instance Id which is used to find and return an environment instance

Example

If we had an environment in our database with an Id of 11101 and had the following attributes

Environment - 11101
{
   "description": "This is Environment 1" 
   "instances": [15100],
   "isActive": true,
   "environmentCode": "ENV1",
   "sortNumber": 1,
   "environmentId": 11101,
   "isBuildEnvironment": true,
   "environmentName": "Env 1"
}

When we run a GET request at the following URL

http://host:port/flexdeploy/rest/topology/environment/11101

The GET request would return the following JSON environment object

Environment GET Return JSON
{
   "description": "This is Environment 1",
   "instances": [15100],
   "isActive": true,
   "environmentCode": "ENV1",
   "sortNumber": 1,
   "environmentId": 11101,
   "isBuildEnvironment": true,
   "environmentName": "Env 1"
}

Back to Top


PUT

This PUT service will replace all attributes of an environment instance with the given environment instance corresponding to the environment id and instance id provided in the url.

API URL

http://host:port/flexdeploy/rest/topology/environmentinstance/{environmentId}/{instanceId}

Sample PUT JSON Request
{
   "description": "This is Put 1",
   "instances": [15100],
   "isActive": false,
   "environmentCode": "PUT1",
   "sortNumber": 6,
   "environmentId": 00000,
   "isBuildEnvironment": true,
   "environmentName": "Put 1"
}

Parameters

Parameter

Type

Required

Description

environmentId

URLYesURL parameter for the environment Id which is used to find and return an environment instance
instanceIdURLYesURL parameter for the instance Id which is used to find and return an environment instance
environmentIdLongNoThe environment id of the environment instance. This parameter is ignored in PUT.
instanceIdLongNoThe instance id of the environment instance. This parameter is ignore in PUT.
isActiveBooleanNoWhether or not the environment instance is active
endPointsList<EndPoint>NoList of endpoint ids and their associated resource type ids
propertiesList<Property>NoList of property names and their values

Example

If we had an environment in our database with an Id of 11101 and had the following attributes

Environment PUT JSON
{
   "description": "This is Environment 1" 
   "instances": [15100],
   "isActive": true,
   "environmentCode": "ENV1",
   "sortNumber": 1,
   "environmentId": 11101,
   "isBuildEnvironment": true,
   "environmentName": "Env 1"
}

When we run a PUT request at the following URL

http://host:port/flexdeploy/rest/topology/environment/11101

And the PUT request receives the following JSON environment object,

Environment PUT Receive JSON
{
   "description": "This is the updated Environment 1",
   "instances": [15101],
   "isActive": true,
   "environmentCode": "PUT2",
   "sortNumber": 2,
   "environmentId": 11101,
   "isBuildEnvironment": false,
   "environmentName": "PUT 2"
}


The PUT request would then update the environment with Id 11101 and return the  following JSON environment object

Environment PUT Return JSON
{
   "description": "This is the updated Environment 1",
   "instances": [15101],
   "isActive": true,
   "environmentCode": "PUT2",
   "sortNumber": 2,
   "environmentId": 11101,
   "isBuildEnvironment": false,
   "environmentName": "PUT 2"
}


Back to Top


PATCH

This PATCH service will update an existing environment instance with the information passed through a JSON object. If an attribute of the JSON is null it will not be updated in the environment instance. Note: end points and resource types will be added, not replaced.


API URL

http://host:port/flexdeploy/rest/topology/environmentinstance/{environmentId}/{instanceId}

Parameters

Parameter

Type

Required

Description

environmentId

URLYesURL parameter for the environment Id which is used to find and return an environment instance
instanceIdURLYesURL parameter for the instance Id which is used to find and return an environment instance
environmentIdLongNoThe environment id of the environment instance. This parameter is ignored in PATCH.
instanceIdLongNoThe instance id of the environment instance. This parameter is ignore in PATCH.
isActiveBooleanNoWhether or not the environment instance is active
endPointsList<EndPoint>NoList of endpoint ids and their associated resource type ids
propertiesList<Property>NoList of property names and their values

Example

If we had an environment in our database with an Id of 11101 and had the following attributes

Environment PATCH JSON
{
   "description": "This is Environment 1",
   "instances": [15101],
   "isActive": true,
   "environmentCode": "ENV1",
   "sortNumber": 1,
   "environmentId": 11101,
   "isBuildEnvironment": false,
   "environmentName": "Env 1"
}

When we run a PATCH request at the following URL

http://host:port/flexdeploy/rest/topology/environment/11101

And the PATCH request receives the following JSON environment object,

Environment PATCH Receive JSON
{
   "description": "This is Patch with some null attributes",
   "instances": [15102,15103],
   "isActive": null,
   "environmentCode": null,
   "sortNumber": 7,
   "environmentId": null,
   "isBuildEnvironment": false,
   "environmentName": "Patch with some null"
}

The PATCH request would then update the environment with Id 11101 and return the  following JSON environment object

Environment PATCH Return JSON
{
   "description": "This is Patch with some null attributes",
   "instances": [15102,15103],
   "isActive": true,
   "environmentCode": "ENV1",
   "sortNumber": 7,
   "environmentId": 11101,
   "isBuildEnvironment": false,
   "environmentName": "Patch with some null"
}

Back to Top



  • No labels