ListRuns

Updated at:

Retrieves a list of runs.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

paiexperiment:ListRuns

list

*All Resource

*

None None

Request syntax

GET /api/v1/runs HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

Name

string

No

The name of the run.

myName

WorkspaceId

string

No

The ID of the workspace to which the experiment belongs. For more information about how to obtain the workspace ID, see ListWorkspaces.

Note

If you do not specify the workspace ID, the system returns the list of runs in the default workspace.

228**

ExperimentId

string

No

The ID of the experiment to which the run belongs.

exp-1zpfthdx******

SourceType

string

No

The type of the PAI workload associated with the run.

TrainingService

SourceId

string

No

The ID of the PAI workload associated with the run.

job-rbvg5wzlj****

Labels

string

No

The labels of the task for exact matching. Supported formats:

  • Single-label query: "is_evaluation:true"

  • Multi-label query (not recommended unless necessary due to potential performance issues): "is_evaluation:true,LLM_evaluation:true". Separate multiple label key-value pairs with commas (,). All specified label key-value pairs must be matched at the same time.

is_evaluation:true

Verbose

boolean

No

Specifies whether to display detailed information, including Metrics, Params, and Labels. Valid values:

  • true: displays detailed information.

  • false (default): does not display detailed information.

true

GmtCreateTime

string

No

The time when the instance was created. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ss.sssZ format.

2021-01-30T12:51:33.028Z

OrderBy

string

No

The list of strings that specify the sorting methods. Supported fields for sorting include GmtCreateTime and Name. Valid sorting methods are DESC and ASC. Default value: ASC. You can specify multiple fields and separate them with commas (,).

GmtCreateTime DESC,Name ASC

PageToken

integer

No

The pagination token. The token starts from 0. Default value: 0.

0

MaxResults

integer

No

The maximum number of results to return for the request. Default value: 10.

10

PageNumber

integer

No

The current page number. Valid values: integers greater than 0. Default value: 1.

1

PageSize

integer

No

The number of entries to return on each page.

10

SortBy

string

No

The name of the field used for sorting. Valid values:

  • Name: the name of the run.

  • GmtCreateTime (default): the time when the run was created.

GmtCreateTime

Order

string

No

The sorting order of the specified field for a paging query. This parameter is used together with SortBy. Valid values:

  • ASC: ascending order.

  • DESC (default): descending order.

DESC

Response elements

Element

Type

Description

Example

object

The returned results.

requestId

string

The ID of the request.

ADF6D849-*****-7E7030F0CE53

Runs

array

The list of runs.

Run

The details of the run instance.

TotalCount

integer

The total number of entries that meet the specified request conditions. This parameter is optional and is not returned by default.

1

NextPageToken

integer

The pagination token. Leave this parameter empty when you query the first page. The token for the next page is returned in the query results. If the returned token is 0, all results are returned. You can obtain the token for the next page from the NextPageToken field in the query results.

0

Examples

Success response

JSON format

{
  "requestId": "ADF6D849-*****-7E7030F0CE53",
  "Runs": [
    {
      "Accessibility": "PRIVATE",
      "SourceId": "train9s0afvjkf",
      "SourceType": "TrainingService",
      "WorkspaceId": "145883",
      "Params": [
        {
          "Value": "",
          "Key": ""
        }
      ],
      "Labels": [
        {
          "Value": "true",
          "RunId": "run-1qJhzJ2YXgX****",
          "GmtCreateTime": "2023-12-27T03:30:04Z",
          "GmtModifiedTime": "2023-12-27T03:30:04Z",
          "Key": "is_evaluation"
        }
      ],
      "GmtModifiedTime": "2021-01-30T12:51:33.028Z",
      "Name": "testrun",
      "Metrics": [
        {
          "Value": 0,
          "Step": 0,
          "Timestamp": 0,
          "Key": "loss"
        }
      ],
      "OwnerId": "163104*****3440",
      "ExperimentId": "exp-1zpfthdx******",
      "UserId": "1557702098******",
      "RunId": "run-1qJhzJ2YXgX****",
      "GmtCreateTime": "2021-01-30T12:51:33.028Z",
      "RequestId": "5A14FA81-DD4E-******-6343FE44B941"
    }
  ],
  "TotalCount": 1,
  "NextPageToken": 0
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.