Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
Top
Top

...

Info
titleBase URL for Environment REST API

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

Table of Contents
maxLevel1

Jump To:

...


Expand
titleGET by ID Example

Example

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

Code Block
themeEclipse
titleEnvironment - 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


Code Block
themeEclipse
titleEnvironment 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



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
titleAPI URLs

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}

...


Expand
titleGET (Using Query Parameters) Example


Example

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

Code Block
themeEclipse
titleEnvironment - 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/?code=ENV1&name=Env 1

The GET request would return the  following JSON environment object


Code Block
themeEclipse
titleEnvironment 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

...

Anchor
POST
POST

POST

This POST service will create a new environment with the same attributes as the given JSON object.

...


Expand
titlePost Example

Example

If the POST request receives the following JSON environment object,

Code Block
themeEclipse
titlePOST JSON
{
   "description": "This is Post 1",
   "instances": [15100,15101],
   "isActive": true,
   "environmentCode": "POST1",
   "sortNumber": 1,
   "environmentId":00000,
   "isBuildEnvironment": true,
   "environmentName": "Post 1"
}


The following environment object will then be created as a new row in the database.


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



Anchor
PUT
PUT

PUT

This PUT service will update all attributes of an environment with the given Id based on the attributes of a JSON object parameters.

...

Back to Top


Anchor
PATCH
PATCH

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
titleAPI URL

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

...

Parameters

Parameters
Required
Type
Description
IdYesURLThis is a URL parameter for the Id which is used to find and return an environment with.
descriptionNoStringThis is the description that the environment's description will be updated to.
instancesNoList<Long>This is the list of instance Ids that will be assigned to the environment that is being updated.
isActiveNoBooleanThis is the isActive boolean that the environment's isActive boolean will be updated to.
environmentCodeNoStringThis is the code that the environment's code will be update to.
sortNumberNoIntegerThis is the sort number that the environment's sort number will be updated to.
environmentIdNoLongThis is the Id place holder. It will not change the environment's Id that is being updated. 
isBuildEnvironmentNoBooleanThis is the isActive boolean that the environment's isActive boolean will be updated to.
environmentNameNoStringThis is the name that the environment's name will be updated to.


Expand
titlePATCH Example

Example

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

Code Block
themeEclipse
titleEnvironment 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,

Code Block
themeEclipse
titleEnvironment 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


Code Block
themeEclipse
titleEnvironment 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

...