gophercloud: github.com/rackspace/gophercloud/openstack/networking/v2/extensions/provider Index | Files

package provider

import "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/provider"

Package provider gives access to the provider Neutron plugin, allowing network extended attributes. The provider extended attributes for networks enable administrative users to specify how network objects map to the underlying networking infrastructure. These extended attributes also appear when administrative users query networks.

For more information about extended attributes, see the NetworkExtAttrs struct. The actual semantics of these attributes depend on the technology back end of the particular plug-in. See the plug-in documentation and the OpenStack Cloud Administrator Guide to understand which values should be specific for each of these attributes when OpenStack Networking is deployed with a particular plug-in. The examples shown in this chapter refer to the Open vSwitch plug-in.

The default policy settings enable only users with administrative rights to specify these parameters in requests and to see their values in responses. By default, the provider network extension attributes are completely hidden from regular tenants. As a rule of thumb, if these attributes are not visible in a GET /networks/<network-id> operation, this implies the user submitting the request is not authorized to view or manipulate provider network attributes.

Index

Package Files

doc.go results.go

func ExtractList Uses

func ExtractList(page pagination.Page) ([]NetworkExtAttrs, error)

ExtractList accepts a Page struct, specifically a NetworkPage struct, and extracts the elements into a slice of NetworkExtAttrs structs. In other words, a generic collection is mapped into a relevant slice.

type AdminState Uses

type AdminState *bool

AdminState gives users a solid type to work with for create and update operations. It is recommended that users use the `Up` and `Down` enums.

var (
    Up   AdminState = &iTrue
    Down AdminState = &iFalse
)

Convenience vars for AdminStateUp values.

type NetworkExtAttrs Uses

type NetworkExtAttrs struct {
    // UUID for the network
    ID  string `mapstructure:"id" json:"id"`

    // Human-readable name for the network. Might not be unique.
    Name string `mapstructure:"name" json:"name"`

    // The administrative state of network. If false (down), the network does not forward packets.
    AdminStateUp bool `mapstructure:"admin_state_up" json:"admin_state_up"`

    // Indicates whether network is currently operational. Possible values include
    // `ACTIVE', `DOWN', `BUILD', or `ERROR'. Plug-ins might define additional values.
    Status string `mapstructure:"status" json:"status"`

    // Subnets associated with this network.
    Subnets []string `mapstructure:"subnets" json:"subnets"`

    // Owner of network. Only admin users can specify a tenant_id other than its own.
    TenantID string `mapstructure:"tenant_id" json:"tenant_id"`

    // Specifies whether the network resource can be accessed by any tenant or not.
    Shared bool `mapstructure:"shared" json:"shared"`

    // Specifies the nature of the physical network mapped to this network
    // resource. Examples are flat, vlan, or gre.
    NetworkType string `json:"provider:network_type" mapstructure:"provider:network_type"`

    // Identifies the physical network on top of which this network object is
    // being implemented. The OpenStack Networking API does not expose any facility
    // for retrieving the list of available physical networks. As an example, in
    // the Open vSwitch plug-in this is a symbolic name which is then mapped to
    // specific bridges on each compute host through the Open vSwitch plug-in
    // configuration file.
    PhysicalNetwork string `json:"provider:physical_network" mapstructure:"provider:physical_network"`

    // Identifies an isolated segment on the physical network; the nature of the
    // segment depends on the segmentation model defined by network_type. For
    // instance, if network_type is vlan, then this is a vlan identifier;
    // otherwise, if network_type is gre, then this will be a gre key.
    SegmentationID string `json:"provider:segmentation_id" mapstructure:"provider:segmentation_id"`
}

NetworkExtAttrs represents an extended form of a Network with additional fields.

func ExtractCreate Uses

func ExtractCreate(r networks.CreateResult) (*NetworkExtAttrs, error)

ExtractCreate decorates a CreateResult struct returned from a networks.Create() function with extended attributes.

func ExtractGet Uses

func ExtractGet(r networks.GetResult) (*NetworkExtAttrs, error)

ExtractGet decorates a GetResult struct returned from a networks.Get() function with extended attributes.

func ExtractUpdate Uses

func ExtractUpdate(r networks.UpdateResult) (*NetworkExtAttrs, error)

ExtractUpdate decorates a UpdateResult struct returned from a networks.Update() function with extended attributes.

Package provider imports 3 packages (graph). Updated 2016-07-16. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).