本文在介紹使用describecommands查詢已經創建的云助手命令的基礎上,重點探討了其具體步驟,本文內容緊湊,希望大家可以有所收獲。
DescribeCommands
請求參數
返回參數
數據集類型 CommandSetType
命令類型 CommandType
示例
請求示例
https://ecs.aliyuncs.com/?Action=DescribeCommands &RegionId=cn-hangzhou &
正常返回示例
xml 格式
<describecommandsresponse> ????<totalcount>5</totalcount> ????<commands> ????????<command> ????????????????<name>Test</name> ????????????????<workingdir></workingdir> ????????????????<commandcontent>ZWNobyAxMjM=</commandcontent> ????????????????<timeout>3600</timeout> ????????????????<type>RunShellScript</type> ????????????????<commandid>c-7d2a745b412b4601b2d47f6a768d3a14</commandid> ????????????????<description>test</description> ????????</command> ????????<command> ????????????????<name>Test1</name> ????????????????<workingdir></workingdir> ????????????????<commandcontent>Y2QgL3Jvb3Q=</commandcontent> ????????????????<timeout>3600</timeout> ????????????????<type>RunShellScript</type> ????????????????<commandid>c-7d2a745b412b4601b2d47f6a768d3a15</commandid> ????????????????<description>test1</description> ????????</command> ????????<command> ????????????????<name>Test2</name> ????????????????<workingdir></workingdir> ????????????????<commandcontent>eXVtIHVwZGF0ZQ==</commandcontent> ????????????????<timeout>3600</timeout> ????????????????<type>RunShellScript</type> ????????????????<commandid>c-7d2a745b412b4601b2d47f6a768d3a16</commandid> ????????????????<description>test2</description> ????????</command> ????????<command> ????????????????<name>Test3</name> ????????????????<workingdir></workingdir> ????????????????<commandcontent>c2VydmljZSBuZ2lueCByZWxvYWQ=</commandcontent> ????????????????<timeout>3600</timeout> ????????????????<type>RunShellScript</type> ????????????????<commandid>c-7d2a745b412b4601b2d47f6a768d3a17</commandid> ????????????????<description>test3</description> ????????</command> ????????<command> ????????????????<name>Test4</name> ????????????????<workingdir></workingdir> ????????????????<commandcontent>bHM=</commandcontent> ????????????????<timeout>120</timeout> ????????????????<type>RunShellScript</type> ????????????????<commandid>c-7d2a745b412b4601b2d47f6a768d3a18</commandid> ????????????????<description>test4</description> ????????</command> ????<pagenumber>1</pagenumber> ????<requestid>E69EF3CC-94CD-42E7-8926-F133B86387C0</requestid> ????<pagesize>10</pagesize></commands></describecommandsresponse>
json 格式
{ ????"TotalCount":?5, ????"Commands":?{ ????????"Command":?[ ????????????{ ????????????????"Name":?"Test", ????????????????"WorkingDir":?"", ????????????????"CommandContent":?"ZWNobyAxMjM=", ????????????????"Timeout":?3600, ????????????????"Type":?"RunShellScript", ????????????????"CommandId":?"c-7d2a745b412b4601b2d47f6a768d3a14", ????????????????"Description":?"test" ????????????}, ????????????{ ????????????????"Name":?"Test1", ????????????????"WorkingDir":?"", ????????????????"CommandContent":?"Y2QgL3Jvb3Q=", ????????????????"Timeout":?3600, ????????????????"Type":?"RunShellScript", ????????????????"CommandId":?"c-7d2a745b412b4601b2d47f6a768d3a15", ????????????????"Description":?"test1" ????????????}, ????????????{ ????????????????"Name":?"Test2", ????????????????"WorkingDir":?"", ????????????????"CommandContent":?"eXVtIHVwZGF0ZQ==", ????????????????"Timeout":?3600, ????????????????"Type":?"RunShellScript", ????????????????"CommandId":?"c-7d2a745b412b4601b2d47f6a768d3a16", ????????????????"Description":?"test2" ????????????}, ????????????{ ????????????????"Name":?"Test3", ????????????????"WorkingDir":?"", ????????????????"CommandContent":?"c2VydmljZSBuZ2lueCByZWxvYWQ=", ????????????????"Timeout":?3600, ????????????????"Type":?"RunShellScript", ????????????????"CommandId":?"c-7d2a745b412b4601b2d47f6a768d3a17", ????????????????"Description":?"test3" ????????????}, ????????????{ ????????????????"Name":?"Test4", ????????????????"WorkingDir":?"", ????????????????"CommandContent":?"bHM=", ????????????????"Timeout":?3600, ????????????????"Type":?"RunShellScript", ????????????????"CommandId":?"c-7d2a745b412b4601b2d47f6a768d3a18", ????????????????"Description":?"test4" ????????????}, ????????] ????}, ????"PageNumber":?1, ????"RequestId":?"E69EF3CC-94CD-42E7-8926-F133B86387C0", ????"PageSize":?10 }
異常返回示例
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 錯誤中心。
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END