2017-03-21 22:24:29 +01:00
|
|
|
---
|
2017-03-21 22:50:17 +01:00
|
|
|
layout: "api"
|
|
|
|
page_title: "Runs API"
|
|
|
|
sidebar_current: "docs-enterprise-api-runs"
|
|
|
|
description: |-
|
|
|
|
Runs in Terraform Enterprise represents a two step Terraform plan and a subsequent apply.
|
2017-03-21 22:24:29 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
# Runs API
|
|
|
|
|
2017-03-21 22:50:17 +01:00
|
|
|
Runs in Terraform Enterprise represents a two step Terraform plan and a subsequent apply.
|
2017-03-21 22:24:29 +01:00
|
|
|
|
2017-03-21 22:50:17 +01:00
|
|
|
Runs are queued under [environments](/docs/enterprise/api/environments.html)
|
2017-03-21 22:24:29 +01:00
|
|
|
and require a two-step confirmation workflow. However, environments
|
|
|
|
can be configured to auto-apply to avoid this.
|
|
|
|
|
|
|
|
### Run Attributes
|
|
|
|
|
2017-03-23 00:23:08 +01:00
|
|
|
<table class="apidocs">
|
2017-03-21 22:24:29 +01:00
|
|
|
<tr>
|
|
|
|
<th>Attribute</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Required</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><code>destroy</code></td>
|
|
|
|
<td>If set to <code>true</code>, this run will be a destroy plan.</td>
|
|
|
|
<td>No</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
### Actions
|
|
|
|
|
2017-03-23 19:03:36 +01:00
|
|
|
The following actions can be performed on this resource.
|
2017-03-21 22:24:29 +01:00
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>Queue a run</dt>
|
2017-03-23 19:03:36 +01:00
|
|
|
<dd>POST /api/v1/environments/:username/:name/plan</dd>
|
2017-03-21 22:24:29 +01:00
|
|
|
</dl>
|
|
|
|
|
|
|
|
### Examples
|
|
|
|
|
|
|
|
#### Queueing a new run
|
|
|
|
|
|
|
|
Starts a new run (plan) in the environment. Requires a configuration
|
|
|
|
version to be present on the environment to succeed, but will otherwise 404.
|
|
|
|
|
|
|
|
$ curl %{ATLAS_URL}/api/v1/environments/%{DEFAULT_USERNAME}/test/plan \
|
|
|
|
-X POST \
|
|
|
|
-d "" \
|
|
|
|
-H "X-Atlas-Token: $ATLAS_TOKEN"
|