provider

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2014 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminState

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

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

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

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

func ExtractGet

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

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

func ExtractList

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.

func ExtractUpdate

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL