网络
虚拟私有云 VPC
弹性公网IP EIP
弹性负载均衡 ELB
NAT网关 NAT
云专线 DC
虚拟专用网络 VPN
云连接 CC
VPC终端节点 VPCEP
企业路由器 ER
企业交换机 ESW
全球加速 GA
企业连接 EC
云原生应用网络 ANC
安全与合规
安全技术与应用
Web应用防火墙 WAF
企业主机安全 HSS
云防火墙 CFW
安全云脑 SecMaster
DDoS防护 AAD
数据加密服务 DEW
数据库安全服务 DBSS
云堡垒机 CBH
数据安全中心 DSC
云证书管理服务 CCM
威胁检测服务 MTD
态势感知 SA
认证测试中心 CTC
边缘安全 EdgeSec
应用中间件
微服务引擎 CSE
分布式消息服务Kafka版
分布式消息服务RabbitMQ版
分布式消息服务RocketMQ版
API网关 APIG
分布式缓存服务 DCS
多活高可用服务 MAS
事件网格 EG
管理与监管
统一身份认证服务 IAM
消息通知服务 SMN
云监控服务 CES
应用运维管理 AOM
应用性能管理 APM
云日志服务 LTS
云审计服务 CTS
标签管理服务 TMS
配置审计 Config
应用身份管理服务 OneAccess
资源访问管理 RAM
组织 Organizations
资源编排服务 RFS
优化顾问 OA
IAM 身份中心
云运维中心 COC
资源治理中心 RGC
解决方案
高性能计算 HPC
SAP
混合云灾备
开天工业工作台 MIW
Haydn解决方案工厂
数字化诊断治理专家服务
云生态
云商店
合作伙伴中心
华为云开发者学堂
华为云慧通差旅
开发与运维
软件开发生产线 CodeArts
需求管理 CodeArts Req
流水线 CodeArts Pipeline
代码检查 CodeArts Check
编译构建 CodeArts Build
部署 CodeArts Deploy
测试计划 CodeArts TestPlan
制品仓库 CodeArts Artifact
移动应用测试 MobileAPPTest
CodeArts IDE Online
开源镜像站 Mirrors
性能测试 CodeArts PerfTest
应用管理与运维平台 ServiceStage
云应用引擎 CAE
开源治理服务 CodeArts Governance
华为云Astro轻应用
CodeArts IDE
Astro工作流 AstroFlow
代码托管 CodeArts Repo
漏洞管理服务 CodeArts Inspector
联接 CodeArtsLink
软件建模 CodeArts Modeling
Astro企业应用 AstroPro
CodeArts 盘古助手
华为云Astro大屏应用
计算
弹性云服务器 ECS
Flexus云服务
裸金属服务器 BMS
云手机服务器 CPH
专属主机 DeH
弹性伸缩 AS
镜像服务 IMS
函数工作流 FunctionGraph
云耀云服务器(旧版)
VR云渲游平台 CVR
Huawei Cloud EulerOS
网络
虚拟私有云 VPC
弹性公网IP EIP
弹性负载均衡 ELB
NAT网关 NAT
云专线 DC
虚拟专用网络 VPN
云连接 CC
VPC终端节点 VPCEP
企业路由器 ER
企业交换机 ESW
全球加速 GA
企业连接 EC
云原生应用网络 ANC
CDN与智能边缘
内容分发网络 CDN
智能边缘云 IEC
智能边缘平台 IEF
CloudPond云服务
安全与合规
安全技术与应用
Web应用防火墙 WAF
企业主机安全 HSS
云防火墙 CFW
安全云脑 SecMaster
DDoS防护 AAD
数据加密服务 DEW
数据库安全服务 DBSS
云堡垒机 CBH
数据安全中心 DSC
云证书管理服务 CCM
威胁检测服务 MTD
态势感知 SA
认证测试中心 CTC
边缘安全 EdgeSec
大数据
MapReduce服务 MRS
数据湖探索 DLI
表格存储服务 CloudTable
可信智能计算服务 TICS
推荐系统 RES
云搜索服务 CSS
数据可视化 DLV
数据接入服务 DIS
数据仓库服务 GaussDB(DWS)
数据治理中心 DataArts Studio
湖仓构建 LakeFormation
智能数据洞察 DataArts Insight
应用中间件
微服务引擎 CSE
分布式消息服务Kafka版
分布式消息服务RabbitMQ版
分布式消息服务RocketMQ版
API网关 APIG
分布式缓存服务 DCS
多活高可用服务 MAS
事件网格 EG
开天aPaaS
应用平台 AppStage
开天企业工作台 MSSE
开天集成工作台 MSSI
API中心 API Hub
云消息服务 KooMessage
交换数据空间 EDS
云地图服务 KooMap
云手机服务 KooPhone
组织成员账号 OrgID
云空间服务 KooDrive
管理与监管
统一身份认证服务 IAM
消息通知服务 SMN
云监控服务 CES
应用运维管理 AOM
应用性能管理 APM
云日志服务 LTS
云审计服务 CTS
标签管理服务 TMS
配置审计 Config
应用身份管理服务 OneAccess
资源访问管理 RAM
组织 Organizations
资源编排服务 RFS
优化顾问 OA
IAM 身份中心
云运维中心 COC
资源治理中心 RGC
区块链
区块链服务 BCS
数字资产链 DAC
华为云区块链引擎服务 HBS
解决方案
高性能计算 HPC
SAP
混合云灾备
开天工业工作台 MIW
Haydn解决方案工厂
数字化诊断治理专家服务
价格
成本优化最佳实践
专属云商业逻辑
云生态
云商店
合作伙伴中心
华为云开发者学堂
华为云慧通差旅
其他
管理控制台
消息中心
产品价格详情
系统权限
客户关联华为云合作伙伴须知
公共问题
宽限期保留期
奖励推广计划
活动
云服务信任体系能力说明
开发与运维
软件开发生产线 CodeArts
需求管理 CodeArts Req
流水线 CodeArts Pipeline
代码检查 CodeArts Check
编译构建 CodeArts Build
部署 CodeArts Deploy
测试计划 CodeArts TestPlan
制品仓库 CodeArts Artifact
移动应用测试 MobileAPPTest
CodeArts IDE Online
开源镜像站 Mirrors
性能测试 CodeArts PerfTest
应用管理与运维平台 ServiceStage
云应用引擎 CAE
开源治理服务 CodeArts Governance
华为云Astro轻应用
CodeArts IDE
Astro工作流 AstroFlow
代码托管 CodeArts Repo
漏洞管理服务 CodeArts Inspector
联接 CodeArtsLink
软件建模 CodeArts Modeling
Astro企业应用 AstroPro
CodeArts 盘古助手
华为云Astro大屏应用
存储
对象存储服务 OBS
云硬盘 EVS
云备份 CBR
高性能弹性文件服务 SFS Turbo
弹性文件服务 SFS
存储容灾服务 SDRS
云硬盘备份 VBS
云服务器备份 CSBS
数据快递服务 DES
云存储网关 CSG
专属分布式存储服务 DSS
数据工坊 DWR
地图数据 MapDS
键值存储服务 KVS
容器
云容器引擎 CCE
云容器实例 CCI
容器镜像服务 SWR
云原生服务中心 OSC
应用服务网格 ASM
华为云UCS
数据库
云数据库 RDS
数据复制服务 DRS
文档数据库服务 DDS
分布式数据库中间件 DDM
云数据库 GaussDB
云数据库 GeminiDB
数据管理服务 DAS
数据库和应用迁移 UGO
云数据库 TaurusDB
人工智能
AI开发平台ModelArts
华为HiLens
图引擎服务 GES
图像识别 Image
文字识别 OCR
自然语言处理 NLP
内容审核 Moderation
图像搜索 ImageSearch
医疗智能体 EIHealth
企业级AI应用开发专业套件 ModelArts Pro
人脸识别服务 FRS
对话机器人服务 CBS
语音交互服务 SIS
人证核身服务 IVS
视频智能分析服务 VIAS
城市智能体
自动驾驶云服务 Octopus
盘古大模型 PanguLargeModels
IoT物联网
设备接入 IoTDA
全球SIM联接 GSL
IoT数据分析 IoTA
路网数字化服务 DRIS
IoT边缘 IoTEdge
设备发放 IoTDP
企业应用
域名注册服务 Domains
云解析服务 DNS
企业门户 EWP
ICP备案
商标注册
华为云WeLink
华为云会议 Meeting
隐私保护通话 PrivateNumber
语音通话 VoiceCall
消息&短信 MSGSMS
云管理网络
SD-WAN 云服务
边缘数据中心管理 EDCM
云桌面 Workspace
应用与数据集成平台 ROMA Connect
ROMA资产中心 ROMA Exchange
API全生命周期管理 ROMA API
政企自服务管理 ESM
视频
实时音视频 SparkRTC
视频直播 Live
视频点播 VOD
媒体处理 MPC
视频接入服务 VIS
数字内容生产线 MetaStudio
迁移
主机迁移服务 SMS
对象存储迁移服务 OMS
云数据迁移 CDM
迁移中心 MGC
专属云
专属计算集群 DCC
开发者工具
SDK开发指南
API签名指南
DevStar
华为云命令行工具服务 KooCLI
Huawei Cloud Toolkit
CodeArts API
云化转型
云架构中心
云采用框架
用户服务
账号中心
费用中心
成本中心
资源中心
企业管理
工单管理
客户运营能力
国际站常见问题
支持计划
专业服务
合作伙伴支持计划
我的凭证
华为云公共事业服务云平台
工业软件
工业数字模型驱动引擎
硬件开发工具链平台云服务
工业数据转换引擎云服务
更新时间:2024-09-10 GMT+08:00
分享

