クラウドアシスタントの定期コマンドタスクの実行情報を変更します。これには、コマンドの内容や実行頻度の変更、Elastic Compute Service (ECS) インスタンスや Alibaba Cloud マネージドインスタンスのコマンドタスクへの追加が含まれます。
操作説明
- 次の実行モード (DescribeInvocations によって返される
RepeatModePeriod:定期的に実行します。
NextRebootOnly:次回インスタンス起動時にコマンドを自動実行します。
EveryReboot:インスタンスが起動するたびにコマンドを自動実行します。
- 次のステータス (DescribeInvocations によって返される
InvocationStatusPending:システムがコマンドを検証または送信中です。少なくとも 1 つのインスタンスのコマンド実行ステータスが Pending の場合、全体の実行ステータスは Pending になります。
Running:コマンドがインスタンスで実行中です。少なくとも 1 つのインスタンスのコマンド実行ステータスが Running の場合、全体の実行ステータスは Running になります。
Scheduled:定期コマンドが送信され、実行を待機しています。少なくとも 1 つのインスタンスのコマンド実行ステータスが Scheduled の場合、全体の実行ステータスは Scheduled になります。
Stopping:タスクが停止中です。少なくとも 1 つのインスタンスのコマンド実行ステータスが Stopping の場合、全体の実行ステータスは Stopping になります。
- 定期タスク (コマンド内容、カスタムパラメーター、実行頻度を含む) の実行情報を変更する前に、関連する ECS インスタンスまたはマネージドインスタンスのクラウドアシスタントエージェントのバージョンが、次のバージョンより新しい必要があります:
Linux:2.2.3.541
Windows:2.1.3.541
応答でエラーコード
InvalidOperation.CloudAssistantVersionUnsupportedが返された場合は、クラウドアシスタントエージェントを最新バージョンに更新してください。
クラウドアシスタントのパブリックコマンドを実行する場合、
CommandContentは変更できません。CommandContentを変更し、InvokeCommand または RunCommand を呼び出す際にKeepCommandをtrueに設定してタスクを作成すると、新しいコマンドが作成されて永続的に保持され、クラウドアシスタントのコマンドクォータを消費します。各リージョンでは、500 から 50,000 のクラウドアシスタントコマンドを保持できます。クォータの引き上げをリクエストできます。クォータの照会と引き上げ方法の詳細については、「クォータ管理」をご参照ください。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:ModifyInvocationAttribute |
update |
*Invocation
Instance
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| RegionId |
string |
必須 |
リージョン ID。 |
cn-hangzhou |
| InstanceId |
array |
任意 |
定期コマンドタスクに追加する ECS インスタンスまたはマネージドインスタンスの ID。 |
|
|
string |
任意 |
定期コマンドタスクに追加する ECS インスタンスまたはマネージドインスタンスの ID。ECS インスタンスまたはマネージドインスタンスを追加した後、定期コマンドタスク内のインスタンスの総数は 100 を超えることはできません。 |
i-bp1i7gg30r52z2em**** |
|
| RegionId |
string |
必須 |
リージョン ID。 |
cn-hangzhou |
| InvokeId |
string |
必須 |
コマンドの実行 ID。 |
t-hz0jdfwd9f**** |
| CommandContent |
string |
任意 |
変更後のコマンドの内容。コマンドの内容は、プレーンテキストまたは Base64 エンコード形式にすることができます。次の点にご注意ください:
|
ZWNobyAxMjM= |
| EnableParameter |
boolean |
任意 |
コマンドにカスタムパラメーターを含めるかどうかを指定します。
|
false |
| Parameters |
object |
任意 |
コマンドにカスタムパラメーターが含まれている場合に渡される、カスタムパラメーターのキーと値のペア。 0 から 10 個のカスタムパラメーターを指定できます。次の点にご注意ください:
このパラメーターはデフォルトで空であり、カスタムパラメーターのキーと値のペアを変更しないことを示します。 |
{"name":"Jack", "accessKey":"LTAI*************"} |
| Frequency |
string |
任意 |
コマンドを実行する頻度。このパラメーターは、
|
0 */20 * * * * |
| ContentEncoding |
string |
任意 |
デフォルト値:PlainText。値が無効な場合、PlainText モードが使用されます。 |
PlainText |
| ClientToken |
string |
任意 |
リクエストのべき等性を保証します。クライアントから一意のパラメーター値を生成して、異なるリクエスト間で一意性を保証します。ClientToken は ASCII 文字のみをサポートし、64 文字を超えることはできません。詳細については、「べき等性を確保する方法」をご参照ください。 |
123e4567-e89b-12d3-a456-426655440000 |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| RequestId |
string |
リクエスト ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
| CommandId |
string |
コマンド ID。
|
c-hz01272yr52**** |
例
成功レスポンス
JSONJSON
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"CommandId": "c-hz01272yr52****"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | InvalidParameter.Frequency | The specified parameter Frequency is not valid. | |
| 400 | InvalidParameters.KeyDuplicate | The key in the parameter Parameters cannot be duplicated. | |
| 400 | InvalidParameters.KeyNotMatch | The key in the parameter Parameters do not match those defined when creating the command. | |
| 400 | InvalidParameters.KeyMalformed | The key in the parameter Parameters is not valid. | |
| 400 | InvalidParameters.KeyEmpty | The key in the parameter Parameters cannot be empty. | |
| 400 | InvalidCommandContent.DecodeError | The specified parameter CommandContent can not be Base64 decoded. | |
| 400 | InvalidClientToken.Malformed | The specified parameter clientToken is not valid. | |
| 500 | InternalError | An error occurred when you dispatched the request. | |
| 403 | InvalidInstanceId.OSTypeUnsupported | The OS type of the instance corresponding to the parameter InstanceId does not support the specified command type. | |
| 403 | InvalidOperation.RepeatModeUnsupported | The operation is not supported for current repeat mode of invocation. | |
| 403 | InvalidOperation.InvokeAlreadyFinished | The operation is not supported for finished invocation. | |
| 403 | InvalidOperation.CloudAssistantVersionUnsupported | The operation is not supported for current CloudAssistant version of instance. | |
| 403 | InvalidOperation.ModifyPublicCommandUnsupported | Modification of the content of Public Command is not supported. | |
| 403 | InvalidCommandContent.LengthLimitExceeded | The length of the parameter CommandContent exceeds the limit of %s KB characters. | |
| 403 | Operation.Forbidden | The operation is not permitted. | |
| 403 | InvalidParameters.CountLimitExceeded | The count of the parameter Parameters exceeds the limit of 10. | |
| 403 | InvalidParameters.KeyLengthLimitExceeded | The length of the key in the parameter Parameters exceeds the limit of 64 characters. | |
| 403 | InvalidInstanceId.CountLimitExceeded | The count of the parameter InstanceId exceeds the limit of %s. | |
| 403 | CommandLimitExceeded | The count of command in current region exceeds the limit of %s. | |
| 403 | InvalidParameters.ValueTypeUnsupported | The type of the value in the parameter Parameters is not supported. | |
| 403 | IdempotentParameterMismatch | The specified parameter has changed while using an already used clientToken. | |
| 403 | IdempotentProcessing | The previous idempotent request(s) is still processing. | |
| 404 | InvalidInvokeId.NotFound | The specified parameter InvokeId does not exist. | |
| 404 | InvalidInstanceId.NotFound | The specified parameter InstanceId does not exist. | |
| 404 | InvalidRegionId.NotFound | The specified parameter RegionId does not exist. | |
| 404 | InvalidCommandId.NotFound | The specified CommandId does not exist. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。