Mengubah informasi eksekusi Tugas terjadwal Asisten Cloud, termasuk konten perintah, jadwal, dan penambahan Instans ECS atau Instans terkelola ke tugas.
Deskripsi operasi
- Mendukung pengubahan Tugas dengan mode eksekusi berikut (lihat nilai
RepeatModeyang dikembalikan oleh DescribeInvocations):Periode: Perintah dijalankan secara berkala.
NextRebootOnly: Perintah dijalankan secara otomatis saat Instans ECS dimulai berikutnya.
EveryReboot: Perintah dijalankan secara otomatis setiap kali Instans ECS dimulai.
- Mendukung pengubahan Tugas dalam status berikut (lihat nilai
InvocationStatusyang dikembalikan oleh DescribeInvocations):Pending: Sistem sedang memeriksa atau mengirim perintah. Jika status eksekusi perintah pada setidaknya satu Instans ECS adalah Pending, status eksekusi keseluruhan adalah Pending.
Running: Perintah sedang berjalan pada Instans ECS. Jika status eksekusi perintah pada setidaknya satu Instans ECS adalah Running, status eksekusi keseluruhan adalah Running.
Scheduled: Perintah terjadwal telah dikirim dan menunggu untuk dijalankan. Jika status eksekusi perintah pada setidaknya satu Instans ECS adalah Scheduled, status eksekusi keseluruhan adalah Scheduled.
Stopping: Tugas sedang dihentikan. Jika status eksekusi perintah pada setidaknya satu Instans ECS adalah Stopping, status eksekusi keseluruhan adalah Stopping.
- Sebelum Anda mengubah informasi eksekusi (termasuk konten perintah, parameter kustom, dan frekuensi eksekusi) dari Tugas terjadwal, pastikan versi Agen Asisten Cloud pada Instans ECS atau Instans terkelola tempat perintah telah dijalankan lebih baru dari versi berikut:
Linux: 2.2.3.541
Windows: 2.1.3.541
Jika kode kesalahan
InvalidOperation.CloudAssistantVersionUnsupporteddikembalikan, perbarui Agen Asisten Cloud ke versi terbaru.
Saat Anda menjalankan perintah publik Asisten Cloud, konten perintah
CommandContenttidak dapat diubah.Saat Anda mengubah konten perintah
CommandContentdan memanggil InvokeCommand atau mengaturKeepCommandmenjaditruesaat memanggil RunCommand untuk membuat Tugas, perintah baru akan ditambahkan dan disimpan untuk waktu yang lama, serta Kuota Asisten Cloud akan terpakai. Anda dapat menyimpan maksimum 500 hingga 50.000 perintah Asisten Cloud di satu Wilayah. Anda juga dapat mengajukan permohonan untuk meningkatkan Kuota. Untuk informasi tentang cara mengkueri dan meningkatkan Kuota, lihat Quota management.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ModifyInvocationAttribute |
update |
*Invocation
Instance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah. |
cn-hangzhou |
| InstanceId |
array |
No |
ID Instans ECS atau Instans terkelola yang akan ditambahkan ke tugas. |
|
|
string |
No |
ID Instans ECS atau Instans terkelola yang akan ditambahkan ke tugas. Jumlah total Instans ECS yang akan ditambahkan dan jumlah Instans ECS tempat perintah telah dijalankan tidak boleh melebihi 100. |
i-bp1i7gg30r52z2em**** |
|
| RegionId |
string |
Yes |
The region ID. |
cn-hangzhou |
| InvokeId |
string |
Yes |
ID eksekusi perintah dalam tugas yang akan diubah. |
t-hz0jdfwd9f**** |
| CommandContent |
string |
No |
Konten perintah yang telah diubah. Konten perintah dapat berupa teks biasa atau konten yang dienkode Base64. Perhatikan hal-hal berikut:
|
ZWNobyAxMjM= |
| EnableParameter |
boolean |
No |
Apakah perintah yang diubah berisi parameter kustom.
|
false |
| Parameters |
object |
No |
Pasangan kunci-nilai dari parameter kustom yang diteruskan saat perintah yang berisi parameter kustom dijalankan. Jumlah parameter kustom berkisar dari 0 hingga 10. Perhatikan hal-hal berikut:
Nilai default kosong, yang menunjukkan bahwa tidak ada pasangan kunci-nilai parameter kustom yang diubah. |
{"name":"Jack", "accessKey":"LTAI*************"} |
| Frequency |
string |
No |
Jadwal yang telah diubah tempat perintah dijalankan. Parameter ini hanya berlaku ketika
|
0 */20 * * * * |
| ContentEncoding |
string |
No |
Mode pengodean konten perintah (
Nilai default: PlainText. Jika nilai tidak valid, PlainText digunakan secara default. |
PlainText |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan permintaan idempoten. Anda dapat menggunakan Klien untuk menghasilkan nilai, tetapi Anda harus memastikan bahwa nilai tersebut unik di antara permintaan yang berbeda. Nilai ClientToken hanya mendukung karakter ASCII dan panjangnya tidak boleh melebihi 64 karakter. Untuk informasi lebih lanjut, lihat How to ensure idempotence. |
123e4567-e89b-12d3-a456-426655440000 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
| CommandId |
string |
ID perintah.
|
c-hz01272yr52**** |
Contoh
Respons sukses
JSONformat
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"CommandId": "c-hz01272yr52****"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 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. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.