ListCodeSources

Updated at:

Queries a list of code configurations with support for pagination, sorting, and conditional filtering.

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

paicodesource:ListCodeSources

list

*All Resource

*

None None

Request syntax

GET /api/v1/codesources HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

DisplayName

string

No

The display name of the code configuration. Fuzzy matching is supported.

MyDataSource

PageNumber

integer

No

The page number of the code configuration list. Pages start from 1. Default value: 1.

1

PageSize

integer

No

The number of entries per page set in the paging Settings for a paged query. Default value: 20.

10

SortBy

string

No

The field used for sorting. Valid values:

  • GmtModifyTime: the modification time of the code source

  • DisplayName: the display name

  • CodeSourceId: the ID of the code source

  • GmtCreateTime: the creation time of the code source Default value: GmtCreateTime.

GmtModifyTime

Order

string

No

The sorting order of the specified field for paging in a paged query. Valid values:

  • ASC: ascending order.

  • DESC: descending order. Default value: ASC.

desc

WorkspaceId

string

No

The ID of the workspace. This parameter is required. For information about how to obtain the workspace ID, see ListWorkspaces.

1234

Response elements

Element

Type

Description

Example

object

The response struct.

CodeSources

array

The list of code source configurations.

CodeSourceItem

The details of the code configuration.

TotalCount

integer

The total number of code source configurations that meet the filter conditions.

2

RequestId

string

The request ID.

5A14FA81-DD4E-******-6343FE44B941

Examples

Success response

JSON format

{
  "CodeSources": [
    {
      "CodeSourceId": "code-202**********",
      "DisplayName": "MyCodeSourceName1",
      "Description": "code source of dlc examples",
      "CodeRepo": "https://code.aliyun.com/****",
      "CodeBranch": "master",
      "CodeCommit": "44da10**********",
      "CodeRepoUserName": "user",
      "CodeRepoAccessToken": "xxxx",
      "Accessibility": "PUBLIC",
      "UserId": "1157290171663117",
      "WorkspaceId": "1234",
      "GmtCreateTime": "2021-01-18T12:52:15Z",
      "GmtModifyTime": "2021-01-18T12:52:15Z",
      "MountPath": "/root/code/",
      "CloneType": 0
    }
  ],
  "TotalCount": 2,
  "RequestId": "5A14FA81-DD4E-******-6343FE44B941"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.