更新时间:2022-02-22 GMT+08:00

查询堆栈执行记录列表

功能介绍

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

URI

GET /v2/stacks/{stack_id}/actions{?last}

表1 路径参数说明

参数

是否必选

描述

stack_id

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

表2 查询参数说明

参数

是否必选

参数类型

描述

last

Boolean

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

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

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

请求消息

N/A。

响应消息

  • 响应参数

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

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

    其中,执行记录结构如表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

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