ListApplicationSources

Updated at:

Applicable editions

Centralized Edition, Region Edition

Endpoints and authorization

  • Get Service Endpoint: Replace {domain} in the API request syntax.
  • Get Personal Access Token.
  • Get the organization ID: Required only for the Centralized Edition. Go to the organization management console and find the ID on the Basic Information page.

Product

Resource

Required permissions

Application Delivery

Application

Read-only

Request syntax

Centralized Edition

GET https://{domain}/oapi/v1/appstack/organizations/{organizationId}/apps/{appName}/sources

Region Edition

GET https://{domain}/oapi/v1/appstack/apps/{appName}/sources

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Your Alibaba Cloud DevOps personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

In

Required

Description

Example

appName

string

path

Yes

The application name.

my-web-service

pagination

string

query

No

The pagination mode. Set to keyset to use keyset pagination. By default, page number pagination is used.

keyset

perPage

number

query

No

The maximum number of items to return per page.

20

orderBy

string

query

No

The field to sort the results by. To ensure reliable iteration, we recommend sorting by id.

id

sort

string

query

No

The sort order. Valid values are asc for ascending and desc for descending. To ensure reliable iteration, we recommend using ascending order.

asc

nextToken

string

query

No

The token for keyset pagination. Omit this parameter for the first page. For subsequent pages, use the nextToken value from the previous response.

token

page

number

query

No

The page number to retrieve. This is used for page number pagination.

1

organizationId

string

path

  • Yes: Centralized Edition

  • No: Region Edition

The organization ID.

ec766e63aee3437d9a51f334d6exe671

Request examples

Centralized Edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/appstack/organizations/ec766e63aee3437d9a51f334d6exe671/apps/my-web-service/sources?pagination=keyset&perPage=20&orderBy=id&sort=asc&nextToken=token&page=1' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region Edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/appstack/apps/my-web-service/sources?pagination=keyset&perPage=20&orderBy=id&sort=asc&nextToken=token&page=1' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example

-

object

The paginated list of results.

current

number

The current page number. This field is present only when using page number pagination.

1

data

array

The list of application sources.

-

object

An application source.

appName

string

The unique name of the application to which this source belongs.

my-web-service

connectionConfig

object

The service connection configuration.

connectionId

string

The ID of the service connection. Use the id value returned by the ListServiceConnections operation.

183240

connectionType

string

The type of the service connection. The value is always FLOW.

FLOW

identifier

string

The provider-specific unique identifier for the code repository.

my-web-service-repo

name

string

The name of the code repository source.

my-web-service-repo-git

repoContext

object

Details about the code repository.

defaultBranch

string

The default branch of the repository.

branch-xxx

repoType

string

The type of the code repository. Valid values: CODEUP for a Codeup repository, CUSTOM_GITLAB for a self-hosted GitLab instance, and GIT for a generic Git repository.

CODEUP

repoUrl

string

The canonical URL of the code repository, as reported by the provider.

https://codeup.aliyun.com/6489a6ad391bxxxxyyy/Codeup-Demo.git

repoUrl

string

The clone URL of the code repository for this application source.

https://codeup.aliyun.com/bd9e3c6d-624f-4580-af7d-c5e26f1ed0f0/my-web-service-repo.git

sn

string

The unique ID of the application source.

2e4bec5575244987a4f09ea4ca29e89f

type

string

The type of the application source. The value is always CODE_REPO.

CODE_REPO

nextToken

string

The token to retrieve the next page of results. This field is returned only for keyset pagination. To fetch the next page, provide this token in the nextToken parameter of your next request.

token

pages

number

The total number of pages. This field is present only when using page number pagination.

10

perPage

number

The maximum number of items per page. This field is present only when using page number pagination.

10

total

number

The total number of items. This field is present only when using page number pagination.

100

Response example

{
    "current": 1,
    "data": [
        {
            "appName": "my-web-service",
            "connectionConfig": {
                "connectionId": "183240",
                "connectionType": "FLOW"
            },
            "identifier": "my-web-service-repo",
            "name": "my-web-service-repo-git",
            "repoContext": {
                "defaultBranch": "branch-xxx",
                "repoType": "CODEUP",
                "repoUrl": "https://codeup.aliyun.com/6489a6ad391bxxxxyyy/Codeup-Demo.git"
            },
            "repoUrl": "https://codeup.aliyun.com/bd9e3c6d-624f-4580-af7d-c5e26f1ed0f0/my-web-service-repo.git",
            "sn": "2e4bec5575244987a4f09ea4ca29e89f",
            "type": "CODE_REPO"
        }
    ],
    "nextToken": "token",
    "pages": 10,
    "perPage": 10,
    "total": 100
}

Error codes

For a complete list of API error codes, refer to the Error Code Center.