# Treasure Workflow

Treasure Workflow

Version: 1.0

## Servers

aws
```
https://api-workflow.treasuredata.com
```

aws-tokyo
```
https://api-workflow.treasuredata.co.jp
```

eu01
```
https://api-workflow.eu01.treasuredata.com
```

ap02
```
https://api-workflow.ap02.treasuredata.com
```

ap03
```
https://api-workflow.ap03.treasuredata.com
```

## Security

### ApiKeyAuth

Type: http
Scheme: TD1

## Download OpenAPI description

[Treasure Workflow](https://docs.treasure.ai/_bundle/@l10n/ja/apis/workflow.yaml)

## Attempt

### List attempts with filters

 - [GET /api/attempts](https://docs.treasure.ai/ja/apis/workflow/attempt/getattempts.md)

### Start a workflow execution as a new session or a new attempt of an existing session

 - [PUT /api/attempts](https://docs.treasure.ai/ja/apis/workflow/attempt/startattempt.md): "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.

### Get an attempt

 - [GET /api/attempts/{id}](https://docs.treasure.ai/ja/apis/workflow/attempt/getattempt.md)

### Set a cancel-requested flag on a running attempt

 - [POST /api/attempts/{id}/kill](https://docs.treasure.ai/ja/apis/workflow/attempt/killattempt.md)

### List attempts of a session of a given attempt

 - [GET /api/attempts/{id}/retries](https://docs.treasure.ai/ja/apis/workflow/attempt/getattemptretries.md)

### List tasks of an attempt

 - [GET /api/attempts/{id}/tasks](https://docs.treasure.ai/ja/apis/workflow/attempt/gettasks.md)

## Log

### List log files of an attempt with filters

 - [GET /api/logs/{attempt_id}/files](https://docs.treasure.ai/ja/apis/workflow/log/getfilehandles.md)

### Download a log file

 - [GET /api/logs/{attempt_id}/files/{file_name}](https://docs.treasure.ai/ja/apis/workflow/log/getfile.md)

## Pool

### List pool rules

 - [GET /api/pool_rules](https://docs.treasure.ai/ja/apis/workflow/pool/getpoolrules.md): List pool rules.

### Create a pool rule

 - [POST /api/pool_rules](https://docs.treasure.ai/ja/apis/workflow/pool/createpoolrule.md): 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.

### Delete a pool rule

 - [DELETE /api/pool_rules/{poolRuleId}](https://docs.treasure.ai/ja/apis/workflow/pool/deletepoolrule.md): Delete a pool rule.

### Get a pool rule

 - [GET /api/pool_rules/{poolRuleId}](https://docs.treasure.ai/ja/apis/workflow/pool/getpoolrule.md): Get a pool rule.

### Update a pool rule

 - [PATCH /api/pool_rules/{poolRuleId}](https://docs.treasure.ai/ja/apis/workflow/pool/updatepoolrule.md): Update a rule that assigns an attempt to a pool based on conditions.

### List pools

 - [GET /api/pools](https://docs.treasure.ai/ja/apis/workflow/pool/getpools.md): List pools.

### Create a pool

 - [POST /api/pools](https://docs.treasure.ai/ja/apis/workflow/pool/createpool.md): 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.

### Delete a pool

 - [DELETE /api/pools/{poolId}](https://docs.treasure.ai/ja/apis/workflow/pool/deletepool.md): 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.

### Get a pool

 - [GET /api/pools/{poolId}](https://docs.treasure.ai/ja/apis/workflow/pool/getpool.md): Get a pool.

### Update a pool

 - [PATCH /api/pools/{poolId}](https://docs.treasure.ai/ja/apis/workflow/pool/updatepool.md): 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.

## Project

### List projects with filters

 - [GET /api/projects](https://docs.treasure.ai/ja/apis/workflow/project/getprojects.md)

### Upload a project archive as a new project or a new revision of an existing project

 - [PUT /api/projects](https://docs.treasure.ai/ja/apis/workflow/project/putproject.md)

### Delete a project

 - [DELETE /api/projects/{id}](https://docs.treasure.ai/ja/apis/workflow/project/deleteproject.md)

### Get a project

 - [GET /api/projects/{id}](https://docs.treasure.ai/ja/apis/workflow/project/getproject.md)

### Download a project archive file

 - [GET /api/projects/{id}/archive](https://docs.treasure.ai/ja/apis/workflow/project/getarchive.md)

### List revisions of a project

 - [GET /api/projects/{id}/revisions](https://docs.treasure.ai/ja/apis/workflow/project/getrevisions.md)

### List schedules of a project with filters

 - [GET /api/projects/{id}/schedules](https://docs.treasure.ai/ja/apis/workflow/project/getprojectschedules.md)

### List secret keys of a project

 - [GET /api/projects/{id}/secrets](https://docs.treasure.ai/ja/apis/workflow/project/getprojectsecrets.md)

### Delete a secret from a project

 - [DELETE /api/projects/{id}/secrets/{key}](https://docs.treasure.ai/ja/apis/workflow/project/deleteprojectsecret.md)

### Set a secret to a project

 - [PUT /api/projects/{id}/secrets/{key}](https://docs.treasure.ai/ja/apis/workflow/project/putprojectsecret.md)

### List sessions of a project with filters

 - [GET /api/projects/{id}/sessions](https://docs.treasure.ai/ja/apis/workflow/project/getprojectsessions.md)

### List workflows of a project with filters

 - [GET /api/projects/{id}/workflows](https://docs.treasure.ai/ja/apis/workflow/project/getworkflows.md)

### getWorkflowByName

 - [GET /api/projects/{id}/workflows/{name}](https://docs.treasure.ai/ja/apis/workflow/project/getworkflowbyname.md)

## Schedule

### List schedules

 - [GET /api/schedules](https://docs.treasure.ai/ja/apis/workflow/schedule/getschedules.md)

### Get a schedule

 - [GET /api/schedules/{id}](https://docs.treasure.ai/ja/apis/workflow/schedule/getschedule.md)

### Backfill sessions for past schedule times

 - [POST /api/schedules/{id}/backfill](https://docs.treasure.ai/ja/apis/workflow/schedule/backfillschedule.md)

### Disable scheduling of new sessions

 - [POST /api/schedules/{id}/disable](https://docs.treasure.ai/ja/apis/workflow/schedule/disableschedule.md)

### Re-enable disabled scheduling

 - [POST /api/schedules/{id}/enable](https://docs.treasure.ai/ja/apis/workflow/schedule/enableschedule.md)

### Skip future sessions by count or time

 - [POST /api/schedules/{id}/skip](https://docs.treasure.ai/ja/apis/workflow/schedule/skipschedule.md)

## Session

### List sessions

 - [GET /api/sessions](https://docs.treasure.ai/ja/apis/workflow/session/getsessions.md)

### Get a session

 - [GET /api/sessions/{id}](https://docs.treasure.ai/ja/apis/workflow/session/getsession.md)

### List attempts of a session

 - [GET /api/sessions/{id}/attempts](https://docs.treasure.ai/ja/apis/workflow/session/getsessionattempts.md)

## Workflow

### List workflows

 - [GET /api/workflows](https://docs.treasure.ai/ja/apis/workflow/workflow/getworkflowdefinitions.md)

### Get a workflow

 - [GET /api/workflows/{id}](https://docs.treasure.ai/ja/apis/workflow/workflow/getworkflowdefinition.md)

### Get truncated local time based on the time zone of a workflow

 - [GET /api/workflows/{id}/truncated_session_time](https://docs.treasure.ai/ja/apis/workflow/workflow/getworkflowtruncatedsessiontime.md)

