文档首页 > > API参考> API> 查询堆栈执行记录列表

查询堆栈执行记录列表

分享
更新时间: 2019/08/26 14:54

功能介绍

用于查询堆栈最近的执行记录列表

URI

GET /v2/stacks/{stack_id}/actions

表1 参数说明

参数

是否必选

描述

stack_id

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

请求消息

  • 请求参数
    表2 请求参数

    参数

    是否必选

    参数类型

    描述

    last

    Boolean

    是否只返回最后一条执行记录。不填写默认为false。

    true: 只返回最近一条执行记录

    false: 返回最新10条执行记录

响应消息

  • 响应参数

    响应参数是一个堆栈执行记录列表或者失败消息结构。

    • 查询成功时返回堆栈执行记录列表。
    • 查询失败时返回失败消息结构。

    其中,执行记录结构如表2所示, 返回失败消息结构如表5所示。

  • 响应示例
    [
        {
            "apiVersion": "paas/v1alpha1",
            "kind": "Execution",
            "metadata": {
                "annotations": {
                    "aos.security.io/account": "******",
                    "aosmeta.cluster.id": "9c34840a-d8c2-11e7-ba71-0255ac101306",
                    "aosmeta.cluster.name": "aos",
                    "aosmeta.description": "",
                    "aosmeta.domain.id": "e00222f923fa4806be2df93191e83880",
                    "aosmeta.force": "false",
                    "aosmeta.labels": "",
                    "aosmeta.namespace": "default",
                    "aosmeta.project.id": "b17be51d45d74323bc39eb60315ba0df",
                    "aosmeta.signature": "1",
                    "aosmeta.template.id": "39368a8a-7743-c58b-e663-f3f9e80049eb",
                    "aosmeta.template.name": "tosca-hello",
                    "aosmeta.template.version": "nginx",
                    "cluster-id": "9c34840a-d8c2-11e7-ba71-0255ac101306",
                    "cluster-version": "v1.5.0-r000000",
                    "namespace": "default",
                    "paas-iam.alpha.kubernetes.io/domain-id": "e00222f923fa4806be2df93191e83880",
                    "stack.kubernetes.io/revision": "2"
                },
                "creationTimestamp": "2018-01-30T13:41:00Z",
                "labels": {
                    "execution-hash": "1686326958",
                    "stackname": "aos-nginx"
                },
                "name": "aos-nginx-1686326958",
                "namespace": "b17be51d45d74323bc39eb60315ba0df",
                "resourceVersion": "29574440",
                "selfLink": "/apis/paas/v1alpha1/namespaces/b17be51d45d74323bc39eb60315ba0df/executions/aos-nginx-1686326958",
                "uid": "357f52cf-05c3-11e8-9daa-0255ac1006d2"
            },
            "spec": {
                "actionName": "scale",
                "disableStrategy": "Cancel",
                "location": "172.16.6.229",
                "metadata": {
                    "creationTimestamp": null,
                    "labels": {
                        "execution-hash": "1686326958",
                        "stackname": "aos-nginx"
                    },
                    "namespace": "b17be51d45d74323bc39eb60315ba0df"
                },
                "objectData": "******",
                "objectReference": {
                    "APIVersion": "",
                    "FieldPath": "",
                    "Kind": "",
                    "Name": "aos-nginx",
                    "Namespace": "b17be51d45d74323bc39eb60315ba0df",
                    "ResourceVersion": "",
                    "UID": "7b22745e-05c2-11e8-b90c-0255ac100ece"
                },
                "onFailureStrategy": "DoNothing",
                "source": "User",
                "timeoutInMinutes": 5
            },
            "status": {
                "actionName": "scale",
                "objectStatus": {
                    "phase": "Succeeded",
                    "updateAt": "2018-01-30T13:41:13.997416Z"
                },
                "progress": 100,
                "subObjectStatuses": {
                    "nginx-app": {
                        "phase": "Succeeded",
                        "subActionName": "scale",
                        "updateAt": "2018-01-30T13:41:13.289541Z"
                    }
                }
            }
        },
        {
            "apiVersion": "paas/v1alpha1",
            "kind": "Execution",
            "metadata": {
                "annotations": {
                    "aos.security.io/account": "******",
                    "aosmeta.cluster.id": "9c34840a-d8c2-11e7-ba71-0255ac101306",
                    "aosmeta.cluster.name": "aos",
                    "aosmeta.description": "",
                    "aosmeta.domain.id": "e00222f923fa4806be2df93191e83880",
                    "aosmeta.force": "false",
                    "aosmeta.labels": "",
                    "aosmeta.namespace": "default",
                    "aosmeta.project.id": "b17be51d45d74323bc39eb60315ba0df",
                    "aosmeta.signature": "1",
                    "aosmeta.template.id": "39368a8a-7743-c58b-e663-f3f9e80049eb",
                    "aosmeta.template.name": "tosca-hello",
                    "aosmeta.template.version": "nginx",
                    "cluster-id": "9c34840a-d8c2-11e7-ba71-0255ac101306",
                    "cluster-version": "v1.5.0-r000000",
                    "namespace": "default",
                    "paas-iam.alpha.kubernetes.io/domain-id": "e00222f923fa4806be2df93191e83880",
                    "stack.kubernetes.io/revision": "1"
                },
                "creationTimestamp": "2018-01-30T13:38:11Z",
                "labels": {
                    "execution-hash": "2513653053",
                    "stackname": "aos-nginx"
                },
                "name": "aos-nginx-2513653053",
                "namespace": "b17be51d45d74323bc39eb60315ba0df",
                "resourceVersion": "29574154",
                "selfLink": "/apis/paas/v1alpha1/namespaces/b17be51d45d74323bc39eb60315ba0df/executions/aos-nginx-2513653053",
                "uid": "d0d17824-05c2-11e8-9daa-0255ac1006d2"
            },
            "spec": {
                "actionName": "create",
                "disableStrategy": "Cancel",
                "location": "172.16.6.229",
                "metadata": {
                    "creationTimestamp": null,
                    "labels": {
                        "execution-hash": "2513653053",
                        "stackname": "aos-nginx"
                    },
                    "namespace": "b17be51d45d74323bc39eb60315ba0df"
                },
                "objectData": "******",
                "objectReference": {
                    "APIVersion": "",
                    "FieldPath": "",
                    "Kind": "",
                    "Name": "aos-nginx",
                    "Namespace": "b17be51d45d74323bc39eb60315ba0df",
                    "ResourceVersion": "",
                    "UID": "7b22745e-05c2-11e8-b90c-0255ac100ece"
                },
                "onFailureStrategy": "DoNothing",
                "source": "User",
                "timeoutInMinutes": 60
            },
            "status": {
                "actionName": "create",
                "objectStatus": {
                    "phase": "Succeeded",
                    "updateAt": "2018-01-30T13:38:25.137462Z"
                },
                "progress": 100,
                "subObjectStatuses": {
                    "nginx-app": {
                        "phase": "Succeeded",
                        "subActionName": "create",
                        "updateAt": "2018-01-30T13:38:25.033433Z"
                    },
                    "nginx-container": {
                        "phase": "Succeeded",
                        "subActionName": "create",
                        "updateAt": "2018-01-30T13:38:12.162796Z"
                    }
                }
            }
        }
    ]

状态码

  • 正常
    表3 状态码

    状态码

    描述

    200

    查询堆栈输入信息成功

  • 异常
    表4 状态码

    状态码

    描述

    400

    请求参数错误

    404

    堆栈不存在

    500

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

分享:

    相关文档

    相关产品

文档是否有解决您的问题?

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

反馈提交失败,请稍后再试!

*必选

请至少选择或填写一项反馈信息

字符长度不能超过200

提交反馈 取消

如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨

跳转到云社区