Mengubah metode penagihan Instance ECS. Mendukung modifikasi Batch.
Deskripsi operasi
Catatan penggunaan
Sebelum menggunakan API ini, pastikan Anda telah familiar dengan metode penagihan Elastic Compute Service (ECS), seperti langganan dan pay-as-you-go, serta harga.
Pastikan Instance ECS target berada dalam status Running (
Running) atau Stopped (Stopped) dan akun Anda tidak memiliki Pembayaran tertunda.Setelah metode penagihan diubah, pembayaran otomatis akan dilakukan secara default. Pastikan saldo akun Anda mencukupi. Jika tidak, Pesanan abnormal akan dibuat dan hanya dapat dibatalkan. Jika saldo akun Anda tidak mencukupi, Anda dapat mengatur parameter
AutoPaymenjadifalse. Dalam hal ini, Pesanan belum bayar normal akan dibuat, dan Anda dapat log masuk ke Konsol ECS untuk membayarnya.
Pertimbangan
Konversi dari langganan ke pay-as-you-go:
- Saat Anda mengonversi Instansi langganan menjadi Instans pay-as-you-go, metode penagihan baru mencakup seluruh siklus hidup Instans. Anda akan menerima pengembalian dana atas selisih harga antara penagihan sebelum dan setelah perubahan, yang akan dikembalikan ke saluran pembayaran asli Anda. Voucher yang telah digunakan tidak akan dikembalikan.
Aturan pengembalian dana: Kuota pengembalian dana yang dapat Anda gunakan secara bebas dalam satu bulan terbatas dan tidak terakumulasi. Setelah Kuota pengembalian dana habis, Anda hanya dapat menunggu hingga bulan berikutnya untuk mengonversi metode penagihan lagi. Kuota pengembalian dana yang dikonsumsi oleh satu konversi penagihan dihitung dengan rumus: Jumlah vCPU * (Hari pengembalian * 24 ± Jam mengambang). Untuk informasi lebih lanjut, lihat Konversi langganan ke pay-as-you-go.
- Konversi dari pay-as-you-go ke langganan:
Mendukung konversi semua disk data pay-as-you-go yang terpasang pada Instans menjadi disk data langganan secara bersamaan.
Jika pengatur waktu rilis telah ditetapkan untuk Instans pay-as-you-go, API ini tidak dapat dipanggil. Untuk informasi lebih lanjut, lihat Konversi langganan ke pay-as-you-go.
Jika Instans berada dalam mode berhenti ekonomis, Anda harus memulai Instans terlebih dahulu.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ModifyInstanceChargeType |
update |
*Instance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceIds |
string |
Yes |
ID instans. Nilai dapat berupa array JSON yang terdiri dari beberapa ID instans. Mendukung hingga 20 ID, dan ID harus dipisahkan dengan koma (,). |
["i-bp67acfmxazb4p****","i-bp67acfmxazb4d****"] |
| RegionId |
string |
Yes |
ID wilayah instans. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah Alibaba Cloud terbaru. |
cn-hangzhou |
| Period |
integer |
No |
Durasi perpanjangan metode penagihan langganan. Jika mesin host Instance ECS adalah host khusus (DDH), rentang nilai tidak boleh melebihi durasi langganan host khusus. Nilai valid: Nilai valid saat `PeriodUnit=Month`: 1, 2, 3, 4, 5, 6, 7, 8, 9, dan 12. |
1 |
| PeriodUnit |
string |
No |
Unit durasi perpanjangan, yang juga merupakan unit parameter Nilai default: Month. |
Month |
| IncludeDataDisks |
boolean |
No |
Apakah akan mengonversi semua disk data pay-as-you-go yang terpasang pada Instans menjadi disk data langganan secara bersamaan.
Nilai default: false. |
false |
| DryRun |
boolean |
No |
Apakah akan menjalankan dry run saja, tanpa menjalankan permintaan aktual. Nilai valid:
Nilai default: false. |
false |
| AutoPay |
boolean |
No |
Apakah akan mengaktifkan pembayaran otomatis. Nilai valid:
Nilai default: true. Catatan
Jika saldo metode pembayaran Anda tidak mencukupi, Anda dapat mengatur AutoPay menjadi false. Dalam hal ini, pesanan belum bayar akan dibuat, dan Anda dapat masuk ke Konsol ECS untuk membayarnya. |
false |
| InstanceChargeType |
string |
No |
Metode penagihan baru Instans. Nilai valid:
Nilai default: PrePaid. |
PrePaid |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan idempotensi permintaan. Buat nilai dari klien Anda untuk memastikan nilai tersebut unik di antara permintaan yang berbeda. ClientToken hanya mendukung karakter ASCII dan tidak boleh melebihi 64 karakter. Untuk informasi lebih lanjut, lihat Cara memastikan idempotensi. |
123e4567-e89b-12d3-a456-426655440000 |
| IsDetailFee |
boolean |
No |
Apakah akan mengembalikan detail biaya pesanan saat mengonversi dari langganan ke pay-as-you-go. Nilai valid:
Nilai default: false. |
false |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| OrderId |
string |
ID Pesanan. Parameter ini hanya dikembalikan ketika metode penagihan diubah menjadi langganan. |
20413515388**** |
| RequestId |
string |
ID permintaan. |
B61C08E5-403A-46A2-96C1-F7B1216DB10C |
| FeeOfInstances |
object |
||
| FeeOfInstance |
array<object> |
Detail biaya pesanan. |
|
|
object |
|||
| InstanceId |
string |
The instance ID. |
i-bp67acfmxazb4p**** |
| Currency |
string |
The unit of currency for the bill. Alibaba Cloud China site (aliyun.com): CNY. Alibaba Cloud International site (alibabacloud.com): USD. |
CNY |
| Fee |
string |
The cost value. |
0 |
Contoh
Respons sukses
JSONformat
{
"OrderId": "20413515388****",
"RequestId": "B61C08E5-403A-46A2-96C1-F7B1216DB10C",
"FeeOfInstances": {
"FeeOfInstance": [
{
"InstanceId": "i-bp67acfmxazb4p****",
"Currency": "CNY",
"Fee": "0"
}
]
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidInstance.UnpaidOrder | %s | |
| 400 | Throttling | Request was denied due to request throttling, try again later. | |
| 400 | InstanceHasProcessingConvertOrder | %s | |
| 400 | InvalidParameter.InstanceIds | The specified InstanceIds are invalid. | |
| 400 | InvalidParameter | %s | |
| 400 | InvalidStatus.ValueNotSupported | %s | |
| 400 | InvalidInstanceChargeType.ValueNotSupported | %s | |
| 400 | InvalidSpotStrategy | The specified spotStrategy is not valid. | |
| 400 | ExpiredInstance | The specified instance has expired. | |
| 400 | InstancesIdQuotaExceed | The maximum number of Instances is exceeded. | |
| 400 | InvalidClientToken.ValueNotSupported | The ClientToken provided is invalid. | |
| 400 | InvalidInternetChargeType.ValueNotSupported | %s | |
| 400 | ReleaseTimeHaveBeenSet | The specified instance has been set released time. | |
| 400 | QuotaExceed.AfterpayInstance | The maximum number of Pay-As-You-Go instances is exceeded: %s. | |
| 400 | InvalidParameter.Bandwidth | %s | |
| 400 | QuotaExceed.RufundVcpu | The maximum number of refund vcpu is exceeded: %s. | |
| 400 | InvalidPeriod.UnitMismatch | The specified Period must be correlated with the PeriodUnit. | |
| 400 | InvalidImageType.NotSupported | %s | |
| 400 | InvalidPeriod.ExceededDedicatedHost | Instance expired date can't exceed dedicated host expired date. | |
| 400 | InvalidMarketImageChargeType.NotSupport | The specified chargeType of marketImage is unsupported. | |
| 400 | InvalidSystemDiskCategory.ValueNotSupported | %s | |
| 400 | InvalidAccountStatus.PayAmountLimitExceeded | Your account is being restricted, due to no default payment method is set or you has not being authorized. | |
| 400 | InvalidInstance.NotFoundSystemDisk | The specified instance has no system disk. | |
| 400 | AccountForbidden.ProductCreationLimited | The commodity must be officially operated by Aliyun and in pay-as-you-go billing method. | |
| 400 | Invalid.PrivatePoolOptions.MatchCriteria | Target mode does not support this operation. | |
| 400 | InvalidPeriod | The specified period is not valid. | |
| 400 | DISK_IN_DEDICATED_BLOCK_STORAGE_CLUSTER | The disk in dedicated block storage cluster is not allowed to do this operation. | |
| 400 | NoPermission.Price | The operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true. | |
| 400 | NoPermission.Refund | The operation requires refund permission. Please apply for permission from your main account. | |
| 400 | QuotaExceeded.InternetBandwidth | %s. | |
| 400 | DiskExpiredOrInArrears | Your account has an overdue payment for the specified instance. | |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | |
| 500 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | |
| 403 | InvalidInstance.TempBandwidthUpgrade | Cannot switch to Pay-As-You-Go during the period of temporary bandwidth upgrade. | |
| 403 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | |
| 403 | InstanceType.Offline | %s | |
| 403 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | |
| 403 | Account.Arrearage | Your account has an outstanding payment. | |
| 403 | InvalidParameter.NotMatch | %s | |
| 403 | InvalidAction | %s | |
| 403 | QuotaExceed.PostPaidDisk | Living postPaid disks quota exceeded. | |
| 403 | ImageNotSupportInstanceType | The specified instanceType is not supported by instance with marketplace image. | |
| 403 | InvalidInstanceType.PhasedOut | This instanceType is no longer offered. | |
| 403 | InvalidPeriod.ExceededDedicatedHost | Instance expired date can't exceed dedicated host expired date. | |
| 403 | RealNameAuthenticationError | Your account has not passed the real-name authentication yet. | |
| 403 | InvalidOperation.NotSupport | Instance on dedicated host not support modify charge type. | |
| 403 | QuotaExceed.ElasticQuota | No additional quota is available for the specified ECS instance type. | |
| 403 | PeriodNotSupported.InstanceOnManagedPrivateSpace | The instance on ManagedPrivateSpace is not supported to modify chargeType. | |
| 403 | UnsupportedIspChargeType | %s | |
| 403 | InvalidOperation.StoppedModeUnsupported | The specified instance is StopCharging. | |
| 404 | InvalidInstanceId.NotFound | The specified instanceId does not exist. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.