云备份 CBR-创建策略:请求示例

时间:2024-12-16 09:24:14

请求示例

  • 创建一个备份策略,周一到周天每天14:00执行备份,保留策略按备份保留时长,保留一天。

    POST https://{endpoint}/v3/f841e01fd2b14e7fa41b6ae7aa6b0594/policies
    
    {
      "policy" : {
        "enabled" : true,
        "name" : "policy001",
        "operation_definition" : {
          "day_backups" : 0,
          "month_backups" : 0,
          "retention_duration_days" : 1,
          "timezone" : "UTC+08:00",
          "week_backups" : 0,
          "year_backups" : 0
        },
        "operation_type" : "backup",
        "trigger" : {
          "properties" : {
            "pattern" : [ "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=14;BYMINUTE=00" ]
          }
        }
      }
    }
  • 创建一个复制策略,周一到周天每天14:00执行复制,保留策略按备份保留时长,保留一天。

    POST https://{endpoint}/v3/f841e01fd2b14e7fa41b6ae7aa6b0594/policies
    
    {
      "policy" : {
        "enabled" : true,
        "name" : "policy002",
        "operation_definition" : {
          "retention_duration_days" : 1,
          "day_backups" : 0,
          "week_backups" : 0,
          "month_backups" : 0,
          "year_backups" : 0,
          "timezone" : "UTC+08:00",
          "destination_region" : "cn-southwest-247",
          "destination_project_id" : "fcf6cb26c3bf4402869792207ad3dce4"
        },
        "operation_type" : "replication",
        "trigger" : {
          "properties" : {
            "pattern" : [ "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=14;BYMINUTE=00" ]
          }
        }
      }
    }
support.huaweicloud.com/api-cbr/CreatePolicy.html