Targets API
7Targets 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 targets.
Authentication - Use Basic Authentication for this API.
GET
This GET service will find a target with the given environment id and instance id. It returns the JSON representation of the target.
API URL
http://host:port/flexdeploy/rest/v1/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 a target. |
instanceId | URL | Yes | URL parameter for the instance Id which is used to find and return a target. |
Response
| Attributes | Type | Description |
|---|---|---|
| environmentId | Long | The environment id of the target. |
| instanceId | Long | The instance id of the target. |
| isActive | Boolean | Whether or not the target is active |
| endPoints | List<EndPoint> | List of endpoint ids and their associated resource type ids |
| properties | List<PropertyValue> | List of property names and their values |
Endpoint, relative to Environment Instance is defined as shown below.
| Attributes | Type | Description |
|---|---|---|
| endPointId | Long | Endpoint id mapped to target. |
| resourceTypeIds | List<Long> | List of resource type id for endpoint mapping. |
| endPointName | String | Name of the endpoint. |
| resourceNames | List<String> | List of resources. |
Property value, relative to Environment Instance is defined as shown below.
| Attributes | Type | Description |
|---|---|---|
| propertyName | String | Property code |
| propertyValue | String | Property value |
| credentialId | Long | Id for the credential associated with property. Applicable only for encrypted properties |
| isExpression | Boolean | Is the propertyValue a groovy expression? |
Response Codes
HTTP Code | Description |
|---|---|
200 | Target was found and returned |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Environment Instance not found |
500 | Unexpected internal server error |
Example
If we had a target in our database with an environment id of 12347 and an instance id of 12342, we can run a GET request at the following URL: http://host:port/flexdeploy/rest/v1/topology/environmentinstance/12347/12342
The GET request would return the following JSON target object:
Environment Instance: 12347, 12342
{
"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,
"isExpression": false
},
{
"propertyName": "FDSOA_REVISIONS_TO_KEEP",
"propertyValue": 15,
"credentialId": null,
"isExpression": false
},
{
"propertyName": "FDSOA_SERVER_HOST",
"propertyValue": "dev-soa.company.local",
"credentialId": null,
"isExpression": false
},
{
"propertyName": "FDSOA_SERVER_PORT",
"propertyValue": 8001,
"credentialId": null,
"isExpression": false
},
{
"propertyName": "FD_ORACLE_SOA_HOME",
"propertyValue": "/u01/oracle/products/fmw/soa",
"credentialId": null,
"isExpression": false
},
{
"propertyName": "MDS_PASS",
"propertyValue": "*****",
"credentialId": 74952,
"isExpression": false
}
]
}PUT
This PUT service will replace all attributes of a target with the given environment instance corresponding to the environment id and instance id provided in the url.
API URL
http://host:port/flexdeploy/rest/v1/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 a target. |
instanceId | URL | Yes | URL parameter for the instance Id which is used to find and return a target. |
environmentId | Long | No | The environment id of the target. This parameter is ignored in PUT. |
instanceId | Long | No | The instance id of the target. This parameter is ignore in PUT. |
isActive | Boolean | No | Whether or not the target 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 target along with any resource types. i.e. at the end of successful request, target 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 target property does not have value in input list, then that property value will be cleared. PropertyValue contains propertyName, propertyValue, and credentialId. |
Response
| Attributes | Type | Description |
|---|---|---|
| environmentId | Long | The environment id of the target. |
| instanceId | Long | The instance id of the target. |
| isActive | Boolean | Whether or not the target is active |
| endPoints | List<EndPoint> | List of endpoint ids and their associated resource type ids |
| properties | List<PropertyValue> | List of property names and their values |
Endpoint, relative to Environment Instance is defined as shown below.
| Attributes | Type | Description |
|---|---|---|
| endPointId | Long | Endpoint id mapped to target. |
| resourceTypeIds | List<Long> | List of resource type id for endpoint mapping. |
| endPointName | String | Name of the endpoint. |
| resourceNames | List<String> | List of resources. |
Property value, relative to Environment Instance is defined as shown below.
| Attributes | Type | Description |
|---|---|---|
| propertyName | String | Property code |
| propertyValue | String | Property value |
| credentialId | Long | Id for the credential associated with property. Applicable only for encrypted properties |
| isExpression | Boolean | Is the propertyValue a groovy expression? |
Response Codes
HTTP Code | Description |
|---|---|
200 | Target was found and updated |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Environment Instance not found |
500 | Unexpected internal server error |