reservedfixedips

package
v0.7.13 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	External  ReservedFixedIPType = "external"
	Subnet    ReservedFixedIPType = "subnet"
	AnySubnet ReservedFixedIPType = "any_subnet"
	IPAddress ReservedFixedIPType = "ip_address"
	Port      ReservedFixedIPType = "port"

	IPv4IPFamilyType      IPFamilyType = "ipv4"
	IPv6IPFamilyType      IPFamilyType = "ipv6"
	DualStackIPFamilyType IPFamilyType = "dual"
)

Variables

This section is empty.

Functions

func Create

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 ExtractReservedFixedIPIDFromTask

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

func ExtractReservedFixedIPInto

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

func List

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  string `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"`
	IPFamily  IPFamilyType        `json:"ip_family,omitempty" validate:"omitempty,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"`
	PortID    string              `json:"port_id,omitempty" validate:"rfe=Type:port,omitempty,uuid4"`
	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

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

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 IPFamilyType added in v0.6.9

type IPFamilyType string

func (IPFamilyType) IsValid added in v0.6.9

func (it IPFamilyType) IsValid() error

func (IPFamilyType) List added in v0.6.9

func (it IPFamilyType) List() []IPFamilyType

func (*IPFamilyType) MarshalJSON added in v0.6.9

func (it *IPFamilyType) MarshalJSON() ([]byte, error)

MarshalJSON - implements Marshaler interface

func (IPFamilyType) String added in v0.6.9

func (it IPFamilyType) String() string

func (IPFamilyType) StringList added in v0.6.9

func (it IPFamilyType) StringList() []string

func (*IPFamilyType) UnmarshalJSON added in v0.6.9

func (it *IPFamilyType) UnmarshalJSON(data []byte) error

UnmarshalJSON - implements Unmarshaler interface

func (IPFamilyType) ValidOrNil added in v0.6.9

func (it IPFamilyType) ValidOrNil() (*IPFamilyType, error)

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

func (opts ListOpts) ToReservedFixedIPListQuery() (string, error)

ToReservedFixedIPListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToReservedFixedIPListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type PortsToShareVIPOpts

type PortsToShareVIPOpts struct {
	PortIDs []string `json:"port_ids" validate:"required,dive,uuid4"`
}

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() (map[string]interface{}, error)
}

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"`
	FixedIPv6Address    net.IP                  `json:"fixed_ipv6_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

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

func (ReservedFixedIPType) IsValid

func (t ReservedFixedIPType) IsValid() error

func (ReservedFixedIPType) List

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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