Unary · Environment Automations
Lists automation tasks with optional filtering.
Use this method to:
- View all tasks in an environment
- Filter tasks by reference
- Monitor task status
Examples
-
List environment tasks:
Shows all tasks for an environment.
filter: environmentIds: ["07e03a28-65a5-4d98-b532-8ea67b188048"] pagination: pageSize: 20 -
Filter by reference:
Lists tasks matching specific references.
filter: references: ["build", "test"] pagination: pageSize: 20
Endpoint
POST /api/gitpod.v1.EnvironmentAutomationService/ListTasks
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/ListTasks" \
--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.ListTasksRequest(
pagination=pagination_pb2.PaginationRequest(
page_size=1,
),
)
response = ona.services.environment_automation.list_tasks(request)
print(response)
import { create } from "@bufbuild/protobuf";
import { createClientFromEnv } from "@gitpod/sdk";
import { ListTasksRequestSchema } from "@gitpod/sdk/gitpod/v1/environment_automation_pb";
async function main() {
const ona = createClientFromEnv();
const request = create(ListTasksRequestSchema, {
pagination: {
pageSize: 1,
},
});
const response = await ona.services.environmentAutomation.listTasks(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.ListTasksRequest{
Pagination: &gitpodpb.PaginationRequest{
PageSize: 1,
},
})
response, err := ona.Services.EnvironmentAutomation.ListTasks(context.Background(), request)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Msg)
}
{
"pagination": {
"pageSize": 1
}
}
Request
gitpod.v1.ListTasksRequest
| Field | Type | Required | Description |
|---|---|---|---|
pagination | PaginationRequest | No | pagination contains the pagination options for listing tasks |
filter | Filter | No | filter contains the filter options for listing tasks |
Response
gitpod.v1.ListTasksResponse
| Field | Type | Required | Description |
|---|---|---|---|
pagination | PaginationResponse | No | |
tasks | array of Task | No |
Related types
Filter
Filter
gitpod.v1.ListTasksRequest.Filter| Field | Type | Required | Description |
|---|---|---|---|
environmentIds | array of string | No | environment_ids filters the response to only tasks of these environments Constraints: repeated.items.string.uuid=true, repeated.max_items=25, repeated.min_items=0. |
references | array of string | No | references filters the response to only services with these references Constraints: repeated.items.string.min_len=1, repeated.max_items=25, repeated.min_items=0. |
taskIds | array of string | No | task_ids filters the response to only tasks with these IDs Constraints: repeated.items.string.uuid=true, 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 |
Task
Task
gitpod.v1.Task| Field | Type | Required | Description |
|---|---|---|---|
id | string | No | Constraints: string.uuid=true. |
environmentId | string | No | Constraints: string.uuid=true. |
metadata | TaskMetadata | No | |
spec | TaskSpec | No | |
dependsOn | array of string | No | dependencies specifies the IDs of the automations this task depends on. Constraints: repeated.items.string.uuid=true. |
TaskMetadata
TaskMetadata
gitpod.v1.TaskMetadata| Field | Type | Required | Description |
|---|---|---|---|
reference | string | No | reference is a user-facing identifier for the task which must be unique on the environment. It is used to express dependencies between tasks, and to identify the task in user interactions (e.g. the CLI). Constraints: string.pattern=^[a-zA-Z0-9_-]{1,128}$. |
name | string | No | name is a user-facing name for the task. Unlike the reference, this field is not unique, and not referenced by the system. This is a short descriptive name for the task. Constraints: string.min_len=1. |
description | string | No | description is a user-facing description for the task. It can be used to provide context and documentation for the task. |
createdAt | RFC 3339 timestamp | No | created_at is the time the task was created. |
creator | Subject | No | creator describes the principal who created the task. |
triggeredBy | array of AutomationTrigger | No | triggered_by is a list of trigger that start the task. |
TaskSpec
TaskSpec
gitpod.v1.TaskSpec| Field | Type | Required | Description |
|---|---|---|---|
command | string | No | command contains the command the task should execute |
runsOn | RunsOn | No | runs_on specifies the environment the task should run on. |
env | array of EnvironmentVariableItem | No | env specifies environment variables for the task. |
prebuildRequiresSuccess | boolean | No | prebuild_requires_success controls whether a non-successful outcome of this task should fail the prebuild. When true and the task is triggered by a prebuild or before_snapshot trigger, any terminal phase other than SUCCEEDED (i.e. FAILED or STOPPED) will cause the prebuild to fail instead of recording a warning. Defaults to false (existing behavior: task failures produce warnings only). |