Documentation ¶
Index ¶
- func DeleteURL(c *golangsdk.ServiceClient, subnetId string) string
- func ExtractSubnets(r pagination.Page) ([]common.Subnet, error)
- func GetURL(c *golangsdk.ServiceClient, subnetId string) string
- func UpdateURL(c *golangsdk.ServiceClient, subnetId string) string
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type ListOpts
- type ListResult
- type ListSubnetsOptsBuilder
- type SubnetPage
- type Subnets
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResp
- type UpdateResult
- type VpcResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractSubnets ¶
func ExtractSubnets(r pagination.Page) ([]common.Subnet, error)
ExtractSubnets accepts a Page struct, specifically a SubnetPage struct, and extracts the elements into a slice of Subnet structs. In other words, a generic collection is mapped into a relevant slice.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Specifies the subnet name. The value is a string of 1 to 64 // characters that can contain letters, digits, underscores (_), and hyphens (-). Name string `json:"name" required:"true"` // Specifies the network segment on which the subnet resides. The // value must be in CIDR format. The value must be within the CIDR block of the VPC. The // subnet mask cannot be greater than 28. Cidr string `json:"cidr" required:"true"` // Specifies the gateway of the subnet. The value must be a valid // IP address. The value must be an IP address in the subnet segment. GatewayIP string `json:"gateway_ip" required:"true"` // Specifies whether the DHCP function is enabled for the subnet. // The value can be true or false. If this parameter is left blank, it is set to true by // default. DhcpEnable *bool `json:"dhcp_enable,omitempty"` // Specifies the IP address of DNS server 1 on the subnet. The // value must be a valid IP address. PrimaryDNS string `json:"primary_dns,omitempty"` // Specifies the IP address of DNS server 2 on the subnet. The // value must be a valid IP address. SecondaryDNS string `json:"secondary_dns,omitempty"` // Specifies the DNS server address list of a subnet. This field // is required if you need to use more than two DNS servers. This parameter value is the // superset of both DNS server address 1 and DNS server address 2. DNSList []string `json:"dnsList,omitempty"` // Specifies the ID of the VPC to which the subnet belongs. VpcID string `json:"vpc_id" required:"true"` SiteID string `json:"site_id,omitempty" required:"true"` }
func (CreateOpts) ToCreateMap ¶
func (opts CreateOpts) ToCreateMap() (map[string]interface{}, error)
type CreateOptsBuilder ¶
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
type DeleteResult ¶
func Delete ¶
func Delete(client *golangsdk.ServiceClient, subnetId string) (r DeleteResult)
type ListOpts ¶
type ListOpts struct { Limit int `q:"limit"` Offset int `q:"offset"` VpcID string `q:"vpc_id"` SiteID string `q:"site_id"` }
ListOpts allows the filtering collections through the API.
func (ListOpts) ToListSubnetsQuery ¶
ToListSubnetsQuery converts ListSubnetsOpts structures to query string
type ListResult ¶
type ListResult struct {
// contains filtered or unexported fields
}
func List ¶
func List(client *golangsdk.ServiceClient, opts ListSubnetsOptsBuilder) (r ListResult)
List returns collection of subnets.
func (ListResult) Extract ¶
func (r ListResult) Extract() (*Subnets, error)
type ListSubnetsOptsBuilder ¶
type SubnetPage ¶
type SubnetPage struct {
pagination.LinkedPageBase
}
SubnetPage is the page returned by a pager when traversing over a collection of subnets.
func (SubnetPage) IsEmpty ¶
func (r SubnetPage) IsEmpty() (bool, error)
IsEmpty checks whether a SubnetPage struct is empty.
type UpdateOpts ¶
type UpdateOpts struct { // Specifies the subnet name. The value is a string of 1 to 64 // characters that can contain letters, digits, underscores (_), and hyphens (-). Name string `json:"name" required:"true"` // Specifies whether the DHCP function is enabled for the subnet. // The value can be true or false. If this parameter is left blank, it is set to true by // default. DhcpEnable *bool `json:"dhcp_enable,omitempty"` // Specifies the IP address of DNS server 1 on the subnet. The // value must be a valid IP address. PrimaryDNS string `json:"primary_dns,omitempty"` // Specifies the IP address of DNS server 2 on the subnet. The // value must be a valid IP address. SecondaryDNS string `json:"secondary_dns,omitempty"` // Specifies the DNS server address list of a subnet. This field // is required if you need to use more than two DNS servers. This parameter value is the // superset of both DNS server address 1 and DNS server address 2. DNSList *[]string `json:"dnsList,omitempty"` }
func (UpdateOpts) ToUpdateMap ¶
func (opts UpdateOpts) ToUpdateMap() (map[string]interface{}, error)
type UpdateOptsBuilder ¶
type UpdateResp ¶
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
func Update ¶
func Update(client *golangsdk.ServiceClient, subnetId string, opts UpdateOptsBuilder) (r UpdateResult)
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*UpdateResp, error)
type VpcResponse ¶
Click to show internal directories.
Click to hide internal directories.