portsbinding

package
v0.0.0-...-2f2c61e Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package portsbinding provides information and interaction with the port binding extension for the OpenStack Networking service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCreate

func HandleCreate(t *testing.T)

func HandleGet

func HandleGet(t *testing.T)

func HandleListSuccessfully

func HandleListSuccessfully(t *testing.T)

func HandleUpdate

func HandleUpdate(t *testing.T)

Types

type CreateOpts

type CreateOpts struct {
	// CreateOptsBuilder is the interface options structs have to satisfy in order
	// to be used in the main Create operation in this package.
	ports.CreateOptsBuilder
	// The ID of the host where the port is allocated
	HostID string
	// The virtual network interface card (vNIC) type that is bound to the
	// neutron port
	VNICType string
	// A dictionary that enables the application running on the specified
	// host to pass and receive virtual network interface (VIF) port-specific
	// information to the plug-in
	Profile map[string]string
}

CreateOpts represents the attributes used when creating a new port with extended attributes.

func (CreateOpts) ToPortCreateMap

func (opts CreateOpts) ToPortCreateMap() (map[string]interface{}, error)

ToPortCreateMap casts a CreateOpts struct to a map.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents the result of a create operation.

func Create

Create accepts a CreateOpts struct and creates a new port with extended attributes. You must remember to provide a NetworkID value.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Port, error)

Extract is a function that accepts a result and extracts a port resource.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a get operation.

func Get

Get retrieves a specific port based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Port, error)

Extract is a function that accepts a result and extracts a port resource.

type IP

type IP struct {
	SubnetID  string `mapstructure:"subnet_id" json:"subnet_id"`
	IPAddress string `mapstructure:"ip_address" json:"ip_address,omitempty"`
}

IP is a sub-struct that represents an individual IP.

type Port

type Port struct {
	ports.Port `mapstructure:",squash"`
	// The ID of the host where the port is allocated
	HostID string `mapstructure:"binding:host_id" json:"binding:host_id"`
	// A dictionary that enables the application to pass information about
	// functions that the Networking API provides.
	VIFDetails map[string]interface{} `mapstructure:"binding:vif_details" json:"binding:vif_details"`
	// The VIF type for the port.
	VIFType string `mapstructure:"binding:vif_type" json:"binding:vif_type"`
	// The virtual network interface card (vNIC) type that is bound to the
	// neutron port
	VNICType string `mapstructure:"binding:vnic_type" json:"binding:vnic_type"`
	// A dictionary that enables the application running on the specified
	// host to pass and receive virtual network interface (VIF) port-specific
	// information to the plug-in
	Profile map[string]string `mapstructure:"binding:profile" json:"binding:profile"`
}

Port represents a Neutron port. See package documentation for a top-level description of what this is.

func ExtractPorts

func ExtractPorts(page pagination.Page) ([]Port, error)

ExtractPorts accepts a Page struct, specifically a PortPage struct, and extracts the elements into a slice of Port structs. In other words, a generic collection is mapped into a relevant slice.

type UpdateOpts

type UpdateOpts struct {
	// UpdateOptsBuilder is the interface options structs have to satisfy in order
	// to be used in the main Update operation in this package.
	ports.UpdateOptsBuilder
	// The ID of the host where the port is allocated
	HostID string
	// The virtual network interface card (vNIC) type that is bound to the
	// neutron port
	VNICType string
	// A dictionary that enables the application running on the specified
	// host to pass and receive virtual network interface (VIF) port-specific
	// information to the plug-in
	Profile map[string]string
}

UpdateOpts represents the attributes used when updating an existing port.

func (UpdateOpts) ToPortUpdateMap

func (opts UpdateOpts) ToPortUpdateMap() (map[string]interface{}, error)

ToPortUpdateMap casts an UpdateOpts struct to a map.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents the result of an update operation.

func Update

Update accepts a UpdateOpts struct and updates an existing port using the values provided.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Port, error)

Extract is a function that accepts a result and extracts a port resource.

Jump to

Keyboard shortcuts

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