本文在介绍如何查询一台ECS实例中的云助手命令执行列表及状态的基础上,重点探讨了其具体步骤,本文内容紧凑,希望大家可以有所收获。
DescribeInvocations
请求参数
返回参数
命令执行记录集类型 InvocationSetType
命令执行类型 InvocationType
执行目标实例集类型 InvokeInstanceSetType
目标实例执行状态类型 InvokeInstanceType
示例
请求示例
https://ecs.aliyuncs.com/?Action=DescribeInvocations &RegionId=cn-hangzhou &<公共请求参数>
正常返回示例
XML 格式
<DescribeInvocationsResponse> <TotalCount>2</TotalCount> <PageNumber>1</PageNumber> <PageSize>10</PageSize> <Invocations> <Invocation> <InvokeStatus>Running</InvokeStatus> <InvokeId>t-7d2a745b412b4601b2d47f6a768d3b53</InvokeId> <CommandName>Test1</CommandName> <CommandType>RunShellScript</CommandType> <Frequency>0 */20 * * * *</Frequency> <InvokeInstances> <InvokeInstance> <InstanceId>i-uf614fhehhzmx</InstanceId> <InstanceInvokeStatus>Finished</InstanceInvokeStatus> </InvokeInstance> <InvokeInstance> <InstanceId>i-uf614fhehhzmy</InstanceId> <InstanceInvokeStatus>Running</InstanceInvokeStatus> </InvokeInstance> </InvokeInstances> <Timed>True</Timed> <CommandId>c-7d2a745b412b4601b2d47f6a768d3a14</CommandId> </Invocation> <Invocation> <InvokeStatus>Finished</InvokeStatus> <InvokeId>t-7d2a745b412b4601b2d47f6a768d3b55</InvokeId> <CommandName>Test3</CommandName> <CommandType>RunShellScript</CommandType> <Frequency> </Frequency> <InvokeInstances> <InvokeInstance> <InstanceId>i-uf614fhehhzmx</InstanceId> <InstanceInvokeStatus>Finished</InstanceInvokeStatus> </InvokeInstance> <InvokeInstance> <InstanceId>i-uf64isakb713x</InstanceId> <InstanceInvokeStatus>Finished</InstanceInvokeStatus> </InvokeInstance> </InvokeInstances> <Timed>False</Timed> <CommandId>c-7d2a745b412b4601b2d47f6a768d3a16</CommandId> </Invocation> </Invocations> <RequestId>E69EF3CC-94CD-42E7-8926-F133B86387C0</RequestId> </DescribeInvocationsResponse>
JSON 格式
{ "TotalCount": 2, "PageNumber": 1, "PageSize": 10, "Invocations": { "Invocation": [ { "InvokeStatus": "Running", "InvokeId": "t-7d2a745b412b4601b2d47f6a768d3b53", "CommandName": "Test1", "CommandType": "RunShellScript", "Frequency": "0 */20 * * * *", "InvokeInstances": { "InvokeInstance": [ { "InstanceId": "i-uf614fhehhzmx", "InstanceInvokeStatus": "Finished" }, { "InstanceId": "i-uf64isakb713x", "InstanceInvokeStatus": "Running" } ] }, "Timed": true, "CommandId": "c-7d2a745b412b4601b2d47f6a768d3a14" }, { "InvokeStatus": "Finished", "InvokeId": ">t-7d2a745b412b4601b2d47f6a768d3b55", "CommandName": "Test3", "CommandType": "RunShellScript", "InvokeInstances": { "InvokeInstance": [ { "InstanceId": "i-uf614fhehhzmx", "InstanceInvokeStatus": "Finished" }, { "InstanceId": "i-uf64isakb713x", "InstanceInvokeStatus": "Finished" } ] }, "Timed": false, "CommandId": "c-7d2a745b412b4601b2d47f6a768d3a16" } ] }, "RequestId": "E69EF3CC-94CD-42E7-8926-F133B86387C0" }
异常返回示例
XML 格式
<Error> <RequestId>E69EF3CC-94CD-42E7-8926-F133B86387C0</RequestId> <HostId>ecs.aliyuncs.com</HostId> <Code>MissingParameter.RegionId</Code> <Message>The input parameter “RegionId” that is mandatory for processing this request is not supplied.</Message> </Error>
JSON 格式
{ "RequestId": "E69EF3CC-94CD-42E7-8926-F133B86387C0", "HostId": "ecs.aliyuncs.com" "Code": "MissingParameter.RegionId" "Message": "The input parameter “RegionId” that is mandatory for processing this request is not supplied." }
错误码
以下为本接口特有的错误码。更多错误码,请访问 API 错误中心。
以上是如何查询一台ECS实例中的云助手命令执行列表及状态的详细内容。更多信息请关注PHP中文网其他相关文章!