获取部署任务详细信息

更新时间:2023-03-28 17:43:40

适用产品

CDN Pro

接口描述

获取有关部署任务的详细信息,包括操作类型、提交时间、任务执行状态以及部署失败时的描述信息。

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Path 参数

参数名称描述
*idString
部署任务id。

返回参数

Body 参数

参数名称描述
nameString
部署任务的名称。
submissionTimeString
RFC 3339格式的日期,表示任务的创建时间。
actionsList
部署任务所要执行的操作,可以包括加速项目和证书的部署或卸载操作。
actionString
取值范围: deploy_property,remove_property,deploy_cert,remove_cert 指定操作类型,包括部署加速项目、卸载加速项目、部署证书以及卸载证书。
propertyIdString
指定要部署或卸载的加速项目ID。
certificateIdString
指定要部署或卸载的证书ID。
versionString
指定要部署或卸载的证书或加速项目的版本。
targetString
取值范围: staging,production 部署任务对应的环境。
finishTimeString
RFC 3339格式的日期,表示任务完成的时间。
statusString
取值范围: waiting,in progress,failed,succeeded 部署任务的执行状态,包括等待中,进行中,部署失败,部署成功等状态。
statusDetailsString
部署任务执行状态的描述信息。
apiRequestIdString
创建部署任务时的API请求ID。
webhookString
部署任务完成时要调用的webhook的ID。

错误码

错误代码(code)描述(message)HTTP状态码语义
AccessDeniedThis user is not allowed to perform this request.403无操作权限。
InvalidDeploymentTaskIdThe specified deployment task ID does not exist.404指定的部署任务ID不存在。

示例

200
403
404
200
请求示例
复制代码 复制成功
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://open.chinanetcenter.com/cdn/deploymentTasks/{id}" \
-X "GET" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json"
返回示例
复制代码 复制成功
{
    "submissionTime": "2019-11-14T01:20:22Z",
    "actions": [
        {
            "certificateId": "61c0dcc92ef4ea6a9ff8c09f",
            "action": "deploy_cert",
            "version": "1"
        }
    ],
    "target": "production",
    "finishTime": "2019-11-14T01:24:18Z",
    "status": "succeeded",
    "apiRequestId": "47636a8908b0f618",
    "statusDetails": "Task has successfully finished"
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!