创建迁移任务

功能介绍

创建迁移任务,创建成功后,任务会被自动启动,不需要额外调用启动任务命令。

接口约束

  • 单个租户在过去24小时内最多可创建1500个迁移任务。

  • 单个租户名下处于“等待中”状态的迁移任务达到1500个时不可再创建任务。

调用方法

请参见如何调用API

URI

POST /v2/{project_id}/tasks

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID。

最小长度:1

最大长度:1024

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

IAM鉴权Token。

最小长度:1

最大长度:16384

表3 请求Body参数

参数

是否必选

参数类型

描述

task_type

String

任务类型,默认为object。

list:对象列表迁移 url_list:URL列表迁移 object:文件/文件夹迁移,默认 prefix:对象前缀迁移

缺省值:object

枚举值:

  • list

  • url_list

  • object

  • prefix

src_node

SrcNodeReq object

源端信息。

dst_node

DstNodeReq object

目的端信息。

enable_kms

Boolean

是否开启KMS加密,默认不开启。

缺省值:false

description

String

任务描述,不能超过255个字符,且不能包含^<>&"'等特殊字符。

最小长度:0

最大长度:255

migrate_since

Long

以时间戳方式表示的迁移指定时间(单位:秒),表示仅迁移在指定时间之后修改的源端待迁移对象。默认不设置迁移指定时间。

最小值:0

最大值:9223372036854775807

缺省值:0

bandwidth_policy

Array of BandwidthPolicyDto objects

配置流量控制策略。数组中一个元素对应一个时段的最大带宽,最多允许5个时段,且时段不能重叠。

数组长度:0 - 5

source_cdn

SourceCdnReq object

指定是否启用CDN迁移支持,若包含此字段则为支持,否则为不支持,启用CDN迁移支持后,迁移时将从CDN域名获取源端对象。

smn_config

SmnConfig object

SMN消息发送配置。

enable_metadata_migration

Boolean

是否启用元数据迁移,默认否。不启用时,为保证迁移任务正常运行,仍将为您迁移ContentType元数据。

缺省值:false

enable_restore

Boolean

是否自动解冻归档数据,默认否。

开启后,如果遇到归档类型数据,会自动解冻再进行迁移。

缺省值:false

enable_failed_object_recording

Boolean

是否记录失败对象,默认开启。

开启后,如果有迁移失败对象,会在目的端存储失败对象信息。

缺省值:true

object_overwrite_mode

String

迁移前同名对象覆盖方式,用于迁移前判断源端与目的端有同名对象时,覆盖目的端或跳过迁移。默认SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE。NO_OVERWRITE:不覆盖。迁移前源端对象与目的端对象同名时,不做对比直接跳过迁移。SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE:大小/最后修改时间对比覆盖。默认配置。迁移前源端对象与目的端对象同名时,通过对比源端和目的端对象大小和最后修改时间,判断是否覆盖目的端,需满足源端/目的端对象的加密状态一致。源端与目的端同名对象大小不相同,或目的端对象的最后修改时间晚于源端对象的最后修改时间(源端较新),覆盖目的端。 CRC64_COMPARISON_OVERWRITE:CRC64对比覆盖。目前仅支持华为/阿里/腾讯。迁移前源端对象与目的端对象同名时,通过对比源端和目的端对象元数据中CRC64值是否相同,判断是否覆盖目的端,需满足源端/目的端对象的加密状态一致。如果源端与目的端对象元数据中不存在CRC64值,则系统会默认使用SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE(大小/最后修改时间对比覆盖)来对比进行覆盖判断。FULL_OVERWRITE:全覆盖。迁移前源端对象与目的端对象同名时,不做对比覆盖目的端。

枚举值:

  • NO_OVERWRITE

  • SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE

  • CRC64_COMPARISON_OVERWRITE

  • FULL_OVERWRITE

dst_storage_policy

String

目的端存储类型设置,当且仅当目的端为华为云OBS时需要,默认为标准存储 STANDARD:华为云OBS标准存储 IA:华为云OBS低频存储 ARCHIVE:华为云OBS归档存储 DEEP_ARCHIVE:华为云OBS深度归档存储 SRC_STORAGE_MAPPING:保留源端存储类型,将源端存储类型映射为华为云OBS存储类型

缺省值:STANDARD

最小长度:0

最大长度:128

枚举值:

  • STANDARD

  • IA

  • ARCHIVE

  • DEEP_ARCHIVE

  • SRC_STORAGE_MAPPING

consistency_check

String

一致性校验方式,用于迁移前/后校验对象是否一致,所有校验方式需满足源端/目的端对象的加密状态一致,具体校验方式和校验结果可通过对象列表查看。默认size_last_modified。size_last_modified:默认配置。迁移前后,通过对比源端和目的端对象大小+最后修改时间,判断对象是否已存在或迁移后数据是否完整。源端与目的端同名对象大小相同,且目的端对象的最后修改时间不早于源端对象的最后修改时间,则代表该对象已存在/迁移成功。crc64:目前仅支持华为/阿里/腾讯。迁移前后,通过对比源端和目的端对象元数据中CRC64值是否相同,判断对象是否已存在/迁移完成。如果源端与目的端对象元数据中不存在CRC64值,则系统会默认使用大小/最后修改时间校验方式来校验。no_check:目前仅支持HTTP/HTTPS数据源。当源端对象无法通过标准http协议中content-length字段获取数据大小时,默认数据下载成功即迁移成功,不对数据做额外校验,且迁移时源端对象默认覆盖目的端同名对象。当源端对象能正常通过标准http协议中content-length字段获取数据大小时,则采用大小/最后修改时间校验方式来校验。

缺省值:size_last_modified

枚举值:

  • size_last_modified

  • crc64

  • no_check

enable_requester_pays

Boolean

是否开启请求者付款,在启用后,请求者支付请求和数据传输费用。

缺省值:false

task_priority

String

HIGH:高优先级 MEDIUM:中优先级 LOW:低优先级

缺省值:MEDIUM

枚举值:

  • HIGH

  • MEDIUM

  • LOW

