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.
...
If we had an environment instance in our database with an environment id of 12347 and an instance id of 12342 with the following attributes,, we can run a GET request at the following URL: http://host:port/flexdeploy/rest/topology/environmentinstance/12347/12342
The GET request would return the following JSON environment instance object:
Code Block | ||||
---|---|---|---|---|
| ||||
{ "instanceId": 12342, "endPoints": [ { "endPointId": 10101, "resourceIds": [11223,11224] }, { "endPointId": 10111, "resourceIds": [11223] } ], "environmentId": 12347, "isActive": true, "properties": [ { "propertyName": "FDSOA_EXT_CLASSPATH", "propertyValue": null, "credentialId": null }, { "propertyName": "FDSOA_REVISIONS_TO_KEEP", "propertyValue": "15, "credentialId": null }, { "propertyName": "FDSOA_SERVER_HOST", "propertyValue": "dev-soa.company.local", "credentialId": null }, { "propertyName": "FDSOA_SERVER_PORT", "propertyValue": 8001, "8001credentialId": null }, { "propertyName": "FD_ORACLE_SOA_HOME", "propertyValue": "/u01/oracle/products/fmw/soa", "credentialId": null }, { ] } |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/topology/environmentinstance/12347/12342
The GET request would return the following JSON environment instance object:
Code Block | ||||
---|---|---|---|---|
| ||||
{ "instanceId": 12342, "endPoints": [ { "endPointId": 10101 "propertyName": "MDS_PASS", "propertyValue": "*****", "resourceIdscredentialId": [11223,11224]74952 }, { "endPointId": 10111, "resourceIds": [11223] } ], "environmentId": 12347, "isActive": true "properties": [ { "propertyName": "FDSOA_EXT_CLASSPATH", "propertyValue": null }, { "propertyName": "FDSOA_REVISIONS_TO_KEEP", "propertyValue": "15" }, { "propertyName": "FDSOA_SERVER_HOST", "propertyValue": "dev-soa.company.local" }, { "propertyName": "FDSOA_SERVER_PORT", "propertyValue": "8001" }, { "propertyName": "FD_ORACLE_SOA_HOME", "propertyValue": "/u01/oracle/products/fmw/soa" } ] } |
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.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/topology/environmentinstance/{environmentId}/{instanceId} |
Request
...
Parameter
...
Type
...
Required
...
Description
...
environmentId
...
List of endpoint ids and their associated resource type ids. If currently associated Endpoint(s) are not in input list, then those Endpoint(s) will be unassigned from environment instance along with any resource types.
i.e. at the end of successful request, environment instance will have mapped Endpoint(s) matching to input request.
EndPoint contains endpointId and array of resourceIds.
...
List of property names and their values. If environment instance property does not have value in input list, then that property value will be cleared.
PropertyValue contains propertyName and propertyValue.
...
Response Codes
...
Example
If we had an environment instance in our database with an environment id of 12347 and an instance id of 12342 with the following attributes,
Code Block | ||||
---|---|---|---|---|
| ||||
{ "instanceId": 12342, "endPoints] } |
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.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/topology/environmentinstance/{environmentId}/{instanceId} |
Request
Parameter | Type | Required | Description |
---|---|---|---|
environmentId | URL | Yes | URL parameter for the environment Id which is used to find and return an environment instance |
instanceId | URL | Yes | URL parameter for the instance Id which is used to find and return an environment instance |
environmentId | Long | No | The environment id of the environment instance. This parameter is ignored in PUT. |
instanceId | Long | No | The instance id of the environment instance. This parameter is ignore in PUT. |
isActive | Boolean | No | Whether or not the environment instance is active. Defaults to true if not passed in. |
endPoints | List<EndPoint> | No | List of endpoint ids and their associated resource type ids. If currently associated Endpoint(s) are not in input list, then those Endpoint(s) will be unassigned from environment instance along with any resource types. i.e. at the end of successful request, environment instance will have mapped Endpoint(s) matching to input request. EndPoint contains endpointId and array of resourceIds. |
properties | List<PropertyValue> | Yes | List of property names, their values, and credential id for encrypted properties. If environment instance property does not have value in input list, then that property value will be cleared. PropertyValue contains propertyName, propertyValue, and credentialId. |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | Environment Instance was found and updated |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Environment Instance not found |
500 | Unexpected internal server error |
Example
If we had an environment instance in our database with an environment id of 12347 and an instance id of 12342 with the following attributes,
Code Block | ||||
---|---|---|---|---|
| ||||
{ "instanceId": 12342, "endPoints": [ { "endPointId": 10101, "resourceIds": [11223,11224] }, { "endPointId": 10111, "resourceIds": [11223] } ], "environmentId": 12347, "isActive": true, "properties": [ { "endPointIdpropertyName": 10101"FDSOA_EXT_CLASSPATH", "resourceIdspropertyValue": [11223,11224]null, "credentialId": null }, { "endPointIdpropertyName": 10111,"FDSOA_REVISIONS_TO_KEEP", "resourceIdspropertyValue": [11223]15, } ], "environmentIdcredentialId": 12347,null "isActive": true "properties": [ }, { "propertyName": "FDSOA_EXTSERVER_CLASSPATHHOST", "propertyValue": null }"dev-soa.company.local", { "propertyNamecredentialId": "FDSOA_REVISIONS_TO_KEEP", "propertyValue": "15"null }, { "propertyName": "FDSOA_SERVER_HOSTPORT", "propertyValue": 8001, "dev-soa.company.local" "credentialId": null }, { "propertyName": "FDSOAFD_ORACLE_SERVERSOA_PORTHOME", "propertyValue": "8001"/u01/oracle/products/fmw/soa", "credentialId": null }, { "propertyName": "FD_ORACLE_SOA_HOMEMDS_PASS", "propertyValue": "*****", "/u01/oracle/products/fmw/soa" "credentialId": 74952 } ] } |
When we run a PUT request at the following URL: http://host:port/flexdeploy/rest/topology/environmentinstance/12347/12342
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "instanceId": 12342, "endPoints": [ { "endPointId": 10101, "resourceIds": [11223] }, { "endPointId": 10111, "resourceIds": [] } ], "environmentId": 12347, "isActive": true, "properties": [ { "propertyName": "FDSOA_EXT_CLASSPATH", "propertyValue": "classpath", "credentialId": null }, { "propertyName": "FDSOA_REVISIONS_TO_KEEP", "propertyValue": "15", "credentialId": null }, { "propertyName": "FDSOA_SERVER_HOST", "propertyValue": "dev-soa.newcompany.local", "credentialId": null }, { "propertyName": "FDSOA_SERVER_PORT", "propertyValue": 8001, "8001credentialId": null }, { "propertyName": "FD_ORACLE_SOA_HOME", "propertyValue": "/u01/oracle/products/fmw/soa", "credentialId": null }, { ] } |
...
"propertyName": "MDS_PASS",
"propertyValue": "newPass",
"credentialId": null
}
]
} |
The PUT request would then update the environment instance with the environment 12347 and the instance 12342. It will return the following JSON object:
Code Block | ||||
---|---|---|---|---|
| ||||
{ "instanceId": 12342, "endPoints": [ { "endPointId": 10101, "resourceIds": [11223] }, { "endPointId": 10111, "resourceIds": [] } ], "environmentId": 12347, "isActive": true, "properties": [ { "propertyName": "FDSOA_EXT_CLASSPATH", "propertyValue": "classpath", "credentialId": null }, { "propertyName": "FDSOA_REVISIONS_TO_KEEP", "propertyValue": "15", }, "credentialId": null }, { "propertyName": "FDSOA_SERVER_HOST", "propertyValue": "dev-soa.newcompany.local", "credentialId": null }, { "propertyName": "FDSOA_SERVER_PORT", "propertyValue": 8001, "8001credentialId": null }, { "propertyName": "FD_ORACLE_SOA_HOME", "propertyValue": "/u01/oracle/products/fmw/soa", "credentialId": null }, ] } |
PATCH
...
{
"propertyName": "MDS_PASS",
"propertyValue": "*****",
"credentialId": 74952
}
]
} |
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.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/topology/environmentinstance/{environmentId}/{instanceId} |
...
Parameter | Type | Required | Description |
---|---|---|---|
environmentId | URL | Yes | URL parameter for the environment Id which is used to find and return an environment instance |
instanceId | URL | Yes | URL parameter for the instance Id which is used to find and return an environment instance |
environmentId | Long | No | The environment id of the environment instance. This parameter is ignored in PATCH. |
instanceId | Long | No | The instance id of the environment instance. This parameter is ignore in PATCH. |
isActive | Boolean | No | Whether or not the environment instance is active |
endPoints | List<EndPoint> | No | List of endpoint ids and their associated resource type ids. If provided endpoint is not associated with environment instance, then it will be mapped. Similarly resource types are associated if not already associated to specific endpoint. If already mapped endpoint is not in input list then it will not be removed. EndPoint contains endpointId and array of resourceIds. |
properties | List<Property> | No | List of property names and , their values, and credential id for encrypted properties. Only values provided in input are updated, other values will not change. PropertyValue contains propertyName, propertyValue, and propertyValuecredentialId. |
Include Page | ||||
---|---|---|---|---|
|
...
HTTP Code | Description |
---|---|
200 | Environment Instance was found and patched |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Environment Instance not found |
500 | Unexpected internal server error |
Example
If we had an environment instance in our database with an environment id of 12347 and an instance id of 12342 with the following attributes,
...
theme | Eclipse |
---|---|
title | Environment Instance: 12347, 12342 |
...
If we had an environment instance in our database with an environment id of 12347 and an instance id of 12342 with the following attributes,
Code Block | ||||
---|---|---|---|---|
| ||||
{ "instanceId": 12342, "endPoints": [ { "endPointId": 10101, "resourceIds": [11223,11224] }, { "endPointId": 10111, "resourceIds": [11223] } ], "environmentId": 12347, "isActive": true, "properties": [ { "propertyName": "FDSOA_EXT_CLASSPATH", "propertyValue": null, "credentialId": null }, { "propertyName": "FDSOA_REVISIONS_TO_KEEP", "propertyValue": 15, "credentialId": null }, { "propertyName": "FDSOA_SERVER_HOST", "propertyValue": "dev-soa.company.local", "credentialId": null }, { "propertyName": "FDSOA_SERVER_PORT", "propertyValue": 8001, "credentialId": null }, { "endPointIdpropertyName": 10111"FD_ORACLE_SOA_HOME", "resourceIdspropertyValue": [11223] } ], "environmentId": 12347, "isActive": true "properties": ["/u01/oracle/products/fmw/soa", "credentialId": null }, { "propertyName": "FDSOAMDS_EXT_CLASSPATHPASS", "propertyValue": null }, { "propertyName": "FDSOA_REVISIONS_TO_KEEP", "propertyValue": "15" },": "*****", "credentialId": 74952 } ] } |
When we run a PATCH request at the following URL: http://host:port/flexdeploy/rest/topology/environmentinstance/12347/12342
And the PATCH request receives the following JSON environment instance object,
Code Block | ||||
---|---|---|---|---|
| ||||
{ "endPoints": [ { "propertyNameendPointId": "FDSOA_SERVER_HOST"10101, "propertyValueresourceIds": "dev-soa.company.local"[12123] }, { "propertyNameendPointId": 12241, "FDSOA_SERVER_PORT", "propertyValue": "8001" }, "resourceIds": [18612] } ], "properties": [ { "propertyName": "FDFDSOA_ORACLEEXT_SOA_HOMECLASSPATH", "propertyValue": "/u01/oracle/products/fmw/soa" } ] } |
When we run a PATCH request at the following URL
http://host:port/flexdeploy/rest/topology/environmentinstance/12347/12342
And the PATCH request receives the following JSON environment instance object,
Code Block | ||||
---|---|---|---|---|
| ||||
{ "endPoints": [ {": "new value", "credentialId": null }, { "propertyName": "MDS_PASS", "endPointIdpropertyValue": 10101"", "resourceIdscredentialId": [12123]52268 }, { "endPointId": 12241, "resourceIds": [18612] } ], "properties ] } |
The PATCH request would then update the environment instance with the environment 12347 and the instance 12342. It will return the following JSON object:
Code Block | ||||
---|---|---|---|---|
| ||||
{ "instanceId": 12342, "endPoints": [ { "propertyNameendPointId": "FDSOA_EXT_CLASSPATH"10101, "propertyValueresourceIds": "new value"[11223,11224,12123] }, ] } |
The PATCH request would then update the environment instance with the environment 12347 and the instance 12342. It will return the following JSON object:
Code Block | ||||
---|---|---|---|---|
| ||||
{ "instanceIdendPointId": 1234210111, "endPoints": [resourceIds": [11223] }, { "endPointId": 1010112241, "resourceIds": [11223,11224,1212318612] } ], { "environmentId": 12347, "endPointIdisActive": 10111true, "resourceIdsproperties": [11223] },{ {"propertyName": "FDSOA_EXT_CLASSPATH", "endPointIdpropertyValue": 12241"new value", "resourceIdscredentialId": [18612]null }, ],{ "environmentIdpropertyName": 12347"FDSOA_REVISIONS_TO_KEEP", "isActivepropertyValue": true15, "propertiescredentialId": null [}, { "propertyName": "FDSOA_EXT_CLASSPATH_SERVER_HOST", "propertyValue": "dev-soa.company.local", "propertyValuecredentialId": "new value"null }, { "propertyName": "FDSOA_REVISIONSSERVER_TO_KEEPPORT", "propertyValue": 8001, "15credentialId": null }, { "propertyName": "FDSOAFD_ORACLE_SERVER_HOST", "propertyValue": "dev-soa.company.local" }, {SOA_HOME", "propertyNamepropertyValue": "FDSOA_SERVER_PORT/u01/oracle/products/fmw/soa", "propertyValuecredentialId": "8001"null }, { "propertyName": "FD_ORACLE_SOA_HOMEMDS_PASS", "propertyValue": "/u01/oracle/products/fmw/soa""*****", "credentialId": 52268 } ] } |