Documentation ¶
Index ¶
- func ExtractVPCsInto(r pagination.Page, v interface{}) error
- func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type Route
- type RoutingTable
- type Subnet
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
- type VPC
- type VPCPage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractVPCsInto ¶
func ExtractVPCsInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List returns a Pager which allows you to iterate over a collection of networks. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
Types ¶
type CreateOpts ¶
type CreateOpts struct { Name string `json:"name"` CIDRv4 string `json:"cidrv4"` TenantID string `json:"tenant_id,omitempty"` ExternalNetworkID string `json:"external_network_id,omitempty"` }
CreateOpts represents options used to create a network.
func (CreateOpts) ToVPCCreateMap ¶
func (opts CreateOpts) ToVPCCreateMap() (map[string]interface{}, error)
ToVPCCreateMap builds a request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents the result of a create operation. Call its Extract method to interpret it as a VPC.
func Create ¶
func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create accepts a CreateOpts struct and creates a new network using the values provided. This operation does not actually require a request body, i.e. the CreateOpts struct argument can be empty.
The tenant ID that is contained in the URI is the tenant that creates the network. An admin user, however, has the option of specifying another tenant ID in the CreateOpts struct.
func (CreateResult) Extract ¶
Extract is a function that accepts a result and extracts a network resource.
func (CreateResult) ExtractInto ¶
func (r CreateResult) ExtractInto(v interface{}) error
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.
func Delete ¶
func Delete(c *gophercloud.ServiceClient, networkID string) (r DeleteResult)
Delete accepts a unique ID and deletes the network associated with it.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a VPC.
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a network resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type ListOpts ¶
type ListOpts struct { TenantID string `q:"tenant_id"` ID string `q:"id"` Name string `q:"name"` RouterExternal bool `q:"router:external"` SortDir string `q:"sort_dir"` SortKey string `q:"sort_key"` }
ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the network attributes you want to see returned. SortKey allows you to sort by a particular network attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.
func (ListOpts) ToVPCListQuery ¶
ToVPCListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type RoutingTable ¶
type RoutingTable struct { GatewayID string `json:"gateway_id"` Subnets []Subnet `json:"subnets"` Name string `json:"name"` VPCs []VPC `json:"vpcs"` TenantID string `json:"tenant_id"` Distributed bool `json:"distributed"` State string `json:"state"` DefaultTable bool `json:"default_table"` CreateTime time.Time `json:"create_time"` Routes []Route `json:"routes"` ID string `json:"id"` }
type Subnet ¶
type Subnet struct { RouterExternal bool `json:"router:external"` Name string `json:"name"` EnableDHCP bool `json:"enable_dhcp"` TenantID string `json:"tenant_id"` Gateway string `json:"gateway"` Routes []Route `json:"routes"` State string `json:"state"` CreateTime string `json:"create_time"` AvailableIPCount int `json:"available_ip_count"` VPC VPC `json:"vpc"` ID string `json:"id"` VPCID string `json:"vpc_id"` Hidden bool `json:"hidden"` CIDR string `json:"cidr"` }
type UpdateOpts ¶
type UpdateOpts struct { AdminStateUp *bool `json:"admin_state_up,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` }
UpdateOpts represents options used to update a network.
func (UpdateOpts) ToVPCUpdateMap ¶
func (opts UpdateOpts) ToVPCUpdateMap() (map[string]interface{}, error)
ToVPCUpdateMap builds a request body from UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a VPC.
func Update ¶
func Update(c *gophercloud.ServiceClient, networkID string, opts UpdateOptsBuilder) (r UpdateResult)
Update accepts a UpdateOpts struct and updates an existing network using the values provided. For more information, see the Create function.
func (UpdateResult) Extract ¶
Extract is a function that accepts a result and extracts a network resource.
func (UpdateResult) ExtractInto ¶
func (r UpdateResult) ExtractInto(v interface{}) error
type VPC ¶
type VPC struct { RouterExternal bool `json:"router:external"` RoutingTables []RoutingTable `json:"routingtables"` Name string `json:"name"` Subnets []Subnet `json:"subnets"` TenantID string `json:"tenant_id"` State string `json:"state"` CreateTime string `json:"create_time"` CIDRv4 string `json:"cidrv4"` ID string `json:"id"` }
func ExtractVPCs ¶
func ExtractVPCs(r pagination.Page) ([]VPC, error)
ExtractVPCs accepts a Page struct, specifically a VPCPage struct, and extracts the elements into a slice of VPC structs. In other words, a generic collection is mapped into a relevant slice.
func (*VPC) UnmarshalJSON ¶
type VPCPage ¶
type VPCPage struct {
pagination.LinkedPageBase
}
VPCPage is the page returned by a pager when traversing over a collection of networks.
func (VPCPage) NextPageURL ¶
NextPageURL is invoked when a paginated collection of networks has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.