
# 查询备份共享
#### 功能介绍
根据条件查询备份共享的详细信息。
#### URI
- URI 格式 GET /v2/{project_id}/os-vendor-backup-sharing/detail
  
- 参数说明
  
  | 参数         | 是否必选 | 描述                                                                                                                                  |
  |:---|:---|:---|
  | project_id | 是    | 项目ID。 获取项目ID方法请参考 [获取项目ID](https://support.huaweicloud.com/api-vbs/zh-cn_topic_0136271365.html) |
     
  

- Request filter参数说明
  
  | 参数                 | 是否必选 | 参数类型    | 描述                                                                                                                                               |
  |:---|:---|:---|:---|
  | share_to_me        | 否    | boolean | 当该参数设置为true时，该接口会查询其它项目共享给当前项目的备份信息，否则会查询当前项目共享出去的备份信息。                                                                                          |
  | volume_id          | 否    | string  | 指定磁盘ID。                                                                                                                                          |
  | name               | 否    | string  | 指定源备份的名称，支持模糊查询。                                                                                                                                 |
  | status             | 否    | string  | 指定源备份的状态。                                                                                                                                        |
  | backup_id          | 否    | string  | 指定源备份的ID。                                                                                                                                        |
  | from_project_id    | 否    | string  | 指定共享的项目ID。                                                                                                                                       |
  | to_project_id      | 否    | string  | 指定被共享的项目ID。                                                                                                                                      |
  | avalilability_zone | 否    | string  | 指定可用区的名称。                                                                                                                                        |
  | sort_dir           | 否    | string  | 指定排序方向。                                                                                                                                          |
  | sort_key           | 否    | string  | 指定排序属性，支持按 **name** 、**status** 、**container_format** 、**disk_format、** **size** , **id、** **created_at** 、**updated_at** 过滤，默认值是**created_at。** |
  | limit              | 否    | int     | 指定需要查询的个数。                                                                                                                                       |
  | offset             | 否    | int     | 指定查询的偏移量。                                                                                                                                        |
     
  
 
#### 请求
无
#### 响应
- 要素说明
  
  | 参数                   | 参数类型         | 描述                                     |
  |:---|:---|:---|
  | shared               | list\<dict\> | 备份共享信息列表。                              |
  | backup_id            | string       | 源备份ID。                                 |
  | created_at           | string       | 备份共享的创建时间。                             |
  | from_project_id      | string       | 共享的项目ID。                               |
  | id                   | string       | 备份共享ID。                                |
  | to_project_id        | string       | 被共享的项目ID。                              |
  | updated_at           | string       | 备份共享的更新时间。                             |
  | backup               | dict         | 源备份的详细信息。                              |
  | availability_zone    | string       | 备份所在的可用分区。                             |
  | container            | string       | 备份所在的容器。                               |
  | created_at           | string       | 备份创建的时间。                               |
  | data_timestamp       | string       | 当前时间。                                  |
  | description          | string       | 备份描述。                                  |
  | fail_reason          | string       | 备份失败的原因。                               |
  | has_dependent_backup | boolean      | 是否有依赖的备份，VBS默认首次全量备份，后续增量备份，故该参数无实际作用。 |
  | id                   | string       | 备份ID。                                  |
  | is_incremental       | boolean      | 是否是增量备份，VBS默认首次全量备份，后续增量备份，故该参数无实际作用。  |
  | name                 | string       | 备份名称。                                  |
  | object_count         | int          | 磁盘数据在对象存储上对应的对象数量。                     |
  | size                 | int          | 备份大小。                                  |
  | snapshot_id          | string       | 关联的快照ID。                               |
  | status               | string       | 备份状态。                                  |
  | updated_at           | string       | 更新时间。                                  |
  | volume_id            | string       | 备份源磁盘ID。                               |
  | service_metadata     | string       | 备份的元数据。                                |
     
  

- 响应样例
  ```
  {
      "shared": [
          {
              "backup": {
                  "availability_zone": "AZ1",
                  "container": null,
                  "created_at": "2017-08-08T04:03:27.456859",
                  "data_timestamp": "2017-08-08T04:03:27.456859",
                  "description": null,
                  "fail_reason": "Invalid InitiatorConnector protocol specified DSWARE",
                  "has_dependent_backups": null,
                  "id": "066b1e37-9305-4057-97e5-2e99b21fc71d",
                  "is_incremental": null,
                  "name": "lbf",
                  "object_count": null,
                  "size": 1,
                  "snapshot_id": null,
                  "status": "available",
                  "updated_at": "2017-08-08T04:03:35.109308",
                  "volume_id": "a7d7783f-02b7-4645-b0e3-61df63f0ba10",
                  "service_metadata": null
              },
              "backup_id": "066b1e37-9305-4057-97e5-2e99b21fc71d",
              "created_at": "2017-08-10T12:25:40.480424",
              "from_project_id": "c13f5220dc1949b0b741ea81a7cd5554",
              "id": "e842bf23-1e05-4c2c-b0f9-25222f4686da",
              "to_project_id": "722513ed0a324dadaabe5b2d0fe848b9",
              "updated_at": "2017-08-14T06:41:49.381069"
          },
          {
              "backup": {
                  "availability_zone": "AZ1",
                  "container": null,
                  "created_at": "2017-08-08T04:03:27.456859",
                  "data_timestamp": "2017-08-08T04:03:27.456859",
                  "description": null,
                  "fail_reason": "Invalid InitiatorConnector protocol specified DSWARE",
                  "has_dependent_backups": null,
                  "id": "066b1e37-9305-4057-97e5-2e99b21fc71d",
                  "is_incremental": null,
                  "name": "lbf",
                  "object_count": null,
                  "size": 1,
                  "snapshot_id": null,
                  "status": "available",
                  "updated_at": "2017-08-08T04:03:35.109308",
                  "volume_id": "a7d7783f-02b7-4645-b0e3-61df63f0ba10",
                  "service_metadata": null
              },
              "backup_id": "066b1e37-9305-4057-97e5-2e99b21fc71d",
              "created_at": "2017-08-10T12:19:37.318031",
              "from_project_id": "c13f5220dc1949b0b741ea81a7cd5554",
              "id": "f842bf23-1e05-4c2c-b0f9-25222f4686da",
              "to_project_id": "722513ed0a324dadaabe5b2d0fe848a9",
              "updated_at": null
          }
      ]
  }
  ```
  
 
#### 状态码
- 正常 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)。
