数据复制服务 DRS-操作指定ID任务:请求示例

时间:2024-09-09 14:42:23

请求示例

  • 执行预检查(异步调用)。
    https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs/c7debc9c-8e09-4a5d-8dd6-cc44f78jb20r/action
    
    {
      "job" : {
        "action_name" : "precheck",
        "action_params" : {
          "precheck_mode" : "forStartJob"
        }
      }
    }
  • 测试连接目标库(异步调用)。
    https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs/c7debc9c-8e09-4a5d-8dd6-cc44f78jb20r/action
    
    {
      "job" : {
        "action_name" : "network",
        "action_params" : {
          "endpoints" : [ {
            "db_type" : "gaussdbv5",
            "endpoint_type" : "cloud",
            "endpoint_role" : "ta",
            "endpoint" : {
              "endpoint_name" : "cloud_gaussdbv5",
              "instance_id" : "c2c7579bc09c490b9d8009db715aeb0ain14",
              "db_user" : "root",
              "db_password" : "******"
            },
            "cloud" : {
              "region" : "cn-north-4",
              "project_id" : "9dc8c0f3f74c4dbb23c29cf0318ee561",
              "az_code" : "cn-north-4a,cn-north-4g,cn-north-4c"
            },
            "vpc" : {
              "vpc_id" : "2cb5d364-ae63-4fbb-85b7-7d59f4a88f8f",
              "subnet_id" : "2cb54324-ae63-4fbb-85b7-7d59f4a88f8f",
              "security_group_id" : "039a3s89-665a-43e2-9b4f-bda7d9ee148d"
            }
          } ]
        }
      }
    }
  • 测试连接源库(异步调用)。
    https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs/c7debc9c-8e09-4a5d-8dd6-cc44f78jb20r/action
    
    {
      "job" : {
        "action_name" : "network",
        "action_params" : {
          "endpoints" : [ {
            "db_type" : "oracle",
            "endpoint_type" : "offline",
            "endpoint_role" : "so",
            "endpoint" : {
              "endpoint_name" : "oracle",
              "ip" : "10.154.217.239",
              "db_port" : "1521",
              "db_user" : "ORACLE_USER",
              "db_password" : "******",
              "id" : "971e1840-9395-4044-b6c8-00ef1f83ce48",
              "db_name" : "serviceName.orcl"
            },
            "ssl" : {
              "ssl_link" : false
            }
          } ]
        }
      }
    }
  • 创建对象对比任务(异步调用)。
    https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs/d0f96c1d-571f-4b63-98a5-3b85b36jb20r/action
    
    {
      "job" : {
        "action_name" : "create_compare",
        "action_params" : {
          "compare_task_param" : {
            "type" : "object"
          }
        }
      }
    }
  • 创建行对比任务(异步调用)。
    https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs/d0f96c1d-571f-4b63-98a5-3b85b36jb20r/action
    
    {
      "job" : {
        "action_name" : "create_compare",
        "action_params" : {
          "compare_task_param" : {
            "type" : "lines",
            "option" : {
              "comparePolicy" : "normal"
            },
            "db_object" : {
              "db1" : {
                "name" : "db1",
                "tables" : {
                  "table1" : {
                    "name" : "table1"
                  }
                }
              }
            }
          }
        }
      }
    }
support.huaweicloud.com/api-drs/drs_03_0178.html