开发者社区> 问答> 正文

如何获取Vault列表



描述


此操作会列出该用户拥有的全部Vault信息。
默认情况下,此操作返回的列表中最多会有10个Vault,列表按Vault ID升序排列。用户应始终检查返回体中的Marker字段,该字段可以在新的请求中作为获取下一个列表的起点;如果Marker为””(空串),则表示列表已全部获取完成。用户还可以通过设置limit参数来限制每次请求返回的Vault数量,但是limit不能超过10,如果超过10,按10处理。

请求参数




请求头部


无,其他公共请求头部参见2.4.1

请求体




返回头部


无,其他公共返回头部参见2.4.2

返回体

  • Marker

下一次列表请求的起始标记,空串(””)表示无后续的列表
  • VaultList

Vault元数据数组,以下是元数据的字段
  • CreationDate

Vault的创建时间
  • LastInventoryDate

归档存储对该Vault最近的一次检索缓存时间
  • NumberOfArchives

最近一次检索时Vault的Archive数
  • SizeInBytes

最近一次检索时Vault的Archive大小总和
  • VaultId

Vault 的 ID
  • VaultName

Vault 的名称

示例


请求示例 GET /vaults HTTP/1.1
Host: cn-hangzhou.oas.aliyuncs.com
Date: Tue, 25 Mar 2014 12:00:00 GMT
x-oas-version: 2014-01-01
Authorization: [SignatureValue]


返回示例 HTTP/1.1 200 OK
x-oas-request-id: [RequestId]
Date: Tue, 25 Mar 2014 12:00:00 GMT
Content-Type: application/json
Content-Length: 497
{
    "Marker": "",
    "VaultList":
    [{
        "CreationDate": "Tue, 18 Mar 2014 22:06:47 GMT",
        "LastInventoryDate": "Tue, 18 Mar 2014 12:00:00 GMT",
        "NumberOfArchives": 2,
        "SizeInBytes": 12334,
        "VaultId": "79D2D8F33B7C287037286185863B6823",
        "VaultName": "myvault1"
    },
    {
       "CreationDate": "Tue, 18 Mar 2014 22:06:47 GMT ",
        "LastInventoryDate": "Tue, 18 Mar 2014 12:00:00 GMT",
        "NumberOfArchives": 0,
        "SizeInBytes": 0,
        "VaultId": "ADD2D8F33B7C287037286185863B68D3",
        "VaultName": "myvault2"
    },
    {
       "CreationDate": "Tue, 18 Mar 2014 22:06:47 GMT ",
        "LastInventoryDate": "Tue, 18 Mar 2014 12:00:00 GMT",
        "NumberOfArchives": 0,
        "SizeInBytes": 0,
        "VaultId": "FDD2D8F33B7C287037286185863B68D3",
        "VaultName": "myvault3"
    }]
}


带limit的请求示例 GET /vaults?limit=2 HTTP/1.1
Host: cn-hangzhou.oas.aliyuncs.com
Date: Tue, 25 Mar 2014 12:00:00 GMT
x-oas-version: 2014-01-01
Authorization: [SignatureValue]


返回示例 HTTP/1.1 200 OK
x-oas-request-id: [RequestId]
Date: Tue, 25 Mar 2014 12:00:00 GMT
Content-Type: application/json
Content-Length: 497
{
    "Marker": "FDD2D8F33B7C287037286185863B68D3",
    "VaultList":
    [{
        "CreationDate": "Tue, 18 Mar 2014 22:06:47 GMT",
        "LastInventoryDate": "Tue, 18 Mar 2014 12:00:00 GMT",
        "NumberOfArchives": 2,
        "SizeInBytes": 12334,
        "VaultId": "79D2D8F33B7C287037286185863B6823",
        "VaultName": "myvault1"
    },
    {
        "CreationDate": "Tue, 18 Mar 2014 22:06:47 GMT",
        "LastInventoryDate": "Tue, 18 Mar 2014 12:00:00 GMT",
        "NumberOfArchives": 0,
        "SizeInBytes": 0,
        "VaultId": "ADD2D8F33B7C287037286185863B68D3",
        "VaultName": "myvault2"
    }]
}


带limit和marker的请求示例 GET /vaults?limit=2&marker=FDD2D8F33B7C287037286185863B68D3
HTTP/1.1
Host: cn-hangzhou.oas.aliyuncs.com
Date: Tue, 25 Mar 2014 12:00:00 GMT
x-oas-version: 2014-01-01
Authorization: [SignatureValue]


返回示例 HTTP/1.1 200 OK
x-oas-request-id: [RequestId]
Date: Tue, 25 Mar 2014 12:00:00 GMT
Content-Type: application/json
Content-Length: 497
{
    "Marker": "",
    "VaultList":
    [{
        "CreationDate": "Tue, 18 Mar 2014 22:06:47 GMT",
        "LastInventoryDate": "Tue, 18 Mar 2014 12:00:00 GMT",
        "NumberOfArchives": 0,
        "SizeInBytes": 0,
        "VaultId": "FDD2D8F33B7C287037286185863B68D3",
        "VaultName": "myvault3"
    }]
}

展开
收起
云栖大讲堂 2017-10-26 14:01:50 2095 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载

相关实验场景

更多