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

Querying a Stack Execution Record List

Function

This API is used to query the latest execution record list of a stack.

URI

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

Table 1 Path parameter description

Parameter

Mandatory

Description

stack_id

Yes

Stack ID, which supports a maximum of 64 characters

Table 2 Query parameters

Parameter

Mandatory

Type

Description

last

No

Boolean

Whether to return only the last execution record. If this parameter is left blank, the default value false is used.

true: Only the latest execution record is returned.

false: The latest 10 execution records are returned.

Request

N/A

Response

  • Response parameters

    The response parameter is a stack execution record list or failure response structure.

    • The stack execution record list is returned when the query is successful.
    • The failure response structure is returned when the query fails.

    The execution record structure is shown in Table 2, and the failure response structure is shown in Table 5.

  • Example response
    [
        {
            "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"
                    }
                }
            }
        }
    ]

Status Code

  • Normal
    Table 3 Status code

    Status Code

    Description

    200

    Querying the stack input information is successful.

  • Abnormal
    Table 4 Status code

    Status Code

    Description

    400

    The request parameter is incorrect.

    404

    The stack does not exist.

    500

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