Documentation ¶
Index ¶
- func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
- func Delete(c *gcorecloud.ServiceClient, floatingID string) (r tasks.Result)
- func ExtractFloatingIPIDFromTask(task *tasks.Task) (string, error)
- func ExtractFloatingIPsInto(r pagination.Page, v interface{}) error
- func List(c *gcorecloud.ServiceClient) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type FloatingIPDetail
- type FloatingIPPage
- type FloatingIPTaskResult
- type GetResult
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
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 ExtractFloatingIPsInto ¶
func ExtractFloatingIPsInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *gcorecloud.ServiceClient) pagination.Pager
Types ¶
type CreateOpts ¶
type CreateOpts struct { PortID string `json:"port_id,omitempty"` 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 ¶
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 ¶
func ListAll(c *gcorecloud.ServiceClient) ([]FloatingIPDetail, error)
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 ¶
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