华为云用户手册

  • 响应参数 状态码:200 表4 响应Body参数 参数 参数类型 描述 next_page Boolean 是否存在下一页 next_marker String 查询下一页所需要的标记(此页末尾对象名,偏移量) 最小长度:0 最大长度:1024 records Array of ShowBucketRecord objects 查询桶信息返回的record 数组长度:0 - 100 表5 ShowBucketRecord 参数 参数类型 描述 name String 对象名 最小长度:0 最大长度:1024 size String 对象大小,若对象无size属性,则返回-- 最小长度:0 最大长度:100 状态码:400 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误信息。 error_code String 错误码。
  • 请求示例 根据给出信息查询桶对象,返回分页的桶对象列表 POST https://{endpoint}/v2/{project_id}/objectstorage/buckets/objects { "page_size" : 100, "behind_filename" : "", "file_path" : "A/", "cloud_type" : "HuaweiCloud", "bucket_name" : "xxx", "ak" : "xxxxxak", "sk" : "xxxxxsk", "data_center" : "cn-north-x" }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String IAM Token认证,需要确认Token中包含的Project ID与请求URI中修改资源的Project ID匹配。 最小长度:1 最大长度:16384 表3 请求Body参数 参数 是否必选 参数类型 描述 cloud_type 是 String 云类型 AWS:亚马逊 Aliyun:阿里云 Qiniu:七牛云 QingCloud:青云 Tencent:腾讯云 Baidu:百度云 KingsoftCloud:金山云 Azure:微软云 UCloud:优刻得 HuaweiCloud:华为云 Google: 谷歌云 URLSource:URL HEC:HEC 缺省值:Aliyun 最小长度: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 app_id 否 String 当源端为腾讯云时,会返回此参数。 最小长度:0 最大长度:255
  • 响应示例 状态码:200 版本信息。 { "links" : [ { "rel" : "self", "href" : "https://oms.cn-north-1.myhuaweicloud.com/v1/" } ], "id" : "v2", "updated" : "2020-04-01T12:00:00Z", "status" : "SUPPORTED" }
  • 响应参数 状态码:200 表3 响应Body参数 参数 参数类型 描述 id String 版本号,例如v1。 links Array of Link objects 链接地址信息。 数组长度:0 - 100 status String 版本状态。 取值“CURRENT”,表示该版本为主推版本。 取值"SUPPORTED",表示支持该版本。 取值“DEPRECATED”,表示为废弃版本,存在后续删除的可能。 枚举值: CURRENT DEPRECATED SUPPORTED updated String 版本更新时间。 格式为“yyyy-mm-ddThh:mm:ssZ”。 其中,T指某个时间的开始;Z指UTC时间。 最小长度:0 最大长度:32 表4 Link 参数 参数类型 描述 href String 链接地址。 rel String 取值为“self”,表示href为本地链接。 状态码:403 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误信息。 error_code String 错误码。
  • 请求示例 输入源端、目的端的AK/SK,重试任务ID为2c11d99a-9596-4bc6-a6ad-2336455b149c的迁移任务组。 PUT https://{endpoint}/v2/{project_id}/taskgroups/2c11d99a-9596-4bc6-a6ad-2336455b149c/retry { "src_ak" : "src_AK", "src_sk" : "src_SK", "dst_ak" : "dst_AK", "dst_sk" : "dst_SK", "migrate_failed_object" : false }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String IAM鉴权Token 最小长度:1 最大长度:16384 表3 请求Body参数 参数 是否必选 参数类型 描述 src_ak 否 String 源端ak(最大长度100个字符) 最小长度:0 最大长度:100 src_sk 否 String 源端sk(最大长度100个字符) 最小长度:0 最大长度:100 json_auth_file 否 String 用于谷歌云Cloud Storage鉴权 最小长度:0 最大长度:65535 dst_ak 否 String 目的端ak(最大长度100个字符) 最小长度:0 最大长度:100 dst_sk 否 String 目的端sk(最大长度100个字符) 最小长度:0 最大长度:100 source_cdn_authentication_key 否 String cdn鉴权秘钥 最小长度:0 最大长度:255 migrate_failed_object 否 Boolean 失败任务重试方式,标识是否为全量重新迁移,默认false(全量重新迁移)。 值为true时表示只重传失败对象。 值为空或者为false时表示全量重新迁移(默认跳过目的端已迁移对象)。 缺省值:false
  • 响应示例 状态码:200 OK { "tasks" : [ { "bandwidth_policy" : [ { "end" : "23:59", "max_bandwidth" : 0, "start" : "00:00" } ], "complete_size" : 0, "description" : "test log", "dst_node" : { "bucket" : "dst_bucket", "region" : "cn-north-1" }, "enable_failed_object_recording" : true, "enable_kms" : true, "enable_restore" : false, "error_reason" : { "error_code" : "string", "error_msg" : "string" }, "failed_num" : 0, "failed_object_record" : { "result" : true, "list_file_key" : "string", "error_code" : "string" }, "group_id" : "string", "id" : 0, "is_query_over" : true, "left_time" : 0, "migrate_since" : 0, "migrate_speed" : 0, "name" : "string", "progress" : 0, "real_size" : 0, "skipped_num" : 0, "src_node" : { "bucket" : "src_bucket", "cloud_type" : "AWS", "region" : "cn-north-1", "app_id" : "string", "object_key" : [ "string", "string" ], "list_file" : { "list_file_key" : "object_list_file.txt", "obs_bucket" : "obs_bucket" } }, "start_time" : 0, "status" : 0, "successful_num" : 0, "task_type" : "list", "total_num" : 0, "total_size" : 0, "total_time" : 0, "smn_info" : { "notify_result" : true, "notify_error_message" : "string", "topic_name" : "string" }, "source_cdn" : { "domain" : "xxx.xxx.xxx", "protocol" : "http", "authentication_type" : "string" } } ], "count" : 1 }
  • URI GET /v2/{project_id}/tasks 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID 最小长度:1 最大长度:1024 表2 Query参数 参数 是否必选 参数类型 描述 group_id 否 String 迁移任务组group_id 最小长度:1 最大长度:100 limit 否 Integer 查询返回迁移任务列表当前页面的数量,默认查询10条。 最多返回100条迁移任务信息。 最小值:1 最大值:100 缺省值:10 offset 否 Integer 起始的任务序号,默认为0。 取值大于等于0,取值为0时从第一条开始查询。 最小值:0 最大值:2147483647 缺省值:0 status 否 Integer 迁移任务状态(无该参数时代表查询所有状态的任务): 1:等待调度 2:正在执行 3:停止 4:失败 5:成功 7: 暂停中 最小值:1 最大值:7
  • URI GET /v2/{project_id}/taskgroups 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID 最小长度:1 最大长度:1024 表2 Query参数 参数 是否必选 参数类型 描述 limit 否 Integer 查询返回迁移组任务列表当前页面的数量,默认查询10条。 最多返回100条迁移任务信息。 最小值:1 最大值:100 缺省值:10 offset 否 Integer 起始的任务序号,默认为0。 取值大于等于0,取值为0时从第一条开始查询。 最小值:0 最大值:2147483647 缺省值:0 status 否 Integer 迁移任务组状态(无该参数时代表查询所有状态的任务) 0 – 等待中 1 – 执行中/创建中 2 – 监控任务执行 3 – 暂停 4 – 创建任务失败 5 – 迁移失败 6 – 迁移完成 7 – 暂停中 8 – 等待删除中 9 – 删除 最小值:0 最大值:9
  • 响应示例 状态码:200 Ok { "count" : 353, "taskgroups" : [ { "group_id" : "9dd98a5e-7ea3-4d80-abff-4c23914313e4", "status" : 6, "error_reason" : null, "src_node" : { "bucket" : "api-auto-test", "cloud_type" : "TENCENT", "region" : "ap-beijing", "app_id" : "1254563210", "object_key" : [ "test" ], "list_file" : null }, "description" : "", "dst_node" : { "bucket" : "test-l30022277", "region" : "cn-north-7", "save_prefix" : "" }, "enable_metadata_migration" : false, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_kms" : false, "task_type" : "PREFIX", "bandwidth_policy" : [ ], "smn_config" : null, "source_cdn" : null, "migrate_since" : 0, "migrate_speed" : 0, "total_time" : 973657, "start_time" : 1663654062461, "total_task_num" : null, "create_task_num" : null, "failed_task_num" : null, "complete_task_num" : null, "paused_task_num" : null, "executing_task_num" : null, "waiting_task_num" : null, "total_num" : 6, "create_complete_num" : null, "success_num" : 6, "fail_num" : 0, "skip_num" : 0, "total_size" : 2469022100, "create_complete_size" : null, "complete_size" : 2469022100, "failed_object_record" : { "result" : null, "list_file_key" : null, "error_code" : null }, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "consistency_check" : "size_last_modified", "enable_requester_pays" : false }, { "group_id" : "2597fc69-af30-4411-b59d-b37857b69792", "status" : 6, "error_reason" : null, "src_node" : { "bucket" : "test-retry", "cloud_type" : "HUAWEICLOUD", "region" : "cn-north-7", "app_id" : "", "object_key" : [ "%21" ], "list_file" : null }, "description" : "", "dst_node" : { "bucket" : "assess-bucket-1", "region" : "cn-north-7", "save_prefix" : "" }, "enable_metadata_migration" : false, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_kms" : false, "task_type" : "PREFIX", "bandwidth_policy" : [ ], "smn_config" : null, "source_cdn" : null, "migrate_since" : 0, "migrate_speed" : 0, "total_time" : 43440, "start_time" : 1663340552910, "total_task_num" : null, "create_task_num" : null, "failed_task_num" : null, "complete_task_num" : null, "paused_task_num" : null, "executing_task_num" : null, "waiting_task_num" : null, "total_num" : 1, "create_complete_num" : null, "success_num" : 0, "fail_num" : 0, "skip_num" : 1, "total_size" : 1205, "create_complete_size" : null, "complete_size" : 1205, "failed_object_record" : { "result" : null, "list_file_key" : null, "error_code" : null }, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "consistency_check" : "size_last_modified", "enable_requester_pays" : false }, { "group_id" : "d85ed5a8-61a1-492f-a146-2fd092dc37cf", "status" : 5, "error_reason" : null, "src_node" : { "bucket" : "assess-bucket-1", "cloud_type" : "HUAWEICLOUD", "region" : "cn-north-7", "app_id" : "", "object_key" : [ "" ], "list_file" : null }, "description" : "", "dst_node" : { "bucket" : "assess-bucket-1", "region" : "cn-north-7", "save_prefix" : "" }, "enable_metadata_migration" : false, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_kms" : false, "task_type" : "PREFIX", "bandwidth_policy" : [ ], "smn_config" : null, "source_cdn" : null, "migrate_since" : 0, "migrate_speed" : 0, "total_time" : 4047612, "start_time" : 1663070894867, "total_task_num" : null, "create_task_num" : null, "failed_task_num" : null, "complete_task_num" : null, "paused_task_num" : null, "executing_task_num" : null, "waiting_task_num" : null, "total_num" : 99020, "create_complete_num" : null, "success_num" : 0, "fail_num" : 99020, "skip_num" : 0, "total_size" : 954329692, "create_complete_size" : null, "complete_size" : 954329692, "failed_object_record" : { "result" : true, "list_file_key" : "oms/task_group/d85ed5a8-61a1-492f-a146-2fd092dc37cf/failed_object_lists/", "error_code" : null }, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "consistency_check" : "size_last_modified", "enable_requester_pays" : false }, { "group_id" : "2a84320a-eddb-4413-9b12-a0251aae0f3e", "status" : 6, "error_reason" : null, "src_node" : { "bucket" : "api-test", "cloud_type" : "UCLOUD", "region" : "cn-bj", "app_id" : "", "object_key" : [ "test" ], "list_file" : null }, "description" : "", "dst_node" : { "bucket" : "test-l30022277", "region" : "cn-north-7", "save_prefix" : "" }, "enable_metadata_migration" : false, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_kms" : false, "task_type" : "PREFIX", "bandwidth_policy" : [ ], "smn_config" : null, "source_cdn" : null, "migrate_since" : 0, "migrate_speed" : 0, "total_time" : 63228, "start_time" : 1662725286648, "total_task_num" : null, "create_task_num" : null, "failed_task_num" : null, "complete_task_num" : null, "paused_task_num" : null, "executing_task_num" : null, "waiting_task_num" : null, "total_num" : 6, "create_complete_num" : null, "success_num" : 5, "fail_num" : 0, "skip_num" : 1, "total_size" : 0, "create_complete_size" : null, "complete_size" : 0, "failed_object_record" : { "result" : null, "list_file_key" : null, "error_code" : null }, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "consistency_check" : "size_last_modified", "enable_requester_pays" : false }, { "group_id" : "64bca3b2-6ccc-4ca4-8394-17d3c7bdf871", "status" : 6, "error_reason" : null, "src_node" : { "bucket" : "api-auto-test", "cloud_type" : "TENCENT", "region" : "ap-beijing", "app_id" : "1254563210", "object_key" : [ "test" ], "list_file" : null }, "description" : "", "dst_node" : { "bucket" : "test-l30022277", "region" : "cn-north-7", "save_prefix" : "" }, "enable_metadata_migration" : false, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_kms" : false, "task_type" : "PREFIX", "bandwidth_policy" : [ ], "smn_config" : null, "source_cdn" : null, "migrate_since" : 0, "migrate_speed" : 0, "total_time" : 553999, "start_time" : 1662725057215, "total_task_num" : null, "create_task_num" : null, "failed_task_num" : null, "complete_task_num" : null, "paused_task_num" : null, "executing_task_num" : null, "waiting_task_num" : null, "total_num" : 6, "create_complete_num" : null, "success_num" : 6, "fail_num" : 0, "skip_num" : 0, "total_size" : 2469022100, "create_complete_size" : null, "complete_size" : 2469022100, "failed_object_record" : { "result" : null, "list_file_key" : null, "error_code" : null }, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "consistency_check" : "size_last_modified", "enable_requester_pays" : false }, { "group_id" : "4c019e94-9ac1-4cd6-b404-982816b20c2f", "status" : 6, "error_reason" : null, "src_node" : { "bucket" : "api-auto-hangzhou", "cloud_type" : "ALIYUN", "region" : "cn-hangzhou", "app_id" : "", "object_key" : [ "test" ], "list_file" : null }, "description" : "", "dst_node" : { "bucket" : "test-l30022277", "region" : "cn-north-7", "save_prefix" : "" }, "enable_metadata_migration" : false, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_kms" : false, "task_type" : "PREFIX", "bandwidth_policy" : [ ], "smn_config" : null, "source_cdn" : null, "migrate_since" : 0, "migrate_speed" : 0, "total_time" : 33279, "start_time" : 1662723650469, "total_task_num" : null, "create_task_num" : null, "failed_task_num" : null, "complete_task_num" : null, "paused_task_num" : null, "executing_task_num" : null, "waiting_task_num" : null, "total_num" : 3, "create_complete_num" : null, "success_num" : 3, "fail_num" : 0, "skip_num" : 0, "total_size" : 31840, "create_complete_size" : null, "complete_size" : 31840, "failed_object_record" : { "result" : null, "list_file_key" : null, "error_code" : null }, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "consistency_check" : "size_last_modified", "enable_requester_pays" : false }, { "group_id" : "5f5dd578-a3a6-4324-ad64-647a38ffb395", "status" : 6, "error_reason" : null, "src_node" : { "bucket" : "api-auto-test", "cloud_type" : "BAIDU", "region" : "bj", "app_id" : "", "object_key" : [ "test" ], "list_file" : null }, "description" : "", "dst_node" : { "bucket" : "assess-bucket-1", "region" : "cn-north-7", "save_prefix" : "" }, "enable_metadata_migration" : false, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_kms" : false, "task_type" : "PREFIX", "bandwidth_policy" : [ ], "smn_config" : null, "source_cdn" : null, "migrate_since" : 0, "migrate_speed" : 0, "total_time" : 53427, "start_time" : 1662722500472, "total_task_num" : null, "create_task_num" : null, "failed_task_num" : null, "complete_task_num" : null, "paused_task_num" : null, "executing_task_num" : null, "waiting_task_num" : null, "total_num" : 15, "create_complete_num" : null, "success_num" : 15, "fail_num" : 0, "skip_num" : 0, "total_size" : 94864941, "create_complete_size" : null, "complete_size" : 94864941, "failed_object_record" : { "result" : null, "list_file_key" : null, "error_code" : null }, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "consistency_check" : "size_last_modified", "enable_requester_pays" : false }, { "group_id" : "912e951b-ae19-4f65-bb94-c889601d8a43", "status" : 6, "error_reason" : null, "src_node" : { "bucket" : "assess-bucket-1", "cloud_type" : "HUAWEICLOUD", "region" : "cn-north-7", "app_id" : "", "object_key" : [ "" ], "list_file" : null }, "description" : "", "dst_node" : { "bucket" : "oms-onebox-lqm", "region" : "cn-north-7", "save_prefix" : "" }, "enable_metadata_migration" : false, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_kms" : false, "task_type" : "PREFIX", "bandwidth_policy" : [ ], "smn_config" : null, "source_cdn" : null, "migrate_since" : 0, "migrate_speed" : 0, "total_time" : 590588, "start_time" : 1662640213374, "total_task_num" : null, "create_task_num" : null, "failed_task_num" : null, "complete_task_num" : null, "paused_task_num" : null, "executing_task_num" : null, "waiting_task_num" : null, "total_num" : 99052, "create_complete_num" : null, "success_num" : 99052, "fail_num" : 0, "skip_num" : 0, "total_size" : 1847919442, "create_complete_size" : null, "complete_size" : 1847919442, "failed_object_record" : { "result" : null, "list_file_key" : null, "error_code" : null }, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "consistency_check" : "size_last_modified", "enable_requester_pays" : false }, { "group_id" : "398b5845-b180-47a1-a7c9-56f051ed3f34", "status" : 5, "error_reason" : null, "src_node" : { "bucket" : "hw-src", "cloud_type" : "HUAWEICLOUD", "region" : "cn-north-7", "app_id" : "", "object_key" : [ "gd.jpg" ], "list_file" : null }, "description" : "", "dst_node" : { "bucket" : "zzww", "region" : "cn-north-7", "save_prefix" : "" }, "enable_metadata_migration" : false, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_kms" : false, "task_type" : "PREFIX", "bandwidth_policy" : [ ], "smn_config" : null, "source_cdn" : null, "migrate_since" : 0, "migrate_speed" : 0, "total_time" : 709891300, "start_time" : 1662369530210, "total_task_num" : null, "create_task_num" : null, "failed_task_num" : null, "complete_task_num" : null, "paused_task_num" : null, "executing_task_num" : null, "waiting_task_num" : null, "total_num" : 1, "create_complete_num" : null, "success_num" : 0, "fail_num" : 1, "skip_num" : 0, "total_size" : 3528, "create_complete_size" : null, "complete_size" : 0, "failed_object_record" : { "result" : true, "list_file_key" : "oms/task_group/398b5845-b180-47a1-a7c9-56f051ed3f34/failed_object_lists/", "error_code" : null }, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "consistency_check" : "size_last_modified", "enable_requester_pays" : false }, { "group_id" : "494cad85-cbe5-4d62-8e70-e4f0e847e39c", "status" : 6, "error_reason" : null, "src_node" : { "bucket" : "test-l30022277-src", "cloud_type" : "HUAWEICLOUD", "region" : "cn-north-7", "app_id" : "", "object_key" : [ "test" ], "list_file" : null }, "description" : "", "dst_node" : { "bucket" : "test-l30022277", "region" : "cn-north-7", "save_prefix" : "" }, "enable_metadata_migration" : false, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_kms" : false, "task_type" : "PREFIX", "bandwidth_policy" : [ ], "smn_config" : null, "source_cdn" : null, "migrate_since" : 0, "migrate_speed" : 0, "total_time" : 33513, "start_time" : 1661928705453, "total_task_num" : null, "create_task_num" : null, "failed_task_num" : null, "complete_task_num" : null, "paused_task_num" : null, "executing_task_num" : null, "waiting_task_num" : null, "total_num" : 2, "create_complete_num" : null, "success_num" : 0, "fail_num" : 0, "skip_num" : 2, "total_size" : 155, "create_complete_size" : null, "complete_size" : 155, "failed_object_record" : { "result" : null, "list_file_key" : null, "error_code" : null }, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "consistency_check" : "size_last_modified", "enable_requester_pays" : false } ] }
  • URI GET /v2/{project_id}/sync-tasks 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID 最小长度:1 最大长度:1024 表2 Query参数 参数 是否必选 参数类型 描述 limit 否 Integer 查询返回同步任务列表当前页面的数量,默认查询10条。 最多返回100条迁移任务信息。 最小值:1 最大值:100 缺省值:10 offset 否 Integer 起始的任务序号,默认为0。 取值大于等于0,取值为0时从第一条开始查询。 最小值:0 最大值:10000 缺省值:0 status 否 String 同步任务状态(无该参数时代表查询所有状态的任务): SYNCHRONIZING:同步中 STOPPED:已停止 最小长度:0 最大长度:255
  • 响应示例 状态码:200 OK { "tasks" : [ { "sync_task_id" : "d18befdd-eb82-41f3-8019-bbb593d74a3e", "src_cloud_type" : "HuaweiCloud", "src_region" : "cn-north-7", "src_bucket" : "oms-sdk-test-src", "create_time" : 1700639560751, "last_start_time" : 1700639560751, "dst_bucket" : "oms-sdk-test-dst", "dst_region" : "cn-north-7", "description" : "sync task test", "status" : "SYNCHRONIZING", "enable_kms" : false, "enable_metadata_migration" : false, "enable_restore" : false, "app_id" : null, "source_cdn" : null, "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE", "dst_storage_policy" : null, "consistency_check" : "size_last_modified" } ], "count" : 1 }
  • 请求示例 查询2c0689c860ad4728a497c91ec0844383项目下的0d146099-8cf4-437d-b6ef-88e043771c8b任务的统计 GET https://{endpoint}/v2/2c0689c860ad4728a497c91ec0844383/sync-tasks/0d146099-8cf4-437d-b6ef-88e043771c8b/statistics?data_type=REQUEST { "sync_task_id" : "4fb05cd2-c94e-44e4-a07f-e65a2f01ebcb", "statistic_time_type" : "FIVE_MINUTES", "statistic_datas" : [ { "data_type" : "REQUEST", "data" : [ { "time_stamp" : 1700150400000, "statistic_num" : 1 }, { "time_stamp" : 1700151000000, "statistic_num" : 20 }, { "time_stamp" : 1700151300000, "statistic_num" : 13 }, { "time_stamp" : 1700151600000, "statistic_num" : 12 }, { "time_stamp" : 1700151900000, "statistic_num" : 10 }, { "time_stamp" : 1700152200000, "statistic_num" : 11 }, { "time_stamp" : 1700152500000, "statistic_num" : 9 }, { "time_stamp" : 1700152800000, "statistic_num" : 12 }, { "time_stamp" : 1700153100000, "statistic_num" : 9 }, { "time_stamp" : 1700153400000, "statistic_num" : 10 }, { "time_stamp" : 1700153700000, "statistic_num" : 7 }, { "time_stamp" : 1700154000000, "statistic_num" : 13 }, { "time_stamp" : 1700154300000, "statistic_num" : 9 }, { "time_stamp" : 1700154600000, "statistic_num" : 9 }, { "time_stamp" : 1700154900000, "statistic_num" : 9 }, { "time_stamp" : 1700155200000, "statistic_num" : 10 }, { "time_stamp" : 1700155500000, "statistic_num" : 11 }, { "time_stamp" : 1700155800000, "statistic_num" : 9 }, { "time_stamp" : 1700156100000, "statistic_num" : 8 }, { "time_stamp" : 1700156400000, "statistic_num" : 11 }, { "time_stamp" : 1700156700000, "statistic_num" : 10 }, { "time_stamp" : 1700157000000, "statistic_num" : 8 }, { "time_stamp" : 1700157300000, "statistic_num" : 10 }, { "time_stamp" : 1700157600000, "statistic_num" : 11 }, { "time_stamp" : 1700157900000, "statistic_num" : 9 }, { "time_stamp" : 1700158200000, "statistic_num" : 11 }, { "time_stamp" : 1700158500000, "statistic_num" : 9 }, { "time_stamp" : 1700158800000, "statistic_num" : 10 }, { "time_stamp" : 1700159100000, "statistic_num" : 11 }, { "time_stamp" : 1700159400000, "statistic_num" : 9 }, { "time_stamp" : 1700159700000, "statistic_num" : 11 }, { "time_stamp" : 1700160000000, "statistic_num" : 10 }, { "time_stamp" : 1700160300000, "statistic_num" : 10 }, { "time_stamp" : 1700160600000, "statistic_num" : 9 }, { "time_stamp" : 1700160900000, "statistic_num" : 8 }, { "time_stamp" : 1700161200000, "statistic_num" : 11 }, { "time_stamp" : 1700161500000, "statistic_num" : 9 }, { "time_stamp" : 1700161800000, "statistic_num" : 9 }, { "time_stamp" : 1700162100000, "statistic_num" : 9 }, { "time_stamp" : 1700162400000, "statistic_num" : 10 }, { "time_stamp" : 1700162700000, "statistic_num" : 11 }, { "time_stamp" : 1700163000000, "statistic_num" : 9 }, { "time_stamp" : 1700163300000, "statistic_num" : 9 }, { "time_stamp" : 1700163600000, "statistic_num" : 11 }, { "time_stamp" : 1700163900000, "statistic_num" : 10 }, { "time_stamp" : 1700164200000, "statistic_num" : 9 }, { "time_stamp" : 1700164500000, "statistic_num" : 10 }, { "time_stamp" : 1700164800000, "statistic_num" : 9 }, { "time_stamp" : 1700165100000, "statistic_num" : 11 }, { "time_stamp" : 1700165400000, "statistic_num" : 10 }, { "time_stamp" : 1700165700000, "statistic_num" : 10 }, { "time_stamp" : 1700166000000, "statistic_num" : 11 }, { "time_stamp" : 1700166300000, "statistic_num" : 10 }, { "time_stamp" : 1700166600000, "statistic_num" : 9 }, { "time_stamp" : 1700166900000, "statistic_num" : 9 }, { "time_stamp" : 1700167200000, "statistic_num" : 11 }, { "time_stamp" : 1700167500000, "statistic_num" : 10 }, { "time_stamp" : 1700167800000, "statistic_num" : 8 }, { "time_stamp" : 1700168100000, "statistic_num" : 11 }, { "time_stamp" : 1700168400000, "statistic_num" : 8 }, { "time_stamp" : 1700168700000, "statistic_num" : 10 }, { "time_stamp" : 1700169000000, "statistic_num" : 10 }, { "time_stamp" : 1700169300000, "statistic_num" : 9 }, { "time_stamp" : 1700169600000, "statistic_num" : 10 }, { "time_stamp" : 1700169900000, "statistic_num" : 8 }, { "time_stamp" : 1700170200000, "statistic_num" : 11 }, { "time_stamp" : 1700170500000, "statistic_num" : 9 }, { "time_stamp" : 1700170800000, "statistic_num" : 13 }, { "time_stamp" : 1700171100000, "statistic_num" : 10 }, { "time_stamp" : 1700171400000, "statistic_num" : 8 }, { "time_stamp" : 1700171700000, "statistic_num" : 10 }, { "time_stamp" : 1700172000000, "statistic_num" : 11 }, { "time_stamp" : 1700172300000, "statistic_num" : 11 }, { "time_stamp" : 1700172600000, "statistic_num" : 10 }, { "time_stamp" : 1700172900000, "statistic_num" : 11 }, { "time_stamp" : 1700173200000, "statistic_num" : 9 }, { "time_stamp" : 1700173500000, "statistic_num" : 9 }, { "time_stamp" : 1700173800000, "statistic_num" : 12 }, { "time_stamp" : 1700174100000, "statistic_num" : 9 }, { "time_stamp" : 1700174400000, "statistic_num" : 11 }, { "time_stamp" : 1700174700000, "statistic_num" : 10 }, { "time_stamp" : 1700175000000, "statistic_num" : 10 }, { "time_stamp" : 1700175300000, "statistic_num" : 11 }, { "time_stamp" : 1700175600000, "statistic_num" : 9 }, { "time_stamp" : 1700175900000, "statistic_num" : 11 }, { "time_stamp" : 1700176200000, "statistic_num" : 10 }, { "time_stamp" : 1700176500000, "statistic_num" : 9 }, { "time_stamp" : 1700176800000, "statistic_num" : 11 }, { "time_stamp" : 1700177100000, "statistic_num" : 9 }, { "time_stamp" : 1700177400000, "statistic_num" : 11 }, { "time_stamp" : 1700177700000, "statistic_num" : 9 }, { "time_stamp" : 1700178000000, "statistic_num" : 12 }, { "time_stamp" : 1700178300000, "statistic_num" : 10 }, { "time_stamp" : 1700178600000, "statistic_num" : 9 }, { "time_stamp" : 1700178900000, "statistic_num" : 11 }, { "time_stamp" : 1700179200000, "statistic_num" : 9 }, { "time_stamp" : 1700179500000, "statistic_num" : 10 }, { "time_stamp" : 1700179800000, "statistic_num" : 10 }, { "time_stamp" : 1700180100000, "statistic_num" : 11 }, { "time_stamp" : 1700180400000, "statistic_num" : 10 }, { "time_stamp" : 1700180700000, "statistic_num" : 9 }, { "time_stamp" : 1700181000000, "statistic_num" : 12 }, { "time_stamp" : 1700181300000, "statistic_num" : 9 }, { "time_stamp" : 1700181600000, "statistic_num" : 12 }, { "time_stamp" : 1700181900000, "statistic_num" : 9 }, { "time_stamp" : 1700182200000, "statistic_num" : 11 }, { "time_stamp" : 1700182500000, "statistic_num" : 9 }, { "time_stamp" : 1700182800000, "statistic_num" : 10 }, { "time_stamp" : 1700183100000, "statistic_num" : 11 }, { "time_stamp" : 1700183400000, "statistic_num" : 10 }, { "time_stamp" : 1700183700000, "statistic_num" : 9 }, { "time_stamp" : 1700184000000, "statistic_num" : 8 }, { "time_stamp" : 1700188200000, "statistic_num" : 1 } ] } ] }
  • 响应示例 状态码:200 OK { "sync_task_id" : "4fb05cd2-c94e-44e4-a07f-e65a2f01ebcb", "statistic_time_type" : "FIVE_MINUTES", "statistic_datas" : [ { "data_type" : "REQUEST", "data" : [ { "time_stamp" : 1700150400000, "statistic_num" : 1 }, { "time_stamp" : 1700151000000, "statistic_num" : 20 }, { "time_stamp" : 1700151300000, "statistic_num" : 13 }, { "time_stamp" : 1700151600000, "statistic_num" : 12 }, { "time_stamp" : 1700151900000, "statistic_num" : 10 }, { "time_stamp" : 1700152200000, "statistic_num" : 11 }, { "time_stamp" : 1700152500000, "statistic_num" : 9 }, { "time_stamp" : 1700152800000, "statistic_num" : 12 }, { "time_stamp" : 1700153100000, "statistic_num" : 9 }, { "time_stamp" : 1700153400000, "statistic_num" : 10 }, { "time_stamp" : 1700153700000, "statistic_num" : 7 }, { "time_stamp" : 1700154000000, "statistic_num" : 13 }, { "time_stamp" : 1700154300000, "statistic_num" : 9 }, { "time_stamp" : 1700154600000, "statistic_num" : 9 }, { "time_stamp" : 1700154900000, "statistic_num" : 9 }, { "time_stamp" : 1700155200000, "statistic_num" : 10 }, { "time_stamp" : 1700155500000, "statistic_num" : 11 }, { "time_stamp" : 1700155800000, "statistic_num" : 9 }, { "time_stamp" : 1700156100000, "statistic_num" : 8 }, { "time_stamp" : 1700156400000, "statistic_num" : 11 }, { "time_stamp" : 1700156700000, "statistic_num" : 10 }, { "time_stamp" : 1700157000000, "statistic_num" : 8 }, { "time_stamp" : 1700157300000, "statistic_num" : 10 }, { "time_stamp" : 1700157600000, "statistic_num" : 11 }, { "time_stamp" : 1700157900000, "statistic_num" : 9 }, { "time_stamp" : 1700158200000, "statistic_num" : 11 }, { "time_stamp" : 1700158500000, "statistic_num" : 9 }, { "time_stamp" : 1700158800000, "statistic_num" : 10 }, { "time_stamp" : 1700159100000, "statistic_num" : 11 }, { "time_stamp" : 1700159400000, "statistic_num" : 9 }, { "time_stamp" : 1700159700000, "statistic_num" : 11 }, { "time_stamp" : 1700160000000, "statistic_num" : 10 }, { "time_stamp" : 1700160300000, "statistic_num" : 10 }, { "time_stamp" : 1700160600000, "statistic_num" : 9 }, { "time_stamp" : 1700160900000, "statistic_num" : 8 }, { "time_stamp" : 1700161200000, "statistic_num" : 11 }, { "time_stamp" : 1700161500000, "statistic_num" : 9 }, { "time_stamp" : 1700161800000, "statistic_num" : 9 }, { "time_stamp" : 1700162100000, "statistic_num" : 9 }, { "time_stamp" : 1700162400000, "statistic_num" : 10 }, { "time_stamp" : 1700162700000, "statistic_num" : 11 }, { "time_stamp" : 1700163000000, "statistic_num" : 9 }, { "time_stamp" : 1700163300000, "statistic_num" : 9 }, { "time_stamp" : 1700163600000, "statistic_num" : 11 }, { "time_stamp" : 1700163900000, "statistic_num" : 10 }, { "time_stamp" : 1700164200000, "statistic_num" : 9 }, { "time_stamp" : 1700164500000, "statistic_num" : 10 }, { "time_stamp" : 1700164800000, "statistic_num" : 9 }, { "time_stamp" : 1700165100000, "statistic_num" : 11 }, { "time_stamp" : 1700165400000, "statistic_num" : 10 }, { "time_stamp" : 1700165700000, "statistic_num" : 10 }, { "time_stamp" : 1700166000000, "statistic_num" : 11 }, { "time_stamp" : 1700166300000, "statistic_num" : 10 }, { "time_stamp" : 1700166600000, "statistic_num" : 9 }, { "time_stamp" : 1700166900000, "statistic_num" : 9 }, { "time_stamp" : 1700167200000, "statistic_num" : 11 }, { "time_stamp" : 1700167500000, "statistic_num" : 10 }, { "time_stamp" : 1700167800000, "statistic_num" : 8 }, { "time_stamp" : 1700168100000, "statistic_num" : 11 }, { "time_stamp" : 1700168400000, "statistic_num" : 8 }, { "time_stamp" : 1700168700000, "statistic_num" : 10 }, { "time_stamp" : 1700169000000, "statistic_num" : 10 }, { "time_stamp" : 1700169300000, "statistic_num" : 9 }, { "time_stamp" : 1700169600000, "statistic_num" : 10 }, { "time_stamp" : 1700169900000, "statistic_num" : 8 }, { "time_stamp" : 1700170200000, "statistic_num" : 11 }, { "time_stamp" : 1700170500000, "statistic_num" : 9 }, { "time_stamp" : 1700170800000, "statistic_num" : 13 }, { "time_stamp" : 1700171100000, "statistic_num" : 10 }, { "time_stamp" : 1700171400000, "statistic_num" : 8 }, { "time_stamp" : 1700171700000, "statistic_num" : 10 }, { "time_stamp" : 1700172000000, "statistic_num" : 11 }, { "time_stamp" : 1700172300000, "statistic_num" : 11 }, { "time_stamp" : 1700172600000, "statistic_num" : 10 }, { "time_stamp" : 1700172900000, "statistic_num" : 11 }, { "time_stamp" : 1700173200000, "statistic_num" : 9 }, { "time_stamp" : 1700173500000, "statistic_num" : 9 }, { "time_stamp" : 1700173800000, "statistic_num" : 12 }, { "time_stamp" : 1700174100000, "statistic_num" : 9 }, { "time_stamp" : 1700174400000, "statistic_num" : 11 }, { "time_stamp" : 1700174700000, "statistic_num" : 10 }, { "time_stamp" : 1700175000000, "statistic_num" : 10 }, { "time_stamp" : 1700175300000, "statistic_num" : 11 }, { "time_stamp" : 1700175600000, "statistic_num" : 9 }, { "time_stamp" : 1700175900000, "statistic_num" : 11 }, { "time_stamp" : 1700176200000, "statistic_num" : 10 }, { "time_stamp" : 1700176500000, "statistic_num" : 9 }, { "time_stamp" : 1700176800000, "statistic_num" : 11 }, { "time_stamp" : 1700177100000, "statistic_num" : 9 }, { "time_stamp" : 1700177400000, "statistic_num" : 11 }, { "time_stamp" : 1700177700000, "statistic_num" : 9 }, { "time_stamp" : 1700178000000, "statistic_num" : 12 }, { "time_stamp" : 1700178300000, "statistic_num" : 10 }, { "time_stamp" : 1700178600000, "statistic_num" : 9 }, { "time_stamp" : 1700178900000, "statistic_num" : 11 }, { "time_stamp" : 1700179200000, "statistic_num" : 9 }, { "time_stamp" : 1700179500000, "statistic_num" : 10 }, { "time_stamp" : 1700179800000, "statistic_num" : 10 }, { "time_stamp" : 1700180100000, "statistic_num" : 11 }, { "time_stamp" : 1700180400000, "statistic_num" : 10 }, { "time_stamp" : 1700180700000, "statistic_num" : 9 }, { "time_stamp" : 1700181000000, "statistic_num" : 12 }, { "time_stamp" : 1700181300000, "statistic_num" : 9 }, { "time_stamp" : 1700181600000, "statistic_num" : 12 }, { "time_stamp" : 1700181900000, "statistic_num" : 9 }, { "time_stamp" : 1700182200000, "statistic_num" : 11 }, { "time_stamp" : 1700182500000, "statistic_num" : 9 }, { "time_stamp" : 1700182800000, "statistic_num" : 10 }, { "time_stamp" : 1700183100000, "statistic_num" : 11 }, { "time_stamp" : 1700183400000, "statistic_num" : 10 }, { "time_stamp" : 1700183700000, "statistic_num" : 9 }, { "time_stamp" : 1700184000000, "statistic_num" : 8 }, { "time_stamp" : 1700188200000, "statistic_num" : 1 } ] } ] }
  • 响应参数 状态码:200 表4 响应Body参数 参数 参数类型 描述 sync_task_id String 同步任务id 最小长度:1 最大长度:255 statistic_time_type String 统计结果时间间隔说明描述 FIVE_MINUTES:5分钟 ONE_HOUR:1小时 最小长度:1 最大长度:255 枚举值: FIVE_MINUTES ONE_HOUR statistic_datas Array of StatisticTypeData objects 查询的同步任务统计结果集 数组长度:0 - 1000 表5 StatisticTypeData 参数 参数类型 描述 data_type String 统计数据类型: REQUEST:请求对象数 SUC CES S:成功对象数 FAILURE:失败对象数 SKIP:跳过对象数 SIZE:对象容量(Byte) 最小长度:1 最大长度:255 枚举值: REQUEST SUCCESS FAILURE SKIP SIZE data Array of StatisticData objects 查询的同步任务统计结果集 数组长度:0 - 1000 表6 StatisticData 参数 参数类型 描述 time_stamp Long 统计时间戳 最小值:0 最大值:9223372036854775807 statistic_num Long 统计数量 最小值:0 最大值:9223372036854775807 状态码:404 表7 响应Body参数 参数 参数类型 描述 error_msg String 错误信息。 error_code String 错误码。
  • URI GET /v2/{project_id}/sync-tasks/{sync_task_id}/statistics 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID 最小长度:1 最大长度:1024 sync_task_id 是 String 同步任务ID。 最小长度:0 最大长度:255 表2 Query参数 参数 是否必选 参数类型 描述 data_type 是 String 统计数据类型: 多类型查询用‘,’分割; REQUEST:接收同步请求对象数 SUCCESS:同步成功对象数 FAILURE:同步失败对象数 SKIP:同步跳过对象数 SIZE:同步成功对象容量(Byte) 最小长度:1 最大长度:255 枚举值: REQUEST SUCCESS FAILURE SKIP SIZE start_time 是 String 查询开始时间 最小长度:1 最大长度:1024 end_time 是 String 查询开始时间 最小长度:1 最大长度:1024
  • 响应示例 状态码:200 OK { "versions" : [ { "links" : [ { "rel" : "self", "href" : "https://oms.cn-north-1.myhuaweicloud.com/v1/" } ], "id" : "v1", "updated" : "2020-01-01T12:00:00Z", "status" : "SUPPORTED" }, { "links" : [ { "rel" : "self", "href" : "https://oms.cn-north-1.myhuaweicloud.com/v2/" } ], "id" : "v1", "updated" : "2020-01-01T12:00:00Z", "status" : "SUPPORTED" } ] }
  • 响应参数 状态码:200 表2 响应Body参数 参数 参数类型 描述 versions Array of Version objects 版本信息列表。 数组长度:0 - 1024 表3 Version 参数 参数类型 描述 id String 版本号,例如v1。 links Array of Link objects 链接地址信息。 数组长度:0 - 100 status String 版本状态。 取值“CURRENT”,表示该版本为主推版本。 取值"SUPPORTED",表示支持该版本。 取值“DEPRECATED”,表示为废弃版本,存在后续删除的可能。 枚举值: CURRENT DEPRECATED SUPPORTED updated String 版本更新时间。 格式为“yyyy-mm-ddThh:mm:ssZ”。 其中,T指某个时间的开始;Z指UTC时间。 最小长度:0 最大长度:32 表4 Link 参数 参数类型 描述 href String 链接地址。 rel String 取值为“self”,表示href为本地链接。 状态码:403 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误信息。 error_code String 错误码。
  • 响应参数 状态码:400 表3 响应Body参数 参数 参数类型 描述 error_code String 迁移失败的错误码。 最小长度:0 最大长度:10 error_msg String 迁移失败的原因。 最小长度:0 最大长度:1024 状态码:403 表4 响应Body参数 参数 参数类型 描述 error_code String 迁移失败的错误码。 最小长度:0 最大长度:10 error_msg String 迁移失败的原因。 最小长度:0 最大长度:1024
  • 响应参数 状态码:200 表10 响应Body参数 参数 参数类型 描述 group_id String 创建的迁移任务组id 最小长度:1 最大长度:100 状态码:400 表11 响应Body参数 参数 参数类型 描述 error_msg String 错误信息。 error_code String 错误码。 状态码:403 表12 响应Body参数 参数 参数类型 描述 error_msg String 错误信息。 error_code String 错误码。 状态码:500 表13 响应Body参数 参数 参数类型 描述 error_msg String 错误信息。 error_code String 错误码。
  • 请求示例 创建迁移任务组任务,以hw/目录下的txt文件中的对象列表信息作为华为云桶bucket的源端数据,迁移至目的端桶zzww。 POST https://{endpoint}/v2/{project_id}/taskgroups { "enable_failed_object_recording" : true, "src_node" : { "bucket" : "hw-src", "cloud_type" : "HuaweiCloud", "ak" : "******", "sk" : "******", "region" : "cn-north-7", "list_file" : { "obs_bucket" : "list-file-bucket", "list_file_key" : "hw/" } }, "enable_kms" : false, "task_type" : "LIST", "enable_restore" : false, "dst_node" : { "bucket" : "zzww", "cloud_type" : "HEC", "ak" : "******", "sk" : "******", "region" : "cn-north-7" }, "enable_metadata_migration" : true } 创建迁移任务组任务,将前缀为Objectlist的对象从源端桶src-bucket迁移至目的端桶dst-bucket。 POST https://{endpoint}/v2/{project_id}/taskgroups { "src_node" : { "region" : "cn-north-4", "ak" : "******", "sk" : "******.", "bucket" : "src-bucket", "cloud_type" : "HuaweiCloud", "object_key" : [ "Objectlist" ] }, "dst_node" : { "region" : "cn-north-4", "ak" : "******", "sk" : "******", "bucket" : "dst-bucket" }, "task_type" : "PREFIX", "enable_failed_object_recording" : true, "enable_kms" : false, "bandwidth_policy" : [ { "max_bandwidth" : 1048576, "start" : "00:01", "end" : "23:59" } ] } 创建迁移任务组任务,以test01/路径下的txt文件作为URL列表目录,迁移至目的端桶jjyy。 POST https://{endpoint}/v2/{project_id}/taskgroups { "src_node" : { "cloud_type" : "URLSource", "list_file" : { "obs_bucket" : "url-file-bucket", "list_file_key" : "test01/" } }, "description" : "", "dst_node" : { "region" : "cn-north-4", "ak" : "******", "sk" : "******.", "bucket" : "jjyy", "cloud_type" : "HEC" }, "enable_failed_object_recording" : true, "enable_restore" : false, "enable_metadata_migration" : false, "enable_kms" : false, "task_type" : "URL_LIST" }
  • 请求示例 使用阿里云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" }
  • 请求示例 创建阿里云北京api-auto-test1桶到华为云北京4的oms-sonar-north桶的同步任务 POST https://v2/{project_id}/sync-tasks { "src_cloud_type" : "Aliyun", "src_region" : "cn-beijing", "src_bucket" : "api-auto-test1", "src_ak" : "src_ak", "src_sk" : "src_sk", "dst_ak" : "dst_ak", "dst_sk" : "dst_sk", "dst_region" : "cn-north-4", "dst_bucket" : "oms-sonar-north", "description" : "XXXX", "enable_kms" : false, "enable_restore" : false, "enable_metadata_migration" : false }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String API认证鉴权的Token认证方式。推荐使用Authorization签名认证方式,具体请参考API认证鉴权 最小长度:1 最大长度:16384 表3 请求Body参数 参数 是否必选 参数类型 描述 object_keys 是 Array of strings 待同步对象的列表,其中待同步对象最大数量为10,列表中object_key为URL编码处理后的结果 最小长度:1 最大长度:16384 数组长度:1 - 100
  • 请求示例 对子任务31e9b7e6-6ffb-452f-9842-6ce354d99d75创建同步事件,对 [ "test%2F001.txt", "test%2F002.txt" ] 进行同步 /v2/f697f813-554a-4f05-bac8-82a183b20878/sync-tasks/31e9b7e6-6ffb-452f-9842-6ce354d99d75/events { "object_keys" : [ "test%2F001.txt", "test%2F002.txt" ] } 对子任务31e9b7e6-6ffb-452f-9842-6ce354d99d75创建同步事件,对 [ "test%2B001.txt"] 进行同步 /v2/f697f813-554a-4f05-bac8-82a183b20878/sync-tasks/31e9b7e6-6ffb-452f-9842-6ce354d99d75/events { "object_keys" : [ "test%2B001.txt" ] } 对子任务31e9b7e6-6ffb-452f-9842-6ce354d99d75创建同步事件,对 [ "test+001.txt" ] 进行同步 /v2/f697f813-554a-4f05-bac8-82a183b20878/sync-tasks/31e9b7e6-6ffb-452f-9842-6ce354d99d75/events { "object_keys" : [ "test+001.txt" ] }
  • 响应参数 状态码:400 表4 响应Body参数 参数 参数类型 描述 error_msg String 错误信息。 error_code String 错误码。 状态码:404 表5 响应Body参数 参数 参数类型 描述 error_msg String 错误信息。 error_code String 错误码。 状态码:503 表6 响应Body参数 参数 参数类型 描述 error_msg String 错误信息。 error_code String 错误码。
  • 请求示例 检查xxxx的前缀是否在xxx桶中存在 POST https://{endpoint}/v2/{project_id}/objectstorage/buckets/prefix { "cloud_type" : "HuaweiCloud", "ak" : "xxxxak", "sk" : "xxxxsk", "app_id" : "apptest123", "bucket_name" : "xxx", "file_name" : "xxxx", "data_center" : "cn-north-x", "security_token" : "string" }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String IAM Token认证,需要确认Token中包含的Project ID与请求URI中修改资源的Project ID匹配。 最小长度:1 最大长度:16384 表3 请求Body参数 参数 是否必选 参数类型 描述 cloud_type 是 String 云类型 AWS:亚马逊 Aliyun:阿里云 Qiniu:七牛云 QingCloud:青云 Tencent:腾讯云 Baidu:百度云 KingsoftCloud:金山云 Azure:微软云 UCloud:优刻得 HuaweiCloud:华为云 Google: 谷歌云 URLSource:URL HEC:HEC 缺省值:Aliyun 最小长度: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 app_id 否 String 当源端为腾讯云时,会返回此参数。 最小长度:0 最大长度:255 bucket_name 是 String 桶名 最小长度:0 最大长度:100 file_name 是 String 前缀名称 最小长度:0 最大长度:1024 data_center 是 String 数据中心,区域 最小长度:0 最大长度:100 security_token 否 String 安全令牌 最小长度:0 最大长度:16384
  • 请求示例 将group_id为xxxxxxxx的任务的限速时段设置为00:01-23:59,限速值设置为50000000Byte/s /v2/{project_id}/tasks/batch-update { "group_id" : "xxxxxxxx", "bandwidth_policy" : [ { "start" : "00:01", "end" : "23:59", "max_bandwidth" : 50000000 } ] } 将id为111,222的任务的限速时段设置为00:01-23:59,限速值设置为50000000Byte/s /v2/{project_id}/tasks/batch-update { "ids" : [ 111, 222 ], "bandwidth_policy" : [ { "start" : "00:01", "end" : "23:59", "max_bandwidth" : 50000000 } ] }
共100000条
提示

您即将访问非华为云网站,请注意账号财产安全