EndPoint API
Endpoints can be accessed and modified through this API using four services: GET, POST, PUT, and PATCH. These four services allow for the retrieval, creation, complete update, and partial update of endpoints.
Authentication - Use Basic Authentication for this API.
GET
There are three implementations of GET. One will find an Endpoint with the given Id and return the JSON representation of the Endpoint. The next one will find a list of Endpoints matching the parameters supplied to it. The last one will test the connection to an endpoint.
GET by ID
This GET service will find an Endpoint with the given Id and return the JSON representation of the object.
API URL
http://host:port/flexdeploy/rest/v1/topology/endpoint
Request
Parameter | Required | Type | Description |
---|---|---|---|
Id | Yes | URL | This is a URL parameter for the Id which is used to find and return an Endpoint |
Response
Attributes | Type | Description |
---|---|---|
endpointId | Long | This is an identification number of an existing Endpoint. |
endpointName | String | This is the unique name of the corresponding Endpoint. |
description | String | This is a description of the Endpoint. |
isActive | Boolean | This is a Boolean that tracks whether or not the Endpoint is active. |
connectionType | String | This specifies the connection Type. |
osType | String | This is a character sequence which corresponds to the operating system type used in the corresponding remote connection. |
endpointAddress | String | This is a String associated with the address of the endpoint. |
endpointPort | String | This is a port associated with an SSH connection. |
baseDirectory | String | This is a character sequence which corresponds to the base directory of the corresponding Endpoint. |
isBaseDirectoryExpression | String | "Y" if the base directory is a Groovy Expression "N" if it isn't. This cannot be set manually through the API, it will automatically be set to "N". |
javaPath | String | This is a character sequence that specifies the java path of the corresponding Endpoint. |
isJavaPathExpression | String | "Y" if the Java path is a Groovy Expression "N" if it isn't. This cannot be set manually through the API, it will automatically be set to "N". |
password | String | Kept for backward compatibility. It will be either ***** or null depending on whether passwordCredentialId is set or not. |
passwordCredentialId | Long | This is the credential id associated with the endpoint password. |
privateKey | String | Fully-qualified path of the SSH private key file. |
passphrase | String | Kept for backward compatibility. It will be either ***** or null depending on whether passphraseCredentialId is set or not. |
passphraseCredentialId | Long | This is the credential id associated with the endpoint passphrase. |
runAsUserName | String | An optional user to run as (using sudo) after establishing connection to the endpoint. |
dockerHost | Boolean | This indicates if endpoint is docker engine. |
k8sCluster | Boolean | This indicates if endpoint is kubernetes engine. |
k8sContext | String | Name of the configured K8s context. |
endpointGroup | String | This is a character sequence associated with this Endpoint's corresponding group. |
endpointSubgroup | String | This is a character sequence associated with this Endpoint's corresponding sub-group. |
Response Codes
HTTP Code | Description |
---|---|
200 | Endpoint was found and returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Endpoint not found |
500 | Unexpected internal server error |
Example
If we had an endpoint in our database with an Id of 13901 and had the following attributes
{ "endpointId": 13910, "endpointName": "GOODPOST1", "description": "description", "isActive": true, "connectionType": "SSH", "osType": "UNIX", "endpointAddress": "NotNeeded00", "endpointPort": "1", "baseDirectory": "ServerInstallRoot + '/localhost'", "isBaseDirectoryExpression": "N", "javaPath": "ServerJavaHome", "isJavaPathExpression": "N", "userName": "userName", "passwordCredentialId": 12345, "privateKey": "privateKey", "runAsUserName": "TestInput", "endpointGroup": "endpointGroup", "endpointSubgroup": "subGroupTester" }
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/topology/endpoint/13901
The GET request would return the following JSON endpoint object
{ "endpointId": 13910, "endpointName": "GOODPOST1", "description": "description", "isActive": true, "connectionType": "SSH", "osType": "UNIX", "endpointAddress": "NotNeeded00", "endpointPort": "1", "baseDirectory": "ServerInstallRoot + '/localhost'", "isBaseDirectoryExpression": "N", "javaPath": "ServerJavaHome", "isJavaPathExpression": "N", "userName": "userName", "password": "*****", "passwordCredentialId": 12345, "privateKey": "privateKey", "passphrase": "*****", "passphraseCredentialId": 54321, "runAsUserName": "TestInput", "endpointGroup": "endpointGroup", "endpointSubgroup": "subGroupTester" }
GET (Using Query Parameters)
This GET service will return a list of Endpoints in the form of JSON objects based on the query parameters name, address, group and subgroup. Endpoints 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 Endpoints.
API URL
http://host:port/flexdeploy/rest/v1/topology/endpoint?
Append the following character sequences to the above URL to specify Query parameters.
Use '&' between successive query parameters:
endpointName={name}
endpointAddress={address}
endpointGroup={group}
endpointSubgroup={subgroup}
isActive={boolean}
Examples:
To Specify the name parameter only:
http://host:port/flexdeploy/rest/v1/topology/endpoint?endpointName={name}
To Specify isActive parameter Only:
http://host:port/flexdeploy/rest/v1/topology/endpoint?isActive=true
To Specify the name and group parameters:
http://host:port/flexdeploy/rest/v1/topology/endpoint?endpointName={name}&endpointGroup={group}
To Specify the name, address and group parameters:
http://host:port/flexdeploy/rest/v1/topology/endpoint?endpointName={name}&endpointAddress={address}&endpointGroup={group}
The query parameters are not case sensitive. Searching by name=NAME is the same as searching by name=name.
Request
Parameter | Required | Type | Description |
---|---|---|---|
endpointName | No | Query - String | Contains ignore case search |
endpointAddress | No | Query - String | Equals ignore case search |
endpointGroup | No | Query - String | Equals ignore case search |
endpointSubgroup | No | Query - String | Equals ignore case search |
isActive | No | Query - Boolean | Returns endpoints where isActive field matches parameter. |
Response
Attributes | Type | Description |
---|---|---|
endpointId | Long | This is an identification number of an existing Endpoint. |
endpointName | String | This is the unique name of the corresponding Endpoint. |
description | String | This is a description of the Endpoint. |
isActive | Boolean | This is a Boolean that tracks whether or not the Endpoint is active. |
connectionType | String | This specifies the connection Type. |
osType | String | This is a character sequence which corresponds to the operating system type used in the corresponding remote connection. |
endpointAddress | String | This is a String associated with the address of the endpoint. |
endpointPort | String | This is a port associated with an SSH connection. |
baseDirectory | String | This is a character sequence which corresponds to the base directory of the corresponding Endpoint. |
isBaseDirectoryExpression | String | "Y" if the base directory is a Groovy Expression "N" if it isn't. This cannot be set manually through the API, it will automatically be set to "N". |
javaPath | String | This is a character sequence that specifies the java path of the corresponding Endpoint. |
isJavaPathExpression | String | "Y" if the Java path is a Groovy Expression "N" if it isn't. This cannot be set manually through the API, it will automatically be set to "N". |
password | String | Kept for backward compatibility. It will be either ***** or null depending on whether passwordCredentialId is set or not. |
passwordCredentialId | Long | This is the credential id associated with the endpoint password. |
privateKey | String | Fully-qualified path of the SSH private key file. |
passphrase | String | Kept for backward compatibility. It will be either ***** or null depending on whether passphraseCredentialId is set or not. |
passphraseCredentialId | Long | This is the credential id associated with the endpoint passphrase. |
runAsUserName | String | An optional user to run as (using sudo) after establishing connection to the endpoint. |
dockerHost | Boolean | This indicates if endpoint is docker engine. |
k8sCluster | Boolean | This indicates if endpoint is kubernetes engine. |
k8sContext | String | Name of the configured K8s context. |
endpointGroup | String | This is a character sequence associated with this Endpoint's corresponding group. |
endpointSubgroup | String | This is a character sequence associated with this Endpoint's corresponding sub-group. |
Response Codes
HTTP Code | Description |
---|---|
200 | Search successful and results returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
500 | Unexpected internal server error |
Example
If we had an endpoints in our database with a Ids of 14517, and 14518 and the following attributes
{ "endpointId": 14517, "endpointName": "Motel6", "description": null, "isActive": true, "connectionType": "LOCALHOST", "osType": null, "endpointAddress": "localhost", "endpointPort": null, "baseDirectory": "ServerInstallRoot + '/localhost'", "isBaseDirectoryExpression": "N", "javaPath": "ServerJavaHome", "isJavaPathExpression": "N", "userName": null, "passwordCredentialId": null, "privateKey": null, "passphrase": null, "passphraseCredentialId": null, "runAsUserName": null, "endpointGroup": "Germany", "endpointSubgroup": "Munich" }
{ "endpointId": 14518, "endpointName": "Raddison Hotel", "description": null, "isActive": true, "connectionType": "LOCALHOST", "osType": null, "endpointAddress": "localhost", "endpointPort": null, "baseDirectory": "ServerInstallRoot + '/localhost'", "isBaseDirectoryExpression": "N", "javaPath": "ServerJavaHome", "isJavaPathExpression": "N", "userName": null, "passphraseCredentialId": null, "passwordCredentialId": null, "privateKey": null, "password": null, "passphrase": null, "runAsUserName": null, "endpointGroup": "Germany", "endpointSubgroup": "Berlin" }
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/topology/endpoint?endpointGroup=Germany
The GET request would return the following JSON endpoint object
[ { "description": null, "password": null, "passwordCredentialId": null, "userName": null, "isActive": true, "privateKey": null, "baseDirectory": "ServerInstallRoot + '/localhost'", "osType": null, "javaPath": "ServerJavaHome", "endpointName": "Motel6", "isBaseDirectoryExpression": "N", "endpointAddress": "localhost", "endpointId": 14517, "passphrase": null, "passphraseCredentialId": null, "connectionType": "LOCALHOST", "isJavaPathExpression": "N", "endpointPort": null, "endpointGroup": "Germany", "endpointSubgroup": "Munich", "runAsUserName": null }, { "description": null, "password": null, "passwordCredentialId": null, "userName": null, "isActive": true, "privateKey": null, "baseDirectory": "ServerInstallRoot + '/localhost'", "osType": null, "javaPath": "ServerJavaHome", "endpointName": "Raddison Hotel", "isBaseDirectoryExpression": "N", "endpointAddress": "localhost", "endpointId": 14518, "passphrase": null, "passphraseCredentialId": null, "connectionType": "LOCALHOST", "isJavaPathExpression": "N", "endpointPort": null, "endpointGroup": "Germany", "endpointSubgroup": "Berlin", "runAsUserName": null } ]
Test Connection (using GET)
API URL
http://host:port/flexdeploy/rest/v1/topology/endpoint/{Id}/test
This GET service will test the connection to an Endpoint with the given Id and return the JSON representation of a test result.
Request
Parameter | Required | Type | Description |
---|---|---|---|
Id | Yes | URL | This is a URL parameter for the Id which is used to find and return an Endpoint |
Response
Attributes | Type | Description |
---|---|---|
message | String | If the test failed, the message will provide more information on why it failed. Otherwise, the message will be ‘Connection to Endpoint [name] was successful' |
successful | Boolean | Whether or not the test was successful |