Membuat virtual private cloud (VPC).
Deskripsi operasi
Saat memanggil operasi ini untuk membuat VPC, perhatikan hal-hal berikut:
-
VPC hanya dapat memiliki satu Blok CIDR IPv4 utama. Anda dapat menambahkan Blok CIDR sekunder IPv4 untuk memperluas ruang alamat.
-
Setelah VPC dibuat, Anda dapat memperluas atau mengecilkan Blok CIDR IPv4 asli. Jika alamat IP dalam Blok CIDR saat ini sudah digunakan dan berada di luar Blok CIDR target, modifikasi akan gagal.
-
Setiap VPC mendukung hingga 300.000 alamat IP jaringan pribadi untuk sumber daya cloud. Kuota ini tidak dapat ditingkatkan.
-
Setelah VPC dibuat, vRouter dan tabel rute akan dibuat secara otomatis.
-
Setiap VPC mendukung hingga tiga Blok CIDR pengguna. Jika Blok CIDR pengguna tumpang tindih, Blok CIDR dengan mask yang lebih pendek akan berlaku. Misalnya, jika 10.0.0.0/16 dan 10.0.0.0/24 ditentukan, 10.0.0.0/16 yang berlaku.
-
CreateVpc adalah operasi asinkron. Setelah Anda mengirimkan permintaan, sistem akan mengembalikan ID instans tetapi VPC belum dibuat. Node untuk membuat VPC berjalan di latar belakang. Anda dapat memanggil DescribeVpcAttribute untuk mengkueri status pembuatan VPC:
Jika VPC berada dalam status Creating, VPC sedang dibuat.
Jika VPC berada dalam status Created, VPC telah dibuat.
-
CreateVpc mendukung pembuatan VPC non-default secara bersamaan di wilayah yang sama, dengan tunduk pada batas kuota.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:CreateVpc |
create |
*VPC
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah VPC. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| CidrBlock |
string |
No |
Blok CIDR VPC.
|
172.16.0.0/12 |
| Ipv6CidrBlock |
string |
No |
Blok CIDR IPv6 VPC. Saat Anda mengaktifkan IPv6 untuk VPC, sistem akan menetapkan Blok CIDR IPv6. Untuk menentukan Blok CIDR IPv6, Anda harus terlebih dahulu memanggil AllocateVpcIpv6Cidr untuk mencadangkan Blok CIDR IPv6, lalu meneruskannya. |
2408:XXXX:0:6a::/56 |
| VpcName |
string |
No |
Nama VPC. Panjang nama harus 1 hingga 128 karakter dan tidak boleh diawali dengan |
abc |
| EnableIpv6 |
boolean |
No |
Apakah akan mengaktifkan IPv6. Nilai valid:
|
false |
| Description |
string |
No |
Deskripsi VPC. Panjang deskripsi harus 1 hingga 256 karakter dan tidak boleh diawali dengan |
This is my first Vpc |
| ResourceGroupId |
string |
No |
ID kelompok sumber daya. Untuk informasi selengkapnya tentang kelompok sumber daya, lihat Apa itu kelompok sumber daya?. |
rg-acfmxazb4ph6aiy**** |
| Tag |
array<object> |
No |
Tag sumber daya. |
|
|
object |
No |
Tag. |
||
| Key |
string |
No |
Kunci tag sumber daya. Anda dapat menentukan hingga 20 kunci tag. Kunci tag tidak boleh berupa string kosong. Panjang kunci tag dapat mencapai 128 karakter dan tidak boleh diawali dengan |
FinanceDept |
| Value |
string |
No |
Nilai tag sumber daya. Anda dapat menentukan hingga 20 nilai tag. Nilai tag dapat berupa string kosong. Panjang nilai tag dapat mencapai 128 karakter dan tidak boleh diawali dengan |
FinanceJoshua |
| DryRun |
boolean |
No |
Apakah akan menjalankan dry run. Nilai valid:
|
false |
| UserCidr |
string |
No |
Blok CIDR pengguna. Pisahkan beberapa Blok CIDR dengan koma (,). Anda dapat menentukan hingga tiga Blok CIDR. Untuk informasi selengkapnya tentang Blok CIDR pengguna, lihat bagian |
192.168.0.0/12 |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan idempotensi permintaan. Anda dapat menggunakan klien untuk menghasilkan token, tetapi Anda harus memastikan bahwa token tersebut unik di antara permintaan yang berbeda. Token hanya dapat berisi karakter ASCII. Catatan
Jika Anda tidak menentukan parameter ini, sistem secara otomatis menggunakan RequestId dari permintaan API sebagai ClientToken. RequestId mungkin berbeda untuk setiap permintaan API. |
123e4567-e89b-12d3-a456-426655440000 |
| Ipv6Isp |
string |
No |
Tipe Blok CIDR IPv6 VPC. Nilai valid:
Catatan
Jika akun Anda termasuk dalam daftar putih bandwidth ISP tunggal China Telecom, Anda dapat mengatur parameter ini ke ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), atau ChinaMobile (China Mobile). |
BGP |
| Ipv4IpamPoolId |
string |
No |
ID instans Kolam IPAM IPv4. |
ipam-pool-sycmt3p2a9v63i**** |
| Ipv4CidrMask |
integer |
No |
Subnet mask yang digunakan untuk mengalokasikan Blok CIDR dari Kolam IPAM ke VPC. Catatan
Saat Anda membuat VPC dengan menentukan Kolam IPAM, Anda harus menentukan setidaknya satu dari CidrBlock atau Ipv4CidrMask. |
12 |
| EnableDnsHostname |
boolean |
No |
Apakah akan mengaktifkan fitur hostname DNS. Nilai valid:
|
false |
| Ipv6IpamPoolId |
string |
No |
ID instans Kolam IPAM IPv6. |
ipam-pool-bp1aq51kkfh477z03**** |
| Ipv6CidrMask |
integer |
No |
Subnet mask yang digunakan untuk mengalokasikan Blok CIDR IPv6 dari Kolam IPAM ke VPC. |
56 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
ID VPC yang dibuat. |
||
| VpcId |
string |
ID VPC yang dibuat. |
vpc-bp15zckdt37pq72zv**** |
| VRouterId |
string |
ID vRouter yang dibuat secara otomatis setelah VPC dibuat. |
vrt-bp1lhl0taikrteen8**** |
| RequestId |
string |
ID permintaan. |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
| RouteTableId |
string |
ID tabel rute yang dibuat secara otomatis setelah VPC dibuat. |
vtb-bp145q7glnuzdv**** |
| ResourceGroupId |
string |
ID kelompok sumber daya. |
rg-acfmxazb4ph6aiy**** |
Contoh
Respons sukses
JSONformat
{
"VpcId": "vpc-bp15zckdt37pq72zv****",
"VRouterId": "vrt-bp1lhl0taikrteen8****",
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
"RouteTableId": "vtb-bp145q7glnuzdv****",
"ResourceGroupId": "rg-acfmxazb4ph6aiy****"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | TOKEN_PROCESSING | Action is processing. | |
| 400 | InvokeError | instance quota rule invoke error. | |
| 400 | InvalidParameter | Specified CIDR block is not valid | |
| 400 | ResourceNotAvailable | Resource you requested is not available in this region or zone. | |
| 400 | InvalidVpcName.Malformed | Specified VPC name is not valid. | |
| 400 | InvalidVpcDiscription.Malformed | Specified VPC description is not valid. | |
| 400 | QuotaExceeded.Vpc | VPC quota exceeded. | |
| 400 | ResourceNotAvailable.Vpc | Resource you requested is not available in this region or zone. | |
| 400 | InvalidUserCidr.Quota | Specified UserCidr number is greater than 3. | |
| 400 | InvalidUserCidr.Malformed | Specified UserCidr overlapping in of 100.64.0.0/10. | |
| 400 | InvalidResourceGroupId | The specified ResourceGroupId does not exist. | |
| 400 | IllegalParam.Ipv6CidrBlock | %s | |
| 400 | OperationFailed.IPv6CidrNotReserved | %s | |
| 400 | MissingParam.EnableIpv6 | %s | |
| 400 | OperationUnsupported.Ipv6Feature | %s | |
| 400 | System.ServiceBusy | System is busy, please try later. | |
| 400 | IllegalParam.UserCidr | UserCidr is not a valid or strict address. | |
| 400 | OperationUnsupported.ResourceGroupId | ResourceGroup is not supported in this region. | |
| 400 | IllegalParam.EnableIpv6 | %s | |
| 400 | InvalidIpv6CidrBlock.Malformed | Specified Ipv6CidrBlock is not valid. | |
| 400 | UnsupportedFeature.Ipv6Isp | The Ipv6Isp feature is not supported. | |
| 400 | ResourceNotEnough.Ipv6Cidr | The specified resource of Ipv6Cidr is not enough. | |
| 400 | UnsupportedFeature.IPAM | VPCs cannot be created by using IPAM. | |
| 400 | IllegalParam.Ipv4CidrMask | The specified Ipv4CidrMask is illegal. | |
| 400 | IllegalParam.IpamPool | The specified IPAM pool cannot be empty. | |
| 400 | OperationDenied.RequestRegionInvalid | The operation is not allowed because the request is not invoked in the region of the IPAM pool. | |
| 400 | OperationDenied.IpamPoolNotInRegion | The operation is not allowed because the IPAM pool not in specific region does not support creating VPC or associating CIDR for VPC. | |
| 400 | MissingParam.CidrOrCidrMask | The CIDR or CIDR Mask must be input. | |
| 400 | OperationDenied.CidrInExcludeCidrs | The operation is not allowed because the input CIDR is within the illegal CIDRs. | |
| 400 | OperationDenied.AvailableCidrInsufficient | The operation is not allowed because available CIDR is insufficient. | |
| 400 | UnsupportedFeature.Ipam | IPAM is not supported in this region. | |
| 400 | OperationDenied.CidrUnavailableInPool | The operation is not allowed because the CIDR is unavailable in the IPAM pool. | |
| 400 | IllegalParam.CidrBlockMask | The param of CidrBlock Mask [%s] is illegal. | |
| 400 | UnsupportedFeature.VpcDnsHostname | The feature of vpc dns hostname is unsupported. | |
| 400 | OperationDenied.MaskOfCidrIsNotAllowed | The input mask or mask of the input CIDR is not allowed. | |
| 400 | IllegalParam.Ipv6Isp | The specified Ipv6Isp is illegal. | |
| 400 | IllegalParam.CidrMask | The input CIDR mask is illegal. | |
| 400 | InvalidRegionId.NotFound | Specified value of "regionId" is not supported. | |
| 400 | UnsupportedFeature.DhcpOptionsSet | The feature of dhcp options set is unsupported. | |
| 400 | OperationDenied.CidrMaskTooLarge | The operation is denied because the CIDR mask %s is larger than the allocationMaxNetmask %s of the pool. | |
| 400 | OperationDenied.CidrMaskTooSmall | The operation is denied because the CIDR mask %s is less than the allocationMinNetmask %s of the pool. | |
| 400 | Mismatch.ParamIpv6IspAndIpamPoolIpv6Isp | The specified IPv6 ISP %s does not match the IPAM pool's IPv6 ISP %s. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | Forbidden | User not authorized to operate on the specified resource. | |
| 404 | ResourceNotFound.IpamPool | The dependent IPAM pool is not found. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.