
# 查询备份策略
#### 功能介绍
查询租户的所有备份策略。
#### URI
- URI格式 GET /v2/{project_id}/backuppolicy
  
- 参数说明
  
  | 参数         | 是否必选 | 描述   |
  |:---|:---|:---|
  | project_id | 是    | 项目ID |
     
  
 
#### 请求
无
#### 响应
- 要素说明
  
  | 参数                              | 参数类型           | 描述                                                                                                                                                                                                                                                                                        |
  |:---|:---|:---|
  | backup_policies                 | list\<dict\>   | 备份策略详情集合。                                                                                                                                                                                                                                                                                 |
  | backup_policy_name              | string         | 备份策略名称。                                                                                                                                                                                                                                                                                   |
  | scheduled_policy                | dict           | 调度策略详情。                                                                                                                                                                                                                                                                                   |
  | start_time                      | string         | 备份开始时间，UTC时间（整点），多个整点间以逗号分隔。                                                                                                                                                                                                                                                              |
  | frequency                       | integer        | 备份间隔（1-14天）。                                                                                                                                                                                                                                                                              |
  | week_frequency                  | list\<string\> | 周信息列表。                                                                                                                                                                                                                                                                                    |
  | rentention_num                  | integer        | 备份保留个数，取值为2-14的整型。                                                                                                                                                                                                                                                                        |
  | rentention_day                  | integer        | 备份保留的天数。取值为2-99999的整型，如果输入的是浮点数，则会在发送请求的时候自动向下取整转化为整型。                                                                                                                                                                                                                                    |
  | remain_first_backup_of_curMonth | string         | 是否保留当月的第一个备份。 - Y  - N   |
  | status                          | string         | 策略状态：启用或停用。 - ON  - OFF   |
  | backup_policy_id                | string         | 备份策略ID。                                                                                                                                                                                                                                                                                   |
  | policy_resource_count           | integer        | 策略上绑定的卷的数量。                                                                                                                                                                                                                                                                               |
  | message                         | string         | 出现错误时，返回的错误消息。                                                                                                                                                                                                                                                                            |
  | code                            | string         | 出现错误时，返回的错误码。 错误码的具体含义请参考[错误码](https://support.huaweicloud.com/api-vbs/zh-cn_topic_0022472083.html)。                                                                                                                                             |
  | time_zone                       | string         | 调度时间的时区。                                                                                                                                                                                                                                                                                  |
     
  
- 响应样例
  ```
  {
      "backup_policies" : [
      {
          "backup_policy_id" : "XX",
          "backup_policy_name": "plan01",
          "scheduled_policy" : {
              "remain_first_backup_of_curMonth" : "Y",
              "rentention_num" : 10,
              "frequency" : 1,
              "start_time" : "12:00",
              "status" : "ON"
          },
          "policy_resource_count": 0
      },
      {
          "backup_policy_id" : "YY",
          "backup_policy_name ": "plan02",
          "scheduled_policy" : {
              "remain_first_backup_of_curMonth" : "Y",
              "rentention_num" : 10,
              "frequency" : 1,
              "start_time" : "14:00",
              "status" : "ON"
          },
          "policy_resource_count": 10
      }]
  }
  ```
  或
  ```
  {
      "error": {
          "code": "XXXX",
          "message": "XXX"
      }
  }
  ```
  
 
#### 状态码
- 正常 200
  
- 异常
  
  | 状态码                               | 说明                           |
  |:---|:---|
  | 400 Bad Request                   | 服务器未能处理请求。                   |
  | 401 Unauthorized                  | 被请求的页面需要用户名和密码。              |
  | 403 Forbidden                     | 对被请求页面的访问被禁止。                |
  | 404 Not Found                     | 服务器无法找到被请求的页面。               |
  | 405 Method Not Allowed            | 请求中指定的方法不被允许。                |
  | 406 Not Acceptable                | 服务器生成的响应无法被客户端所接受。           |
  | 407 Proxy Authentication Required | 用户必须首先使用代理服务器进行验证，这样请求才会被处理。 |
  | 408 Request Timeout               | 请求超出了服务器的等待时间。               |
  | 409 Conflict                      | 由于冲突，请求无法被完成。                |
  | 500 Internal Server Error         | 请求未完成。服务异常。                  |
  | 501 Not Implemented               | 请求未完成。服务器不支持所请求的功能。          |
  | 502 Bad Gateway                   | 请求未完成。服务器从上游服务器收到一个无效的响应。    |
  | 503 Service Unavailable           | 请求未完成。系统暂时异常。                |
  | 504 Gateway Timeout               | 网关超时。                        |
     
  
 
#### 错误码
请参考[错误码](https://support.huaweicloud.com/api-vbs/zh-cn_topic_0022472083.html)。
