Documentation
¶
Index ¶
- type AddExtendCidrOption
- type CidrOpts
- type CloudResource
- type ListOpts
- type Vpc
- func AddSecondaryCidr(client *golangsdk.ServiceClient, id string, opts CidrOpts) (*Vpc, error)
- func ExtractVpcs(r pagination.NewPage) ([]Vpc, error)
- func Get(client *golangsdk.ServiceClient, id string) (*Vpc, error)
- func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Vpc, error)
- func RemoveSecondaryCidr(client *golangsdk.ServiceClient, id string, opts CidrOpts) (*Vpc, error)
- type VpcPage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddExtendCidrOption ¶
type AddExtendCidrOption struct {
// Secondary CIDR blocks that can be added to VPCs
// The value cannot contain the following:
// 100.64.0.0/10
// 214.0.0.0/7
// 198.18.0.0/15
// 169.254.0.0/16
// 0.0.0.0/8
// 127.0.0.0/8
// 240.0.0.0/4
// 172.31.0.0/16
// 192.168.0.0/16
// Currently, only one secondary CIDR block can be added to each VPC.
ExtendCidrs []string `json:"extend_cidrs"`
}
type CidrOpts ¶
type CidrOpts struct {
// Whether to only check the request.
// Value range:
// true: Only the check request will be sent and no secondary CIDR block will be added.
// Check items include mandatory parameters, request format, and constraints.
// If the check fails, an error will be returned. If the check succeeds, response code 202 will be returned.
// false (default value): A request will be sent and a secondary CIDR block will be added.
DryRun *bool `json:"dry_run,omitempty"`
// Request body for adding a secondary CIDR block.
Vpc *AddExtendCidrOption `json:"vpc"`
}
type CloudResource ¶
type ListOpts ¶
type ListOpts struct {
// Number of records displayed on each page.
// Value range: 0 to 2000
Limit int `q:"limit,omitempty"`
// Start resource ID of pagination query.
// If the parameter is left blank, only resources on the first page are queried.
Marker string `q:"marker,omitempty"`
// VPC ID, which can be used to filter VPCs.
Id []string `q:"id,omitempty"`
// VPC name, which can be used to filter VPCs.
Name []string `q:"name,omitempty"`
// Supplementary information about the VPC, which can be used to filter VPCs.
Description []string `q:"description,omitempty"`
// VPC CIDR block, which can be used to filter VPCs.
Cidr []string `q:"cidr,omitempty"`
}
type Vpc ¶
type Vpc struct {
// VPC ID, which uniquely identifies the VPC
// The value is in UUID format with hyphens (-).
Id string `json:"id"`
// VPC name
// The value can contain no more than 64 characters, including letters,
// digits, underscores (_), hyphens (-), and periods (.).
Name string `json:"name"`
// Provides supplementary information about the VPC.
// The value can contain no more than 255 characters and cannot contain angle brackets (< or >).
Description string `json:"description"`
// Available VPC CIDR blocks
// Value range:
// 10.0.0.0/8-10.255.255.240/28
// 172.16.0.0/12-172.31.255.240/28
// 192.168.0.0/16-192.168.255.240/28
// If cidr is not specified, the default value is "".
// The value must be in IPv4 CIDR format, for example, 192.168.0.0/16.
Cidr string `json:"cidr"`
// Secondary CIDR blocks of VPCs
// Currently, only IPv4 CIDR blocks are supported.
SecondaryCidrs []string `json:"extend_cidrs"`
// VPC status
// Value range:
// PENDING: The VPC is being created.
// ACTIVE: The VPC is created successfully.
Status string `json:"status"`
// ID of the project to which the VPC belongs
ProjectId string `json:"project_id"`
// Time when the VPC is created
// UTC time in the format of yyyy-MM-ddTHH:mmss
CreatedAt string `json:"created_at"`
// Time when the VPC is updated
// UTC time in the format of yyyy-MM-ddTHH:mmss
UpdatedAt string `json:"updated_at"`
// Type and number of resources associated with the VPC
// Currently, only route tables and subnets of the VPC are returned.
// The number of virsubnets is the total number of IPv4 and IPv6 subnets.
CloudResources []CloudResource `json:"cloud_resources"`
// VPC tags. For details, see the tag objects.
// Value range: 0 to 10 tag key-value pairs
Tags []tags.ResourceTag `json:"tags"`
}
func AddSecondaryCidr ¶
AddSecondaryCidr is used to add a secondary CIDR block to a VPC.
func ExtractVpcs ¶
func ExtractVpcs(r pagination.NewPage) ([]Vpc, error)
ExtractVpcs accepts a Page struct, specifically a VpcPage struct, and extracts the elements into a slice of Vpc structs.
type VpcPage ¶
type VpcPage struct {
pagination.NewSinglePageBase
}
VpcPage is the page returned by a pager when traversing over a collection of vpcs
Click to show internal directories.
Click to hide internal directories.