Binds a source code repository to a repository.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateRepoSourceCodeRepo

The operation that you want to perform. Set the value to CreateRepoSourceCodeRepo.

CodeRepoName String Yes repo

The name of the source code repository.

CodeRepoNamespaceName String Yes namespace

The namespace to which the source code repository belongs.

CodeRepoType String Yes GITHUB

The type of the code hosting platform. Valid values: GITHUB, GITLAB, GITEE, CODE, and CODEUP.

InstanceId String Yes cri-shac42yvqzvq****

The ID of the Container Registry instance.

RegionId String Yes cn-hangzhou

The ID of the region.

RepoId String Yes crr-gzsrlevmvoaq****

The ID of the repository.

AutoBuild Boolean No true

Specifies whether to trigger image building when source code is committed. Valid values:

  • true: triggers image building when source code is committed.
  • false: does not trigger image building when source code is committed.
OverseaBuild Boolean No false

Specifies whether to accelerate image building for servers outside mainland China. Valid values:

  • true: accelerates image building for servers outside mainland China.
  • false: does not accelerate image building for servers outside mainland China.
DisableCacheBuild Boolean No false

Specifies whether to disable build cache. Valid values:

  • true: disables build cache.
  • false: enables build cache.

Response parameters

Parameter Type Example Description
Code String success

The response code.

IsSuccess Boolean true

Indicates whether the API call is successful.

RequestId String 4CE1F661-75DD-4EBD-A4AD-057B26834ABB

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateRepoSourceCodeRepo
&CodeRepoName=repo
&CodeRepoNamespaceName=namespace
&CodeRepoType=GITHUB
&InstanceId=cri-shac42yvqzvq****
&RegionId=cn-hangzhou
&RepoId=crr-gzsrlevmvoaq****
&<Common request parameters>

Sample success responses

XML format

<IsSuccess>true</IsSuccess>
<RequestId>4CE1F661-75DD-4EBD-A4AD-057B26834ABB</RequestId>
<Code>success</Code>

JSON format

{
    "IsSuccess": true,
    "RequestId": "4CE1F661-75DD-4EBD-A4AD-057B26834ABB",
    "Code": "success"
}

Error codes

For a list of error codes, visit the API Error Center.