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

package portsbinding

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

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

Index

Package Files

doc.go fixtures.go requests.go results.go urls.go

func ExtractPorts Uses

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.

func HandleCreate Uses

func HandleCreate(t *testing.T)

func HandleGet Uses

func HandleGet(t *testing.T)

func HandleListSuccessfully Uses

func HandleListSuccessfully(t *testing.T)

func HandleUpdate Uses

func HandleUpdate(t *testing.T)

type CreateOpts Uses

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 Uses

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

ToPortCreateMap casts a CreateOpts struct to a map.

type CreateResult Uses

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

CreateResult represents the result of a create operation.

func Create Uses

func Create(c *gophercloud.ServiceClient, opts ports.CreateOptsBuilder) CreateResult

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

func (CreateResult) Extract Uses

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

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

type GetResult Uses

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

GetResult represents the result of a get operation.

func Get Uses

func Get(c *gophercloud.ServiceClient, id string) GetResult

Get retrieves a specific port based on its unique ID.

func (GetResult) Extract Uses

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

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

type IP Uses

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 Uses

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.

type UpdateOpts Uses

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 Uses

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

ToPortUpdateMap casts an UpdateOpts struct to a map.

type UpdateResult Uses

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

UpdateResult represents the result of an update operation.

func Update Uses

func Update(c *gophercloud.ServiceClient, id string, opts ports.UpdateOptsBuilder) UpdateResult

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

func (UpdateResult) Extract Uses

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

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

Package portsbinding imports 9 packages (graph). Updated 2016-07-23. Refresh now. Tools for package owners.