首页  >  文章  >  运维  >  如何查询一台ECS实例中的云助手命令执行列表及状态

如何查询一台ECS实例中的云助手命令执行列表及状态

坏嘻嘻
坏嘻嘻原创
2018-09-27 14:36:242281浏览

本文在介绍如何查询一台ECS实例中的云助手命令执行列表及状态的基础上,重点探讨了其具体步骤,本文内容紧凑,希望大家可以有所收获。

DescribeInvocations

请求参数

微信截图_20180927143144.png

微信截图_20180927143159.png

返回参数

微信截图_20180927143206.png

命令执行记录集类型 InvocationSetType

微信截图_20180927143215.png

命令执行类型 InvocationType

微信截图_20180927143221.png

执行目标实例集类型 InvokeInstanceSetType

微信截图_20180927143240.png

目标实例执行状态类型 InvokeInstanceType

微信截图_20180927143247.png

示例

请求示例

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 错误中心。

微信截图_20180927143302.png

以上是如何查询一台ECS实例中的云助手命令执行列表及状态的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn