Updated on 2022-02-22 GMT+08:00

Querying a Stack Element

Function

This API is used to query a stack element.

URI

GET /v2/stacks/{stack_id}/elements/{node_id}

Table 1 Parameter description

Parameter

Mandatory

Description

stack_id

Yes

Stack ID, which supports a maximum of 64 characters

node_id

Yes

Stack element ID, which supports a maximum of 64 characters

Request

N/A

Response

  • Response parameters

    A response parameter is a stack element structure or response structure.

    • The stack element structure is returned when the query is successful.
    • The response structure is returned when the query fails.

    The stack element structure is shown in Table 2 Response parameters, and the returned response structure is shown in Table 5.

    Table 2 Response parameters

    Parameter

    Type

    Description

    instances

    Array of objects

    Structure of instances. For details, see Table 3. Only application instances are returned in this structure. This field is empty for cloud services.

    id

    String

    Element name.

    description

    String

    Element description.

    properties

    Object

    Element attribute, which corresponds to the template content.

    runtime_properties

    Object

    Element runtime attribute.

    relationships

    Array of objects

    Relationships between elements. For details, see Table 4.

    stack_id

    String

    Stack guid to which the element belongs.

    type

    String

    Element type.

    create_at

    String

    Element creation time.

    update_at

    String

    Element update time.

    type_hierarchy

    String

    Stack element type.

    action_status

    Object

    Status of a stack element. For details, see Table 5.

    Table 3 Data structure of the instances field

    Parameter

    Type

    Description

    items

    Array<Map<String,Map<String,String>>>

    Information about all instances of an element

  • Example response
    {
        "create_at": "2020-07-21T05:45:19Z",
        "description": "",
        "id": "redis-app",
        "properties": {},
        "relationships": [],
        "runtime_properties": {},
        "stack_id": "0404c915-4a0c-260f-e146-eea4b95ee578",
        "type": "Cloud.AOS.Stack",
        "update_at": "2020-07-21T05:45:19Z",
        "instances": {
            "items": []
        }
    }

Status Code

  • Normal
    Table 4 Status code

    Status Code

    Description

    200

    Querying the stack element is successful.

  • Abnormal
    Table 5 Status code

    Status Code

    Description

    404

    The requested stack or element does not exist.

    500

    The server fails to process the request due to an unexpected condition.