Jobs

This endpoint is used to create, update, search or delete jobs for a particular Terrakube workspace.

Entity fields:

Path
Type
Description

data.type

string

Should be "job"

data.attributes.overrideBranch

string

Branch that will be use to execute the job

data.attributes.templateReference

string

Terrakube template id to use when running the job

data.relationships.workspace.data.type

string

Should be "workspace"

data.relationships.workspace.data.Id

string

Should be the VCS Workspace Id (OPTIONAL)

To better understand Terrakube Configuration Language job templates please refer to the following GitHub repository.

Example:

{
  "data": {
    "type": "job",
    "attributes": {
      "overrideBranch": "main"
      "templateReference": "XXXXXXXXX"
    },
    "relationships":{
        "workspace":{
            "data":{
                "type": "workspace",
                "id": "{{workspaceId}}"
            }
        }
    }
  }
}

Supported Operations

post

Creates an item of type job and adds it to job

Path parameters
organizationIdstringRequired

organization Identifier

Body
Responses
201

Successful response

application/vnd.api+json
post
POST /api/v1/organization/{organizationId}/job HTTP/1.1
Host: 
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 548

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "approvalTeam": null,
      "comments": null,
      "commitId": null,
      "createdBy": null,
      "createdDate": null,
      "output": null,
      "overrideBranch": null,
      "planChanges": null,
      "refresh": null,
      "refreshOnly": null,
      "status": null,
      "tcl": null,
      "templateReference": null,
      "terraformPlan": null,
      "updatedBy": null,
      "updatedDate": null,
      "via": null
    },
    "relationships": {
      "address": {
        "data": [
          null
        ]
      },
      "organization": {
        "data": [
          null
        ]
      },
      "step": {
        "data": [
          null
        ]
      },
      "workspace": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
201

Successful response

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "approvalTeam": null,
      "comments": null,
      "commitId": null,
      "createdBy": null,
      "createdDate": null,
      "output": null,
      "overrideBranch": null,
      "planChanges": null,
      "refresh": null,
      "refreshOnly": null,
      "status": null,
      "tcl": null,
      "templateReference": null,
      "terraformPlan": null,
      "updatedBy": null,
      "updatedDate": null,
      "via": null
    },
    "relationships": {
      "address": {
        "data": [
          null
        ]
      },
      "organization": {
        "data": [
          null
        ]
      },
      "step": {
        "data": [
          null
        ]
      },
      "workspace": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
get

Returns an instance of type job

Path parameters
organizationIdstringRequired

organization Identifier

jobIdstringRequired

job Identifier

Query parameters
Responses
200

Successful response

application/vnd.api+json
get
GET /api/v1/organization/{organizationId}/job/{jobId} HTTP/1.1
Host: 
Accept: */*
200

Successful response

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "approvalTeam": null,
      "comments": null,
      "commitId": null,
      "createdBy": null,
      "createdDate": null,
      "output": null,
      "overrideBranch": null,
      "planChanges": null,
      "refresh": null,
      "refreshOnly": null,
      "status": null,
      "tcl": null,
      "templateReference": null,
      "terraformPlan": null,
      "updatedBy": null,
      "updatedDate": null,
      "via": null
    },
    "relationships": {
      "address": {
        "data": [
          null
        ]
      },
      "organization": {
        "data": [
          null
        ]
      },
      "step": {
        "data": [
          null
        ]
      },
      "workspace": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
patch

Modifies an instance of type job

Path parameters
organizationIdstringRequired

organization Identifier

jobIdstringRequired

job Identifier

Body
Responses
204

Successful response

patch
PATCH /api/v1/organization/{organizationId}/job/{jobId} HTTP/1.1
Host: 
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 548

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "approvalTeam": null,
      "comments": null,
      "commitId": null,
      "createdBy": null,
      "createdDate": null,
      "output": null,
      "overrideBranch": null,
      "planChanges": null,
      "refresh": null,
      "refreshOnly": null,
      "status": null,
      "tcl": null,
      "templateReference": null,
      "terraformPlan": null,
      "updatedBy": null,
      "updatedDate": null,
      "via": null
    },
    "relationships": {
      "address": {
        "data": [
          null
        ]
      },
      "organization": {
        "data": [
          null
        ]
      },
      "step": {
        "data": [
          null
        ]
      },
      "workspace": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
204

Successful response

No content

delete

Deletes an instance of type job

Path parameters
organizationIdstringRequired

organization Identifier

jobIdstringRequired

job Identifier

Responses
204

Successful response

delete
DELETE /api/v1/organization/{organizationId}/job/{jobId} HTTP/1.1
Host: 
Accept: */*
204

Successful response

No content

For a complete list of organization operation please visit the OpenAPI specification

Last updated

Was this helpful?