floatingips

package
v0.3.16 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create accepts a CreateOpts struct and creates a new floating ip using the values provided.

func Delete

func Delete(c *gcorecloud.ServiceClient, floatingID string) (r tasks.Result)

Delete accepts a unique ID and deletes the floating ip associated with it.

func ExtractFloatingIPIDFromTask

func ExtractFloatingIPIDFromTask(task *tasks.Task) (string, error)

func ExtractFloatingIPsInto

func ExtractFloatingIPsInto(r pagination.Page, v interface{}) error

Types

type CreateOpts

type CreateOpts struct {
	PortID         string `json:"port_id" required:"true"`
	FixedIPAddress net.IP `json:"fixed_ip_address,omitempty"`
}

CreateOpts represents options used to create a floating ip.

func (CreateOpts) ToFloatingIPCreateMap

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

ToFloatingIPCreateMap builds a request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToFloatingIPCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder adds additional parameters to the request.

type CreateResult

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

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a FloatingIP.

func (CreateResult) Extract

func (r CreateResult) Extract() (*instances.FloatingIP, error)

Extract is a function that accepts a result and extracts a security group resource.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

type FloatingIPDetail

type FloatingIPDetail struct {
	*instances.FloatingIP
	Instance instances.Instance `json:"instance"`
}

FloatingIPDetail represents a floating IP with details.

func ExtractFloatingIPs

func ExtractFloatingIPs(r pagination.Page) ([]FloatingIPDetail, error)

ExtractFloatingIP accepts a Page struct, specifically a FloatingIPPage struct, and extracts the elements into a slice of FloatingIP structs. In other words, a generic collection is mapped into a relevant slice.

func ListAll

ListAll returns all floating IPs

type FloatingIPPage

type FloatingIPPage struct {
	pagination.LinkedPageBase
}

FloatingIPPage is the page returned by a pager when traversing over a collection of security groups.

func (FloatingIPPage) IsEmpty

func (r FloatingIPPage) IsEmpty() (bool, error)

IsEmpty checks whether a FloatingIPPage struct is empty.

func (FloatingIPPage) NextPageURL

func (r FloatingIPPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of security groups has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type FloatingIPTaskResult

type FloatingIPTaskResult struct {
	FloatingIPs []string `json:"floatingips"`
}

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a FloatingIP.

func Get

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

Get retrieves a specific floating ip based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*instances.FloatingIP, error)

Extract is a function that accepts a result and extracts a security group resource.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToFloatingIPUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult represents the result of a assign or unassign operation. Call its Extract method to interpret it as a FloatingIP.

func Assign

func Assign(c *gcorecloud.ServiceClient, floatingIPID string, opts CreateOptsBuilder) (r UpdateResult)

Assign accepts a CreateOpts struct and assign floating IP.

func UnAssign

func UnAssign(c *gcorecloud.ServiceClient, floatingIPID string) (r UpdateResult)

UnAssign

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*instances.FloatingIP, error)

Extract is a function that accepts a result and extracts a security group resource.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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