Documentation ¶
Index ¶
- func Create(c *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
- func Delete(c *gcorecloud.ServiceClient, id string) (r tasks.Result)
- func ExtractDeviceInto(r pagination.Page, v interface{}) error
- func ExtractReservedFixedIPIDFromTask(task *tasks.Task) (string, error)
- func ExtractReservedFixedIPInto(r pagination.Page, v interface{}) error
- func List(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func ListAvailableDevice(c *gcorecloud.ServiceClient, id string) pagination.Pager
- func ListConnectedDevice(c *gcorecloud.ServiceClient, id string) pagination.Pager
- type AllowedAddressPairs
- type CreateOpts
- type CreateOptsBuilder
- type Device
- type DevicePage
- type GetResult
- type IPAssignment
- type IPReservation
- type ListOpts
- type ListOptsBuilder
- type PortsToShareVIPOpts
- type PortsToShareVIPOptsBuilder
- type ReservedFixedIP
- type ReservedFixedIPPage
- type ReservedFixedIPTaskResult
- type ReservedFixedIPType
- func (t ReservedFixedIPType) IsValid() error
- func (t ReservedFixedIPType) List() []ReservedFixedIPType
- func (t *ReservedFixedIPType) MarshalJSON() ([]byte, error)
- func (t ReservedFixedIPType) String() string
- func (t ReservedFixedIPType) StringList() []string
- func (t *ReservedFixedIPType) UnmarshalJSON(data []byte) error
- func (t ReservedFixedIPType) ValidOrNil() (*ReservedFixedIPType, error)
- type SliceResult
- type SwitchVIPOpts
- type SwitchVIPOptsBuilder
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 reserved fixed ip using the values provided.
func Delete ¶
func Delete(c *gcorecloud.ServiceClient, id string) (r tasks.Result)
Delete accepts a unique ID and deletes the reserved fixed ip associated with it.
func ExtractDeviceInto ¶
func ExtractDeviceInto(r pagination.Page, v interface{}) error
func ExtractReservedFixedIPInto ¶
func ExtractReservedFixedIPInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List retrieves list of reserved fixed ips.
func ListAvailableDevice ¶
func ListAvailableDevice(c *gcorecloud.ServiceClient, id string) pagination.Pager
ListAvailableDevice accepts a unique ID and retrieves list of available devices associated with it.
func ListConnectedDevice ¶
func ListConnectedDevice(c *gcorecloud.ServiceClient, id string) pagination.Pager
ListConnectedDevice accepts a unique ID and retrieves list of connected devices associated with it.
Types ¶
type AllowedAddressPairs ¶
type AllowedAddressPairs struct { IPAddress net.IP `json:"ip_address"` MacAddress string `json:"mac_address"` }
AllowedAddressPairs represents the information of an allowed address pairs for any particular ReservedFixedIP
type CreateOpts ¶
type CreateOpts struct { Type ReservedFixedIPType `json:"type" required:"true" validate:"required,enum"` NetworkID string `json:"network_id,omitempty" validate:"rfe=Type:ip_address;any_subnet,omitempty,uuid4"` SubnetID string `json:"subnet_id,omitempty" validate:"rfe=Type:subnet,omitempty,uuid4"` IPAddress net.IP `json:"ip_address,omitempty" validate:"rfe=Type:ip_address,omitempty"` IsVip bool `json:"is_vip"` }
CreateOpts represents options used to create a reserved fixed ip.
func (CreateOpts) ToReservedFixedIPCreateMap ¶
func (opts CreateOpts) ToReservedFixedIPCreateMap() (map[string]interface{}, error)
ToReservedFixedIPCreateMap builds a request body.
func (*CreateOpts) Validate ¶
func (opts *CreateOpts) Validate() error
type CreateOptsBuilder ¶
ToReservedFixedIPCreateMap allows extensions to add additional parameters to the Create request
type Device ¶
type Device struct { PortID string `json:"port_id"` IPAssignments []IPAssignment `json:"ip_assignments"` InstanceID string `json:"instance_id"` InstanceName string `json:"instance_name"` Network networks.Network `json:"network"` }
Device represents a Device structure.
func ExtractDevices ¶
func ExtractDevices(r pagination.Page) ([]Device, error)
ExtractDevices accepts a Page struct, specifically a DevicePage struct, and extracts the elements into a slice of Device structs. In other words, a generic collection is mapped into a relevant slice.
func ListAllAvailableDevice ¶
func ListAllAvailableDevice(c *gcorecloud.ServiceClient, id string) ([]Device, error)
ListAllAvailableDevice returns all available device.
func ListAllConnectedDevice ¶
func ListAllConnectedDevice(c *gcorecloud.ServiceClient, id string) ([]Device, error)
ListAllConnectedDevice returns all connected device.
type DevicePage ¶
type DevicePage struct {
pagination.LinkedPageBase
}
DevicePage is the page returned by a pager when traversing over a collection of ReservedFixedIPs.
func (DevicePage) IsEmpty ¶
func (r DevicePage) IsEmpty() (bool, error)
IsEmpty checks whether a DevicePage struct is empty.
func (DevicePage) NextPageURL ¶
func (r DevicePage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of Device 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 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 ReservedFixedIP.
func Get ¶
func Get(c *gcorecloud.ServiceClient, id string) (r GetResult)
Get retrieves a specific reserved fixed ip based on its unique ID.
func SwitchVIP ¶
func SwitchVIP(c *gcorecloud.ServiceClient, id string, opts SwitchVIPOptsBuilder) (r GetResult)
SwitchVIP accepts a SwitchVIPOpts struct and switch vip status using the values provided.
func (GetResult) Extract ¶
func (r GetResult) Extract() (*ReservedFixedIP, error)
Extract is a function that accepts a result and extracts a reserved fixed ip resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type IPAssignment ¶
type IPAssignment struct { IPAddress net.IP `json:"ip_address"` SubnetID string `json:"subnet_id"` Subnet subnets.Subnet `json:"subnet"` }
IPAssignment represents a IPAssignment structure.
type IPReservation ¶
type IPReservation struct { Status string `json:"status"` ResourceType *string `json:"resource_type"` ResourceID *string `json:"resource_id"` }
IPReservation represents the information of an ip reservation
type ListOpts ¶
type ListOpts struct { ExternalOnly bool `q:"external_only"` InternalOnly bool `q:"internal_only"` AvailableOnly bool `q:"available_only"` VipOnly bool `q:"vip_only"` DeviceID string `q:"device_id"` }
ListOpts allows the filtering and sorting List API response.
func (ListOpts) ToReservedFixedIPListQuery ¶
ToReservedFixedIPListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type PortsToShareVIPOpts ¶
type PortsToShareVIPOpts struct {
}PortsToShareVIPOpts represents options used to add ports to share vip.
func (PortsToShareVIPOpts) ToPortsToShareVIPOptsMap ¶
func (opts PortsToShareVIPOpts) ToPortsToShareVIPOptsMap() (map[string]interface{}, error)
ToAddPortsToShareVIPOptsMap builds a request body.
func (*PortsToShareVIPOpts) Validate ¶
func (opts *PortsToShareVIPOpts) Validate() error
type PortsToShareVIPOptsBuilder ¶
type PortsToShareVIPOptsBuilder interface {
}ToPortsToShareVIPOptsMap allows extensions to add additional parameters to the AddPortsToShareVIP request
type ReservedFixedIP ¶
type ReservedFixedIP struct { PortID string `json:"port_id"` Name string `json:"name"` CreatedAt gcorecloud.JSONRFC3339Z `json:"created_at"` UpdatedAt gcorecloud.JSONRFC3339Z `json:"updated_at"` Status string `json:"status"` FixedIPAddress net.IP `json:"fixed_ip_address"` SubnetID string `json:"subnet_id"` CreatorTaskID string `json:"creator_task_id"` TaskID *string `json:"task_id"` IsExternal bool `json:"is_external"` IsVip bool `json:"is_vip"` Reservation IPReservation `json:"reservation"` Region string `json:"region"` RegionID int `json:"region_id"` ProjectID int `json:"project_id"` AllowedAddressPairs []AllowedAddressPairs `json:"allowed_address_pairs"` NetworkID string `json:"network_id"` Network networks.Network `json:"network"` }
ReservedFixedIP represents a ReservedFixedIP structure.
func ExtractReservedFixedIPs ¶
func ExtractReservedFixedIPs(r pagination.Page) ([]ReservedFixedIP, error)
ExtractReservedFixedIPs accepts a Page struct, specifically a ReservedFixedIPPage struct, and extracts the elements into a slice of ReservedFixedIP structs. In other words, a generic collection is mapped into a relevant slice.
func ListAll ¶
func ListAll(c *gcorecloud.ServiceClient, opts ListOptsBuilder) ([]ReservedFixedIP, error)
ListAll returns all reserved fixed ips.
type ReservedFixedIPPage ¶
type ReservedFixedIPPage struct {
pagination.LinkedPageBase
}
ReservedFixedIPPage is the page returned by a pager when traversing over a collection of ReservedFixedIPs.
func (ReservedFixedIPPage) IsEmpty ¶
func (r ReservedFixedIPPage) IsEmpty() (bool, error)
IsEmpty checks whether a ReservedFixedIPPage struct is empty.
func (ReservedFixedIPPage) NextPageURL ¶
func (r ReservedFixedIPPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of ReservedFixedIP 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 ReservedFixedIPTaskResult ¶
type ReservedFixedIPTaskResult struct {
Ports []string `json:"ports"`
}
type ReservedFixedIPType ¶
type ReservedFixedIPType string
const ( External ReservedFixedIPType = "external" Subnet ReservedFixedIPType = "subnet" AnySubnet ReservedFixedIPType = "any_subnet" IPAddress ReservedFixedIPType = "ip_address" )
func (ReservedFixedIPType) IsValid ¶
func (t ReservedFixedIPType) IsValid() error
func (ReservedFixedIPType) List ¶
func (t ReservedFixedIPType) List() []ReservedFixedIPType
func (*ReservedFixedIPType) MarshalJSON ¶
func (t *ReservedFixedIPType) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaler interface for ReservedFixedIPType
func (ReservedFixedIPType) String ¶
func (t ReservedFixedIPType) String() string
func (ReservedFixedIPType) StringList ¶
func (t ReservedFixedIPType) StringList() []string
func (*ReservedFixedIPType) UnmarshalJSON ¶
func (t *ReservedFixedIPType) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface for ReservedFixedIPType
func (ReservedFixedIPType) ValidOrNil ¶
func (t ReservedFixedIPType) ValidOrNil() (*ReservedFixedIPType, error)
type SliceResult ¶
type SliceResult struct {
gcorecloud.Result
}
func AddPortsToShareVIP ¶
func AddPortsToShareVIP(c *gcorecloud.ServiceClient, id string, opts PortsToShareVIPOptsBuilder) (r SliceResult)
AddPortsToShareVIP accepts a unique ID, PortsToShareVIPOpts and add ports to share vip using the value provided.
func ReplacePortsToShareVIP ¶
func ReplacePortsToShareVIP(c *gcorecloud.ServiceClient, id string, opts PortsToShareVIPOptsBuilder) (r SliceResult)
ReplacePortsToShareVIP accepts a unique ID, PortsToShareVIPOpts and replace ports to share vip using the value provided.
func (SliceResult) Extract ¶
func (r SliceResult) Extract() ([]Device, error)
Extract is a function that accepts a result and extracts a slice of device resource.
func (SliceResult) ExtractInto ¶
func (r SliceResult) ExtractInto(v interface{}) error
type SwitchVIPOpts ¶
type SwitchVIPOpts struct {
IsVip bool `json:"is_vip"`
}
SwitchVIPOpts represents options used to switch vip status.
func (SwitchVIPOpts) ToReservedFixedIPSwitchVIPMap ¶
func (opts SwitchVIPOpts) ToReservedFixedIPSwitchVIPMap() (map[string]interface{}, error)
ToReservedFixedIPSwitchVIPMap builds a request body.
type SwitchVIPOptsBuilder ¶
type SwitchVIPOptsBuilder interface {
ToReservedFixedIPSwitchVIPMap() (map[string]interface{}, error)
}
ToReservedFixedIPSwitchVIPMap allows extensions to add additional parameters to the SwitchVIP request