表4 SrcNodeReq

参数

是否必选

参数类型

描述

cloud_type

String

源端云服务提供商,task_type为非url_list时,本参数为URLSource且必选。可选值有AWS、Azure、Aliyun、Tencent、HuaweiCloud、QingCloud、KingsoftCloud、Baidu、Qiniu、Google、URLSource或者UCloud。默认值为Aliyun。

缺省值:Aliyun

region

String

源端桶所处的区域,task_type为非url_list时,本参数为必选。

最小长度:0

最大长度:100

ak

String

源端桶的AK(最大长度100个字符),task_type为非url_list时,本参数为必选。

最小长度:0

最大长度:100

sk

String

源端桶的SK(最大长度100个字符),task_type为非url_list时,本参数为必选。

最小长度:0

最大长度:100

json_auth_file

String

用于谷歌云Cloud Storage鉴权

最小长度:0

最大长度:65535

security_token

String

源端桶的临时Token(最大长度16384个字符)

最小长度:0

最大长度:16384

app_id

String

当源端为腾讯云时,需要填写此参数。

最小长度:0

最大长度:255

bucket

String

源端桶的名称,task_type为非url_list时,本参数为必选。

最小长度:0

最大长度:1024

object_key

Array of strings

任务类型为对象迁移任务时,表示待迁移对象名称(以“/”结尾的字符串代表待迁移的文件夹,非“/”结尾的字符串代表待迁移的文件。); 任务类型为前缀迁移任务时,表示待迁移前缀。 整桶迁移时,此参数设置为[""]。

最小长度:0

最大长度:1024

数组长度:0 - 500

list_file

ListFile object

列表文件配置,当task_type为list或url_list时,list_file为必选参数。

表5 ListFile

参数

是否必选

参数类型

描述

list_file_key

String

对象列表文件或URL列表文件对象名。

最小长度:1

最大长度:1024

obs_bucket

String

存放对象列表文件的OBS桶名。

请确保与目的端桶处于同一区域,否则将导致任务创建失败。

最小长度:0

最大长度:1024

list_file_num

String

存放对象列表文件的数量

最小长度:0

最大长度:65535

表6 DstNodeReq

参数

是否必选

参数类型

描述

ak

String

目的端桶的AK(最大长度100个字符)。

最小长度:0

最大长度:100

sk

String

目的端桶的SK(最大长度100个字符)。

最小长度:0

最大长度:100

security_token

String

目的端的临时Token(最大长度16384个字符)。

最小长度:0

最大长度:16384

bucket

String

目的端桶的名称。

最小长度:0

最大长度:1024

save_prefix

String

目的端桶内路径前缀(拼接在对象key前面,组成新的key,拼接后不能超过1024个字符)。

最小长度:0

最大长度:1024

region

String

目的端桶所处的区域。

请与Endpoint对应的区域保持一致。

最小长度:0

最大长度:100

表7 BandwidthPolicyDto

参数

是否必选

参数类型

描述

end

String

流量控制结束时间(包含),格式为“hh:mm”。例如“12:03”表示12时03分。

max_bandwidth

Long

时段内允许的最大流量带宽,单位Byte/s,取值范围为>= 1048576Byte/s(相当于1MB/s)且<=209715200Byte/s(相当于200MB/s)。

最小值:1048576

最大值:209715200

start

String

流量控制开始时间(包含),格式为“hh:mm”。例如“12:03”表示12时03分。

表8 SourceCdnReq

参数

是否必选

参数类型

描述

authentication_key

String

CDN鉴权秘钥,如果CDN需要进行鉴权,则此选项为必选。

无需授权:无需配置此项。 Qiniu:无需配置此项。 Aliyun:根据authentication_type指定的鉴权方式配置此项。 KingsoftCloud:无需配置此项。

最小长度:0

最大长度:255

authentication_type

String

鉴权类型: NONE, QINIU_PRIVATE_AUTHENTICATION, ALIYUN_OSS_A, ALIYUN_OSS_B, ALIYUN_OSS_C, KSYUN_PRIVATE_AUTHENTICATION, AZURE_SAS_TOKEN,TENCENT_COS_A,TENCENT_COS_B,TENCENT_COS_C,TENCENT_COS_D

缺省值:NONE

枚举值:

  • NONE

  • QINIU_PRIVATE_AUTHENTICATION

  • ALIYUN_OSS_A

  • ALIYUN_OSS_B

  • ALIYUN_OSS_C

  • KSYUN_PRIVATE_AUTHENTICATION

  • AZURE_SAS_TOKEN

  • TENCENT_COS_A

  • TENCENT_COS_B

  • TENCENT_COS_C

  • TENCENT_COS_D

domain

String

从指定域名获取对象。

最小长度:0

最大长度:1024

protocol

String

协议类型,支持http和https协议。

枚举值:

  • http

  • https

表9 SmnConfig

参数

是否必选

参数类型

描述

language

String

当前用户所使用的管理控制台的语言。

可以选择zh-cn或者en-us。

缺省值:en-us

枚举值:

  • zh-cn

  • en-us

topic_urn

String

迁移任务所绑定的SMN消息主题的urn号。

最小长度:0

最大长度:1024

trigger_conditions

Array of strings

SMN消息的触发条件,取决于迁移任务状态。

迁移任务状态的取值范围为SUCCESS或者FAILURE。

  • FAILURE表示任务失败后发送SMN消息。

  • SUCCESS表示任务成功后发送SMN消息。

数组长度:1 - 2

message_template_name

String

如果设置此值,则表示用模板方式发送smn信息。 模板示例: { “Task_Status”: "", "Task_Name" : "", "Start_Time": "", "Total_Time_Used": "", "Transferred_Data": "", "Average_Speed": "", "Source_Bucket": "", "Destination_Bucket": "", "List_File_Bucket": "", "List_File_Key": "", "Success_object_list_path": "", "Skip_object_list_path": "", "Failed_object_list_path": "" }

响应参数

状态码: 200

表10 响应Body参数

参数

参数类型

描述

id

Long

任务ID。

最小值:0

最大值:999999999999999

task_name

String

任务名称。

最小长度:0

最大长度:2048

状态码: 400

表11 响应Body参数

参数

参数类型

描述

error_msg

String

错误信息。

error_code

String

错误码。

