更新时间:2023-05-19 GMT+08:00
分享

查询堆栈元素列表

功能介绍

用于查询堆栈元素列表。

URI

GET /v2/stacks/{stack_id}/elements

表1 参数说明

参数

是否必选

描述

stack_id

堆栈id,长度[1, 64]。

element_type

堆栈元素类型:Application(应用)、SoftwareComponent(软件组件)、Service(服务)、AppGroup(应用组)、Port(端口)、Cluster(集群)、Volume(卷)等。其他的类型也可以是在模板中定义的类型。此处输入只需要满足长度在[1, 64]之间即可。

请求消息

N/A。

响应消息

  • 响应参数

    响应参数是一个堆栈元素结构列表或者返回消息结构。

    • 查询成功时返回堆栈元素结构列表。
    • 查询失败时返回失败消息结构。

    返回失败消息结构如表5所示。

    表2 响应参数

    参数

    参数类型

    描述

    [数组元素]

    Array of objects

    数组每个元素表示堆栈某一个元素的详细信息,详情请参见表3

    表3 堆栈元素详细信息

    参数

    参数类型

    描述

    id

    String

    元素的名称

    description

    String

    元素的描述

    properties

    Object

    元素的属性,与模板内容相对应。

    runtime_properties

    Object

    元素运行时属性

    relationships

    Object

    元素的关系,详情请参见表4

    stack_id

    String

    元素所属的堆栈的guid

    type

    String

    元素的类型

    create_at

    String

    元素创建时间

    update_at

    String

    元素更新时间

    type_hierarchy

    String

    堆栈元素类型

    charge_mode

    String

    元素的计费模式

    min_duration

    Integer

    生命周期最小持续时间

    max_duration

    Integer

    生命周期最大持续时间

    deletion_policy

    String

    元素的删除策略

    action_status

    Object

    堆栈元素当前的状态,详情请参见表5

    表4 Stack Nodes Relationship结构

    参数

    参数类型

    描述

    name

    String

    关系的名称

    type

    String

    关系的类型

    target_id

    String

    关系的目标节点名字

    type_hierarchy

    Array of strings

    关系的继承结构

    properties

    Object

    关系的属性,内含一个名为connection_type类型为String的key,表示关系的连接类型。

    表5 action_status字段数据结构说明

    参数

    参数类型

    描述

    subActionName

    String

    元素子操作的名字

    phase

    String

    堆栈的执行状态,有执行成功、执行中、执行挂起、执行取消、执行取消中、执行强制取消中、执行挂起中、执行重试中、执行运行中等,详情请参见表10

    createAt

    String

    以RFC3339格式表示的信息创建的UTC时间戳

    updateAt

    String

    以RFC3339格式表示的信息更新的UTC时间戳

  • 响应示例
    [
        {
            "id": "subnet",
            "stack_id": "a067769b-c1bb-11ea-8a77-0255ac1003d8",
            "relationships": [
                {
                    "name": "vpcId",
                    "type": "HuaweiCloud.Relationships.ContainedIn",
                    "type_hierarchy": [
                        "HuaweiCloud.Relationships.Root",
                        "HuaweiCloud.Relationships.DependsOn",
                        "HuaweiCloud.Relationships.ContainedIn"
                    ],
                    "properties": {},
                    "target_id": "vpc"
                }
            ],
            "type_hierarchy": [
                "HuaweiCloud.Node.Root",
                "HuaweiCloud.VPC.Subnet"
            ],
            "properties": {
                "cidr": "192.168.1.0/24",
                "dhcpEnable": true,
                "gateway": "192.168.1.1",
                "name": "dfsdf",
                "vpcId": {
                    "get_attribute": [
                        "vpc",
                        "refID"
                    ]
                }
            },
            "type": "HuaweiCloud.VPC.Subnet",
            "runtime_properties": {
                "neutron_network_id": "940bb729-260c-44fe-ab40-e98367865530",
                "neutron_subnet_id": "dc893222-ab37-4358-b162-3316c97c4958",
                "refID": "940bb729-260c-44fe-ab40-e98367865530",
                "refName": "dfsdf",
                "vpcId": "f78881f0-2944-44d4-9325-966f5f30369e"
            },
            "action_status": {
                "subActionName": "create",
                "phase": "Succeeded",
                "updateAt": "2020-07-09T08:10:26.830795Z",
                "createAt": "2020-07-09T08:10:22.270746Z"
            },
            "create_at": "2020-07-09T08:10:18Z",
            "update_at": "2020-07-09T08:10:18Z"
        },
        {
            "id": "vpc",
            "stack_id": "a067769b-c1bb-11ea-8a77-0255ac1003d8",
            "relationships": [],
            "type_hierarchy": [
                "HuaweiCloud.Node.Root",
                "HuaweiCloud.VPC.VPC"
            ],
            "properties": {
                "cidr": "192.168.0.0/16",
                "name": "sdfs"
            },
            "type": "HuaweiCloud.VPC.VPC",
            "runtime_properties": {
                "refID": "f78881f0-2944-44d4-9325-966f5f30369e",
                "refName": "sdfs"
            },
            "action_status": {
                "subActionName": "create",
                "phase": "Succeeded",
                "updateAt": "2020-07-09T08:10:22.270648Z",
                "createAt": "2020-07-09T08:10:18.278579Z"
            },
            "create_at": "2020-07-09T08:10:18Z",
            "update_at": "2020-07-09T08:10:18Z"
        }
    ]

状态码

  • 正常
    表6 状态码

    状态码

    描述

    200

    查询堆栈元素列表成功

  • 异常
    表7 状态码

    状态码

    描述

    404

    请求堆栈不存在

    500

    服务器遇到了一个未曾预料的状况,导致无法完成对请求的处理。

分享:

    相关文档

    相关产品