##Using the OpenStack Orchestration provider
Creating a client is straight-forward:
var openstack = pkgcloud.orchestration.createClient({
provider: 'openstack', // required
username: 'your-user-name', // required
password: 'your-password', // required
authUrl: 'your identity service url' // required
});
Note: Due to variances between OpenStack deployments, you may or may not need a region
option.
More options for creating clients
Lists all stacks that are available to use on your OpenStack account
Callback returns f(err, stacks)
where stacks
is an Array
Creates a stack with the options specified.
Options are as follows:
{
name: 'my-stack-name', // required
timeout: 30, // timeout, in minutes, required
templateUrl: 'http://path.to.some.openstack.heat.template', // required, unless you pass template directly
template: { ... }, // optional, unless you don't provide templateUrl
parameters: { ... }, // optional parameters for the stack
environment: { ... }, // optional environment values for the stack
files: { ... }, // optional files for the stack
}
Returns the stack in the callback f(err, stack)
Retrieves the provided stack or stackId from the service. Callback has the signature f(err, stack)
.
Result stack-object includes following fields
{
id: ,
name: ,
status: ,
description: ,
templateDescription: ,
statusReason: ,
owner: ,
disableRollback: ,
parameters: ,
capabilities: ,
notificationTopics: ,
timeout: ,
createdAt: ,
updatedAt: ,
outputs: // Outputs field has value only if outputs are defined in template and the stack has been instantiated.
}
Identical to the client.createStack()
call, except it only previews the creation, instead of actually provisioning
the stack.
Returns the previewed stack in the callback f(err, stack)
Identical to the client.createStack()
call, except it requires passing details.stackData
which is the abandonedStack
value returned from client.abandonStack()
.
Returns the created stack in the callback f(err, stack)
Update the provided stack.
The following values from the provided stack are updatable.
{
name: 'my-stack-name', // required
timeout: 30, // timeout, in minutes, required
templateUrl: 'http://path.to.some.openstack.heat.template', // required, unless you pass template directly
template: { ... }, // optional, unless you don't provide templateUrl
parameters: { ... }, // optional parameters for the stack
environment: { ... }, // optional environment values for the stack
files: { ... }, // optional files for the stack
}
Delete the created stack, and delete the resources. Callback is f(err)
.
Delete the created stack, but leave the resources running. Will callback with f(err, abandonedStack)
where the
abandonedStack
would be passed in as an option to client.createStack()
.
Get the template for a provided stack. Will callback with f(err, template)
.
Get the resource for a provided stack and resource or resourceName in the callback f(err, resource)
Get the resources for a provided stack. Callback is f(err, resources)
.
Options are as follows:
{
nestedDepth: 3 // include resources from nested stacks up to nestedDepth levels of recursion
}
Get a list of valid resource types. Callback is f(err, resourceTypes)
.
Get the schema for a provided resourceType. Callback is f(err, resourceSchema)
.
Get the template for a provided resourceType. Callback is f(err, resourceTemplate)
.
Get the event for a provided stack, resource and eventId.
f(err, event)
Get all of the events for a provided stack
f(err, events)
Get all of the events for a stack and resource.
f(err, events)
Validates a provided template, with a callback of f(err, template)
.