terraform/website/source/docs/enterprise/api/runs.html.md

66 lines
1.7 KiB
Markdown
Raw Normal View History

---
2017-04-03 19:53:38 +02:00
layout: "enterprise"
2017-04-07 05:59:58 +02:00
page_title: "Runs - API - Terraform Enterprise"
2017-03-21 22:50:17 +01:00
sidebar_current: "docs-enterprise-api-runs"
description: |-
Runs in Terraform Enterprise represents a two step Terraform plan and a subsequent apply.
---
# Runs API
2017-04-07 05:59:58 +02:00
Runs in Terraform Enterprise represents a two step Terraform plan and a
subsequent apply.
2017-03-21 22:50:17 +01:00
Runs are queued under [environments](/docs/enterprise/api/environments.html)
and require a two-step confirmation workflow. However, environments
can be configured to auto-apply to avoid this.
2017-04-07 05:59:58 +02:00
## Queue Run
2017-04-07 05:59:58 +02:00
Starts a new run (plan) in the environment. Requires a configuration version to
be present on the environment to succeed, but will otherwise 404.
2017-04-07 05:59:58 +02:00
| Method | Path |
| :----- | :------------- |
| `POST` | `/environments/:username/:name/plan` |
2017-04-07 05:59:58 +02:00
### Parameters
2017-04-07 05:59:58 +02:00
- `:username` `(string: <required>)` - Specifies the username or organization
name under which to get the latest configuration version. This username must
already exist in the system, and the user must have permission to create new
configuration versions under this namespace. This is specified as part of the
URL.
2017-04-07 05:59:58 +02:00
- `:name` `(string: <required>)` - Specifies the name of the configuration for
which to get the latest configuration. This is specified as part of the URL.
2017-04-07 05:59:58 +02:00
- `destroy` `(bool: false)` - Specifies if the plan should be a destroy plan.
2017-04-07 05:59:58 +02:00
### Sample Payload
2017-04-07 05:59:58 +02:00
```json
{
"destroy": false
}
```
### Sample Request
```text
$ curl \
--request POST \
--header "X-Atlas-Token: ..." \
--header "Content-Type: application/json" \
--data @payload.json \
https://atlas.hashicorp.com/api/v1/environments/my-organization/my-environment/plan
```
### Sample Response
```json
{
"success": true
}
```