Membuat vSwitch.
Deskripsi operasi
Saat memanggil operasi ini untuk membuat vSwitch, perhatikan hal-hal berikut:
-
Anda dapat membuat hingga 150 vSwitch di setiap VPC.
-
Alamat IP pertama dan tiga alamat IP terakhir dari setiap Blok CIDR vSwitch dicadangkan oleh sistem. Misalnya, sistem mencadangkan 192.168.1.0, 192.168.1.253, 192.168.1.254, dan 192.168.1.255 di Blok CIDR 192.168.1.0/24.
-
Jumlah instans layanan cloud di vSwitch tidak boleh melebihi jumlah instans layanan cloud yang tersedia di VPC (15.000 dikurangi jumlah instans layanan cloud saat ini).
-
Satu instans layanan cloud hanya dapat menjadi milik satu vSwitch.
-
vSwitch tidak mendukung multicast atau broadcast.
-
Setelah vSwitch dibuat, Anda tidak dapat mengubah Blok CIDR-nya.
-
CreateVSwitch adalah operasi asinkron. Setelah Anda mengirim permintaan, sistem akan mengembalikan ID vSwitch. Namun, vSwitch belum dibuat. Sistem masih membuat vSwitch di backend. Anda dapat memanggil DescribeVSwitchAttributes untuk mengkueri status vSwitch:
Jika vSwitch berada dalam status Pending, vSwitch sedang dikonfigurasi.
Jika vSwitch berada dalam status Available, vSwitch sudah tersedia.
-
Anda tidak dapat memanggil CreateVSwitch secara berulang untuk membuat vSwitch di VPC yang sama.
-
Anda tidak dapat menggunakan CreateVSwitch untuk membuat vSwitch yang memiliki Blok CIDR 100.64.0.0/10 atau salah satu subnetnya.
Coba sekarang
Test
RAM authorization
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Tag |
array<object> |
No |
Tag Sumber daya. |
|
|
object |
No |
Tag. |
||
| Key |
string |
No |
Kunci tag. 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 |
FinanceJoshua |
| Value |
string |
No |
Nilai tag. 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 |
FinanceDept |
| ZoneId |
string |
Yes |
ID zona tempat vSwitch yang akan dibuat berada. Anda dapat memanggil operasi DescribeZones untuk mengkueri ID zona yang tersedia. |
cn-hangzhou-b |
| RegionId |
string |
No |
ID wilayah tempat vSwitch yang akan dibuat berada. Anda dapat memanggil operasi DescribeRegions untuk mengkueri ID wilayah yang tersedia. |
cn-hangzhou |
| CidrBlock |
string |
Yes |
Blok CIDR vSwitch. Perhatikan persyaratan berikut:
Catatan
Setelah vSwitch dibuat, Anda tidak dapat mengubah Blok CIDR-nya. |
172.16.0.0/24 |
| Ipv6CidrBlock |
integer |
No |
Delapan bit terakhir dari Blok CIDR IPv6 vSwitch. Nilai valid: 0 hingga 255. Anda dapat menentukan parameter ini untuk menetapkan Blok CIDR IPv6 ke vSwitch hanya jika IPv6 telah diaktifkan untuk VPC tempat vSwitch berada. Setelah Blok CIDR IPv6 ditetapkan, Anda tidak dapat mengubahnya. Pastikan Blok CIDR IPv6 tidak tumpang tindih dengan Blok CIDR vSwitch lain di VPC. |
12 |
| VpcId |
string |
Yes |
ID VPC tempat vSwitch yang akan dibuat berada. |
vpc-257gqcdfvx6n**** |
| VSwitchName |
string |
No |
Nama vSwitch. Panjang nama harus 1 hingga 128 karakter dan tidak boleh diawali dengan |
vSwitch-1 |
| Description |
string |
No |
Deskripsi vSwitch. Panjang deskripsi harus 1 hingga 256 karakter dan tidak boleh diawali dengan |
vSwitch |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan idempotensi permintaan. Anda dapat menggunakan klien untuk menghasilkan nilai ini, tetapi Anda harus memastikan nilainya unik di antara permintaan yang berbeda. Token hanya dapat berisi karakter ASCII. Catatan
Jika Anda tidak menentukan parameter ini, sistem akan menggunakan nilai RequestId sebagai nilai ClientToken. Nilai RequestId berbeda untuk setiap permintaan API. |
0c593ea1-3bea-11e9-b96b-88e9fe63**** |
| VpcIpv6CidrBlock |
string |
No |
Blok CIDR IPv6 VPC. Jika VPC tempat vSwitch berada memiliki beberapa Blok CIDR IPv6, Anda dapat menggunakan parameter ini untuk menentukan Blok CIDR IPv6 tempat vSwitch berada. Jika Anda tidak menentukan parameter ini, Blok CIDR IPv6 yang ditetapkan ke VPC saat IPv6 diaktifkan akan digunakan. |
2408:XXXX:0:6a::/56 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Format respons. |
||
| VSwitchId |
string |
ID vSwitch yang dibuat. |
vsw-25navfgbue4g**** |
| RequestId |
string |
ID permintaan. |
0ED8D006-F706-4D23-88ED-E11ED28DCAC0 |
Contoh
Respons sukses
JSONformat
{
"VSwitchId": "vsw-25navfgbue4g****",
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | OperationFailed.ResourceConflict | vpc only support one cloud box. | |
| 400 | OperationFailed.IdempotentTokenProcessing | Action is processing. | |
| 400 | InvalidDescription.Malformed | Invalid description. | |
| 400 | InvalidVSwitchName.Malformed | Specified virtual switch name is not valid. | |
| 400 | InvalidVSwitchDiscription.Malformed | Specified virtual switch description is not valid. | |
| 400 | Abs.Vpc.InvalidDescription.Malformed | Specified virtual switch name is not valid. | |
| 400 | MissingParam.vpcId | The parameter vpcId is mandatory. | |
| 400 | ResourceNotAvailable | Resource you requested is not available in this region or zone. | |
| 400 | InvalidParameter | Specified CIDR block is not valid in VPC. | |
| 400 | InvalidCidrBlock.Overlapped | Specified CIDR block overlapped with other subnets. | |
| 400 | QuotaExceeded.VSwitch | Virtual switch quota exceeded. | |
| 400 | IncorrectRouteEntryStatus | Some route entry status blocked this operation. | |
| 400 | IncorrectVSwitchStatus | Some virtual switch is modifying within the same VPC. | |
| 400 | InvalidCirdrBlock.MaskLength | Specified CIDR block is not valid . | |
| 400 | IncorrectVpcStatus | Current VPC status does not support this operation. | |
| 400 | CreateVSwitch.IncorrectStatus.cbnStatus | Current CBN status does not support this operation. | |
| 400 | InvalidCidrBlock.Malformed | Specified CIDR block is not valid. | |
| 400 | MissingParameter | Miss mandatory parameter. | |
| 400 | TaskConflict | The operation is too frequent, TaskConflict. | |
| 400 | VPC.SWITCH.RULE.QUOTA.NOT.EXISTS | vSwitch quota rule not exists. | |
| 400 | Forbidden.VpcNotFound | Specified VPC can not found. | |
| 400 | RouteConflict.AlreadyExist | Route conflict exists in routing table. | |
| 400 | OperationFailed.CidrAcross | Classic link instance cidr must not across. | |
| 400 | Duplicated.ClientToken | %s | |
| 400 | OperationFailed.Ipv6CidrBlockExisted | %s | |
| 400 | IllegalParam.Ipv6CidrBlock | %s | |
| 400 | OperationFailed.VpcIpv6Disabled | %s | |
| 400 | IncorrectStatus.cbnStatus | Current CBN status does not support this operation. | |
| 400 | OperationFailed.NotifyCenCreate | Failed to notify cen when create vswitch. | |
| 400 | OperationFailed.DistibuteLock | Distibute lock fail. | |
| 400 | UnsupportedFeature.CloudBoxIpv6 | The IPv6 feature is not supported by cloud box. | |
| 400 | OperationDenied.VpcPeerExist | The operation is not allowed because the VPC peer exists. | |
| 400 | OperationDenied.CenAttached | The operation is not allowed because the VPC is attached to CEN. | |
| 400 | OperationDenied.NatgwExist | The operation is not allowed because the NAT gateway exists in VPC. | |
| 400 | MissingParam.Ipv6CidrBlock | The parameter Ipv6CidrBlock is mandatory. | |
| 400 | IllegalParam.VpcIpv6CidrBlock | %s | |
| 400 | OperationDenied.OtherSubnetCreating | The operation is not allowed because the other VSwitch is creating. | |
| 400 | OperationDenied.VpcPeerExists | The operation is not allowed because the VpcPeer exists. | |
| 400 | IllegalParam.CidrBlock | The param of CidrBlock [%s] is illegal. | |
| 400 | InvalidStatus.RouteEntry | RouteEntry status error. | |
| 400 | InvalidZoneId.NotFound | Specified zone does not exist. | |
| 400 | OperationDenied.ZoneIsDisabled | The specified zone is disabled. You cannot create a vSwitch in a disabled zone. | |
| 404 | Invalid.NotExist | witch mask rule not exists. | |
| 404 | InvalidVpcId.NotFound | Specified VPC does not exist. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.