All Products
Search
Document Center

Platform For AI:GetCodeSource

Last Updated:Jul 09, 2026

Retrieves the details of a code source configuration.

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:GetCodeSource

get

*All Resource

*

None None

Request syntax

GET /api/v1/codesources/{CodeSourceId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

CodeSourceId

string

Yes

The code source configuration ID. To obtain the code source configuration ID, call ListCodeSources.

code-202**********

Request parameters

Parameter

Type

Required

Description

Example

No parameters required.

Response elements

Element

Type

Description

Example

object

The response struct.

CodeSourceId

string

The code source configuration ID.

code-202**********

DisplayName

string

The code source configuration name.

MyCodeSource1

Description

string

The detailed description of the code source configuration.

This is my data source 1.

CodeRepo

string

The code repository URL.

https://code.aliyun.com/pai-dlc/examples.git

CodeBranch

string

The code repository branch.

master

CodeCommit

string

The code commit ID.

44da10***********

CodeRepoUserName

string

The username of the code repository.

user1

CodeRepoAccessToken

string

The access code repository token.

xxxx

MountPath

string

The local mount directory of the code.

/root/code

Accessibility

string

The visibility of the code source configuration.

Valid values:

  • PUBLIC :

    Visible to everyone in this workspace.

  • PRIVATE :

    Visible only to you and administrators in this workspace.

PRIVATE

UserId

string

The creator ID of the code source configuration.

1722********

WorkspaceId

string

The workspace ID.

1234

GmtCreateTime

string

The creation time of the code source configuration. The time is in ISO 8601 format.

2021-01-12T23:36:01.123Z

GmtModifyTime

string

The modification time of the code source configuration. The time is in ISO 8601 format.

2021-01-12T23:36:01.123Z

RequestId

string

The request ID.

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

CloneType

integer

The clone mode. Valid values:

  • 0: Create a new subdirectory.

  • 1: Tile to the current directory.

0

Examples

Success response

JSON format

{
  "CodeSourceId": "code-202**********",
  "DisplayName": "MyCodeSource1",
  "Description": "This is my data source 1.",
  "CodeRepo": "https://code.aliyun.com/pai-dlc/examples.git",
  "CodeBranch": "master",
  "CodeCommit": "44da10***********",
  "CodeRepoUserName": "user1",
  "CodeRepoAccessToken": "xxxx",
  "MountPath": "/root/code",
  "Accessibility": "PRIVATE",
  "UserId": "1722********",
  "WorkspaceId": "1234",
  "GmtCreateTime": "2021-01-12T23:36:01.123Z",
  "GmtModifyTime": "2021-01-12T23:36:01.123Z",
  "RequestId": "5A14FA81-DD4E-******-6343FE44B941",
  "CloneType": 0
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.