Treasure Workflow API
Treasure Workflow — the Digdag-based orchestration API. 43 operations over projects, workflow definitions, revisions, schedules, sessions, attempts, tasks, logs, secrets and resource pools.
Treasure Workflow — the Digdag-based orchestration API. 43 operations over projects, workflow definitions, revisions, schedules, sessions, attempts, tasks, logs, secrets and resource pools.
openapi: 3.0.1
info:
description: Treasure Workflow
title: Treasure Workflow
version: '1.0'
servers:
- description: aws
url: https://api-workflow.treasuredata.com
- description: aws-tokyo
url: https://api-workflow.treasuredata.co.jp
- description: eu01
url: https://api-workflow.eu01.treasuredata.com
- description: ap02
url: https://api-workflow.ap02.treasuredata.com
- description: ap03
url: https://api-workflow.ap03.treasuredata.com
security:
- ApiKeyAuth: []
paths:
/api/attempts:
get:
operationId: getAttempts
parameters:
- description: exact matching filter on project name
in: query
name: project
schema:
type: string
- description: exact matching filter on workflow name
in: query
name: workflow
schema:
type: string
- description: list more than 1 attempts per session
in: query
name: include_retried
schema:
type: boolean
- description: >-
List attempts whose ID is smaller than this ID for pagination.
Attempts are returned in descending order by ID.
in: query
name: last_id
schema:
type: integer
format: int64
- description: number of attempts to return
in: query
name: page_size
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSessionAttemptCollection'
description: default response
summary: List attempts with filters
tags:
- Attempt
put:
description: >-
"resume" is used to rerun an attempt. It is used in the case an attempt
failed then users want to resume it from the middle.It has two modes
"failed" or "from" to set the way to resume.In "failed" mode, the
attempt specified by "attemptId" is resumed from the failed tasks.In
"from" mode, the attempt is resumed from the task which is set in "from"
field.
operationId: startAttempt
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RestSessionAttemptRequest'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSessionAttempt'
description: return an attempt
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSessionAttempt'
description: session or attempt already exist. return the existing attempt.
summary: >-
Start a workflow execution as a new session or a new attempt of an
existing session
tags:
- Attempt
/api/attempts/{id}:
get:
operationId: getAttempt
parameters:
- description: attempt id
in: path
name: id
required: true
schema:
type: integer
format: int64
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSessionAttempt'
description: default response
summary: Get an attempt
tags:
- Attempt
/api/attempts/{id}/kill:
post:
operationId: killAttempt
parameters:
- description: attempt id
in: path
name: id
required: true
schema:
type: integer
format: int64
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSessionAttempt'
description: return an attempt
summary: Set a cancel-requested flag on a running attempt
tags:
- Attempt
/api/attempts/{id}/retries:
get:
operationId: getAttemptRetries
parameters:
- description: attempt id
in: path
name: id
required: true
schema:
type: integer
format: int64
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSessionAttemptCollection'
description: default response
summary: List attempts of a session of a given attempt
tags:
- Attempt
/api/attempts/{id}/tasks:
get:
operationId: getTasks
parameters:
- description: attempt id
in: path
name: id
required: true
schema:
type: integer
format: int64
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestTaskCollection'
description: default response
summary: List tasks of an attempt
tags:
- Attempt
/api/logs/{attempt_id}/files:
get:
operationId: getFileHandles
parameters:
- description: attempt id
in: path
name: attempt_id
required: true
schema:
type: integer
format: int64
- description: partial prefix match filter on task name
in: query
name: task
schema:
type: string
- description: enable returning direct download handle
in: query
name: direct_download
schema:
type: boolean
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestLogFileHandleCollection'
description: default response
summary: List log files of an attempt with filters
tags:
- Log
/api/logs/{attempt_id}/files/{file_name}:
get:
operationId: getFile
parameters:
- description: attempt id
in: path
name: attempt_id
required: true
schema:
type: integer
format: int64
- description: log file name
in: path
name: file_name
required: true
schema:
type: string
responses:
'200':
content:
application/gzip:
schema:
type: string
format: byte
description: default response
summary: Download a log file
tags:
- Log
/api/pool_rules:
get:
description: List pool rules.
operationId: getPoolRules
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestPoolRuleCollection'
description: List of pool rules
summary: List pool rules
tags:
- Pool
post:
description: >-
Create a rule that assigns an attempt to a pool based on conditions. A
rule consists of a priority, conditions, and a pool ID. Rules are
evaluated in priority order, from the lowest value to the highest value.
Multiple rules cannot have the same priority. If all of a rule's
conditions are met, an attempt is assigned to its pool. If none of the
rules are met, an attempt is assigned to a default pool.
operationId: createPoolRule
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RestPoolRuleCreateRequest'
required: true
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/RestPoolRule'
description: Pool rule created
'400':
description: Invalid request
'403':
description: Forbidden
summary: Create a pool rule
tags:
- Pool
/api/pool_rules/{poolRuleId}:
delete:
description: Delete a pool rule.
operationId: deletePoolRule
parameters:
- in: path
name: poolRuleId
required: true
schema:
type: integer
format: int32
description: ID of the rule
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestPoolRule'
description: Pool rule deleted
'403':
description: Forbidden
'404':
description: Pool rule not found
summary: Delete a pool rule
tags:
- Pool
get:
description: Get a pool rule.
operationId: getPoolRule
parameters:
- in: path
name: poolRuleId
required: true
schema:
type: integer
format: int32
description: ID of the rule
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestPoolRule'
description: Pool rule
'404':
description: Pool rule not found
summary: Get a pool rule
tags:
- Pool
patch:
description: Update a rule that assigns an attempt to a pool based on conditions.
operationId: updatePoolRule
parameters:
- in: path
name: poolRuleId
required: true
schema:
type: integer
format: int32
description: ID of the rule
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RestPoolRuleUpdateRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestPoolRule'
description: Pool rule updated
'400':
description: Invalid request
'403':
description: Forbidden
'404':
description: Pool rule not found
summary: Update a pool rule
tags:
- Pool
/api/pools:
get:
description: List pools.
operationId: getPools
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestPoolCollection'
description: List of pools
summary: List pools
tags:
- Pool
post:
description: >-
Create a pool with the specified name and concurrency limit. A default
pool is created with the account's concurrency limit if it does not
exist. The default pool’s concurrency limit is reduced by the new pool’s
concurrency limit. You cannot create a pool if the default pool has more
running attempts than its new reduced concurrency limit.
operationId: createPool
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RestPoolCreateRequest'
required: true
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/RestPool'
description: Pool created
'400':
description: Invalid request
'403':
description: Forbidden
'409':
description: Pool name is already used
summary: Create a pool
tags:
- Pool
/api/pools/{poolId}:
delete:
description: >-
Delete a pool. You cannot delete a pool if there are any attempts
running or queued in the pool, if a pool rule references it, or if it is
the default pool. The deleted pool’s concurrency limit is added to the
default pool’s concurrency limit.
operationId: deletePool
parameters:
- in: path
name: poolId
required: true
schema:
type: integer
format: int32
description: ID of the pool.
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestPool'
description: Pool deleted
'400':
description: Bad Request
'403':
description: Forbidden
'404':
description: Pool not found
summary: Delete a pool
tags:
- Pool
get:
description: Get a pool.
operationId: getPool
parameters:
- in: path
name: poolId
required: true
schema:
type: integer
format: int32
description: ID of the pool
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestPool'
description: Pool
'404':
description: Pool not found
summary: Get a pool
tags:
- Pool
patch:
description: >-
Update a pool with the specified name and concurrency limit. You cannot
update the default pool. The default pool’s concurrency limit is
adjusted to accommodate the new concurrency limit. A pool’s concurrency
limit cannot be reduced if it has more running attempts than its new
reduced concurrency limit.
operationId: updatePool
parameters:
- in: path
name: poolId
required: true
schema:
type: integer
format: int32
description: ID of the pool.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RestPoolUpdateRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestPool'
description: Pool updated
'400':
description: Invalid request
'403':
description: Forbidden
'404':
description: Pool not found
summary: Update a pool
tags:
- Pool
/api/projects:
get:
operationId: getProjects
parameters:
- description: exact matching filter on project name
in: query
name: name
schema:
type: string
- description: >-
List projects whose ID is greater than this ID for pagination.
Projects are returned in ascending order by ID.
in: query
name: last_id
schema:
type: integer
format: int32
- description: number of projects to return
in: query
name: count
schema:
type: integer
format: int32
- description: name pattern to be partially matched
in: query
name: name_pattern
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestProjectCollection'
description: default response
summary: List projects with filters
tags:
- Project
put:
operationId: putProject
parameters:
- description: project name
in: query
name: project
required: true
schema:
type: string
- description: revision
in: query
name: revision
required: true
schema:
type: string
- in: header
name: Content-Length
schema:
type: integer
format: int64
- description: >-
start scheduling of new workflows from the given time instead of
current time
in: query
name: schedule_from
schema:
type: string
- description: clear_schedule
in: query
name: clear_schedule
schema:
type: array
items:
type: string
- description: clear_schedule_all
in: query
name: clear_schedule_all
schema:
type: boolean
default: false
- description: >-
skip schedules to current time for workflows whose schedule
definition changed. Ignored when clear_schedule or
clear_schedule_all is specified.
in: query
name: skip_schedule
schema:
type: boolean
default: true
requestBody:
content:
application/gzip:
schema:
type: string
format: binary
description: project archive data
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestProject'
description: default response
summary: >-
Upload a project archive as a new project or a new revision of an
existing project
tags:
- Project
/api/projects/{id}:
delete:
operationId: deleteProject
parameters:
- in: path
name: id
required: true
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestProject'
description: default response
summary: Delete a project
tags:
- Project
get:
operationId: getProject
parameters:
- description: project id
in: path
name: id
required: true
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestProject'
description: default response
summary: Get a project
tags:
- Project
/api/projects/{id}/archive:
get:
operationId: getArchive
parameters:
- description: project id
in: path
name: id
required: true
schema:
type: integer
format: int32
- description: use a given revision of a project instead of the latest revision
in: query
name: revision
required: true
schema:
type: string
- description: enable returning direct download handle
in: query
name: direct_download
schema:
type: boolean
responses:
'200':
description: archive of files of a project.
summary: Download a project archive file
tags:
- Project
/api/projects/{id}/revisions:
get:
operationId: getRevisions
parameters:
- in: path
name: id
required: true
schema:
type: integer
format: int32
- description: deprecated - do not use
in: query
name: last_id
schema:
type: integer
format: int32
- description: revision name
in: query
name: name
schema:
type: string
- description: cursor to next page
in: query
name: page[after]
schema:
type: string
- description: page size
in: query
name: page[size]
schema:
type: integer
format: int32
default: 100
maximum: 100
minimum: 0
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestRevisionCollection'
description: default response
summary: List revisions of a project
tags:
- Project
/api/projects/{id}/schedules:
get:
operationId: getProjectSchedules
parameters:
- description: project id
in: path
name: id
required: true
schema:
type: integer
format: int32
- description: exact matching filter on workflow name
in: query
name: workflow
schema:
type: string
- description: >-
List schedules whose ID is greater than this ID for pagination.
Schedules are returned in ascending order by ID.
in: query
name: last_id
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestScheduleCollection'
description: default response
summary: List schedules of a project with filters
tags:
- Project
/api/projects/{id}/secrets:
get:
operationId: getProjectSecrets
parameters:
- description: project id
in: path
name: id
required: true
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSecretList'
description: default response
summary: List secret keys of a project
tags:
- Project
/api/projects/{id}/secrets/{key}:
delete:
operationId: deleteProjectSecret
parameters:
- description: project id
in: path
name: id
required: true
schema:
type: integer
format: int32
- description: secret key
in: path
name: key
required: true
schema:
type: string
responses:
'204':
description: Treasure Workflow never returns content
summary: Delete a secret from a project
tags:
- Project
put:
operationId: putProjectSecret
parameters:
- description: project id
in: path
name: id
required: true
schema:
type: integer
format: int32
- description: secret key
in: path
name: key
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RestSetSecretRequest'
responses:
'204':
description: Treasure Workflow never returns content
summary: Set a secret to a project
tags:
- Project
/api/projects/{id}/sessions:
get:
operationId: getProjectSessions
parameters:
- description: project id
in: path
name: id
required: true
schema:
type: integer
format: int32
- description: exact matching filter on workflow name
in: query
name: workflow
schema:
type: string
- description: >-
List sessions whose ID is smaller than this ID for pagination.
Sessions are returned in descending order by ID.
in: query
name: last_id
schema:
type: integer
format: int64
- description: number of sessions to return
in: query
name: page_size
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSessionCollection'
description: default response
summary: List sessions of a project with filters
tags:
- Project
/api/projects/{id}/workflows:
get:
operationId: getWorkflows
parameters:
- description: project id
in: path
name: id
required: true
schema:
type: integer
format: int32
- description: use a given revision of the project instead of the latest revision
in: query
name: revision
required: true
schema:
type: string
- description: exact matching filter on workflow name
in: query
name: name
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestWorkflowDefinitionCollection'
description: default response
summary: List workflows of a project with filters
tags:
- Project
/api/projects/{id}/workflows/{name}:
get:
operationId: getWorkflowByName
parameters:
- in: path
name: id
required: true
schema:
type: integer
format: int32
- in: path
name: name
required: true
schema:
type: string
- in: query
name: revision
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestWorkflowDefinition'
description: default response
tags:
- Project
/api/schedules:
get:
operationId: getSchedules
parameters:
- description: >-
List schedules whose ID is greater than this ID for pagination.
Schedules are returned in ascending order by ID.
in: query
name: last_id
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestScheduleCollection'
description: default response
summary: List schedules
tags:
- Schedule
/api/schedules/{id}:
get:
operationId: getSchedule
parameters:
- description: schedule id
in: path
name: id
required: true
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSchedule'
description: default response
summary: Get a schedule
tags:
- Schedule
/api/schedules/{id}/backfill:
post:
operationId: backfillSchedule
parameters:
- description: session id
in: path
name: id
required: true
schema:
type: integer
format: int32
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RestScheduleBackfillRequest'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestScheduleAttemptCollection'
description: default response
summary: Backfill sessions for past schedule times
tags:
- Schedule
/api/schedules/{id}/disable:
post:
operationId: disableSchedule
parameters:
- description: session id
in: path
name: id
required: true
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestScheduleSummary'
description: default response
summary: Disable scheduling of new sessions
tags:
- Schedule
/api/schedules/{id}/enable:
post:
operationId: enableSchedule
parameters:
- description: session id
in: path
name: id
required: true
schema:
type: integer
format: int32
requestBody:
content:
'*/*':
schema:
$ref: '#/components/schemas/RestScheduleEnableRequest'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestScheduleSummary'
description: default response
summary: Re-enable disabled scheduling
tags:
- Schedule
/api/schedules/{id}/skip:
post:
operationId: skipSchedule
parameters:
- description: session id
in: path
name: id
required: true
schema:
type: integer
format: int32
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RestScheduleSkipRequest'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestScheduleSummary'
description: default response
summary: Skip future sessions by count or time
tags:
- Schedule
/api/sessions:
get:
operationId: getSessions
parameters:
- description: >-
List sessions whose ID is smaller than this ID for pagination.
Sessions are returned in descending order by ID.
in: query
name: last_id
schema:
type: integer
format: int64
- description: number of sessions to return
in: query
name: page_size
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSessionCollection'
description: default response
summary: List sessions
tags:
- Session
/api/sessions/{id}:
get:
operationId: getSession
parameters:
- description: session id
in: path
name: id
required: true
schema:
type: integer
format: int64
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSession'
description: default response
summary: Get a session
tags:
- Session
/api/sessions/{id}/attempts:
get:
operationId: getSessionAttempts
parameters:
- description: session id
in: path
name: id
required: true
schema:
type: integer
format: int64
- description: >-
List attempts whose ID is smaller than this ID for pagination.
Attempts are returned in descending order by ID.
in: query
name: last_id
schema:
type: integer
format: int64
- description: number of attempts to return
in: query
name: page_size
schema:
type: integer
format: int32
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RestSessionAttemptCollection'
description: default response
summary: List attempts of a session
tags:
- Session
/api/workflows:
get:
operationId: getWorkflowDefinitions
parameters:
- description: >-
pagination. return workflows which id are greater than last_id with
order 'asc', which id are less than the last_id with order 'desc'
in: query
name: last_id
schema:
type: integer
format: int64
- description: number of workflows to return
in: query
name: count
schema:
type: integer
format: int32
- description: Sort order. 'asc' or 'desc'
in: query
name: order
schema:
type: string
default: asc
- description: name pattern to be partially matched
in: query
name: name_pattern
schema:
# --- truncated at 32 KB (67 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/treasure-data/refs/heads/main/openapi/treasure-data-workflow-api-openapi.yml