Anchor | ||||
---|---|---|---|---|
|
...
Table of Contents | ||
---|---|---|
|
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 |
...
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. The name query parameter searches if any environment contains the value given in there name while all other query parameters check if any environment has attributes that are equal to the parameter value. 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:environmentcode={code} environmentname={name} Examples:To search by code only:http://host:port/flexdeploy/rest/topology/environment?environmentcode={code} To search by name only:http://host:port/flexdeploy/rest/topology/environment?environmentname={name} To search by code and name:http://host:port/flexdeploy/rest/topology/environment?environmentcode={code}&environmentname={name} |
...
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} |
...
Parameters
Parameters | Type | Required | Description |
---|---|---|---|
Id | URL | Yes | This is a URL parameter for the Id which is used to find and return an environment with. |
description | String | No | This is the description that the environment's description will be updated to. |
instances | List<Long> | No | This is the list of instance Ids that will be assigned to the environment that is being updated. |
isActive | Boolean | No | This is the isActive boolean that the environment's isActive boolean will be updated to. |
environmentCode | String | No | This is the code that the environment's code will be update to. |
sortNumber | Integer | No | This is the sort number that the environment's sort number will be updated to. |
environmentId | Long | No | This is the Id place holder. It will not change the environment's Id that is being updated. |
isBuildEnvironment | Boolean | No | This is the isActive boolean that the environment's isActive boolean will be updated to. |
environmentName | String | No | This is the name that the environment's name will be updated to. |
Response Codes
HTTP Code | Description |
---|---|
200 | Environment was found and patched |
400 | Bad request |
401 | Unauthorized |
404 | Environment not found |
500 | Unexpected internal server error |
Example
If we had an environment in our database with an Id of 11101 and had the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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,
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" } |
The PATCH request would then update the environment with Id 11101 and return the following JSON environment object
Code Block | ||||
---|---|---|---|---|
| ||||
{ "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" } |
...