sys.endpoints
This package contains methods to handle legacy services.
findById(id)
Finds an endpoint by its ID.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
id |
|
yes |
ID of the endpoint. |
Returns
sys.endpoints.Endpoint - The endpoint object or null if not found.
Exceptions
badRequest
If id is not a valid ID or it is empty.
Samples
// finds an endpoint and prints its status
var endpoint = sys.endpoints.findById('');
log('status: '+endpoint.status());
findByName(name)
Finds an endpoint by its name.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name |
|
yes |
Name of the endpoint. |
Returns
sys.endpoints.Endpoint - The endpoint object or null if not found.
Exceptions
badRequest
If name is empty.
Samples
// finds an endpoint and prints its status
var endpoint = sys.endpoints.findByName('sample');
log('status: '+endpoint.status());
isDeployed(name)
Checks if an endpoint is deployed.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name |
|
yes |
Name of the endpoint. |
Returns
boolean - true if the endpoint is deployed, false otherwise.
Exceptions
badRequest
If name is empty or endpoint is not found with that name.
Samples
// prints if the endpoint is deployed
log('endpoint deployed: '+sys.endpoints.isDeployed('sample'));
sys.endpoints.Endpoint
Contains information about an endpoint.
id()
Returns the ID of the endpoint.
Returns
string - The ID of the endpoint
label()
Returns the label of the endpoint.
Returns
string - The label of the endpoint.
name()
Returns the name of the endpoint.
Returns
string - The name of the endpoint.
type()
Returns the type of the endpoint
Returns
string - The type of the endpoint
status()
Returns the current status of the endpoint. Possible values are DEPLOYED, UNDEPLOYED, DEPLOYING, UNDEPLOYING, UNKNOWN.
Returns
string - The current status of the endpoint.
version()
Returns the current version of the running endpoint.
Returns
string - The current version of the endpoint.