external

package
Version: v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2015 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package external provides information and interaction with the external extension for the OpenStack Networking service.

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 CreateOpts

type CreateOpts struct {
	Parent   networks.CreateOpts
	External bool
}

CreateOpts is the structure used when creating new external network resources. It embeds networks.CreateOpts and so inherits all of its required and optional fields, with the addition of the External field.

func (CreateOpts) ToNetworkCreateMap

func (o CreateOpts) ToNetworkCreateMap() (map[string]interface{}, error)

ToNetworkCreateMap casts a CreateOpts struct to a map.

type NetworkExternal

type NetworkExternal 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 whether the network is an external network or not.
	External bool `mapstructure:"router:external" json:"router:external"`
}

NetworkExternal represents a decorated form of a Network with based on the "external-net" extension.

func ExtractCreate

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

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

func ExtractGet

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

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

func ExtractList

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

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

func ExtractUpdate

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

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

type UpdateOpts

type UpdateOpts struct {
	Parent   networks.UpdateOpts
	External bool
}

UpdateOpts is the structure used when updating existing external network resources. It embeds networks.UpdateOpts and so inherits all of its required and optional fields, with the addition of the External field.

func (UpdateOpts) ToNetworkUpdateMap

func (o UpdateOpts) ToNetworkUpdateMap() (map[string]interface{}, error)

ToNetworkUpdateMap casts an UpdateOpts struct to a map.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL