Querying the Execution Record of a Stack
Function
This API is used to query a stack execution record.
URI
GET /v2/stacks/{stack_id}/actions/{action_id}
Parameter |
Mandatory |
Value Range |
Description |
---|---|---|---|
stack_id |
Yes |
String |
Stack ID. The value must be 1 to 64 characters long. |
action_id |
Yes |
String |
Name of the execution record. The value must be 1 to 64 characters long. |
Request
N/A
Response
- Response parameters
For the description about response parameters, see Table 2.
Table 2 Response parameters Parameter
Type
Description
metadata
Object
Execution metadata. For details, see Table 3.
spec
Object
Execution attributes. For details, see Table 4.
status
Object
Execution status. For details, see Table 7.
Table 3 Execution Metadata structure Parameter
Type
Description
name
String
Execution name, which is parsed as action_id when the lifecycle operation is executed.
labels
String
Execution label, which is the same as that of the stack during creation. An additional execution-hash field is added.
namespace
String
Project ID of the stack, which is the same as the namespace field of the stack.
annotations
Map<String,String>
Special attributes of a stack. Currently, there are three fields.
- paas-iam.alpha.kubernetes.io/domain-id: consistent with the top-level domain_id field
- namespace: consistent with the top-level namespace field
- cluster-id: consistent with the top-level cluster_id field
resourceVersion
String
Resource version.
selfLink
String
API address for accessing the resource.
uid
String
Stack resource ID, which is the same as the top-level guid field.
Table 4 Structure of Execution Spec Parameter
Type
Description
actionName
String
Lifecycle name of the execution.
changedObjectData
String
Node attribute modified by the execution, which is Base64-encoded.
disableStrategy
String
Perform the operation disabling policy.
location
String
Location of the specified Execution executor.
metadata
Object
Metadata of K8SStackSpec. For details, see Table 5.
objectData
String
Node attribute during execution operation, that is, Base64-encoded template instantiation data.
objectReference
Object
The objectReference parameter of ExecutionSpec. For details, see Table 6.
onFailureStrategy
String
Timeout retry logic of the execution.
source
String
Action source. The options are System and User.
subObjectNames
String
Name of the to-be-executed object specified by the execution. If this parameter is not blank, the lifecycle of the specified object is executed. If this parameter is blank, the lifecycle of all objects is executed.
timeoutInMinutes
Integer
Timeout time of the execution.
Table 5 Execution Spec Metadata structure Parameter
Type
Description
labels
Object
Execution label, which is the same as stack.spec.selector.matchlabels during creation.
Each internal key-value structure indicates a label with key as the name and value as the value.
namespace
String
The value of this parameter is the same as that of the stack namespace.
Other fields provided by K8S
-
-
Table 6 Execution Spec ObjectReference structure Parameter
Type
Description
kind
Object
Consistent with kind of the stack.
namespace
String
Consistent with namespace of the stack.
uid
String
Consistent with uid of the stack.
Table 7 Stack Status ExecutionStatus structure Parameter
Type
Description
actionName
String
Operation name. The value can be create, delete, upgrade, rollback, reconfig, or retry.
progress
Integer
Execution progress.
objectStatus
Object
Overall execution progress of the operation. For details, see Table 8.
subObjectStatuses
Object
Execution progress of an operation sub-step. Each key-value pair indicates the execution progress of the node corresponding to the key. The value is shown in Table 9.
Table 8 Stack Status ExecutionStatus ActionStatus structure Parameter
Type
Description
phase
String
Execution status of an operation step.
message
String
Detailed error information.
reason
String
Brief error description in the CamelCase format.
updateAt
String
UTC timestamp of the information update in the RFC3339 format.
Table 9 Stack Status ExecutionStatus SubActionStatus structure Parameter
Type
Description
phase
String
Execution status of an operation step.
message
String
Detailed error information.
reason
String
Brief error description in the CamelCase format.
updateAt
String
UTC timestamp of the information update in the RFC3339 format.
subActionName
String
Name of an element suboperation.
createAt
String
UTC timestamp of the information creation in the RFC3339 format.
- Example response
{ "metadata": { "name": "trim-4074942376", "namespace": "aos", "selfLink": "/apis/paas/v1alpha1/namespaces/aos/executions/trim-4074942376", "uid": "ccb8fec5-cc70-11e6-8448-0242ac001004", "resourceVersion": "48180", "creationTimestamp": "2016-12-27T20:12:32Z", "labels": { "execution-hash": "4074942376", "stackname": "trim" }, "annotations": { "paas-iam.alpha.kubernetes.io/domain-id": "ea816a0cc3204ee09efb6d585bee4c58", "stack.kubernetes.io/revision": "1" }, "enable": true }, "spec": { "metadata": { "namespace": "aos", "creationTimestamp": null, "labels": { "execution-hash": "4074942376", "stackname": "trim" }, "enable": true }, "objectReference": { "namespace": "aos", "name": "trim", "uid": "cb2cdea0-cc70-11e6-8448-0242ac001004" }, "actionName": "create", "timeoutInMinutes": 60, "onFailureStrategy": "DoNothing", "disableStrategy": "Cancel", "source": "User", "objectData": "*****", "location": "172.16.0.0" }, "status": { "actionName": "create", "progress": 100, "objectStatus": { "phase": "Succeeded", "updateAt": "2016-12-27T20:12:47Z" }, "subObjectStatuses": { "hello-app": { "phase": "Succeeded", "updateAt": "2016-12-27T20:12:33Z" }, "hello-component": { "phase": "Succeeded", "updateAt": "2016-12-27T20:12:47Z" }, "hello-package": { "phase": "Succeeded", "updateAt": "2016-12-27T20:12:34Z" } } } }
Status Code
- Normal
Table 10 Status code Status Code
Description
200
Querying the execution record is successful.
- Abnormal
Table 11 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.