Run Triggers

The RunTrigger resource

Run triggers allow runs to queue automatically in downstream workspace on successful apply of runs in any of the upstream workspaces.

Key path

Description

type* (string)

Available values: run-triggers

id (string)

attributes.created-at (string)

The resource creation timestamp.

relationships.downstream* (object)

Downstream workspace in which new runs will be created.

relationships.downstream.data.type* (string)

Available values: workspaces

relationships.downstream.data.id* (string)

relationships.upstream* (object)

Upstream workspace to track new runs.

relationships.upstream.data.type* (string)

Available values: workspaces

relationships.upstream.data.id* (string)

links.self (string)

Create a Run Trigger.

POST /api/iacp/v3/run-triggers

Create a new run trigger.

In order to create a run trigger, the user must have workspaces:read permission for the upstream workspace and permissions workspaces:update and runs:create for the downstream workspace.

Request body:

Key path

Description

data.type* (string)

Available values: run-triggers

data.id (string)

data.relationships.downstream* (object)

Downstream workspace in which new runs will be created.

data.relationships.downstream.data.type* (string)

Available values: workspaces

data.relationships.downstream.data.id* (string)

data.relationships.upstream* (object)

Upstream workspace to track new runs.

data.relationships.upstream.data.type* (string)

Available values: workspaces

data.relationships.upstream.data.id* (string)

Example Request:

POST /api/iacp/v3/run-triggers HTTP/1.1
Host: my.scalr.io
Content-Type: application/vnd.api+json
Prefer: profile=preview

{
    "data": {
        "id": "string",
        "relationships": {
            "downstream": {
                "data": {
                    "id": "string",
                    "type": "workspaces"
                }
            },
            "upstream": {
                "data": {
                    "id": "string",
                    "type": "workspaces"
                }
            }
        },
        "type": "run-triggers"
    }
}
Status Codes
  • 201 Created – Successfully created a run trigger.

  • 403 Forbidden – Missing required permissions.

  • 404 Not Found – Relationship not found, or user unauthorized to perform action.

  • 422 Unprocessable Entity – Malformed request body (missing attributes, wrong types, etc.)

  • 4XX – Client error.

  • 5XX – Server error.

Delete a Run Trigger

DELETE /api/iacp/v3/run-triggers/{run_trigger}
Parameters
  • run_trigger (string) – The ID of the run trigger to delete.

Status Codes
  • 204 No Content – Run trigger deleted.

  • 404 Not Found – Run trigger not found, or user unauthorized to perform action.

  • 4XX – Client error.

  • 5XX – Server error.

Get a Run Trigger

GET /api/iacp/v3/run-triggers/{run_trigger}

Show details of a specific trigger.

Parameters
  • run_trigger (string) – The ID of the run trigger to show.

Query Parameters
  • include (array) – The comma-separated list of relationship paths. (Available values: downstream, upstream)

Example Request:

GET /api/iacp/v3/run-triggers/{run_trigger} HTTP/1.1
Host: my.scalr.io
Prefer: profile=preview
Status Codes
  • 200 OK – Request was successful.

  • 404 Not Found – Run trigger not found, or user unauthorized to perform action.

  • 4XX – Client error.

  • 5XX – Server error.