Unary · Environment Automations
Lists executions of automation tasks.
Use this method to:
- View task execution history
- Monitor running tasks
- Track task completion status
Examples
-
List all executions:
Shows execution history for all tasks.
filter: environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] pagination: pageSize: 20 -
Filter by phase:
Lists executions in specific phases.
filter: phases: ["TASK_EXECUTION_PHASE_RUNNING", "TASK_EXECUTION_PHASE_FAILED"] pagination: pageSize: 20
Endpoint
POST /api/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions
https://app.ona.com with that domain.
Request example
export ONA_HOST=https://app.ona.com
export ONA_API_KEY=<your-token>
curl --request POST \
--url "$ONA_HOST/api/gitpod.v1.EnvironmentAutomationService/ListTaskExecutions" \
--header "Authorization: Bearer $ONA_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"pagination": {
"pageSize": 1
}
}'
import gitpod.v1.environment_automation_pb2 as environment_automation_pb2
import gitpod.v1.pagination_pb2 as pagination_pb2
from ona_sdk import create_client_from_env
ona = create_client_from_env()
request = environment_automation_pb2.ListTaskExecutionsRequest(
pagination=pagination_pb2.PaginationRequest(
page_size=1,
),
)
response = ona.services.environment_automation.list_task_executions(request)
print(response)
import { create } from "@bufbuild/protobuf";
import { createClientFromEnv } from "@gitpod/sdk";
import { ListTaskExecutionsRequestSchema } from "@gitpod/sdk/gitpod/v1/environment_automation_pb";
async function main() {
const ona = createClientFromEnv();
const request = create(ListTaskExecutionsRequestSchema, {
pagination: {
pageSize: 1,
},
});
const response = await ona.services.environmentAutomation.listTaskExecutions(request);
console.log(response);
}
main().catch(console.error);
package main
import (
"context"
"fmt"
"log"
"connectrpc.com/connect"
"github.com/gitpod-io/gitpod-sdk-go/sdk"
gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
)
func main() {
ona, err := sdk.NewFromEnv()
if err != nil {
log.Fatal(err)
}
request := connect.NewRequest(&gitpodpb.ListTaskExecutionsRequest{
Pagination: &gitpodpb.PaginationRequest{
PageSize: 1,
},
})
response, err := ona.Services.EnvironmentAutomation.ListTaskExecutions(context.Background(), request)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Msg)
}
{
"pagination": {
"pageSize": 1
}
}
Request
gitpod.v1.ListTaskExecutionsRequest
| Field | Type | Required | Description |
|---|---|---|---|
pagination | PaginationRequest | No | pagination contains the pagination options for listing task runs |
filter | Filter | No | filter contains the filter options for listing task runs |
Response
gitpod.v1.ListTaskExecutionsResponse
| Field | Type | Required | Description |
|---|---|---|---|
pagination | PaginationResponse | No | |
taskExecutions | array of TaskExecution | No |
Related types
Filter
Filter
gitpod.v1.ListTaskExecutionsRequest.Filter| Field | Type | Required | Description |
|---|---|---|---|
taskIds | array of string | No | task_ids filters the response to only task runs of these tasks Constraints: repeated.items.string.uuid=true, repeated.max_items=25, repeated.min_items=0. |
taskReferences | array of string | No | task_references filters the response to only task runs with this reference Constraints: repeated.max_items=25, repeated.min_items=0. |
environmentIds | array of string | No | environment_ids filters the response to only task runs of these environments Constraints: repeated.items.string.uuid=true, repeated.max_items=25, repeated.min_items=0. |
phases | array of TaskExecutionPhase | No | phases filters the response to only task runs in these phases Constraints: repeated.max_items=25, repeated.min_items=0. |
PaginationRequest
PaginationRequest
gitpod.v1.PaginationRequest| Field | Type | Required | Description |
|---|---|---|---|
pageSize | integer | No | Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. Constraints: int32.gte=0, int32.lte=100. |
token | string | No | Token for the next set of results that was returned as next_token of a PaginationResponse |
PaginationResponse
PaginationResponse
gitpod.v1.PaginationResponse| Field | Type | Required | Description |
|---|---|---|---|
nextToken | string | No | Token passed for retrieving the next set of results. Empty if there are no more results |
TaskExecution
TaskExecution
gitpod.v1.TaskExecution| Field | Type | Required | Description |
|---|---|---|---|
id | string | No | Constraints: string.uuid=true. |
metadata | TaskExecutionMetadata | No | |
spec | TaskExecutionSpec | No | |
status | TaskExecutionStatus | No |
TaskExecutionMetadata
TaskExecutionMetadata
gitpod.v1.TaskExecutionMetadata| Field | Type | Required | Description |
|---|---|---|---|
taskId | string | No | task_id is the ID of the main task being executed. Constraints: string.uuid=true. |
environmentId | string | No | environment_id is the ID of the environment in which the task run is executed. Constraints: string.uuid=true. |
createdAt | RFC 3339 timestamp | No | created_at is the time the task was created. |
creator | Subject | No | creator describes the principal who created/started the task run. |
startedBy | string | No | started_by describes the trigger that started the task execution. |
startedAt | RFC 3339 timestamp | No | started_at is the time the task execution actually started to run. |
completedAt | RFC 3339 timestamp | No | completed_at is the time the task execution was done. |
TaskExecutionSpec
TaskExecutionSpec
gitpod.v1.TaskExecutionSpec| Field | Type | Required | Description |
|---|---|---|---|
plan | array of Group | No | plan is a list of groups of steps. The steps in a group are executed concurrently, while the groups are executed sequentially. The order of the groups is the order in which they are executed. |
desiredPhase | TaskExecutionPhase | No | desired_phase is the phase the task execution should be in. Used to stop a running task execution early. Constraints: enum.defined_only=true. |
TaskExecutionStatus
TaskExecutionStatus
gitpod.v1.TaskExecutionStatus| Field | Type | Required | Description |
|---|---|---|---|
statusVersion | 64-bit integer string | No | version of the status update. Task executions themselves are unversioned, but their status has different versions. The value of this field has no semantic meaning (e.g. don’t interpret it as as a timestamp), but it can be used to impose a partial order. If a.status_version < b.status_version then a was the status before b. |
phase | TaskExecutionPhase | No | the phase of a task execution represents the aggregated phase of all steps. |
failureMessage | string | No | failure_message summarises why the task execution failed to operate. If this is non-empty the task execution has failed to operate and will likely transition to a failed state. |
steps | array of Step | No | steps provides the status for each individual step of the task execution. If a step is missing it has not yet started. |
logUrl | string | No | log_url is the URL to the logs of the task’s steps. If this is empty, the task either has no logs or has not yet started. |
TaskExecutionPhase
TaskExecutionPhase
| Value | Number | Description |
|---|---|---|
TASK_EXECUTION_PHASE_UNSPECIFIED | 0 | |
TASK_EXECUTION_PHASE_PENDING | 1 | |
TASK_EXECUTION_PHASE_RUNNING | 2 | |
TASK_EXECUTION_PHASE_SUCCEEDED | 3 | |
TASK_EXECUTION_PHASE_FAILED | 4 | |
TASK_EXECUTION_PHASE_STOPPED | 5 |