调用CreateChain创建交付链。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String CreateChain

系统规定参数。取值:CreateChain

RegionId String cn-chengdu

地域ID

InstanceId String cri-4cdrlqmhn4gm****

实例ID

RepoName String repo1

仓库名称

RepoNamespaceName String ns1

命名空间名称

Name String test

交付链名称

Description String description

交付链描述

ChainConfig String chainconfig

JSON化交付链描述的实体对象

返回数据

名称 类型 示例值 描述
Code String success

返回码

ChainId String chi-02ymhtwl3cq8****

交付链ID

IsSuccess Boolean true

是否成功

RequestId String 4BC03B36-E515-5806-99AC-268AE3C0****

请求ID

示例

请求示例

http(s)://[Endpoint]/?Action=CreateChain
&InstanceId=cri-4cdrlqmhn4gm****
&Name=test
&RegionId=cn-chengdu
&RepoName=repo1
&RepoNamespaceName=ns1
&Description=description
&ChainConfig={"Routers":[{"From":{"NodeName":"DOCKER_IMAGE_BUILD"},"To":{"NodeName":"DOCKER_IMAGE_PUSH"}},{"From":{"NodeName":"DOCKER_IMAGE_PUSH"},"To":{"NodeName":"VULNERABILITY_SCANNING"}},{"From":{"NodeName":"VULNERABILITY_SCANNING"},"To":{"NodeName":"ACTIVATE_REPLICATION"}},{"From":{"NodeName":"ACTIVATE_REPLICATION"},"To":{"NodeName":"TRIGGER"}},{"From":{"NodeName":"VULNERABILITY_SCANNING"},"To":{"NodeName":"SNAPSHOT"}},{"From":{"NodeName":"SNAPSHOT"},"To":{"NodeName":"TRIGGER_SNAPSHOT"}}],"Nodes":[{"Customized":true,"Title":"镜像构建","Enable":true,"Icon":"","Name":"DOCKER_IMAGE_BUILD","NodeName":"DOCKER_IMAGE_BUILD","NodeConfig":{}},{"Customized":false,"Title":"镜像推送","Enable":true,"Icon":"","Name":"DOCKER_IMAGE_PUSH","NodeName":"DOCKER_IMAGE_PUSH","NodeConfig":{}},{"Customized":true,"Title":"安全扫描","Enable":true,"Icon":"","Name":"VULNERABILITY_SCANNING","NodeName":"VULNERABILITY_SCANNING","NodeConfig":{"DenyPolicy":{},"ScanEngine":"ACR_SCAN_SERVICE"}},{"Customized":true,"Title":"触发同步","Enable":true,"Icon":"","Name":"ACTIVATE_REPLICATION","NodeName":"ACTIVATE_REPLICATION","NodeConfig":{}},{"Customized":true,"Title":"触发器","Enable":true,"Icon":"","Name":"TRIGGER","NodeName":"TRIGGER","NodeConfig":{}},{"Customized":true,"Title":"磁盘快照","Enable":false,"Icon":"","Name":"SNAPSHOT","NodeName":"SNAPSHOT","NodeConfig":{}},{"Customized":true,"Title":"磁盘快照触发器","Enable":false,"Icon":"","Name":"TRIGGER_SNAPSHOT","NodeName":"TRIGGER_SNAPSHOT","NodeConfig":{}}]}
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateChainResponse>
    <Code>success</Code>
    <ChainId>chi-02ymhtwl3cq8****</ChainId>
    <IsSuccess>true</IsSuccess>
    <RequestId>4BC03B36-E515-5806-99AC-268AE3C0****</RequestId>
</CreateChainResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Code" : "success",
  "ChainId" : "chi-02ymhtwl3cq8****",
  "IsSuccess" : true,
  "RequestId" : "4BC03B36-E515-5806-99AC-268AE3C0****"
}

错误码

访问错误中心查看更多错误码。