# Orchestration v1

## Setup

### Rackspace setup

The first step is to pass in your credentials and set up a client. For Rackspace users, you will need your username and API key:

    use OpenCloud\Rackspace;

    $client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
      'username' => '{username}',
      'apiKey'   => '{apiKey}',
    ));

### OpenStack setup

If you’re an OpenStack user, you will also need to prove a few other configuration parameters:

    $client = new OpenCloud\OpenStack('{keystoneUrl}', array(
      'username' => '{username}',
      'password' => '{apiKey}',
      'tenantId' => '{tenantId}',
    ));

### Orchestration service

Now to instantiate the Orchestration service:

    $service = $client->orchestrationService('{catalogName}', '{region}', '{urlType}');

- `{catalogName}` is the name of the service as it appears in the service catalog. OpenStack users must set this value. For Rackspace users, a default will be provided if you pass in `null`.
- `{region}` is the region the service will operate in. For Rackspace users, you can select one of the following from the supported regions page.
- `{urlType}` is the type of URL to use, depending on which endpoints your catalog provides. If omitted, it will default to the public network.

## Operations

- Templates
  - Validating templates
    - Validate a template from a file
    - Validate Template from URL
- Stacks
  - Preview stack
    - Preview a stack from a template file
    - Preview a stack from a template URL
  - Create stack
    - Create a stack from a template file
    - Create a stack from a template URL
  - List stacks
  - Get stack
  - Get stack template
  - Update stack
    - Update a stack from a template file
    - Update Stack from Template URL
  - Delete stack
  - Abandon Stack
  - Adopt stack
- Stack resources
  - List stack resources
  - Get stack resource
  - Get stack resource metadata
- Resource types
  - List resource types
  - Get resource type
  - Get resource type template
- Build info
  - Get build info
- Stack resource events
  - List stack events
  - List stack resource events
  - Get stack resource event

## Glossary

template
  An Orchestration template is a JSON or YAML document that describes how a set of resources should be assembled to produce a working deployment. The template specifies what resources should be used, what attributes of these resources are parameterized and what information is output to the user when a template is instantiated.
resource
  A resource is a template artifact that represents some component of your desired architecture (a Cloud Server, a group of scaled Cloud Servers, a load balancer, some configuration management system, and so forth).
stack
  A stack is a running instance of a template. When a stack is created, the resources specified in the template are created.

## Further links

- Getting Started Guide for the API
- API Developer Guide
- API release history