请求示例

  • 使用阿里云A方式进行https CDN方式迁移,开启按时段限速,限速值为50MB/S,将对象列表object_list_file.txt中的对象列表执行迁移,并开启迁移结果通知。

    POST https://{endpoint}/v2/{project_id}/tasks
    
    {
      "task_type" : "list",
      "src_node" : {
        "cloud_type" : "HuaweiCloud",
        "region" : "cn-north-1",
        "bucket" : "src_bucket",
        "ak" : "src_ak",
        "sk" : "src_sk",
        "list_file" : {
          "obs_bucket" : "list_file_bucket",
          "list_file_key" : "object_list_file.txt"
        }
      },
      "dst_node" : {
        "region" : "cn-north-1",
        "ak" : "dst_ak",
        "sk" : "dst_sk",
        "bucket" : "dst_bucket"
      },
      "enable_kms" : false,
      "enable_failed_object_recording" : true,
      "description" : "xxx",
      "migrate_since" : 123456789,
      "bandwidth_policy" : [ {
        "start" : "00:00",
        "end" : "23:59",
        "max_bandwidth" : 50000000
      } ],
      "source_cdn" : {
        "protocol" : "https",
        "domain" : "xxx.xxx.xxx",
        "authentication_type" : "ALIYUN_OSS_A",
        "authentication_key" : "xxx"
      },
      "smn_config" : {
        "topic_urn" : "urn:smn:region:4cf2090802d94440b4cdd72ef26857b2:OMS",
        "trigger_conditions" : [ "SUCCESS", "FAILURE" ],
        "language" : "en-us"
      }
    }
  • 使用阿里云A方式进行https CDN方式迁移,开启按时段限速,限速值为50MB/S,将对象文件/前缀["file1.xxx", "file2.xxx", "path1/"]进行迁移,并开启迁移结果通知

    POST https://{endpoint}/v2/{project_id}/tasks
    
    {
      "task_type" : "object",
      "src_node" : {
        "cloud_type" : "HuaweiCloud",
        "region" : "cn-north-1",
        "bucket" : "src_bucket",
        "ak" : "src_ak",
        "sk" : "src_sk",
        "object_key" : [ "file1.xxx", "file2.xxx", "path1/" ]
      },
      "dst_node" : {
        "region" : "cn-north-1",
        "ak" : "dst_ak",
        "sk" : "dst_sk",
        "bucket" : "dst_bucket"
      },
      "enable_kms" : false,
      "enable_failed_object_recording" : true,
      "description" : "xxx",
      "migrate_since" : 123456789,
      "bandwidth_policy" : [ {
        "start" : "00:00",
        "end" : "23:59",
        "max_bandwidth" : 50000000
      } ],
      "source_cdn" : {
        "protocol" : "https",
        "domain" : "xxx.xxx.xxx",
        "authentication_type" : "ALIYUN_OSS_A",
        "authentication_key" : "xxx"
      },
      "smn_config" : {
        "topic_urn" : "urn:smn:region:4cf2090802d94440b4cdd72ef26857b2:OMS",
        "trigger_conditions" : [ "SUCCESS", "FAILURE" ],
        "language" : "en-us"
      }
    }
  • 创建URL列表迁移任务,将object_list_file.txt中的URL列表执行迁移。

    POST https://{endpoint}/v2/{project_id}/tasks
    
    {
      "task_type" : "url_list",
      "src_node" : {
        "cloud_type" : "URLSource",
        "list_file" : {
          "obs_bucket" : "list_file_bucket",
          "list_file_key" : "object_list_file.txt"
        }
      },
      "dst_node" : {
        "region" : "cn-north-1",
        "ak" : "dst_ak",
        "sk" : "dst_sk",
        "bucket" : "dst_bucket"
      },
      "enable_kms" : false,
      "enable_failed_object_recording" : true,
      "description" : "xxx"
    }
  • 创建前缀迁移任务,将[ "abc", "123", "prefix3", "path/prefix4" ]为前缀的对象文件进行迁移。

    POST https://{endpoint}/v2/{project_id}/tasks
    
    {
      "task_type" : "prefix",
      "src_node" : {
        "cloud_type" : "HuaweiCloud",
        "region" : "cn-north-1",
        "bucket" : "src_bucket",
        "ak" : "src_ak",
        "sk" : "src_sk",
        "object_key" : [ "abc", "123", "prefix3", "path/prefix4" ]
      },
      "dst_node" : {
        "region" : "cn-north-1",
        "ak" : "dst_ak",
        "sk" : "dst_sk",
        "bucket" : "dst_bucket"
      },
      "enable_kms" : false,
      "enable_failed_object_recording" : true,
      "description" : "xxx"
    }

响应示例

状态码: 200

Created

{
  "id" : 200429548242937,
  "task_name" : "task_name"
}

SDK代码示例

