Anchor | ||||
---|---|---|---|---|
|
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/topology/environment |
Jump To:
...
Anchor | ||||
---|---|---|---|---|
|
Overview:
Environments 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 environments.You can find more information about the REST API functions on the Topology REST API page.
Each function returns a JSON environment object. The environment object has these attributes:
Attributes | Type | Description |
---|---|---|
description | String | This is a description of the environment |
instances | List<Long> | This is a list of the Instance Ids associated with the environment |
isActive | Boolean | This is a boolean that tracks whether or not the environment is active |
environmentCode | String | This is the unique code of the environment |
sortNumber | Integer | This is a number associated with the environment that sets the environments priority in a list of other environments |
environmentId | Long | This is the unique Id of the environment |
isBuildEnvironment | Boolean | This is a boolean that tracks whether or not the environment is a build environment |
environmentName | String | This is the unique name of the environment |
...
Anchor | ||||
---|---|---|---|---|
|
GET
There are two implementations of GET. One will find an environment with the given Id and return the JSON representation of the environment. The other will find a list of environments matching the parameters supplied to it.
GET by ID
This GET service will find an environment with the given Id and return the JSON representation of the object.
...
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/topology/environment/{Id} |
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
Id | Yes | URL | This is a URL parameter for the Id which is used to find and return an environment |
Expand | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
ExampleIf we had an environment in our database with an Id of 11101 and had the following attributes
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
|
GET (Using Query Parameters)
This GET service will return a list of environments in the form of JSON objects based on the query parameters code and name. Environments 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 environments.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/topology/environment? Append the following character sequences to the above URL to specify Query parameters.Use '&' between successive query parameters:code={code} name={name} Examples:To search by code only:http://host:port/flexdeploy/rest/topology/environment?code={code} To search by name only:http://host:port/flexdeploy/rest/topology/environment?name={name} To search by code and name:http://host:port/flexdeploy/rest/topology/environment?code={code}&name={name} |
...
Tip |
---|
The query parameters are not case sensitive. Searching by name=NAME is the same as searching by name=name. |
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
Code | No | URL | This is a URL query parameter for the code which is used to search the environments. |
Name | No | URL | This is a URL query parameter for the name which is used to search the environments. |
...
Expand | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
ExampleIf we had an environment in our database with an Id of 11101 and had the following attributes
When we run a GET request at the following URL http://host:port/flexdeploy/rest/topology/environment/?code=ENV1&name=Env 1 The GET request would return the following JSON environment object
|
...
Anchor | ||||
---|---|---|---|---|
|
POST
This POST service will create a new environment with the same attributes as the given JSON object.
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "description": "This is Post 1", "instances": [15100,15101], "isActive": true, "environmentCode": "POST1", "sortNumber": 1, "environmentId":"", "isBuildEnvironment": true, "environmentName": "Post 1" } |
Parameters
Parameters | Required | Type | Description |
---|---|---|---|
description | No | String | This is the description that the created environment will have. |
instances | No | List<Long> | This is the list of Instance Ids that are assigned to the created environment. |
isActive | Yes | Boolean | This is the isActive boolean that is true if the created environment is active. |
environmentCode | Yes | String | This is the Code that the created environment will have. |
sortNumber | Yes | Integer | This is the sort number that the created environment will have. |
environmentId | Yes | Long | This is the Id place holder. This Id will not be given to the created environment. |
isBuildEnvironment | Yes | Boolean | This is the isBuildEnvironment boolean that is true if the created environment is a build environment. |
environmentName | Yes | String | This is the name of the created environment. |
Expand | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
ExampleIf the POST request receives the following JSON environment object,
The following environment object will then be created as a new row in the database.
|
Anchor | ||||
---|---|---|---|---|
|
PUT
This PUT service will update all attributes of an environment with the given Id based on the attributes of a JSON object parameters.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/topology/environment/{Id} |
Code Block | ||||
---|---|---|---|---|
| ||||
{ "description": "This is Put 1", "instances": [15100], "isActive": false, "environmentCode": "PUT1", "sortNumber": 6, "environmentId": 00000, "isBuildEnvironment": true, "environmentName": "Put 1" } |
Parameters
Parameters | Required | Type | Description |
---|---|---|---|
Id | Yes | URL | This is a URL parameter for the Id which is used to find and return an environment with. |
description | No | String | This is the description that the environment's description will be updated to. |
instances | No | List<Long> | This is the list of Instance Ids that will be assigned to the environment that is being updated. |
isActive | Yes | Boolean | This is the isActive boolean that the environment's isActive boolean will be updated to. |
environmentCode | Yes | String | This is the Code that the environment's Code will be updated to. |
sortNumber | Yes | Integer | This is the sort number that the environment's sort number will be updated to. |
environmentId | Yes | Long | This is the Id place holder. This Id will not be updated in the environment. |
isBuildEnvironment | Yes | Boolean | This is the isBuildEnvironment boolean that the environment's isBuildEnvironment boolean will be updated to. |
environmentName | Yes | String | This is the name that the environment's name will be updated to. |
Expand | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||
ExampleIf we had an environment in our database with an Id of 11101 and had the following attributes
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,
The PUT request would then update the environment with Id 11101 and return the following JSON environment object
|
PATCH
This PATCH service will update an existing environment with the information passed through a JSON object. If an attribute of the JSON is null it will not be updated in the environment.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/topology/environment/{Id} |
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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" } |
Parameters
Parameters | Required | Type | Description |
---|---|---|---|
Id | Yes | URL | This is a URL parameter for the Id which is used to find and return an environment with. |
description | No | String | This is the description that the environment's description will be updated to. |
instances | No | List<Long> | This is the list of instance Ids that will be assigned to the environment that is being updated. |
isActive | No | Boolean | This is the isActive boolean that the environment's isActive boolean will be updated to. |
environmentCode | No | String | This is the code that the environment's code will be update to. |
sortNumber | No | Integer | This is the sort number that the environment's sort number will be updated to. |
environmentId | No | Long | This is the Id place holder. It will not change the environment's Id that is being updated. |
isBuildEnvironment | No | Boolean | This is the isActive boolean that the environment's isActive boolean will be updated to. |
environmentName | No | String | This is the name that the environment's name will be updated to. |
Expand | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||
ExampleIf we had an environment in our database with an Id of 11101 and had the following attributes
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,
The PATCH request would then update the environment with Id 11101 and return the following JSON environment object
|
...