Updated on 2024-01-31 GMT+08:00

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.

  • Pagination is not supported so all stacks will be returned.

  • If no stacks are available, a list of empty value will be returned.

ListStacks returns only the summary information, ListStacksResponseBody returns details, and GetStackMetadata returns detailed metadata of stacks.

URI

GET /v1/{project_id}/stacks

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

A project ID is obtained by calling an API or from the console.

Obtaining a Project ID

Minimum: 3

Maximum: 64

Request Parameters

Table 2 Request header 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

Table 3 Response body parameters

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.

Table 4 Stack

Parameter

Type

Description

stack_name

String

A stack name is unique within its domain (domain_id), region, and project (project_id). It is case-sensitive and starts with a letter. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Minimum: 1

Maximum: 128

description

String

Description of a stack. It can be used by customers to identify their own stacks.

Minimum: 0

Maximum: 1024

stack_id

String

Unique stack ID.

It is a UUID generated by RFS when a stack is created.

Stack names are unique at one specific time, so you can create a stack named HelloWorld and another stack with the same name after deleting the first one.

For parallel development, team members may want to ensure that they are operating the stack they created, not one with the same name created by other members after deleting the previous one.

To avoid this mismatch, check the ID, since RFS ensures each stack has a unique ID that does not change with updates. If the stack_id value differs from the current stack ID, 400 is returned.

Minimum: 36

Maximum: 36

status

String

Status of a stack. * CREATION_COMPLETE indicates an empty stack has been created and no deployment is performed. * DEPLOYMENT_IN_PROGRESS indicates the stack deployment is in progress. * DEPLOYMENT_FAILED indicates the deployment fails. You can obtain the error information summary from status_message. To obtain event details, you can call ListStackEvents. * DEPLOYMENT_COMPLETE indicates the deployment completed. * ROLLBACK_IN_PROGRESS indicates the deployment failed and the rollback is in progress. * ROLLBACK_FAILED indicates the rollback failed. You can obtain the error information summary from status_message. To obtain event details, you can call ListStackEvents. * ROLLBACK_COMPLETE indicates the rollback completed. * DELETION_IN_PROGRESS indicates the deletion is in progress. * DELETION_FAILED indicates the deletion failed. You can obtain the error information summary from status_message. To obtain event details, you can call ListStackEvents.

Enumeration values:

  • CREATION_COMPLETE

  • DEPLOYMENT_IN_PROGRESS

  • DEPLOYMENT_FAILED

  • DEPLOYMENT_COMPLETE

  • ROLLBACK_IN_PROGRESS

  • ROLLBACK_FAILED

  • ROLLBACK_COMPLETE

  • DELETION_IN_PROGRESS

  • DELETION_FAILED

create_time

String

Creation time of a stack. The format complies with the RFC 3339 format (YYYY-MM-DDTHH:MM:SSZ), for example, 1970-01-01T00:00:00Z.

update_time

String

Update time of a stack (applied to the metadata update and deployment scenarios). The format complies with the RFC 3339 format (YYYY-MM-DDTHH:MM:SSZ), for example, 1970-01-01T00:00:00Z.

status_message

String

If a stack is in a failure state (ending with FAILED), a brief error information summary is displayed for debugging.

Status code: 400

Table 5 Response body parameters

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.

Status code: 401

Table 6 Response body parameters

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.

Status code: 403

Table 7 Response body parameters

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.

Status code: 429

Table 8 Response body parameters

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.

Status code: 500

Table 9 Response body parameters

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.

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"
  } ]
}

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.