调用ListServiceVersions接口获取版本列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
GET /services/{serviceName}/versions
请求参数
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
serviceName | String | Path | 是 | service_name | 服务的名称。 |
limit | Integer | Query | 否 | 20 | 限定此次返回资源的数量。如果不设定,默认返回20,最大不能超过100。返回结果可以小于指定的数量,但不会多于指定的数量。 |
nextToken | String | Query | 否 | nextservice | 用来返回更多结果。第一次查询不需要提供这个参数,后续查询的Token从返回结果中获取。 |
startKey | String | Query | 否 | nextservice | 设定结果从startKey之后(包括startKey)按版本号排序的第一个开始返回。 |
direction | String | Query | 否 | BACKWARD | 限定返回的版本排序方向。
|
返回数据
名称 | 类型 | 示例值 | 描述 |
direction | String | BACKWARD | 返回的版本排序方向。
|
nextToken | String | null | 用来返回更多结果。 说明 如果这个值没有返回,则说明没有更多结果。 |
versions | Array | 版本列表。 |
|
createdTime | String | 2020-03-16T06:23:50Z | 服务版本的创建时间。 |
description | String | test_description | 服务的版本描述。 |
lastModifiedTime | String | 2020-07-15T06:12:31Z | 服务的版本上一次被更新的时间。 |
versionId | String | 1 | 服务的版本号。 |
示例
请求示例
GET /2016-08-15/services/service_name/versions HTTP/1.1
公共请求头
正常返回示例
JSON
格式
HTTP/1.1 200 OK
公共响应头
{
"versions": [
{
"versionId": "4",
"description": "test_description",
"createdTime": "2020-07-15T06:13:25Z",
"lastModifiedTime": "2020-07-15T06:13:25Z"
},
{
"versionId": "3",
"description": "test_description",
"createdTime": "2020-07-15T06:12:31Z",
"lastModifiedTime": "2020-07-15T06:12:31Z"
},
{
"versionId": "2",
"description": "test_description",
"createdTime": "2020-03-16T06:23:50Z",
"lastModifiedTime": "2020-03-16T06:23:50Z"
}
],
"nextToken": null,
"direction": "BACKWARD"
}
错误码
访问错误中心查看更多错误码。
该文章对您有帮助吗?