Jobs
This endpoint is used to create, update, search or delete jobs for a particular Terrakube workspace.
To use this endpoint you need to create a Terrakube workspace.
Entity fields:
data.type
string
Should be "job"
data.attributes.tcl
string
Terraform Configuration Language job template
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)
Example:
{
"data": {
"type": "job",
"attributes": {
"tcl": "Base64 TCL job template"
"templateReference": "XXXXXXXXX"
},
"relationships":{
"workspace":{
"data":{
"type": "workspace",
"id": "{{workspaceId}}"
}
}
}
}
}
Supported Operations
Returns an instance of type job
workspace Identifier
job Identifier
GET /api/v1/workspace/{workspaceId}/job/{jobId} HTTP/1.1
Host:
Accept: */*
Successful response
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"command": "plan",
"output": "text",
"status": "pending"
},
"relationships": {
"organization": {
"id": "text",
"type": "organization"
},
"workspace": {
"id": "text",
"type": "workspace"
}
}
},
"included": [
{
"attributes": {},
"id": "text",
"relationships": {},
"type": "text"
}
]
}
Creates an item of type job and adds it to job
workspace Identifier
POST /api/v1/workspace/{workspaceId}/job HTTP/1.1
Host:
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 217
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"command": "plan",
"output": "text",
"status": "pending"
},
"relationships": {
"organization": {
"id": "text",
"type": "organization"
},
"workspace": {
"id": "text",
"type": "workspace"
}
}
}
}
Successful response
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"command": "plan",
"output": "text",
"status": "pending"
},
"relationships": {
"organization": {
"id": "text",
"type": "organization"
},
"workspace": {
"id": "text",
"type": "workspace"
}
}
}
}
Deletes an instance of type job
workspace Identifier
job Identifier
DELETE /api/v1/workspace/{workspaceId}/job/{jobId} HTTP/1.1
Host:
Accept: */*
Successful response
No content
Modifies an instance of type job
workspace Identifier
job Identifier
PATCH /api/v1/workspace/{workspaceId}/job/{jobId} HTTP/1.1
Host:
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 217
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"command": "plan",
"output": "text",
"status": "pending"
},
"relationships": {
"organization": {
"id": "text",
"type": "organization"
},
"workspace": {
"id": "text",
"type": "workspace"
}
}
}
}
Successful response
No content
Last updated
Was this helpful?