全部產品
Search
文件中心

Elastic Compute Service:ModifyCommand - 修改雲助手命令

更新時間:Apr 04, 2026

調用ModifyCommand修改一條雲助手命令相關參數。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

ecs:ModifyCommand

update

*Command

acs:ecs:{#regionId}:{#accountId}:command/{#commandId}

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

地區 ID。您可以調用 DescribeRegions 查看最新的阿里雲地區列表。

cn-hangzhou

RegionId

string

地區 ID。您可以調用 DescribeRegions 查看最新的阿里雲地區列表。

cn-hangzhou

CommandId

string

命令 ID。您可以通過介面 DescribeCommands 查詢所有可用的 CommandId。

c-hz01272yr52****

Name

string

命令名稱。支援全字元集,長度不得超過 128 個字元。

test-CommandName

Description

string

命令描述。支援全字元集,長度不得超過 512 個字元。

This is description.

CommandContent

string

說明

該參數已廢棄,傳入該參數不會生效。

echo

WorkingDir

string

執行路徑。長度不得超過 200 個字元。

/home/

Timeout

integer

您建立的命令在 ECS 執行個體中執行時最大的逾時時間,單位為秒。當無法在配置的時間內運行並完成您建立的命令時,會出現逾時現象。逾時後,會強制終止命令進程,即取消命令的 PID。

120

Launcher

string

指令碼執行的引導程式。長度不能超過 1 KB。

python3 -u {{ACS::ScriptFileName|Ext(".py")}}

返回參數

名稱

類型

描述

樣本值

object

RequestId

string

請求 ID。

0DE9B41E-EF0D-40A0-BB43-37749C5BDA9C

樣本

正常返回樣本

JSON格式

{
  "RequestId": "0DE9B41E-EF0D-40A0-BB43-37749C5BDA9C"
}

異常返回樣本

JSON格式

{
    "RequestId":"E69EF3CC-94CD-42E7-8926-F133B86387C0",
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 RegionId.ApiNotSupported The api is not supported in this region. 指定地區下不支援調用 API。請檢查 RegionId 參數取值是否正確。
400 InvalidParameter.WorkingDir The specified parameter WorkingDir is not valid. 指定的參數WorkingDir不合法。
500 InternalError.Dispatch An error occurred when you dispatched the request. 發送請求時發生錯誤,請稍後重試。
403 CmdName.Readonly The command name is readonly after publishing. 命令已經發布,禁止修改。
403 CmdName.ExceedLimit The length of the command name exceeds the upper limit. 命令名稱長度超過上限。
403 CmdContent.ExceedLimit The length of the command content exceeds the upper limit. 命令內容長度超過上限。
403 CmdDesc.ExceedLimit The length of the command description exceeds the upperlimit. 命令描述長度超過上限。
403 Operation.Forbidden The operation is not permitted. 該操作是不被允許的。
403 InvalidParameterCharacter.CommandName The command Name contains illegal characters. 命令名稱包含非法字元。
403 InvalidParameterCharacter.CommandDescription The command Description contains illegal characters. 命令描述包含非法字元。
403 InvalidParameterCharacter.CommandWorkingDir The command WorkingDir contains illegal characters. 命令執行路徑包含非法字元。
403 InvalidLauncher.LengthLimitExceeded The length of the parameter Launcher exceeds the limit of 1 KB characters. 參數Launcher的長度超過了 1 KB個字元的限制。
403 InvalidTimeout.ExceedLimit The specified parameter Timeout exceeds the upper limit.
404 InvalidRegionId.NotFound The RegionId provided does not exist in our records. 地區資訊錯誤
404 InvalidCmdId.NotFound The specified command ID does not exist. 指定的 CommandId 參數有誤,請檢查參數值是否正確。您可以通過介面 DescribeCommands 查詢所有可用的 CommandId。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情