CDN Pro
该接口用来创建任务,验证加速项目的某个版本。在您部署某个加速项目版本到演练或生产环境之前,必须先调用此接口验证加速项目中语法的准确性。
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 描述 |
---|---|
nameString | 验证任务的名称。 |
*propertyIdString | 需要验证的加速项目的ID。 |
*versionInteger | 需要验证的加速项目的版本号。 |
webhookString | 验证任务完成时需要调用的webhook ID。webhook是指通过“创建webhook接口”创建的回调接口。 |
参数名称 | 描述 |
---|---|
LocationString | 通过Location响应头返回新建的验证任务的URL。URL中包含了验证任务的ID,可使用该ID调用'查询验证任务详情'接口来查看任务详情。URL示例: Location: http://open.chinanetcenter.com/cdn/validations/5dca2205f9e9cc0001df7b24 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
InvalidProperty | The property specified does not exist. | 400 | 指定的加速项目不存在。 |
InvalidPropertyVersion | The property version specified does not exist. | 400 | 指定的加速项目版本不存在。 |
#!/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/validations" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{"propertyId": "b8ce50a9cb84242c39f07066", "version": 1}'
{ "code": "InvalidPropertyVersion", "message": "The property version specified does not exist." }