Updated on 2023-11-15 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 message.

  • 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.

    charge_mode

    String

    Element billing mode

    min_duration

    Integer

    Minimum lifecycle duration

    max_duration

    Integer

    Maximum lifecycle duration

    deletion_policy

    String

    Element deletion policy

    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": "2016-12-21T05:45:19Z",
        "description": "",
        "id": "redis-app",
        "properties": {},
        "relationships": [],
        "runtime_properties": {},
        "stack_id": "0404c915-4a0c-260f-e146-eea4b95ee578",
        "type": "HuaweiCloud.AOS.StatelessApplication",
        "update_at": "2016-12-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.