github.com/morlay/goqcloud@v0.0.0-20181123023149-b00e0b0b9afc/clients/vpc/create_vpc.go (about) 1 package vpc 2 3 import ( 4 github_com_morlay_goqcloud "github.com/morlay/goqcloud" 5 ) 6 7 // 创建VPC 8 // https://cloud.tencent.com/document/api/215/15774 9 10 type CreateVpcRequest struct { 11 // vpc的cidr,只能为10.0.0.0/16,172.16.0.0/12,192.168.0.0/16这三个内网网段内。 12 CidrBlock string `name:"CidrBlock"` 13 // DNS地址,最多支持4个 14 DnsServers []*string `name:"DnsServers,omitempty"` 15 // 域名 16 DomainName *string `name:"DomainName,omitempty"` 17 // 是否开启组播。true: 开启, false: 不开启。 18 EnableMulticast *string `name:"EnableMulticast,omitempty"` 19 // 区域 20 Region string `name:"Region"` 21 // vpc名称,最大长度不能超过60个字节。 22 VpcName string `name:"VpcName"` 23 } 24 25 func (req *CreateVpcRequest) Invoke(client github_com_morlay_goqcloud.Client) (*CreateVpcResponse, error) { 26 resp := &CreateVpcResponse{} 27 err := client.Request("vpc", "CreateVpc", "2017-03-12").Do(req, resp) 28 return resp, err 29 } 30 31 type CreateVpcResponse struct { 32 github_com_morlay_goqcloud.TencentCloudBaseResponse 33 // Vpc对象。 34 Vpc Vpc `json:"Vpc"` 35 }