Versions Compared

Key

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

...

Initiate Post Refresh Request

Include Page
REST V1 Authentication
REST V1 Authentication

Post refresh requests can be initiated through this API using the POST service.

...

This POST service will perform the same action found on the Post Refresh requests form off of the Environment Instance page. It will initiate a post refresh request to build and deploy any projects in order to refresh an environment to its original state after that instance has been cloned from another environment. The service will return a post refresh request json object..

Initiate Post Refresh Request

There are two implementations of GET. One will find a test instance with the given Id and return the JSON representation of the test instance. The other will find a list of test instances matching the parameters supplied to it.

Info
titleAPI URL

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

Request

Parameter
Required
Type
Description

environmentId

YesURL

This is the target environment Id. This is the environment that will be refreshed through builds and deploys.

instanceIdYesURLThis is the instance Id for which the two environments are associated. This instance must be associated with both environments.
refreshEnvironmentIdYesLongThe source environment Id. This is the environment that the target environment will be refreshed from. This is the same environment that would be selected in the refreshed from environment drop down on the post refresh requests screen
requestedStartDate
N
NoString

The time when the deployment will be started. Format should yyyy-MM-dd'T'HH:mm:ssXXX.

For example, 2019-03-16T21:17:52-06:00

Response

Parameter
Type
Description

instanceId

Long

The instance Id that was associated with both the target environment and refresh from environment.

requestedStartTimeString

 The requested start time that was given.

targetEnvironmentIdLong

The Id for the target environment.

postRefreshIdLong

The post refresh request Id.

refreshEnvIdLongThe Id for the refresh from environment.

Response Codes

HTTP Code
Description
201Post refresh request initiated successfully
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Environment instance not found
500Unexpected internal server error

Example

We can post refresh an environment with Id 10004 from an environment with Id 12345 with the following request. Both environments would be associated with an instance with Id 11101.

js
Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/topology/environmentinstance/10004/11101/initiatepostrefresh

Code Block
language

themeEclipse
titleTest Instance - 11101
{
	"refreshEnvironmentId": 12345
}

In response we will receive a post refresh request.

Code Block
languagejs
themeEclipse
titleTest Instance GET Return JSON
 {
   "instanceId": 22223,
   "requestedStartTime": "Fri Dec 13 11:01:32 CST 2019",
   "targetEnvironmentId": 18802,
   "postRefreshId": 54321,
   "refreshEnvId": 22331
}

Code Block
languagejs
themeEclipse
titleTest Instance - 11101
{
	"refreshEnvironmentId": 12345
}