UNPKG

@itentialopensource/adapter-terraform_enterprise

Version:

This adapter integrates with system described as: terraform Enterprise.

1,235 lines (1,234 loc) 114 kB
{ "swagger": "2.0", "info": { "title": "Terraform", "description": "Terraform Cloud is an application that helps teams use Terraform together. It manages Terraform runs in a consistent and reliable environment, and includes easy access to shared state and secret data, access controls for approving changes to infrastructure, a private registry for sharing Terraform modules, detailed policy controls for governing the contents of Terraform configurations, and more.\n\nTerraform Cloud is available as a hosted service at https://app.terraform.io. We offer free accounts for small teams, and paid plans with additional feature sets for medium-sized businesses.\n\nLarge enterprises can purchase Terraform Enterprise, our self-hosted distribution of Terraform Cloud. It offers enterprises a private instance of the Terraform Cloud application, with no resource limits and with additional enterprise-grade architectural features like audit logging and SAML single sign-on.", "version": "v2", "contact": { "email": "apiteam@swagger.io" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } }, "host": "app.terraform.io", "basePath": "/api", "schemes": [ "https", "http" ], "tags": [ { "name": "default", "description": "", "externalDocs": { "url": "http://swagger.io" } }, { "name": "Account", "description": "Account represents the current user interacting with Terraform. It returns the same type of object as the Users API, but also includes an email address, which is hidden when viewing info about other users.", "externalDocs": "https://www.terraform.io/docs/cloud/api/account.html" }, { "name": "Applies", "description": "An apply represents the results of applying a Terraform Run's execution plan.", "externalDocs": "https://www.terraform.io/docs/cloud/api/applies.html" }, { "name": "CostEstimates", "description": "Cost estimate Information", "externalDocs": "https://www.terraform.io/docs/cloud/api/cost-estimates.html" }, { "name": "NotificationConfigurations", "description": "Terraform Cloud can be configured to send notifications for run state transitions. The configuration allows you to specify a destination URL, request type, and what events will trigger the notification. Each workspace can have up to 20 notification configurations, and they apply to all runs for that workspace.", "externalDocs": "https://www.terraform.io/docs/cloud/api/notification-configurations.html" }, { "name": "OAuthClients", "description": "An OAuth Client represents the connection between an organization and a VCS provider.", "externalDocs": null }, { "name": "OAuthTokens", "description": "The oauth-token object represents a VCS configuration which includes the OAuth connection and the associated OAuth token. This object is used when creating a workspace to identify which VCS connection to use.", "externalDocs": null }, { "name": "Organizations", "description": "The Organizations API is used to list, show, create, update, and destroy organizations.", "externalDocs": "https://www.terraform.io/docs/cloud/api/organizations.html" }, { "name": "OrganizationMemberships", "description": "Users are added to organizations by inviting them to join. Once accepted, they become members of the organization. The Organization Membership resource represents this membership.\nYou can invite users who already have an account, as well as new users. If the user has an existing account with the same email address used to invite them, they can reuse the same login.", "externalDocs": "https://www.terraform.io/docs/cloud/api/organization-memberships.html" }, { "name": "OrganizationToken", "description": "Organization Token API", "externalDocs": null }, { "name": "PlanExports", "description": "Plan exports allow users to download data exported from the plan of a Run in a Terraform workspace. Currently, the only supported format for exporting plan data is to generate mock data for Sentinel.", "externalDocs": null }, { "name": "Plans", "description": "Plan exports allow users to download data exported from the plan of a Run in a Terraform workspace.", "externalDocs": "https://www.terraform.io/docs/cloud/api/plans.html" }, { "name": "Policies", "description": "Policies are configured on a per-organization level and are organized and grouped into policy sets, which define the workspaces on which policies are enforced during runs. In these workspaces, the plan's changes are validated against the relevant policies after the plan step.", "externalDocs": "https://www.terraform.io/docs/cloud/api/policies.html" }, { "name": "PolicyChecks", "description": "Policy Checks.", "externalDocs": "https://www.terraform.io/docs/cloud/api/policy-checks.html" }, { "name": "PolicySets", "description": "Policy Sets.", "externalDocs": "https://www.terraform.io/docs/cloud/api/policy-sets.html" }, { "name": "PolicySetParameters", "description": "Policy Set Parameters.", "externalDocs": "https://www.terraform.io/docs/cloud/api/policy-set-params.html" }, { "name": "Runs", "description": "Performing a run on a new configuration is a multi-step process. Create a configuration version on the workspace. Upload configuration files to the configuration version. Create a run on the workspace; this is done automatically when a configuration file is uploaded. Create and queue an apply on the run; if the run can't be auto-applied. Alternatively, you can create a run with a pre-existing configuration version, even one from another workspace. This is useful for promoting known good code from one workspace to another.", "externalDocs": "https://www.terraform.io/docs/cloud/api/run.html" }, { "name": "StateVersions", "description": "State Versions.", "externalDocs": "https://www.terraform.io/docs/cloud/api/state-versions.html" }, { "name": "StateVersionOutputs", "description": "State Version Outputs.", "externalDocs": "https://www.terraform.io/docs/cloud/api/state-versions.html" }, { "name": "Users", "description": "Terraform Cloud's user objects do not contain any identifying information about a user, other than their Terraform Cloud username and avatar image; they are intended for displaying names and avatars in contexts that refer to a user by ID, like lists of team members or the details of a run. Most of these contexts can already include user objects via an ?include parameter, so you shouldn't usually need to make a separate call to this endpoint.", "externalDocs": null }, { "name": "Variables", "description": "This set of APIs covers create, update, list and delete operations on variables.", "externalDocs": "https://www.terraform.io/docs/cloud/api/variables.html" }, { "name": "Workspaces", "description": "Workspaces represent running infrastructure managed by Terraform.", "externalDocs": "https://www.terraform.io/docs/cloud/api/workspaces.html" }, { "name": "WorkspacesVariables", "description": "This set of APIs covers create, update, list and delete operations on workspace variables", "externalDocs": "https://www.terraform.io/docs/cloud/api/workspace-variables.html" } ], "paths": { "/account/details": { "get": { "parameters": [], "operationId": "GET", "tags": [ "Account" ], "summary": "GetAccountDetails", "description": "Get account details.", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/runs": { "post": { "parameters": [ { "name": "body", "in": "body", "schema": { "type": "string" } } ], "tags": [ "Runs" ], "operationId": "createRun", "summary": "Create a Run", "description": "A run performs a plan and apply, using a configuration version and the workspace’s current variables. You can specify a configuration version when creating a run; if you don’t provide one, the run defaults to the workspace’s most recently used version. (A configuration version is “used” when it is created or used for a run in this workspace.)", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/runs/{run_id}/actions/apply": { "post": { "parameters": [ { "name": "run_id", "in": "path", "description": "The run ID to apply", "type": "string" }, { "name": "body", "in": "body", "schema": { "type": "string" } } ], "tags": [ "Runs" ], "operationId": "applyRun", "summary": "Apply a Run", "description": "Applies a run that is paused waiting for confirmation after a plan. This includes runs in the \"needs confirmation\" and \"policy checked\" states. This action is only required for runs that can't be auto-applied. (Plans can be auto-applied if the auto-apply setting is enabled on the workspace and the plan was queued by a new VCS commit or by a user with write permissions.)", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/workspaces/{workspace_id}/runs": { "get": { "parameters": [ { "name": "workspace_id", "in": "path", "type": "string", "description": "The workspace ID to list runs for." }, { "in": "query", "name": "page[number]", "description": "Page Number", "type": "number" }, { "name": "page[size]", "in": "query", "description": "Page Size", "type": "number" } ], "tags": [ "Runs" ], "operationId": "ListRuns", "summary": "List Runs in a Workspace", "description": "List Runs in a Workspace", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/runs/{run_id}": { "get": { "parameters": [ { "name": "run_id", "in": "path", "description": "The run ID to get.", "type": "string" } ], "tags": [ "Runs" ], "operationId": "GetRunDetails", "summary": "Get run details", "description": "This endpoint is used for showing details of a specific run.", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/runs/{run_id}/actions/discard": { "post": { "parameters": [ { "name": "run_id", "in": "path", "type": "string", "description": "The run ID to discard" }, { "name": "body", "in": "body", "schema": { "type": "string" } } ], "tags": [ "Runs" ], "operationId": "DiscardRun", "summary": "Discard a Run", "description": "The discard action can be used to skip any remaining work on runs that are paused waiting for confirmation or priority. This includes runs in the \"pending,\" \"needs confirmation,\" \"policy checked,\" and \"policy override\" states.", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/runs/{run_id}/actions/cancel": { "post": { "parameters": [ { "name": "run_id", "in": "path", "description": "The run ID to cancel", "type": "string" }, { "name": "body", "in": "body", "schema": { "type": "string" } } ], "tags": [ "Runs" ], "operationId": "cancelRun", "summary": "Cancel a Run", "description": "The cancel action can be used to interrupt a run that is currently planning or applying. Performing a cancel is roughly equivalent to hitting ctrl+c during a Terraform plan or apply on the CLI. The running Terraform process is sent an INT signal, which instructs Terraform to end its work and wrap up in the safest way possible.", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/runs/{run_id}/actions/force-cancel": { "post": { "parameters": [ { "name": "run_id", "in": "path", "description": "The run ID to cancel", "type": "string" }, { "name": "body", "in": "body", "schema": { "type": "string" } } ], "tags": [ "Runs" ], "operationId": "forceCancel", "summary": "Forcefully cancel a run", "description": "The force-cancel action is like cancel, but ends the run immediately. Once invoked, the run is placed into a canceled state, and the running Terraform process is terminated. The workspace is immediately unlocked, allowing further runs to be queued. The force-cancel operation requires workspace admin privileges.", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/runs/{run_id}/actions/force-execute": { "get": { "parameters": [ { "name": "run_id", "in": "path", "description": "The run ID to execute", "type": "string" } ], "tags": [ "Runs" ], "operationId": "forceExecute", "summary": "Forcefully execute a run", "description": "The force-execute action cancels all prior runs that are not already complete, unlocking the run's workspace and allowing the run to be executed. (It initiates the same actions as the \"Run this plan now\" button at the top of the view of a pending run.)", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/account/update": { "patch": { "parameters": [ { "name": "body", "in": "body", "description": "JSON body for update", "schema": { "type": "string" } } ], "tags": [ "Account" ], "operationId": "updateAccount", "summary": "Update Account", "description": "Update account details", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/account/password": { "patch": { "parameters": [ { "name": "body", "in": "body", "schema": { "type": "string" } } ], "tags": [ "Account" ], "operationId": "changePassword", "summary": "Change Password", "description": "Change your password", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/applies/{id}": { "get": { "parameters": [ { "name": "id", "in": "path", "description": "The ID of the apply to show." } ], "tags": [ "Applies" ], "operationId": "getApply", "summary": "Get Apply", "description": "Show an apply", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/cost-estimates/{id}": { "get": { "parameters": [ { "name": "id", "in": "path", "description": "The ID of the cost estimate to show.." } ], "tags": [ "CostEstimates" ], "operationId": "getCostEstimate", "summary": "Get Cost Estimate", "description": "Show a cost estimate", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/workspaces/{workspace_id}/notification-configurations": { "post": { "parameters": [ { "name": "body", "in": "body", "schema": { "type": "string" } } ], "tags": [ "NotificationConfigurations" ], "operationId": "createNotificationConfiguration", "summary": "Create Notification Configuration", "description": "Create a Notification Configuration", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } }, "get": { "parameters": [ { "name": "workspace_id", "in": "path", "description": "The ID of the workspace to list configurations from. Obtain this from the workspace settings or the Show Workspace endpoint.", "type": "string", "required": true } ], "tags": [ "NotificationConfigurations" ], "operationId": "listNotificationConfigurations", "summary": "List Notification Configurations", "description": "List all notification configurations", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/notification-configurations/{notification-configuration-id}": { "get": { "parameters": [ { "name": "notification-configuration-id", "in": "path", "description": "The id of the notification configuration to show.", "type": "string", "required": true } ], "tags": [ "NotificationConfigurations" ], "operationId": "getNotificationConfiguration", "summary": "Get Notification Configuration", "description": "Get details for a notification configuration", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } }, "patch": { "parameters": [ { "name": "notification-configuration-id", "in": "path", "description": "The id of the notification configuration to update.", "type": "string", "required": true } ], "tags": [ "NotificationConfigurations" ], "operationId": "updateNotificationConfiguration", "summary": "Update Notification Configuration", "description": "Update a notification configuration", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } }, "delete": { "parameters": [ { "name": "notification-configuration-id", "in": "path", "description": "The id of the notification configuration to delete.", "type": "string", "required": true } ], "tags": [ "NotificationConfigurations" ], "operationId": "deleteNotificationConfiguration", "summary": "Delete Notification Configuration", "description": "This endpoint deletes a notification configuration.", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/notification-configurations/{notification-configuration-id}/actions/verify": { "post": { "parameters": [ { "name": "notification-configuration-id", "in": "path", "description": "The id of the notification configuration to verify.", "type": "string", "required": true } ], "tags": [ "NotificationConfigurations" ], "operationId": "verifyNotificationConfiguration", "summary": "Verify a Notification Configuration", "description": "This will cause Terraform Cloud to send a verification request for the specified configuration. If a response is received, it will be stored and returned in the delivery-responses attribute. More details in the Notification Verification and Delivery Responses section above.", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/organizations": { "get": { "parameters": [], "tags": [ "Organizations" ], "operationId": "listOrganizations", "summary": "List Organizations", "description": "List the organizations", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/organizations/{organization_name}": { "get": { "parameters": [ { "name": "organization_name", "in": "path", "description": "The name of the organization to show", "type": "string", "required": true } ], "tags": [ "Organizations" ], "operationId": "getOrganization", "summary": "Get Organization", "description": "Get an organization", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/organizations/{organization_name}/organization-memberships": { "post": { "parameters": [ { "name": "organization_name", "in": "path", "description": "The name of the organization the user will be invited to join. The inviting user must have permission to manage organization memberships", "type": "string", "required": true }, { "name": "body", "in": "body", "schema": { "type": "string" } } ], "tags": [ "OrganizationMemberships" ], "operationId": "InviteUserToOrganization", "summary": "Invite a User to an Organization", "description": "Invite a User to an Organization", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } }, "get": { "parameters": [ { "name": "organization_name", "in": "path", "type": "string", "description": "The name of the organization to list the memberships of.", "required": true }, { "name": "q", "in": "query", "description": "Optional. A search query string. Organization memberships are searchable by user name and email.", "type": "string" }, { "name": "filter[status]", "in": "query", "description": "Optional. If specified, restricts results to those with the matching status value. Valid values are invited and active.", "type": "string" }, { "name": "page[number]", "in": "query", "description": "Optional. If omitted, the endpoint will return the first page.", "type": "string" }, { "name": "page[size]", "in": "query", "description": "Optional. If omitted, the endpoint will return 20 users per page.", "type": "string" } ], "tags": [ "OrganizationMemberships" ], "operationId": "listMembershipsOrganization", "summary": "List Memberships for an Organization", "description": "List Memberships for an Organization", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/organization-memberships": { "get": { "parameters": [], "tags": [ "OrganizationMemberships" ], "operationId": "listUserOwnMemberships", "summary": "List User's Own Memberships", "description": "List User's Own Memberships", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/organization-memberships/{organization_membership_id}": { "get": { "parameters": [ { "name": "organization_membership_id", "in": "path", "type": "string", "description": "The organization membership", "required": true } ], "tags": [ "OrganizationMemberships" ], "operationId": "showMembership", "summary": "Show a Membership", "description": "Show a Membership", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } }, "delete": { "parameters": [ { "name": "organization_membership_id", "in": "path", "type": "string", "description": "The organization membership", "required": true } ], "tags": [ "OrganizationMemberships" ], "operationId": "removeUserFromOrganization", "summary": "Remove User from Organization", "description": "Remove User from Organization", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/plans/{id}": { "get": { "parameters": [ { "name": "id", "in": "path", "description": "The ID of the plan to show", "type": "string", "required": true } ], "tags": [ "Plans" ], "operationId": "showPlan", "summary": "Show a plan", "description": "Show a plan", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/organizations/{organization_name}/policies": { "post": { "parameters": [ { "name": "organization_name", "in": "path", "description": "The organization to create the policy in. The organization must already exist in the system, and the token authenticating the API request must belong to the \"owners\" team or a member of the \"owners\" team.", "type": "string", "required": true }, { "name": "body", "in": "body", "schema": { "type": "string" } } ], "tags": [ "Policies" ], "operationId": "createPolicy", "summary": "Create a Policy", "description": "Create a Policy", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } }, "get": { "parameters": [ { "description": "The organization to list policies for.", "type": "string", "in": "path", "name": "organization_name", "required": true }, { "name": "page[number]", "in": "query", "description": "Optional. If omitted, the endpoint will return the first page.", "type": "string" }, { "name": "page[size]", "in": "query", "description": "Optional. If omitted, the endpoint will return 20 policies per page.", "type": "string" }, { "name": "search[name]", "in": "query", "description": "Optional. Allows searching the organization's policies by name.", "type": "string" } ], "tags": [ "Policies" ], "operationId": "listPolicies", "summary": "List Policies", "description": "List Policies", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/policies/{policy_id}": { "get": { "parameters": [ { "name": "policy_id", "in": "path", "description": "The ID of the policy to show. Use the \"List Policies\" endpoint to find IDs.", "type": "string", "required": true } ], "tags": [ "Policies" ], "operationId": "showPolicy", "summary": "Show a Policy", "description": "Show a Policy", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } }, "patch": { "parameters": [ { "name": "policy_id", "description": "The ID of the policy to update. Use the \"List Policies\" endpoint to find IDs.", "in": "path", "type": "string", "required": true }, { "name": "body", "in": "body", "schema": { "type": "string" } } ], "tags": [ "Policies" ], "operationId": "updatePolicy", "summary": "Update a Policy", "description": "This endpoint can update the enforcement mode of an existing policy. To update the policy code itself, use the upload endpoint.", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } }, "delete": { "parameters": [ { "name": "policy_id", "in": "path", "description": "The ID of the policy to delete. Use the \"List Policies\" endpoint to find IDs.", "type": "string", "required": true } ], "tags": [ "Policies" ], "operationId": "deletePolicy", "summary": "Delete a Policy", "description": "Delete a Policy", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/policies/{policy_id}/upload": { "put": { "parameters": [ { "name": "policy_id", "in": "path", "description": "The ID of the policy to upload code to. Use the \"List Policies\" endpoint (or the response to a \"Create Policy\" request) to find IDs.", "type": "string", "required": true } ], "tags": [ "Policies" ], "operationId": "uploadPolicy", "summary": "Upload a Policy", "description": "Upload a Policy", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/runs/{run_id}/policy-checks": { "get": { "parameters": [ { "name": "run_id", "in": "path", "description": "specifies the run ID for which to list policy checks", "type": "string", "required": true } ], "tags": [ "PolicyChecks" ], "operationId": "listPolicyChecks", "summary": "List policy checks", "description": "This endpoint lists the policy checks in a run.", "responses": { "200": { "schema": { "type": "string" }, "description": "successful operation" }, "400": { "description": "failed operation" } } } }, "/policy-checks/{policy_check_id}/actions/override": { "post": { "parameters": [ { "name": "policy_check_id", "in": "path", "type": "string", "description": "specifies the ID for the policy check to override", "required": true } ], "tags": [ "PolicyChecks" ], "operationId": "overridePolicy", "summary": "Override Policy", "description": "This endpoint overrides a soft-mandatory or warning policy.", "responses": { "200": { "schema": { "type": "string"