Orchestration REST interface
Please also read the Orchestration page, especially with regards to understanding the difference between Orchestration v1 and v2.
GET requests:
- Get supported providers
- Get available providers
- Get information about a provider
- Get available releases
- Get information about a release
- Get available node families (Orchestration v1)
- Get available node families (Orchestration v2)
- Get information about a node family (Orchestration v2)
- Get available domains of a node family
- Get information about a domain
- Get available nodes (Orchestration v1)
- Get available nodes (Orchestration v2)
- Get information about a node (Orchestration v2)
POST requests:
- Register provider
- Upload release
- Create node family (Orchestration v1)
- Create node family (Orchestration v2)
- Attach release to a node family
- Set firewall configuration for a node family
- Set node hooks for a node family
- Add deployment domains to a node family
- Deploy a node
- Upload file to a node (deprecated - only Orchestration v1)
DELETE requests:
- Unregister provider
- Delete release
- Delete family (Orchestration v1)
- Delete family (Orchestration v2)
- Terminate family (Orchestration v2)
- Terminate a node
Get supported providers
Retrieve a list of all the providers supported by this WombatOAM version.
Definition
1 |
|
Example request
1 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Arguments
None.
Returns
An array of provider objects.
Get available providers
Retrieve a list of all the available providers (i.e. providers already registered by the user).
Definition
1 |
|
Example request
1 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Arguments
None.
Returns
An array of provider objects.
Get information about a provider
Retrieve details of a specified provider.
Definition
1 |
|
Example request
1 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Arguments
Argument | Description |
---|---|
release UUID | Required. The identifier of the release. |
Returns
The release object.
Get available releases
Retrieve a list of all available releases.
Definition
1 |
|
Example request
1 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Arguments
None.
Returns
An array of release objects.
Get information about a release
Retrieve details of a specified release.
Definition
1 |
|
Example request
1 |
|
Response definition
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Arguments
Argument | Description |
---|---|
release UUID | Required. The identifier of the release. |
Returns
The release object.
Get available node families (Orchestration v1)
Retrieve a list of node families. Note that this request belongs to the Topology service. The following also shows the Orchestration-specific parts of the response.
Definition
1 |
|
Example request
1 |
|
Response definition
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
Arguments
None.
Returns
An array of node family objects.
Get available node families (Orchestration v2)
Definition
1 |
|
Example request
1 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
Arguments
None.
Returns
An array of orchestration node family objects.
Get information about a node family (Orchestration v2)
Definition
1 |
|
Example request
1 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
Arguments
None.
Returns
An orchestration node family object.
Get available domains of a node family
Definition
1 |
|
Example request
1 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Arguments
None.
Returns
An array of domain objects.
Get information about a domain
Definition
1 |
|
Example request
1 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Arguments
None.
Returns
A domain object.
Get available nodes (Orchestration v1)
Retrieve a list of deployed nodes.
Definition
1 |
|
Example request
1 |
|
Response definition
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Arguments
None.
Returns
An array of node objects.
Get available nodes (Orchestration v2)
Retrieve a list of deployed nodes.
Definition
1 |
|
Example request
1 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
Arguments
None.
Returns
An array of node objects.
Get information about a node (Orchestration v2)
Retrieve a list of deployed nodes.
Definition
1 |
|
Example request
1 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Arguments
None.
Returns
A node object.
Register provider
Register a cloud provider in WombatOAM.
Definition
1 |
|
Data
Request body for a physical provider
1 2 3 4 5 |
|
Request body for Amazon EC2
1 2 3 4 5 6 7 |
|
Request body for the HP Cloud
1 2 3 4 5 6 7 8 9 10 |
|
Request body for Rackspace
1 2 3 4 5 6 7 8 |
|
Example request
The following example adds an Amazon EC2 provider.
1 2 3 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Arguments
Details are provided in the request bodies for the various providers, above.
Returns
The provider object.
Upload release
Upload a release to WombatOAM.
Definition
1 |
|
Data
1 2 3 4 5 6 7 8 9 |
|
Example request
1 2 3 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Arguments
Argument | Description |
---|---|
name | Required. A custom string with which to identify the release. |
description | Optional. A custom string that can contain a more detailed description about the release. |
start_cmd | Required. WombatOAM will use this command to start the release once deployed. |
stop_cmd | Required. WombatOAM will use this command to stop the release. |
cookie | Required. The Erlang cookie that WombatOAM will use to connect to the deployed node. |
node_name_templates | Required. The path to the vm.args file within the release archive. |
release | Required. The release archive encoded in Base64. |
Returns
A release object. Note that the response is returned before the release is
ready to be used (after copying, WombatOAM will perform some preparations on it).
Before using a release (e.g. specifying it when creating a node family),
use GET /api/orch/release
to check that its status is UPLOADED
(as opposed to UPLOADING
).
Create node family (Orchestration v1)
Create a node family, which can deploy a certain release to certain providers. In Orchestration v1, the node family can be created using the Topology API.
Definition
1 |
|
Data
1 2 3 4 5 6 |
|
Example request
1 2 3 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Arguments
Argument | Description |
---|---|
name | Required. A custom string with which to identify the node family. |
bootstrap_node_selection | Required. When a new node joins a cluster, its bootstrap script gets another node as a parameter. This field defines how to select that other node. Currently the only option is random , which means that a random node is selected. |
bootstrap_strategy | Required. Determines what WombatOAM should do when it deploys a new node to a node family. The available options are distributed erlang , sd erlang and custom . With custom , you can specify a script to be executed in bootstrap_strategy_opts . |
bootstrap_strategy_opts | Optional. Specify what should happen when a new node is deployed into a node family. For example, to execute the script bin/bootstrap (included in the release archive), specify "cmd":"bin/bootstrap" . |
Returns
A node family object.
Create node family (Orchestration v2)
Create a node family, which can deploy a certain release to certain providers. In Orchestration v2, there is no "bootstrap strategy", so creating a node family is simpler than in v1.
Definition
1 |
|
Data
1 2 3 |
|
Example request
1 2 3 |
|
Example response
1 2 3 4 |
|
Arguments
Argument | Description |
---|---|
name | Required. A custom string with which to identify the node family. |
Returns
A node family object.
Attach release to a node family
Connect a node family with a release.
Definition
1 |
|
Data
1 2 3 |
|
Example request
1 2 3 |
|
Example response
200 OK
Arguments
Argument | Description |
---|---|
family ID | Required. The identifier of the node family. |
release | Required. The identifier of the release to be deployed on the nodes in the node family. |
Returns
The HTTP status code only.
Set firewall configuration for a node family
Set the firewall rules that define network ports to be open on the virtual machine instances in the node family.
Definition
1 |
|
Data
The request body is an array that contains one or more rule objects.
1 2 3 4 5 6 7 8 |
|
Example request
1 2 3 |
|
Example response
200 OK
Arguments
Argument | Description |
---|---|
family ID | Required. The identifier of the node family. |
protocol | Required. The protocol whose network traffic to filter with this firewall rule. The options are "tcp" and "udp" . |
port_from | Required. The first in the range of port numbers to which to apply this rule. |
port_to | Required. The first in the range of port numbers to which to apply this rule. |
Response
The HTTP status code only.
Set node hooks for a node family
Replace the set of hooks defined for a node family.
Definition
1 |
|
Data
1 2 3 |
|
Example request
1 2 3 |
|
Example response
200 OK
Arguments
Argument | Description |
---|---|
node_hooks | Required An object describing which hooks shall be called on which occasions. See the detailed explanation and specification in the "Node hooks" section. |
Returns
The HTTP status code only.
Add deployment domains to a node family
Add a deployment domain to a node family. A deployment domain is a part of the node family which uses the same provider with the same virtual image and hardware profile. When a node is deployed to a node family, it is actually deployed into a domain.
If the domain is a cloud domain (i.e. it will deploy nodes on hosts requested from a cloud provider like Amazon EC2, HP Cloud or Rackspace), then an SSH key and possibly a security group are created on the cloud provider during the execution of this request.
In Orchestration v2, the domain object has a "configured" field. The domain is ready to be used when that field is set to "true". The node family can still receive commands about node deployments, and the deployments will automatically start once the domain to be used has been configured.
Definition
1 |
|
Data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Example request body
1 2 3 4 5 6 7 8 9 10 11 |
|
Note: The vdisk
and hw_profile
fields are not used for physical
providers.
Example request
1 2 3 |
|
Example response
1 2 3 4 5 6 7 8 9 10 11 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Note: Ranges are converted into JSON in a weird way. This will be fixed in the future.
Arguments
Argument | Description |
---|---|
family ID | Required. The identifier of the node family. |
provider | Required. The identifier of the provider. |
provider | Required. The infrastructure provider used by the domain. Each domain uses one provider. |
ssh_user | Required. The user with which WombatOAM can SSH into virtual machine instances created by this provider. |
vdisk | Required. Virtual disk. The system image that should be placed in the virtual machine instance. |
hw_profile | Required. The hardware profile of the virtual machine instances. Different providers use different terminology: Amazon calls them instance types; OpenStack, HP Cloud and Rackspace calls them flavors; Libcloud calls them sizes. |
type | Required. "virtual" or "physical" . |
capabilities | Optional. An array of objects with the following properties: id, type ("value" , "all_in_list" , "one_in_list" , "all_in_range" or "one_in_range" ), and value. The possible type of value field depends on the value of the type field. If type is "value" , then value can be any JSON value. If type is "all_in_list" or "one_in_list" , then value should be a list of JSON values. If type is "all_in_range" or "one_in_range" , then value should be a list with two elements, a minimum and a maximum. Both can be either a number or the string "no_limit" , which stands for minus infinity when used as the minimum, and stands for plus infinity when used as the maximum. |
The behaviour of capabilities is described in detail in a document called Capability-matching Heterogeneous deployment of a Load Testing Tool.
Returns
A deployment domain object.
Deploy a node
Deploy nodes to the configured providers.
Definition
1 |
|
Data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Request body example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Example request
1 2 3 |
|
Example response (Orchestration v1)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
Example response (Orchestration v2)
In case of success, the ids of the new nodes is returned (with status code 200):
1 2 3 4 |
|
In case of error, the error is returned (with status code 400):
1 2 3 |
|
Arguments
Argument | Description |
---|---|
family UUID | Required. The identifier of the node family to deploy the node into. |
amount | Required. The number of nodes to deploy. |
autostart | Optional. Boolean. If true , WombatOAM will not only copy the release archive file to the instances, but it will also start the nodes. |
autojoin | Optional. Boolean. If true , WombatOAM will not only start the nodes but make them join into a cluster. |
demands | Optional. An array of objects describing capabilities, each with the following properties: id, type, value, and nature. The objects might also have the following priority: maximize_method (default: match ), priority (default: 0 ) and multiplier (default: 1 ). |
node_name_base_template | Optional. A string from which the base name of the nodes is calculated. See the detailed explanation below. |
node_hooks | Optional An object describing which hooks shall be called on which occasions. See the detailed explanation and specification below in the "Node hooks" section. |
The behaviour of demands is described in detail in a document called Capability-matching Heterogeneous deployment of a Load Testing Tool.
Returns
In case of Orchestration v1: The list of nodes for which the deployment process was started. This may be less than the number of nodes requested. If no nodes were deployed because the deployment demands weren't satisfied by any domain, the response is an empty list.
In case of Orchestration v2: The ids of the nodes for which the deployment process was started. There are always the same amount of nodes that the user asked for -- i.e. the deployment is started for either all nodes or none of them. In the latter case (if the deployment demands weren't satisfied by any domain, or the licence doesn't allow the number of nodes the user wanted to start), an error JSON is reported.
Node name base templates
When deploying a set of nodes with WombatOAM, the user may specify a node name base
template. The actual node names are generated from this template. E.g. if the
template is node-{{index}}
, and 3 nodes are deployed on hostA
, hostB
and
hostC
, then the names of the nodes will be node-1@hostA
, node-2@hostB
and
node-3@hostC
.
The node name base template might contain some patterns which are expanded. All other characters will go into the node names unmodified. The following patterns are accepted:
-
{{node_id}}
: Will be replaced with the identifier of the node. -
{{index}}
: When the user deploys N nodes, this pattern is replaced with the index of the node (which goes from 1 to N by default). So if e.g. 3 nodes are deployed with templatenode-{{index}}
, the generated node name bases will benode-1
,node-2
andnode-3
. -
{{index PADDING}}
, e.g.{{index 4}}
: Similar to{{index}}
, but the index will always contain at least PADDING characters, padded with zeroes. So e.g.node-{{index 4}}
might becomenode-0001
. -
{{startindex DIGITS}}
, e.g.{{startindex 20}}
: This is a global setting for the template, which specifies the first index to be used. So if e.g. 3 nodes are deployed with the templatenode-{{index}}{{startindex 20}}
, then the generated node name bases will benode-20
,node-21
andnode-22
.
The default node name base is {{node_id}}
.
Node hooks
When deploying a set of nodes with WombatOAM, the user may specify a set of actions that need to be executed before/after certain events happen. Each such occasion where WombatOAM is able to execute a list of custom actions is called a hook.
This section starts with explaining hooks with examples. The "Specifying the hooks and actions to WombatOAM" subsection contains the exact specification of how hooks can be defined to WombatOAM.
Hooks
There are six hooks: pre_node_start
, post_node_start
, pre_node_stop
,
post_node_stop
, join
and leave
. Their names describe when they fire, e.g.
the actions assigned to the pre_node_start
hook will be executed when the user
issues WombatOAM to start a node, but before it is actually started. Both families
and nodes may have actions assigned to hooks.
Note that these are all "node hooks", even those that are assigned to the family, so they fire when any node of the family is started or stopped, and not when the family itself is created or deleted.
Starting and stopping nodes
When a node is started, the actions are executed in the following order:
pre_node_start
hook actions that are assigned to the family of the node.pre_node_start
hook actions that are assigned to the node.- The node is started by executing the start command.
post_node_start
hook actions that are assigned to the family of the node.post_node_start
hook actions that are assigned to the node.
When a node is stopped, the actions are executed in the following order:
pre_node_stop
hook actions that are assigned to the node.pre_node_stop
hook actions that are assigned to the family of the node.- The node is stopped by executing the stop command.
post_node_stop
hook actions that are assigned to the node.post_node_stop
hook actions that are assigned to the family of the node.
When multiple nodes are deployed, this is performed in parallel, so the order of hooks running on different nodes is not deterministic (they may happen to run actually in parallel).
Nodes joining and leaving the cluster (in Orchestration v2)
When a node joins a cluster, the actions are executed in the following order:
join
hook actions that are assigned to the family of the node.join
hook actions that are assigned to the node.
When a node leaves the cluster, the actions are executed in the following order:
leave
hook actions that are assigned to the node.leave
hook actions that are assigned to the family of the node.
Note that there is no "join command" or "leave command", so these hooks are themselves responsible for asking the nodes to join/leave the cluster, and return only when that operation has finished.
The user may specify the "autojoin" option when deploying the nodes. In that
case, when the first node of the node family is started, it will be appointed as
the "bootstrap" node, and it will be declared a part of the cluster without
executing anything. For each successive node that is started, the "join" is
performed towards the bootstrap node (i.e. the join hooks are executed with the
bootstrap_node_id
and bootstrap_node_name
variables set accordingly). The
"join" operations are performed sequentially (i.e. join for a node is started
only if the join for the previous node has been finished).
Note that in the future, it should be possible to initiate a node joining/leaving the cluster by sending a REST request, but these are not yet implemented. So the only way to get a node join a cluster is to use "autojoin", and there is no way to make a node leave a cluster.
Actions
There are three kinds of actions: run
, call
and send_file
.
In each case, the output of the actions is logged in WombatOAM's debug log.
If the action shall be executed on a node, and the node is not (yet) available, then the action is retried (10 times by default, with waiting 30 seconds between retries).
"Run" action
This action runs a program (either a script or an executable binary). The following options are available:
executable
(mandatory): The path to the file that should be executed. If the script is executed on the node, this path can be either absolute or relative to the release directory (~/<node_id>/
). If it is executed on WombatOAM, it shall be absolute.location
(mandatory): Whether the script should be executed on the WombatOAM host or the managed node's host.args
(optional): The arguments to be passed to the executable. Each argument can be either a string (which is passed unmodified), the variablenode_id
ornode_name
(whose value is passed) or a concatenation of strings and variables. In case of the "join" and "leave" hooks, the variablesbootstrap_node_id
andbootstrap_node_name
can also be used.
Running a script on a remote node is performed using SSH.
As an example, if the following action is executed on node with id
d010c157-dd36-4990-b894-eeccce873c09
and name mynode@127.0.0.1
1 2 3 4 5 6 7 8 9 |
|
then the following will be executed:
1 2 |
|
The return code of the script is checked and if it is not zero, the execution is considered to be failed and further actions on the node are cancelled.
"Call" action
This action calls an Erlang function. The following options are available:
mod_name
,fun_name
(mandatory): The module and name of the function to be called.location
(mandatory): Whether the function should be called on the WombatOAM node or the managed node.args
(optional): The arguments to be passed to the function. Each argument can be either a term (which is passed unmodified after being parsed from the JSON string) or the variablenode_id
ornode_name
(whose value is passed). In case of the "join" and "leave" hooks, the variablesbootstrap_node_id
andbootstrap_node_name
can also be used.
Calling a function on a remote node is performed using Erlang RPC.
As an example, if the following action is executed on node with id
d010c157-dd36-4990-b894-eeccce873c09
and name mynode@127.0.0.1
1 2 3 4 5 6 7 8 |
|
then the following function call will be executed:
1 2 3 4 |
|
In order to execute an Erlang function on WombatOAM, WombatOAM needs to find the
containing module. To do that, the directory that contains the compiled version
of the module shall be added to the "wo_orch/hook_dirs"
option. For example:
1 2 3 |
|
In order to execute an Erlang function on the deployed node, the creator of the release package needs to make sure that the node will find the module.
Since Erlang functions on the node can be executed only when the node is
running, "call" actions on nodes should not be specified in pre_node_start
and
post_node_stop
hook.
"Send file" action
This action copies a file from WombatOAM to the node's host machine. The following options are available:
source
(mandatory): The path to the file to be copied on the WombatOAM host. It is recommended to use an absolute path.target
(mandatory): The path that the file shall have on the target machine, or the directory into which it should be copied. It can be either relative or absolute. In the latter case, it is relative to the node's main directory (which is~/<node_id>
).
Copying a file to the node is performed using SCP.
Specifying the hooks and actions to WombatOAM
The exact structure of the NodeHooks
JSON object is the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
Upload file to a node (deprecated - only Orchestration v1)
Upload a file to a specified location on a node.
This feature is deprecated and will be removed. If you wish to upload files
to the nodes, ask the hostnames from WombatOAM and use scp
.
Definition
1 |
|
Data
1 2 3 4 |
|
Example response
200 OK
Arguments
Argument | Description |
---|---|
path | Required. The location on the target node to which the file will be copied. |
content | Required. The base64-encoded version of the content of the file to be uploaded. |
Returns
The HTTP status code only.
Unregister provider
Remove an infrastructure provider from the list of available providers.
Definition
1 |
|
Example request
1 |
|
Example response
200 OK
Arguments
Argument | Description |
---|---|
provider UUID | Required. The identifier of the infrastructure provider. |
Returns
The HTTP status code only.
Delete release
Delete a release.
Definition
1 |
|
Example request
1 |
|
Example response
200 OK
Arguments
Argument | Description |
---|---|
release UUID | Required. The identifier of the release. |
Returns
The HTTP status code only.
Delete family (Orchestration v1)
Delete a node family (using the Topology API).
Definition
1 |
|
Example request
1 |
|
Example response
200 OK
Arguments
Argument | Description |
---|---|
family UUID | Required. The identifier of the node family. |
Returns
The HTTP status code only.
Delete family (Orchestration v2)
Delete a node family (using the Orchestration API). This includes releasing all resources associated with the deployment domains in the cloud (SSH keys and security groups).
If the family has nodes, an error is returned.
Definition
1 |
|
Example request
1 |
|
Example response
200 OK
Arguments
Argument | Description |
---|---|
family UUID | Required. The identifier of the node family. |
Returns
The HTTP status code only.
Terminate family (Orchestration v2)
Delete a node family (using the Orchestration API). If the family has nodes, terminate them.
Definition
1 |
|
Example request
1 |
|
Example response
200 OK
Arguments
Argument | Description |
---|---|
family UUID | Required. The identifier of the node family. |
Returns
The HTTP status code only.
Terminate a node
Terminate a deployed node. If the node is running in the cloud, this includes releasing the host machine.
Definition
1 |
|
Example request
1 |
|
Example response
200 OK
Arguments
Argument | Description |
---|---|
family UUID | Required. The identifier of the deployed node. |
Returns
The HTTP status code only.