SDK代码示例如下。

  • 使用阿里云A方式进行https CDN方式迁移,开启按时段限速,限速值为50MB/S,将对象列表object_list_file.txt中的对象列表执行迁移,并开启迁移结果通知。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    package com.huaweicloud.sdk.test;
    
    import com.huaweicloud.sdk.core.auth.ICredential;
    import com.huaweicloud.sdk.core.auth.BasicCredentials;
    import com.huaweicloud.sdk.core.exception.ConnectionException;
    import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
    import com.huaweicloud.sdk.core.exception.ServiceResponseException;
    import com.huaweicloud.sdk.oms.v2.region.OmsRegion;
    import com.huaweicloud.sdk.oms.v2.*;
    import com.huaweicloud.sdk.oms.v2.model.*;
    
    import java.util.List;
    import java.util.ArrayList;
    
    public class CreateTaskSolution {
    
        public static void main(String[] args) {
            // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
            // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
            String ak = System.getenv("CLOUD_SDK_AK");
            String sk = System.getenv("CLOUD_SDK_SK");
    
            ICredential auth = new BasicCredentials()
                    .withAk(ak)
                    .withSk(sk);
    
            OmsClient client = OmsClient.newBuilder()
                    .withCredential(auth)
                    .withRegion(OmsRegion.valueOf("<YOUR REGION>"))
                    .build();
            CreateTaskRequest request = new CreateTaskRequest();
            CreateTaskReq body = new CreateTaskReq();
            List<String> listSmnConfigTriggerConditions = new ArrayList<>();
            listSmnConfigTriggerConditions.add("SUCCESS");
            listSmnConfigTriggerConditions.add("FAILURE");
            SmnConfig smnConfigbody = new SmnConfig();
            smnConfigbody.withLanguage(SmnConfig.LanguageEnum.fromValue("en-us"))
                .withTopicUrn("urn:smn:region:4cf2090802d94440b4cdd72ef26857b2:OMS")
                .withTriggerConditions(listSmnConfigTriggerConditions);
            SourceCdnReq sourceCdnbody = new SourceCdnReq();
            sourceCdnbody.withAuthenticationKey("xxx")
                .withAuthenticationType(SourceCdnReq.AuthenticationTypeEnum.fromValue("ALIYUN_OSS_A"))
                .withDomain("xxx.xxx.xxx")
                .withProtocol(SourceCdnReq.ProtocolEnum.fromValue("https"));
            List<BandwidthPolicyDto> listbodyBandwidthPolicy = new ArrayList<>();
            listbodyBandwidthPolicy.add(
                new BandwidthPolicyDto()
                    .withEnd("23:59")
                    .withMaxBandwidth(50000000L)
                    .withStart("00:00")
            );
            DstNodeReq dstNodebody = new DstNodeReq();
            dstNodebody.withAk("dst_ak")
                .withSk("dst_sk")
                .withBucket("dst_bucket")
                .withRegion("cn-north-1");
            ListFile listFileSrcNode = new ListFile();
            listFileSrcNode.withListFileKey("object_list_file.txt")
                .withObsBucket("list_file_bucket");
            SrcNodeReq srcNodebody = new SrcNodeReq();
            srcNodebody.withCloudType("HuaweiCloud")
                .withRegion("cn-north-1")
                .withAk("src_ak")
                .withSk("src_sk")
                .withBucket("src_bucket")
                .withListFile(listFileSrcNode);
            body.withEnableFailedObjectRecording(true);
            body.withSmnConfig(smnConfigbody);
            body.withSourceCdn(sourceCdnbody);
            body.withBandwidthPolicy(listbodyBandwidthPolicy);
            body.withMigrateSince(123456789L);
            body.withDescription("xxx");
            body.withEnableKms(false);
            body.withDstNode(dstNodebody);
            body.withSrcNode(srcNodebody);
            body.withTaskType(CreateTaskReq.TaskTypeEnum.fromValue("list"));
            request.withBody(body);
            try {
                CreateTaskResponse response = client.createTask(request);
                System.out.println(response.toString());
            } catch (ConnectionException e) {
                e.printStackTrace();
            } catch (RequestTimeoutException e) {
                e.printStackTrace();
            } catch (ServiceResponseException e) {
                e.printStackTrace();
                System.out.println(e.getHttpStatusCode());
                System.out.println(e.getRequestId());
                System.out.println(e.getErrorCode());
                System.out.println(e.getErrorMsg());
            }
        }
    }
    
  • 使用阿里云A方式进行https CDN方式迁移,开启按时段限速,限速值为50MB/S,将对象文件/前缀["file1.xxx", "file2.xxx", "path1/"]进行迁移,并开启迁移结果通知

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    package com.huaweicloud.sdk.test;
    
    import com.huaweicloud.sdk.core.auth.ICredential;
    import com.huaweicloud.sdk.core.auth.BasicCredentials;
    import com.huaweicloud.sdk.core.exception.ConnectionException;
    import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
    import com.huaweicloud.sdk.core.exception.ServiceResponseException;
    import com.huaweicloud.sdk.oms.v2.region.OmsRegion;
    import com.huaweicloud.sdk.oms.v2.*;
    import com.huaweicloud.sdk.oms.v2.model.*;
    
    import java.util.List;
    import java.util.ArrayList;
    
    public class CreateTaskSolution {
    
        public static void main(String[] args) {
            // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
            // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
            String ak = System.getenv("CLOUD_SDK_AK");
            String sk = System.getenv("CLOUD_SDK_SK");
    
            ICredential auth = new BasicCredentials()
                    .withAk(ak)
                    .withSk(sk);
    
            OmsClient client = OmsClient.newBuilder()
                    .withCredential(auth)
                    .withRegion(OmsRegion.valueOf("<YOUR REGION>"))
                    .build();
            CreateTaskRequest request = new CreateTaskRequest();
            CreateTaskReq body = new CreateTaskReq();
            List<String> listSmnConfigTriggerConditions = new ArrayList<>();
            listSmnConfigTriggerConditions.add("SUCCESS");
            listSmnConfigTriggerConditions.add("FAILURE");
            SmnConfig smnConfigbody = new SmnConfig();
            smnConfigbody.withLanguage(SmnConfig.LanguageEnum.fromValue("en-us"))
                .withTopicUrn("urn:smn:region:4cf2090802d94440b4cdd72ef26857b2:OMS")
                .withTriggerConditions(listSmnConfigTriggerConditions);
            SourceCdnReq sourceCdnbody = new SourceCdnReq();
            sourceCdnbody.withAuthenticationKey("xxx")
                .withAuthenticationType(SourceCdnReq.AuthenticationTypeEnum.fromValue("ALIYUN_OSS_A"))
                .withDomain("xxx.xxx.xxx")
                .withProtocol(SourceCdnReq.ProtocolEnum.fromValue("https"));
            List<BandwidthPolicyDto> listbodyBandwidthPolicy = new ArrayList<>();
            listbodyBandwidthPolicy.add(
                new BandwidthPolicyDto()
                    .withEnd("23:59")
                    .withMaxBandwidth(50000000L)
                    .withStart("00:00")
            );
            DstNodeReq dstNodebody = new DstNodeReq();
            dstNodebody.withAk("dst_ak")
                .withSk("dst_sk")
                .withBucket("dst_bucket")
                .withRegion("cn-north-1");
            List<String> listSrcNodeObjectKey = new ArrayList<>();
            listSrcNodeObjectKey.add("file1.xxx");
            listSrcNodeObjectKey.add("file2.xxx");
            listSrcNodeObjectKey.add("path1/");
            SrcNodeReq srcNodebody = new SrcNodeReq();
            srcNodebody.withCloudType("HuaweiCloud")
                .withRegion("cn-north-1")
                .withAk("src_ak")
                .withSk("src_sk")
                .withBucket("src_bucket")
                .withObjectKey(listSrcNodeObjectKey);
            body.withEnableFailedObjectRecording(true);
            body.withSmnConfig(smnConfigbody);
            body.withSourceCdn(sourceCdnbody);
            body.withBandwidthPolicy(listbodyBandwidthPolicy);
            body.withMigrateSince(123456789L);
            body.withDescription("xxx");
            body.withEnableKms(false);
            body.withDstNode(dstNodebody);
            body.withSrcNode(srcNodebody);
            body.withTaskType(CreateTaskReq.TaskTypeEnum.fromValue("object"));
            request.withBody(body);
            try {
                CreateTaskResponse response = client.createTask(request);
                System.out.println(response.toString());
            } catch (ConnectionException e) {
                e.printStackTrace();
            } catch (RequestTimeoutException e) {
                e.printStackTrace();
            } catch (ServiceResponseException e) {
                e.printStackTrace();
                System.out.println(e.getHttpStatusCode());
                System.out.println(e.getRequestId());
                System.out.println(e.getErrorCode());
                System.out.println(e.getErrorMsg());
            }
        }
    }
    
  • 创建URL列表迁移任务,将object_list_file.txt中的URL列表执行迁移。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    package com.huaweicloud.sdk.test;
    
    import com.huaweicloud.sdk.core.auth.ICredential;
    import com.huaweicloud.sdk.core.auth.BasicCredentials;
    import com.huaweicloud.sdk.core.exception.ConnectionException;
    import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
    import com.huaweicloud.sdk.core.exception.ServiceResponseException;
    import com.huaweicloud.sdk.oms.v2.region.OmsRegion;
    import com.huaweicloud.sdk.oms.v2.*;
    import com.huaweicloud.sdk.oms.v2.model.*;
    
    
    public class CreateTaskSolution {
    
        public static void main(String[] args) {
            // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
            // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
            String ak = System.getenv("CLOUD_SDK_AK");
            String sk = System.getenv("CLOUD_SDK_SK");
    
            ICredential auth = new BasicCredentials()
                    .withAk(ak)
                    .withSk(sk);
    
            OmsClient client = OmsClient.newBuilder()
                    .withCredential(auth)
                    .withRegion(OmsRegion.valueOf("<YOUR REGION>"))
                    .build();
            CreateTaskRequest request = new CreateTaskRequest();
            CreateTaskReq body = new CreateTaskReq();
            DstNodeReq dstNodebody = new DstNodeReq();
            dstNodebody.withAk("dst_ak")
                .withSk("dst_sk")
                .withBucket("dst_bucket")
                .withRegion("cn-north-1");
            ListFile listFileSrcNode = new ListFile();
            listFileSrcNode.withListFileKey("object_list_file.txt")
                .withObsBucket("list_file_bucket");
            SrcNodeReq srcNodebody = new SrcNodeReq();
            srcNodebody.withCloudType("URLSource")
                .withListFile(listFileSrcNode);
            body.withEnableFailedObjectRecording(true);
            body.withDescription("xxx");
            body.withEnableKms(false);
            body.withDstNode(dstNodebody);
            body.withSrcNode(srcNodebody);
            body.withTaskType(CreateTaskReq.TaskTypeEnum.fromValue("url_list"));
            request.withBody(body);
            try {
                CreateTaskResponse response = client.createTask(request);
                System.out.println(response.toString());
            } catch (ConnectionException e) {
                e.printStackTrace();
            } catch (RequestTimeoutException e) {
                e.printStackTrace();
            } catch (ServiceResponseException e) {
                e.printStackTrace();
                System.out.println(e.getHttpStatusCode());
                System.out.println(e.getRequestId());
                System.out.println(e.getErrorCode());
                System.out.println(e.getErrorMsg());
            }
        }
    }
    
  • 创建前缀迁移任务,将[ "abc", "123", "prefix3", "path/prefix4" ]为前缀的对象文件进行迁移。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    package com.huaweicloud.sdk.test;
    
    import com.huaweicloud.sdk.core.auth.ICredential;
    import com.huaweicloud.sdk.core.auth.BasicCredentials;
    import com.huaweicloud.sdk.core.exception.ConnectionException;
    import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
    import com.huaweicloud.sdk.core.exception.ServiceResponseException;
    import com.huaweicloud.sdk.oms.v2.region.OmsRegion;
    import com.huaweicloud.sdk.oms.v2.*;
    import com.huaweicloud.sdk.oms.v2.model.*;
    
    import java.util.List;
    import java.util.ArrayList;
    
    public class CreateTaskSolution {
    
        public static void main(String[] args) {
            // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
            // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
            String ak = System.getenv("CLOUD_SDK_AK");
            String sk = System.getenv("CLOUD_SDK_SK");
    
            ICredential auth = new BasicCredentials()
                    .withAk(ak)
                    .withSk(sk);
    
            OmsClient client = OmsClient.newBuilder()
                    .withCredential(auth)
                    .withRegion(OmsRegion.valueOf("<YOUR REGION>"))
                    .build();
            CreateTaskRequest request = new CreateTaskRequest();
            CreateTaskReq body = new CreateTaskReq();
            DstNodeReq dstNodebody = new DstNodeReq();
            dstNodebody.withAk("dst_ak")
                .withSk("dst_sk")
                .withBucket("dst_bucket")
                .withRegion("cn-north-1");
            List<String> listSrcNodeObjectKey = new ArrayList<>();
            listSrcNodeObjectKey.add("abc");
            listSrcNodeObjectKey.add("123");
            listSrcNodeObjectKey.add("prefix3");
            listSrcNodeObjectKey.add("path/prefix4");
            SrcNodeReq srcNodebody = new SrcNodeReq();
            srcNodebody.withCloudType("HuaweiCloud")
                .withRegion("cn-north-1")
                .withAk("src_ak")
                .withSk("src_sk")
                .withBucket("src_bucket")
                .withObjectKey(listSrcNodeObjectKey);
            body.withEnableFailedObjectRecording(true);
            body.withDescription("xxx");
            body.withEnableKms(false);
            body.withDstNode(dstNodebody);
            body.withSrcNode(srcNodebody);
            body.withTaskType(CreateTaskReq.TaskTypeEnum.fromValue("prefix"));
            request.withBody(body);
            try {
                CreateTaskResponse response = client.createTask(request);
                System.out.println(response.toString());
            } catch (ConnectionException e) {
                e.printStackTrace();
            } catch (RequestTimeoutException e) {
                e.printStackTrace();
            } catch (ServiceResponseException e) {
                e.printStackTrace();
                System.out.println(e.getHttpStatusCode());
                System.out.println(e.getRequestId());
                System.out.println(e.getErrorCode());
                System.out.println(e.getErrorMsg());
            }
        }
    }
    
  • 使用阿里云A方式进行https CDN方式迁移,开启按时段限速,限速值为50MB/S,将对象列表object_list_file.txt中的对象列表执行迁移,并开启迁移结果通知。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    # coding: utf-8
    
    import os
    from huaweicloudsdkcore.auth.credentials import BasicCredentials
    from huaweicloudsdkoms.v2.region.oms_region import OmsRegion
    from huaweicloudsdkcore.exceptions import exceptions
    from huaweicloudsdkoms.v2 import *
    
    if __name__ == "__main__":
        # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        ak = os.environ["CLOUD_SDK_AK"]
        sk = os.environ["CLOUD_SDK_SK"]
    
        credentials = BasicCredentials(ak, sk)
    
        client = OmsClient.new_builder() \
            .with_credentials(credentials) \
            .with_region(OmsRegion.value_of("<YOUR REGION>")) \
            .build()
    
        try:
            request = CreateTaskRequest()
            listTriggerConditionsSmnConfig = [
                "SUCCESS",
                "FAILURE"
            ]
            smnConfigbody = SmnConfig(
                language="en-us",
                topic_urn="urn:smn:region:4cf2090802d94440b4cdd72ef26857b2:OMS",
                trigger_conditions=listTriggerConditionsSmnConfig
            )
            sourceCdnbody = SourceCdnReq(
                authentication_key="xxx",
                authentication_type="ALIYUN_OSS_A",
                domain="xxx.xxx.xxx",
                protocol="https"
            )
            listBandwidthPolicybody = [
                BandwidthPolicyDto(
                    end="23:59",
                    max_bandwidth=50000000,
                    start="00:00"
                )
            ]
            dstNodebody = DstNodeReq(
                ak="dst_ak",
                sk="dst_sk",
                bucket="dst_bucket",
                region="cn-north-1"
            )
            listFileSrcNode = ListFile(
                list_file_key="object_list_file.txt",
                obs_bucket="list_file_bucket"
            )
            srcNodebody = SrcNodeReq(
                cloud_type="HuaweiCloud",
                region="cn-north-1",
                ak="src_ak",
                sk="src_sk",
                bucket="src_bucket",
                list_file=listFileSrcNode
            )
            request.body = CreateTaskReq(
                enable_failed_object_recording=True,
                smn_config=smnConfigbody,
                source_cdn=sourceCdnbody,
                bandwidth_policy=listBandwidthPolicybody,
                migrate_since=123456789,
                description="xxx",
                enable_kms=False,
                dst_node=dstNodebody,
                src_node=srcNodebody,
                task_type="list"
            )
            response = client.create_task(request)
            print(response)
        except exceptions.ClientRequestException as e:
            print(e.status_code)
            print(e.request_id)
            print(e.error_code)
            print(e.error_msg)
    
  • 使用阿里云A方式进行https CDN方式迁移,开启按时段限速,限速值为50MB/S,将对象文件/前缀["file1.xxx", "file2.xxx", "path1/"]进行迁移,并开启迁移结果通知

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    # coding: utf-8
    
    import os
    from huaweicloudsdkcore.auth.credentials import BasicCredentials
    from huaweicloudsdkoms.v2.region.oms_region import OmsRegion
    from huaweicloudsdkcore.exceptions import exceptions
    from huaweicloudsdkoms.v2 import *
    
    if __name__ == "__main__":
        # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        ak = os.environ["CLOUD_SDK_AK"]
        sk = os.environ["CLOUD_SDK_SK"]
    
        credentials = BasicCredentials(ak, sk)
    
        client = OmsClient.new_builder() \
            .with_credentials(credentials) \
            .with_region(OmsRegion.value_of("<YOUR REGION>")) \
            .build()
    
        try:
            request = CreateTaskRequest()
            listTriggerConditionsSmnConfig = [
                "SUCCESS",
                "FAILURE"
            ]
            smnConfigbody = SmnConfig(
                language="en-us",
                topic_urn="urn:smn:region:4cf2090802d94440b4cdd72ef26857b2:OMS",
                trigger_conditions=listTriggerConditionsSmnConfig
            )
            sourceCdnbody = SourceCdnReq(
                authentication_key="xxx",
                authentication_type="ALIYUN_OSS_A",
                domain="xxx.xxx.xxx",
                protocol="https"
            )
            listBandwidthPolicybody = [
                BandwidthPolicyDto(
                    end="23:59",
                    max_bandwidth=50000000,
                    start="00:00"
                )
            ]
            dstNodebody = DstNodeReq(
                ak="dst_ak",
                sk="dst_sk",
                bucket="dst_bucket",
                region="cn-north-1"
            )
            listObjectKeySrcNode = [
                "file1.xxx",
                "file2.xxx",
                "path1/"
            ]
            srcNodebody = SrcNodeReq(
                cloud_type="HuaweiCloud",
                region="cn-north-1",
                ak="src_ak",
                sk="src_sk",
                bucket="src_bucket",
                object_key=listObjectKeySrcNode
            )
            request.body = CreateTaskReq(
                enable_failed_object_recording=True,
                smn_config=smnConfigbody,
                source_cdn=sourceCdnbody,
                bandwidth_policy=listBandwidthPolicybody,
                migrate_since=123456789,
                description="xxx",
                enable_kms=False,
                dst_node=dstNodebody,
                src_node=srcNodebody,
                task_type="object"
            )
            response = client.create_task(request)
            print(response)
        except exceptions.ClientRequestException as e:
            print(e.status_code)
            print(e.request_id)
            print(e.error_code)
            print(e.error_msg)
    
  • 创建URL列表迁移任务,将object_list_file.txt中的URL列表执行迁移。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    # coding: utf-8
    
    import os
    from huaweicloudsdkcore.auth.credentials import BasicCredentials
    from huaweicloudsdkoms.v2.region.oms_region import OmsRegion
    from huaweicloudsdkcore.exceptions import exceptions
    from huaweicloudsdkoms.v2 import *
    
    if __name__ == "__main__":
        # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        ak = os.environ["CLOUD_SDK_AK"]
        sk = os.environ["CLOUD_SDK_SK"]
    
        credentials = BasicCredentials(ak, sk)
    
        client = OmsClient.new_builder() \
            .with_credentials(credentials) \
            .with_region(OmsRegion.value_of("<YOUR REGION>")) \
            .build()
    
        try:
            request = CreateTaskRequest()
            dstNodebody = DstNodeReq(
                ak="dst_ak",
                sk="dst_sk",
                bucket="dst_bucket",
                region="cn-north-1"
            )
            listFileSrcNode = ListFile(
                list_file_key="object_list_file.txt",
                obs_bucket="list_file_bucket"
            )
            srcNodebody = SrcNodeReq(
                cloud_type="URLSource",
                list_file=listFileSrcNode
            )
            request.body = CreateTaskReq(
                enable_failed_object_recording=True,
                description="xxx",
                enable_kms=False,
                dst_node=dstNodebody,
                src_node=srcNodebody,
                task_type="url_list"
            )
            response = client.create_task(request)
            print(response)
        except exceptions.ClientRequestException as e:
            print(e.status_code)
            print(e.request_id)
            print(e.error_code)
            print(e.error_msg)
    
  • 创建前缀迁移任务,将[ "abc", "123", "prefix3", "path/prefix4" ]为前缀的对象文件进行迁移。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    # coding: utf-8
    
    import os
    from huaweicloudsdkcore.auth.credentials import BasicCredentials
    from huaweicloudsdkoms.v2.region.oms_region import OmsRegion
    from huaweicloudsdkcore.exceptions import exceptions
    from huaweicloudsdkoms.v2 import *
    
    if __name__ == "__main__":
        # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        ak = os.environ["CLOUD_SDK_AK"]
        sk = os.environ["CLOUD_SDK_SK"]
    
        credentials = BasicCredentials(ak, sk)
    
        client = OmsClient.new_builder() \
            .with_credentials(credentials) \
            .with_region(OmsRegion.value_of("<YOUR REGION>")) \
            .build()
    
        try:
            request = CreateTaskRequest()
            dstNodebody = DstNodeReq(
                ak="dst_ak",
                sk="dst_sk",
                bucket="dst_bucket",
                region="cn-north-1"
            )
            listObjectKeySrcNode = [
                "abc",
                "123",
                "prefix3",
                "path/prefix4"
            ]
            srcNodebody = SrcNodeReq(
                cloud_type="HuaweiCloud",
                region="cn-north-1",
                ak="src_ak",
                sk="src_sk",
                bucket="src_bucket",
                object_key=listObjectKeySrcNode
            )
            request.body = CreateTaskReq(
                enable_failed_object_recording=True,
                description="xxx",
                enable_kms=False,
                dst_node=dstNodebody,
                src_node=srcNodebody,
                task_type="prefix"
            )
            response = client.create_task(request)
            print(response)
        except exceptions.ClientRequestException as e:
            print(e.status_code)
            print(e.request_id)
            print(e.error_code)
            print(e.error_msg)
    
  • 使用阿里云A方式进行https CDN方式迁移,开启按时段限速,限速值为50MB/S,将对象列表object_list_file.txt中的对象列表执行迁移,并开启迁移结果通知。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    package main
    
    import (
    	"fmt"
    	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
        oms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2"
    	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2/model"
        region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2/region"
    )
    
    func main() {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        ak := os.Getenv("CLOUD_SDK_AK")
        sk := os.Getenv("CLOUD_SDK_SK")
    
        auth := basic.NewCredentialsBuilder().
            WithAk(ak).
            WithSk(sk).
            Build()
    
        client := oms.NewOmsClient(
            oms.OmsClientBuilder().
                WithRegion(region.ValueOf("<YOUR REGION>")).
                WithCredential(auth).
                Build())
    
        request := &model.CreateTaskRequest{}
    	var listTriggerConditionsSmnConfig = []string{
            "SUCCESS",
    	    "FAILURE",
        }
    	languageSmnConfig:= model.GetSmnConfigLanguageEnum().EN_US
    	smnConfigbody := &model.SmnConfig{
    		Language: &languageSmnConfig,
    		TopicUrn: "urn:smn:region:4cf2090802d94440b4cdd72ef26857b2:OMS",
    		TriggerConditions: listTriggerConditionsSmnConfig,
    	}
    	authenticationKeySourceCdn:= "xxx"
    	sourceCdnbody := &model.SourceCdnReq{
    		AuthenticationKey: &authenticationKeySourceCdn,
    		AuthenticationType: model.GetSourceCdnReqAuthenticationTypeEnum().ALIYUN_OSS_A,
    		Domain: "xxx.xxx.xxx",
    		Protocol: model.GetSourceCdnReqProtocolEnum().HTTPS,
    	}
    	var listBandwidthPolicybody = []model.BandwidthPolicyDto{
            {
                End: "23:59",
                MaxBandwidth: int64(50000000),
                Start: "00:00",
            },
        }
    	dstNodebody := &model.DstNodeReq{
    		Ak: "dst_ak",
    		Sk: "dst_sk",
    		Bucket: "dst_bucket",
    		Region: "cn-north-1",
    	}
    	listFileSrcNode := &model.ListFile{
    		ListFileKey: "object_list_file.txt",
    		ObsBucket: "list_file_bucket",
    	}
    	cloudTypeSrcNode:= "HuaweiCloud"
    	regionSrcNode:= "cn-north-1"
    	akSrcNode:= "src_ak"
    	skSrcNode:= "src_sk"
    	bucketSrcNode:= "src_bucket"
    	srcNodebody := &model.SrcNodeReq{
    		CloudType: &cloudTypeSrcNode,
    		Region: &regionSrcNode,
    		Ak: &akSrcNode,
    		Sk: &skSrcNode,
    		Bucket: &bucketSrcNode,
    		ListFile: listFileSrcNode,
    	}
    	enableFailedObjectRecordingCreateTaskReq:= true
    	migrateSinceCreateTaskReq:= int64(123456789)
    	descriptionCreateTaskReq:= "xxx"
    	enableKmsCreateTaskReq:= false
    	taskTypeCreateTaskReq:= model.GetCreateTaskReqTaskTypeEnum().LIST
    	request.Body = &model.CreateTaskReq{
    		EnableFailedObjectRecording: &enableFailedObjectRecordingCreateTaskReq,
    		SmnConfig: smnConfigbody,
    		SourceCdn: sourceCdnbody,
    		BandwidthPolicy: &listBandwidthPolicybody,
    		MigrateSince: &migrateSinceCreateTaskReq,
    		Description: &descriptionCreateTaskReq,
    		EnableKms: &enableKmsCreateTaskReq,
    		DstNode: dstNodebody,
    		SrcNode: srcNodebody,
    		TaskType: &taskTypeCreateTaskReq,
    	}
    	response, err := client.CreateTask(request)
    	if err == nil {
            fmt.Printf("%+v\n", response)
        } else {
            fmt.Println(err)
        }
    }
    
  • 使用阿里云A方式进行https CDN方式迁移,开启按时段限速,限速值为50MB/S,将对象文件/前缀["file1.xxx", "file2.xxx", "path1/"]进行迁移,并开启迁移结果通知

      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    package main
    
    import (
    	"fmt"
    	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
        oms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2"
    	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2/model"
        region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2/region"
    )
    
    func main() {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        ak := os.Getenv("CLOUD_SDK_AK")
        sk := os.Getenv("CLOUD_SDK_SK")
    
        auth := basic.NewCredentialsBuilder().
            WithAk(ak).
            WithSk(sk).
            Build()
    
        client := oms.NewOmsClient(
            oms.OmsClientBuilder().
                WithRegion(region.ValueOf("<YOUR REGION>")).
                WithCredential(auth).
                Build())
    
        request := &model.CreateTaskRequest{}
    	var listTriggerConditionsSmnConfig = []string{
            "SUCCESS",
    	    "FAILURE",
        }
    	languageSmnConfig:= model.GetSmnConfigLanguageEnum().EN_US
    	smnConfigbody := &model.SmnConfig{
    		Language: &languageSmnConfig,
    		TopicUrn: "urn:smn:region:4cf2090802d94440b4cdd72ef26857b2:OMS",
    		TriggerConditions: listTriggerConditionsSmnConfig,
    	}
    	authenticationKeySourceCdn:= "xxx"
    	sourceCdnbody := &model.SourceCdnReq{
    		AuthenticationKey: &authenticationKeySourceCdn,
    		AuthenticationType: model.GetSourceCdnReqAuthenticationTypeEnum().ALIYUN_OSS_A,
    		Domain: "xxx.xxx.xxx",
    		Protocol: model.GetSourceCdnReqProtocolEnum().HTTPS,
    	}
    	var listBandwidthPolicybody = []model.BandwidthPolicyDto{
            {
                End: "23:59",
                MaxBandwidth: int64(50000000),
                Start: "00:00",
            },
        }
    	dstNodebody := &model.DstNodeReq{
    		Ak: "dst_ak",
    		Sk: "dst_sk",
    		Bucket: "dst_bucket",
    		Region: "cn-north-1",
    	}
    	var listObjectKeySrcNode = []string{
            "file1.xxx",
    	    "file2.xxx",
    	    "path1/",
        }
    	cloudTypeSrcNode:= "HuaweiCloud"
    	regionSrcNode:= "cn-north-1"
    	akSrcNode:= "src_ak"
    	skSrcNode:= "src_sk"
    	bucketSrcNode:= "src_bucket"
    	srcNodebody := &model.SrcNodeReq{
    		CloudType: &cloudTypeSrcNode,
    		Region: &regionSrcNode,
    		Ak: &akSrcNode,
    		Sk: &skSrcNode,
    		Bucket: &bucketSrcNode,
    		ObjectKey: &listObjectKeySrcNode,
    	}
    	enableFailedObjectRecordingCreateTaskReq:= true
    	migrateSinceCreateTaskReq:= int64(123456789)
    	descriptionCreateTaskReq:= "xxx"
    	enableKmsCreateTaskReq:= false
    	taskTypeCreateTaskReq:= model.GetCreateTaskReqTaskTypeEnum().OBJECT
    	request.Body = &model.CreateTaskReq{
    		EnableFailedObjectRecording: &enableFailedObjectRecordingCreateTaskReq,
    		SmnConfig: smnConfigbody,
    		SourceCdn: sourceCdnbody,
    		BandwidthPolicy: &listBandwidthPolicybody,
    		MigrateSince: &migrateSinceCreateTaskReq,
    		Description: &descriptionCreateTaskReq,
    		EnableKms: &enableKmsCreateTaskReq,
    		DstNode: dstNodebody,
    		SrcNode: srcNodebody,
    		TaskType: &taskTypeCreateTaskReq,
    	}
    	response, err := client.CreateTask(request)
    	if err == nil {
            fmt.Printf("%+v\n", response)
        } else {
            fmt.Println(err)
        }
    }
    
  • 创建URL列表迁移任务,将object_list_file.txt中的URL列表执行迁移。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    package main
    
    import (
    	"fmt"
    	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
        oms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2"
    	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2/model"
        region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2/region"
    )
    
    func main() {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        ak := os.Getenv("CLOUD_SDK_AK")
        sk := os.Getenv("CLOUD_SDK_SK")
    
        auth := basic.NewCredentialsBuilder().
            WithAk(ak).
            WithSk(sk).
            Build()
    
        client := oms.NewOmsClient(
            oms.OmsClientBuilder().
                WithRegion(region.ValueOf("<YOUR REGION>")).
                WithCredential(auth).
                Build())
    
        request := &model.CreateTaskRequest{}
    	dstNodebody := &model.DstNodeReq{
    		Ak: "dst_ak",
    		Sk: "dst_sk",
    		Bucket: "dst_bucket",
    		Region: "cn-north-1",
    	}
    	listFileSrcNode := &model.ListFile{
    		ListFileKey: "object_list_file.txt",
    		ObsBucket: "list_file_bucket",
    	}
    	cloudTypeSrcNode:= "URLSource"
    	srcNodebody := &model.SrcNodeReq{
    		CloudType: &cloudTypeSrcNode,
    		ListFile: listFileSrcNode,
    	}
    	enableFailedObjectRecordingCreateTaskReq:= true
    	descriptionCreateTaskReq:= "xxx"
    	enableKmsCreateTaskReq:= false
    	taskTypeCreateTaskReq:= model.GetCreateTaskReqTaskTypeEnum().URL_LIST
    	request.Body = &model.CreateTaskReq{
    		EnableFailedObjectRecording: &enableFailedObjectRecordingCreateTaskReq,
    		Description: &descriptionCreateTaskReq,
    		EnableKms: &enableKmsCreateTaskReq,
    		DstNode: dstNodebody,
    		SrcNode: srcNodebody,
    		TaskType: &taskTypeCreateTaskReq,
    	}
    	response, err := client.CreateTask(request)
    	if err == nil {
            fmt.Printf("%+v\n", response)
        } else {
            fmt.Println(err)
        }
    }
    
  • 创建前缀迁移任务,将[ "abc", "123", "prefix3", "path/prefix4" ]为前缀的对象文件进行迁移。

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    package main
    
    import (
    	"fmt"
    	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
        oms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2"
    	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2/model"
        region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2/region"
    )
    
    func main() {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        ak := os.Getenv("CLOUD_SDK_AK")
        sk := os.Getenv("CLOUD_SDK_SK")
    
        auth := basic.NewCredentialsBuilder().
            WithAk(ak).
            WithSk(sk).
            Build()
    
        client := oms.NewOmsClient(
            oms.OmsClientBuilder().
                WithRegion(region.ValueOf("<YOUR REGION>")).
                WithCredential(auth).
                Build())
    
        request := &model.CreateTaskRequest{}
    	dstNodebody := &model.DstNodeReq{
    		Ak: "dst_ak",
    		Sk: "dst_sk",
    		Bucket: "dst_bucket",
    		Region: "cn-north-1",
    	}
    	var listObjectKeySrcNode = []string{
            "abc",
    	    "123",
    	    "prefix3",
    	    "path/prefix4",
        }
    	cloudTypeSrcNode:= "HuaweiCloud"
    	regionSrcNode:= "cn-north-1"
    	akSrcNode:= "src_ak"
    	skSrcNode:= "src_sk"
    	bucketSrcNode:= "src_bucket"
    	srcNodebody := &model.SrcNodeReq{
    		CloudType: &cloudTypeSrcNode,
    		Region: &regionSrcNode,
    		Ak: &akSrcNode,
    		Sk: &skSrcNode,
    		Bucket: &bucketSrcNode,
    		ObjectKey: &listObjectKeySrcNode,
    	}
    	enableFailedObjectRecordingCreateTaskReq:= true
    	descriptionCreateTaskReq:= "xxx"
    	enableKmsCreateTaskReq:= false
    	taskTypeCreateTaskReq:= model.GetCreateTaskReqTaskTypeEnum().PREFIX
    	request.Body = &model.CreateTaskReq{
    		EnableFailedObjectRecording: &enableFailedObjectRecordingCreateTaskReq,
    		Description: &descriptionCreateTaskReq,
    		EnableKms: &enableKmsCreateTaskReq,
    		DstNode: dstNodebody,
    		SrcNode: srcNodebody,
    		TaskType: &taskTypeCreateTaskReq,
    	}
    	response, err := client.CreateTask(request)
    	if err == nil {
            fmt.Printf("%+v\n", response)
        } else {
            fmt.Println(err)
        }
    }
    

更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。

状态码

状态码

描述

200

Created

400

Bad Request

错误码

请参见错误码

相关文档