CommandId、InstanceId、ResourceGroupId などのパラメーターを指定して、1 つ以上の ECS インスタンスでクラウドアシスタントコマンドを実行します。
操作説明
操作の説明。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:InvokeCommand |
update |
*Command。
*Instance。
|
|
なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| RegionId |
string |
必須 |
リージョン ID。 DescribeRegions を呼び出して最新のリージョンリストをクエリできます。 |
cn-hangzhou |
| ResourceGroupId |
string |
任意 |
コマンド実行のリソースグループ ID。このパラメーターを指定した場合: |
rg-bp67acfmxazb4p**** |
| CommandId |
string |
必須 |
コマンド ID。 DescribeCommands を呼び出して、利用可能なすべてのコマンド ID をクエリできます。 |
c-e996287206324975b5fbe1d**** |
| RepeatMode |
string |
任意 |
コマンドの実行モード。有効な値: |
Once |
| Timed |
boolean |
任意 |
[非推奨] このパラメーターは非推奨です。このパラメーターを指定しても効果はありません。 |
true |
| Frequency |
string |
任意 |
コマンドが実行されるスケジュール。3 種類のスケジュール実行がサポートされています: 固定間隔での実行 (Rate 式ベース)、指定時刻での 1 回限りの実行、および時計ベースのスケジュール実行 (Cron 式ベース)。 |
0 */20 * * * ? |
| Parameters |
object |
任意 |
カスタムパラメーター特徴が有効になっているコマンドを実行する際に渡すカスタムパラメーターのキーと値のペア。カスタムパラメーターの数は 0 から 10 の範囲です。 |
{"name":"Jack", "accessKey":"LTAI************"} |
| Username |
string |
任意 |
ECS インスタンスでコマンドを実行するために使用されるユーザー名。長さは 255 文字を超えることはできません。 |
test |
| WindowsPasswordName |
string |
任意 |
Windows インスタンスでコマンドを実行するユーザーのパスワードの名前。長さは 255 文字を超えることはできません。 |
axtSecretPassword |
| InstanceId |
array |
任意 |
コマンドを実行するインスタンスのリスト。最大 100 個のインスタンス ID を指定できます。N の有効な値: 1〜100。 |
i-bp185dy2o3o6n**** |
|
string |
任意 |
コマンドを実行するインスタンスの ID。 |
i-bp185dy2o3o6n**** |
|
| ContainerId |
string |
任意 |
コンテナ ID。64 ビットの 16 進数文字列のみがサポートされています。 |
ab141ddfbacfe02d9dbc25966ed971536124527097398d419a6746873fea**** |
| ContainerName |
string |
任意 |
コンテナ名。 |
テストコンテナ |
| Timeout |
integer |
任意 |
コマンド実行のタイムアウト期間。単位: 秒。 |
60 |
| Tag |
array<object> |
任意 |
タグ。 |
|
|
object |
任意 |
タグ。 |
||
| Value |
string |
任意 |
コマンド実行のタグ値。N の有効な値: 1〜20。値は空文字列にできます。 |
TestValue |
| Key |
string |
任意 |
コマンド実行のタグキー。N の有効な値: 1〜20。タグキーは一度指定すると空文字列にすることはできません。 |
TestKey |
| ClientToken |
string |
任意 |
リクエストのべき等性を確保するために使用されるクライアントトークン。クライアントを使用してトークンを生成できますが、異なるリクエスト間でトークンが一意であることを確認してください。ClientToken 値には ASCII 文字のみを含めることができ、長さは 64 文字を超えることはできません。詳細については、「べき等性を確保する方法」をご参照ください。 |
123e4567-e89b-12d3-a456-42665544**** |
| ResourceTag |
array<object> |
任意 |
インスタンスをフィルター処理するために使用されるタグ。InstanceId を指定せずに、同じタグを持つインスタンスでバッチ的にコマンドを実行できます。 |
|
|
object |
任意 |
インスタンスをフィルター処理するために使用されるタグ。InstanceId を指定せずに、同じタグを持つインスタンスでバッチ的にコマンドを実行できます。 |
||
| Value |
string |
任意 |
インスタンスをフィルター処理するために使用されるタグ値。 |
TestValue |
| Key |
string |
任意 |
インスタンスをフィルター処理するために使用されるタグキー。 |
TestKey |
| TerminationMode |
string |
任意 |
タスクを停止するモード (手動停止またはタイムアウトによる中断)。有効な値: |
ProcessTree |
| Launcher |
string |
任意 |
スクリプト実行のブートストラッププログラム。長さは 1 KB を超えることはできません。 |
python3 -u {{ACS::ScriptFileName|Ext(".py")}} |
| WorkingDir |
string |
任意 |
ECS インスタンスでコマンドが実行されるディレクトリ。長さは 200 文字を超えることはできません。 |
/home/user |
| OssOutputDelivery |
string |
任意 |
コマンド実行出力の OSS 配信構成。 |
oss://testBucket/testPrefix |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| InvokeId |
string |
コマンド実行 ID。 |
t-7d2a745b412b4601b2d47f6a768d**** |
| RequestId |
string |
リクエスト ID |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
例
成功レスポンス
JSONJSON
{
"InvokeId": "t-7d2a745b412b4601b2d47f6a768d****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | ResourceBusy.SlrCreation | The ServiceLinkedRole is still being created or has not taken effect yet. Please try again later. | |
| 400 | RegionId.ApiNotSupported | The api is not supported in this region. | 現在のリージョンではこの API はサポートされていません。 |
| 400 | InvalidParameter.WorkingDir | The specified parameter WorkingDir is not valid. | 指定された WorkingDir パラメーターが無効です。 |
| 400 | MissingParam.InstanceId | The parameter instanceId is missing or empty. | インスタンス ID が空です。 |
| 400 | InvalidContainerId.Malformed | The specified parameter ContainerId is not valid. | 指定されたコンテナ ID が無効です。 |
| 400 | InvalidContainerName.Malformed | The specified parameter ContainerName is not valid. | 指定されたコンテナ名が無効です。 |
| 400 | InvalidClientToken.Malformed | The specified parameter clientToken is not valid. | 指定された ClientToken パラメーターが形式要件を満たしていません。パラメーターには ASCII 文字のみを含める必要があり、長さは 64 文字を超えることはできません。 |
| 400 | InvalidInstance.NotMatch | The specified instance type does not match the command. | |
| 400 | MissingParam.Frequency | The frequency must be specified when you create a timed task. | |
| 400 | InvalidParam.Frequency | The specified frequency is invalid. | |
| 400 | Parameter.MissingValue | The parameter value of this command is required. | |
| 400 | Parameter.Disabled | Parameters cannot be passed in when the command customization function is disabled. | |
| 400 | InvalidParameter.Parameters | The specified parameter Parameters is not valid. | 指定された Parameters パラメーターが無効です。 |
| 400 | NumberExceed.ResourceTags | The maximum number of ResourceTags is exceeded. | |
| 400 | MissingParameter.ResourceTagKey | You must specify ResourceTag.N.Key. | |
| 400 | InvalidResourceTagKey.Malformed | The specified ResourceTag key is not valid. | |
| 400 | InvalidResourceTagValue.Malformed | The specified ResourceTag value is not valid. | |
| 400 | Duplicate.ResourceTagKey | The ResourceTag contains duplicate keys. | |
| 400 | InvalidResourceTag.InstanceNotFound | InstanceIds are not found by the specified ResourceTag. | |
| 400 | InvalidResourceTag.ConflictWithInstanceIds | The specified param ResourceTag conflicts with InstanceId. | |
| 400 | InvalidOssOutputDelivery.BucketInOtherRegion | The OSS bucket specified in the parameter OssOutputDelivery is in another region. | OssOutputDelivery パラメーターに指定された OSS バケットが異なるリージョンにあります。 |
| 400 | InvalidParameter.OssOutputDelivery | The specified parameter OssOutputDelivery is not valid. | 指定された OssOutputDelivery パラメーターが無効です。 |
| 400 | InvalidOssOutputDelivery.KeyPrefixMalformed | The prefix of the OSS key specified in the parameter OssOutputDelivery is not valid. | OssOutputDelivery パラメーターに指定されたプレフィックスが無効です。 |
| 500 | InternalError.Dispatch | An error occurred when you dispatched the request. | リクエストの送信中にエラーが発生しました。後でもう一度お試しください。 |
| 403 | InvalidOssOutputDelivery.BucketAccessDenied | The error message returned by the OSS API is: %s | |
| 403 | InstanceIds.ExceedLimit | The number of instance IDs exceeds the upper limit. | ターゲットインスタンスの数が上限を超えています。 |
| 403 | Invocation.ExceedQuota | The invocation quota in the current region has been reached for today. | 現在のリージョンにおけるコマンドを実行する操作の数が、本日のクォータに達しました。 |
| 403 | ParameterCount.ExceedLimit | The maximum number of parameters is exceeded. | カスタムパラメーターの数が上限を超えています。 |
| 403 | ParameterKey.ExceedLimit | The maximum length of a parameter name is exceeded. | 指定されたパラメーターのキー長が許容される最大値を超えています。 |
| 403 | CmdContent.ExceedLimit | The maximum length of a command is exceeded. | コマンド内容の長さが上限を超えています。 |
| 403 | ParameterKey.Duplicate | Parameter names cannot be duplicated. | パラメーター名を重複させることはできません。パラメーター名を確認して、再試行してください。 |
| 403 | Parameter.NotMatched | The passed-in parameters do not match the parameters defined when you created the command. | 渡されたカスタムパラメーターが、コマンド作成時に定義されたカスタムパラメーターと一致しません。 |
| 403 | ParameterType.NotSupported | The type of parameter value is not supported. | |
| 403 | Username.ExceedLimit | The length of the username exceeds the upper limit. | ユーザー名の長さが上限を超えています。 |
| 403 | WindowsPasswordName.ExceedLimit | The length of the WindowsPasswordName exceeds the upper limit. | 指定された WindowsPasswordName パラメーターの長さが上限を超えています。 |
| 403 | WindowsPasswordName.Missed | WindowsPasswordName must be specified when you create a Windows task. | リクエストパラメーター WindowsPasswordName の値が指定されていません。 |
| 403 | ParameterStore.NotSupported | Parameter Store is not supported in this region. | |
| 403 | TemporaryAccessKey.Error | The temporary accessKey is invalid. | |
| 403 | ParameterStore.InvalidParameters | The parameter is invalid in Parameter Store. | コマンド内容で {{oos:?}} によって指定されたパラメーターが見つかりませんでした。 |
| 403 | ParameterStore.NoPermission | You have no access to Parameter Store. | |
| 403 | Operation.Forbidden | The operation is not permitted. | 現在の RAM ユーザーには、この操作を実行する権限がありません。 |
| 403 | IdempotentParameterMismatch | The specified parameter has changed while using an already used clientToken. | 指定されたクライアントトークンはすでに使用されています。 |
| 403 | IdempotentProcessing | The previous idempotent request(s) is still processing. | 以前の冪等リクエストはまだ処理中です。後でもう一度お試しください。 |
| 403 | InvalidLauncher.LengthLimitExceeded | The length of the parameter Launcher exceeds the limit of 1 KB characters. | Launcher パラメーターの長さが 1 KB 文字の上限を超えています。 |
| 403 | InvalidParameterCharset.Parameters | The parameter Parameters contains illegal charset. | コマンドパラメーターに無効な文字セットが含まれています。 |
| 403 | CreateServiceLinkedRole.NoPermission | You do not have permission to create ServiceLinkedRole for output delivery. | 出力配信機能のサービスリンクロールを作成する権限がありません。 |
| 403 | InvalidTimeout.ExceedLimit | The specified parameter Timeout exceeds the upper limit. | |
| 404 | InvalidRepeatMode.NotFound | The specified repeat mode does not exist. | 指定されたコマンド実行メソッドが存在しません。 |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | リージョン情報が無効です。 |
| 404 | InvalidInstance.NotFound | The specified instance does not exist. | 指定されたインスタンスが存在しません。 |
| 404 | InvalidCmdId.NotFound | The specified command ID does not exist. | 指定された CommandId パラメーターが無効です。パラメーター値が正しいかどうかを確認してください。DescribeCommands 操作を呼び出して、利用可能なすべての CommandId 値をクエリできます。 |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | 対応するリソースグループが見つかりません。 |
| 404 | InvalidTerminationMode.NotFound | The specified parameter TerminationMode does not exist. | 指定されたパラメーター TerminationMode が存在しません。 |
| 404 | InvalidOssOutputDelivery.BucketNotFound | The OSS bucket specified in the parameter OssOutputDelivery does not exist. | OssOutputDelivery パラメーターに指定されたバケットが存在しません。 |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。