Schedule
This endpoint is used to create, update, search or delete schedules for a particular workspace inside an organization, this is useful when you need to create schedule task or running jobs in a particular time.
Entity fields:
data.type
string
Should be "schedule"
data.attributes.cron
string
Cron expression to schedule a job inside a workspace. For more information please visit Quartz documentation.
data.attributes.templateReference
string
Terrakube template id
In 2.34.0, the deprecated tcl field is excluded from the API. Use templateReference to select an organization template.
Example:
{
"data": {
"type": "schedule",
"attributes": {
"cron": "0 0/1 * * * ?",
"templateReference": "<template id>"
}
}
}Supported Operations
Returns the relationship schedule
workspace Identifier
Filters the collection of schedule using a 'disjoint' RSQL expression
Number of pages to return. Can be used with page[size]
Number of elements per page. Can be used with page[number]
Offset from 0 to start paginating. Can be used with page[limit]
Maximum number of items to return. Can be used with page[offset]
For requesting total pages/records be included in the response page meta data
Successful response
GET /api/v1/workspace/{workspaceId}/schedule HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful response
{
"data": [
{
"type": "text",
"id": "text",
"attributes": {
"createdBy": null,
"createdDate": null,
"cron": null,
"description": null,
"enabled": null,
"templateReference": null,
"updatedBy": null,
"updatedDate": null
},
"relationships": {
"workspace": {
"data": [
null
]
}
}
}
],
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Creates an item of type schedule and adds it to schedule
workspace Identifier
Successful response
POST /api/v1/workspace/{workspaceId}/schedule HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 316
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"createdBy": null,
"createdDate": null,
"cron": null,
"description": null,
"enabled": null,
"templateReference": null,
"updatedBy": null,
"updatedDate": null
},
"relationships": {
"workspace": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Successful response
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"createdBy": null,
"createdDate": null,
"cron": null,
"description": null,
"enabled": null,
"templateReference": null,
"updatedBy": null,
"updatedDate": null
},
"relationships": {
"workspace": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Deletes an instance of type schedule
workspace Identifier
schedule Identifier
Successful response
No content
DELETE /api/v1/workspace/{workspaceId}/schedule/{scheduleId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful response
No content
Modifies an instance of type schedule
workspace Identifier
schedule Identifier
Successful response
No content
PATCH /api/v1/workspace/{workspaceId}/schedule/{scheduleId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 316
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"createdBy": null,
"createdDate": null,
"cron": null,
"description": null,
"enabled": null,
"templateReference": null,
"updatedBy": null,
"updatedDate": null
},
"relationships": {
"workspace": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Successful response
No content
Returns an instance of type schedule
workspace Identifier
schedule Identifier
Successful response
GET /api/v1/workspace/{workspaceId}/schedule/{scheduleId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful response
{
"data": {
"type": "text",
"id": "text",
"attributes": {
"createdBy": null,
"createdDate": null,
"cron": null,
"description": null,
"enabled": null,
"templateReference": null,
"updatedBy": null,
"updatedDate": null
},
"relationships": {
"workspace": {
"data": [
null
]
}
}
},
"included": [
{
"type": "text",
"id": "text",
"attributes": {},
"relationships": {}
}
]
}Last updated
Was this helpful?