对象存储迁移服务 OMS-创建迁移任务组:请求示例

时间:2023-11-21 20:07:05

请求示例

  • 创建迁移任务组任务,以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"
    }
support.huaweicloud.com/api-oms/CreateTaskGroup.html