Documentation ¶
Overview ¶
Package networks provides information and interaction with the network API resource for the Rackspace Cloud Servers service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(c *gophercloud.ServiceClient) 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 { // REQUIRED. See Network object for more info. CIDR string // REQUIRED. See Network object for more info. Label string }
CreateOpts is the common options struct used in this package's Create operation.
func (CreateOpts) ToNetworkCreateMap ¶
func (opts CreateOpts) ToNetworkCreateMap() (map[string]interface{}, error)
ToNetworkCreateMap casts a CreateOpts struct to a map.
type CreateOptsBuilder ¶
CreateOptsBuilder is the interface options structs have to satisfy in order to be used in the main Create operation in this package. Since many extensions decorate or modify the common logic, it is useful for them to satisfy a basic interface in order for them to be used.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents the result of a create operation.
func Create ¶
func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) 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.
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
DeleteResult represents the result of a delete operation.
func Delete ¶
func Delete(c *gophercloud.ServiceClient, networkID string) 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.
func Get ¶
func Get(c *gophercloud.ServiceClient, id string) GetResult
Get retrieves a specific network based on its unique ID.
type Network ¶
type Network struct { // UUID for the network ID string `mapstructure:"id" json:"id"` // Human-readable name for the network. Might not be unique. Label string `mapstructure:"label" json:"label"` // Classless Inter-Domain Routing CIDR string `mapstructure:"cidr" json:"cidr"` }
Network represents, well, a network.
func ExtractNetworks ¶
func ExtractNetworks(page pagination.Page) ([]Network, error)
ExtractNetworks accepts a Page struct, specifically a NetworkPage struct, and extracts the elements into a slice of Network structs. In other words, a generic collection is mapped into a relevant slice.
type NetworkPage ¶
type NetworkPage struct {
pagination.SinglePageBase
}
NetworkPage is the page returned by a pager when traversing over a collection of networks.
func (NetworkPage) IsEmpty ¶
func (r NetworkPage) IsEmpty() (bool, error)
IsEmpty returns true if the NetworkPage contains no Networks.