Listing Stacks
Function
ListStacks
This API lists all stacks in current region.
-
Stacks are sorted by creation time in descending order so that the stack created latest is displayed at the front.
-
If no stacks are available, a list of empty value will be returned.
-
Support pagination. If there is next_marker in the response, more output is available than is included in the current response. Use this value in the marker request parameter in a subsequent call to get the next part of the outputs. You should repeat this until the next_marker response is set to null.
ListStacks returns only the summary information, ListStacksResponseBody returns details, and GetStackMetadata returns detailed metadata of stacks.
URI
GET /v1/{project_id}/stacks
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | A project ID is obtained by calling an API or from the console. Minimum: 3 Maximum: 64 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| marker | No | String | Pagination marker. When a single page cannot return all results, the previous request will return a next_marker to indicate there are more pages. Users can place the value of next_marker here to query information from the next page. This marker can only be used for requests with the same parameters as the previous request. If not specified, the query will start from the first page by default. Minimum: 1 Maximum: 512 |
| limit | No | Integer | The maximum number of results to return per page. Minimum: 10 Maximum: 1000 Default: 1000 |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Client-Request-Id | Yes | String | A unique request ID is specified by a user to locate a request. UUID is recommended. Minimum: 36 Maximum: 128 |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| stacks | Array of Stack objects | Stack list. Stacks are sorted by creation time in descending order. The one created latest is displayed on the top. |
| page_info | PageInfo object | Pagination information |
| Parameter | Type | Description |
|---|---|---|
| next_marker | String | Forward pagination identifier. Marker for the next set of results. If present, more output is available than is included in the current response. Use this value in the marker request parameter in a subsequent call to get the next part of the outputs. You should repeat this until the next_marker response is set to null. |
| previous_marker | String | Backward pagination identifier. |
| current_count | Integer | The number of items returned on current page. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. |
| error_msg | String | Response message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. |
| error_msg | String | Response message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. |
| error_msg | String | Response message. |
Status code: 429
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. |
| error_msg | String | Response message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Response code. Minimum: 11 Maximum: 11 |
| error_msg | String | Response message. |
| encoded_authorization_message | String | The message contains information about unauthorized requests. |
| details | Array of Detail objects | Detailed error messages returned by service when permission is denied. |
Example Requests
List stacks.
GET https://{endpoint}/v1/ba2b9930c977f71edaeaa3a5e96a8ff1/stacks Example Responses
Status code: 200
Stacks listed.
{
"stacks" : [ {
"stack_name" : "my_second_stack",
"description" : "my second stack",
"stack_id" : "4d4f4ece-b291-4c71-8083-bec9b8a44de0",
"status" : "DEPLOYMENT_COMPLETE",
"create_time" : "2023-05-17T07:34:22Z",
"update_time" : "2023-05-17T07:34:44Z"
}, {
"stack_name" : "my_first_stack",
"description" : "my second stack",
"stack_id" : "e830c288-ee34-48c0-ba6b-a0e6f6b48d3e",
"status" : "CREATION_COMPLETE",
"create_time" : "2023-05-17T07:34:06Z",
"update_time" : "2023-05-17T07:34:28Z"
} ],
"page_info" : {
"current_count" : 2,
"next_marker" : null,
"previous_marker" : "zxc1oHc08HcCmypYGTsOoRcvoHUvHRUAW5NOSnc1oHc08HcCPZrwP5NOeTlRiukJgtGxeujJeuGwGIihaIUCmypYGTsOtqvKPr2xmH8fPqpGWyQ0axGwGZp9aqvx8pQ7m5FvGTsJiKk7gtNFiuaxetdRCks="
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Stacks listed. |
| 400 | Invalid request. |
| 401 | Authentication failed. |
| 403 | The user does not have the permission to call this API. |
| 429 | Too frequent requests. |
| 500 | Internal server error. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.