更新时间:2023-08-17 17:36:33
GetService接口用于获取用户的所有空间。此操作需要IAM wos:GetGetService权限
GET / HTTP/1.1
Host: Bucket.Endpoint
Date: Date
Authorization: Authorization
该请求消息中不带请求参数。
使用公共请求头部。
无请求主体。
HTTP/1.1 StatusCode
x-wos-request-id: RequestId
Date: Date
Content-Type: type
Content-Length: length
Server: WS-web-server
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListAllMyBucketsResult xmlns="https://www.wangsu.com/document">
<Owner>
<ID>id</ID>
<DisplayName>name</DisplayName>
</Owner>
<Buckets>
<Bucket>
<Name>bucketName</Name>
<CreationDate>date</CreationDate>
</Bucket>
...
</Buckets>
</ListAllMyBucketsResult>
使用公共响应头部。
该请求的响应消息中,会以XML形式将用户拥有的空间列出来,元素的具体含义如下表所示。
元素名称 | 描述 |
---|---|
ListAllMyBucketsResult | 用户的空间列表。 类型:XML。 |
Owner | 用户信息,包含用户Id和用户名。 类型:XML。 |
ID | 用户的DomainId。 类型:字符串。 |
DisplayName | 用户名。 类型:字符串。 |
Buckets | 用户所拥有的空间列表。 类型:XML。 |
Bucket | 具体的空间信息。 类型:XML。 |
Name | 空间名称。 类型:字符串。 |
CreationDate | 空间的创建时间。 类型:字符串。 |
GET / HTTP/1.1
Host: s3-cn-south-1.wcsapi.com
Date: Wed, 04 Nov 2020 03:09:24 GMT
Authorization: WOS-HMAC-SHA256 BF6C09F302931425E9A7:tQ+A280jUgPCAdSTuUis35T9gWI=
HTTP/1.1 200 OK
x-wos-request-id: 9D3CC717E561E4D37A1285489689346
Content-Type: application/xml
Date: Sun, 26 Sep 2010 08:28:06 GMT
Content-Length: 485
Server: WS-web-server
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListAllMyBucketsResult xmlns="http://wcs.chinanetcenter.com/document">
<Owner>
<ID>bcaf1ffd86f41caff1a493dc2ad8c2c281e37522a640e161ca5fb16fd081034f</ID>
<DisplayName>user01</DisplayName>
</Owner>
<Buckets>
<Bucket>
<Name>bucket01</Name>
<CreationDate>2010-09-26T03:10:23.211Z</CreationDate>
</Bucket>
<Bucket>
<Name>bucket02</Name>
<CreationDate>2010-09-20T12:05:46.187Z</CreationDate>
</Bucket>
<Bucket>
<Name>bucket03</Name>
<CreationDate>2010-09-26T08:25:13.059Z</CreationDate>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>