Updated on 2023-11-15 GMT+08:00

Querying a Stack Output

Function

This API is used to query a stack output.

URI

GET /v2/stacks/{stack_id}/outputs

Table 1 Parameter description

Parameter

Mandatory

Description

stack_id

Yes

Stack ID, which has a length of 1 to 64 characters

Request

N/A

Response

  • Response parameters
    Table 2 Response parameters

    Parameter

    Type

    Description

    outputs

    Object

    Stack output information. For each key-value pair, the key indicates the output's name. The value indicates a description. The structure of the description is shown in Table 3.

    Table 3 Output parameters

    Parameter

    Type

    Description

    value

    String

    Output value, which is generated based on the internal definition of the template and the runtime attribute of the stack

    description

    String

    Output description

    When the value of the output is defined in the template as get_attribute: [app, ips], the value returned when the output is queried is the character string array of the IP address.

  • Example response
    {
        "outputs": {
            "address_ip": {
                "value": [
                    "10.175.11.126"
                ],
                "description": "ip of mysql-instance"
            },
            "address_port": {
                "value": "32138",
                "description": "port of mysql-instance"
            },
            "paasword": {
                "value": "root",
                "description": "paasword of mysql-instance"
            },
            "user_name": {
                "value": "root",
                "description": "user_name of mysql-instance"
            }
        }
    }

Status Code

  • Normal
    Table 4 Status Code

    Status Code

    Description

    200

    Querying the stack output is successful.

  • Abnormal
    Table 5 Status code

    Status Code

    Description

    404

    The stack does not exist.

    500

    The server encountered an unexpected condition which prevented it from fulfilling the request.