Documentation ¶
Overview ¶
Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb
Package load_balancers contains functionality for working with ECL Managed Load Balancer resources.
Example to list load balancers
listOpts := load_balancers.ListOpts{} allPages, err := load_balancers.List(managedLoadBalancerClient, listOpts).AllPages() if err != nil { panic(err) } allLoadBalancers, err := load_balancers.ExtractLoadBalancers(allPages) if err != nil { panic(err) } for _, loadBalancer := range allLoadBalancers { fmt.Printf("%+v\n", loadBalancer) }
Example to create a load balancer
reservedFixedIP1 := load_balancers.CreateOptsReservedFixedIP{ IPAddress: "192.168.0.2", } reservedFixedIP2 := load_balancers.CreateOptsReservedFixedIP{ IPAddress: "192.168.0.3", } reservedFixedIP3 := load_balancers.CreateOptsReservedFixedIP{ IPAddress: "192.168.0.4", } reservedFixedIP4 := load_balancers.CreateOptsReservedFixedIP{ IPAddress: "192.168.0.5", } interface1 := load_balancers.CreateOptsInterface{ NetworkID: "d6797cf4-42b9-4cad-8591-9dd91c3f0fc3", VirtualIPAddress: "192.168.0.1", ReservedFixedIPs: &[]load_balancers.CreateOptsReservedFixedIP{reservedFixedIP1, reservedFixedIP2, reservedFixedIP3, reservedFixedIP4}, } syslogServer1 := load_balancers.CreateOptsSyslogServer{ IPAddress: "192.168.0.6", Port: 514, Protocol: "udp", } createOpts := load_balancers.CreateOpts{ Name: "load_balancer", Description: "description", Tags: map[string]string{"key": "value"}, PlanID: "00713021-9aea-41da-9a88-87760c08fa72", SyslogServers: &[]load_balancers.CreateOptsSyslogServer{syslogServer1}, Interfaces: &[]load_balancers.CreateOptsInterface{interface1}, } loadBalancer, err := load_balancers.Create(managedLoadBalancerClient, createOpts).Extract() if err != nil { panic(err) } fmt.Printf("%+v\n", loadBalancer)
Example to show a load balancer
showOpts := load_balancers.ShowOpts{} id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" loadBalancer, err := load_balancers.Show(managedLoadBalancerClient, id, showOpts).Extract() if err != nil { panic(err) } fmt.Printf("%+v\n", loadBalancer)
Example to update a load balancer
name := "load_balancer" description := "description" updateOpts := load_balancers.UpdateOpts{ Name: &name, Description: &description, Tags: &map[string]string{"key": "value"}, } id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" loadBalancer, err := load_balancers.Update(managedLoadBalancerClient, updateOpts).Extract() if err != nil { panic(err) } fmt.Printf("%+v\n", loadBalancer)
Example to delete a load balancer
id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" err := load_balancers.Delete(managedLoadBalancerClient, id).ExtractErr() if err != nil { panic(err) }
Example to perform apply-configurations action on a load balancer
id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" err := load_balancers.ApplyConfigurations(managedLoadBalancerClient, id).ExtractErr() if err != nil { panic(err) }
Example to perform system-update action on a load balancer
systemUpdateOpts := load_balancers.SystemUpdateOpts{ SystemUpdateID: "31746df7-92f9-4b5e-ad05-59f6684a54eb", } id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" err := load_balancers.SystemUpdate(managedLoadBalancerClient, id, systemUpdateOpts).ExtractErr() if err != nil { panic(err) }
Example to perform cancel-configurations action on a load balancer
id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" err := load_balancers.CancelConfigurations(managedLoadBalancerClient, id).ExtractErr() if err != nil { panic(err) }
Example to create staged load balancer configurations
reservedFixedIP1 := load_balancers.CreateStagedOptsReservedFixedIP{ IPAddress: "192.168.0.2", } reservedFixedIP2 := load_balancers.CreateStagedOptsReservedFixedIP{ IPAddress: "192.168.0.3", } reservedFixedIP3 := load_balancers.CreateStagedOptsReservedFixedIP{ IPAddress: "192.168.0.4", } reservedFixedIP4 := load_balancers.CreateStagedOptsReservedFixedIP{ IPAddress: "192.168.0.5", } interface1 := load_balancers.CreateStagedOptsInterface{ NetworkID: "d6797cf4-42b9-4cad-8591-9dd91c3f0fc3", VirtualIPAddress: "192.168.0.1", ReservedFixedIPs: &[]load_balancers.CreateStagedOptsReservedFixedIP{reservedFixedIP1, reservedFixedIP2, reservedFixedIP3, reservedFixedIP4}, } syslogServer1 := load_balancers.CreateStagedOptsSyslogServer{ IPAddress: "192.168.0.6", Port: 514, Protocol: "udp", } createStagedOpts := load_balancers.CreateStagedOpts{ SyslogServers: &[]load_balancers.CreateStagedOptsSyslogServer{syslogServer1}, Interfaces: &[]load_balancers.CreateStagedOptsInterface{interface1}, } id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" loadBalancerConfigurations, err := load_balancers.CreateStaged(managedLoadBalancerClient, id, createStagedOpts).Extract() if err != nil { panic(err) } fmt.Printf("%+v\n", loadBalancerConfigurations)
Example to show staged load balancer configurations
id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" loadBalancerConfigurations, err := load_balancers.ShowStaged(managedLoadBalancerClient, id).Extract() if err != nil { panic(err) } fmt.Printf("%+v\n", loadBalancerConfigurations)
Example to update staged load balancer configurations
reservedFixedIP1IPAddress := "192.168.0.2" reservedFixedIP1 := load_balancers.UpdateStagedOptsReservedFixedIP{ IPAddress: &reservedFixedIP1IPAddress, } reservedFixedIP2IPAddress := "192.168.0.3" reservedFixedIP2 := load_balancers.UpdateStagedOptsReservedFixedIP{ IPAddress: &reservedFixedIP2IPAddress, } reservedFixedIP3IPAddress := "192.168.0.4" reservedFixedIP3 := load_balancers.UpdateStagedOptsReservedFixedIP{ IPAddress: &reservedFixedIP3IPAddress, } reservedFixedIP4IPAddress := "192.168.0.5" reservedFixedIP4 := load_balancers.UpdateStagedOptsReservedFixedIP{ IPAddress: &reservedFixedIP4IPAddress, } interface1NetworkID := "d6797cf4-42b9-4cad-8591-9dd91c3f0fc3" interface1VirtualIPAddress := "192.168.0.1" interface1 := load_balancers.UpdateStagedOptsInterface{ NetworkID: &interface1NetworkID, VirtualIPAddress: &interface1VirtualIPAddress, ReservedFixedIPs: &[]load_balancers.UpdateStagedOptsReservedFixedIP{reservedFixedIP1, reservedFixedIP2, reservedFixedIP3, reservedFixedIP4}, } syslogServer1IPAddress := "192.168.0.6" syslogServer1Port := 514 syslogServer1Protocol := "udp" syslogServer1 := load_balancers.UpdateStagedOptsSyslogServer{ IPAddress: &syslogServer1IPAddress, Port: &syslogServer1Port, Protocol: &syslogServer1Protocol, } updateStagedOpts := load_balancers.UpdateStagedOpts{ SyslogServers: &[]load_balancers.UpdateStagedOptsSyslogServer{syslogServer1}, Interfaces: &[]load_balancers.UpdateStagedOptsInterface{interface1}, } id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" loadBalancerConfigurations, err := load_balancers.UpdateStaged(managedLoadBalancerClient, updateStagedOpts).Extract() if err != nil { panic(err) } fmt.Printf("%+v\n", loadBalancerConfigurations)
Example to cancel staged load balancer configurations
id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" err := load_balancers.CancelStaged(managedLoadBalancerClient, id).ExtractErr() if err != nil { panic(err) }
Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb
Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb
Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb
Index ¶
- func ExtractLoadBalancersInto(r pagination.Page, v interface{}) error
- func List(c *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type ActionResult
- type CancelStagedResult
- type ConfigurationInResponse
- type CreateOpts
- type CreateOptsBuilder
- type CreateOptsInterface
- type CreateOptsReservedFixedIP
- type CreateOptsSyslogServer
- type CreateResult
- type CreateStagedOpts
- type CreateStagedOptsBuilder
- type CreateStagedOptsInterface
- type CreateStagedOptsReservedFixedIP
- type CreateStagedOptsSyslogServer
- type CreateStagedResult
- type DeleteResult
- type InterfaceInResponse
- type ListOpts
- type ListOptsBuilder
- type LoadBalancer
- type LoadBalancerPage
- type ReservedFixedIPInResponse
- type ShowOpts
- type ShowOptsBuilder
- type ShowResult
- type ShowStagedResult
- type SyslogServerInResponse
- type SystemUpdateOpts
- type SystemUpdateOptsBuilder
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
- type UpdateStagedOpts
- type UpdateStagedOptsBuilder
- type UpdateStagedOptsInterface
- type UpdateStagedOptsReservedFixedIP
- type UpdateStagedOptsSyslogServer
- type UpdateStagedResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractLoadBalancersInto ¶
func ExtractLoadBalancersInto(r pagination.Page, v interface{}) error
ExtractLoadBalancersInto interprets the results of a single page from a List() call, producing a slice of load balancer entities.
func List ¶
func List(c *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List returns a Pager which allows you to iterate over a collection of load balancers. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
Types ¶
type ActionResult ¶
type ActionResult struct {
eclcloud.ErrResult
}
ActionResult represents the result of a Action operation. Call its ExtractErr method to determine if the request succeeded or failed.
func ApplyConfigurations ¶
func ApplyConfigurations(c *eclcloud.ServiceClient, id string) (r ActionResult)
ApplyConfigurations performs action on a existing load balancer.
func CancelConfigurations ¶
func CancelConfigurations(c *eclcloud.ServiceClient, id string) (r ActionResult)
CancelConfigurations performs action on a existing load balancer.
func SystemUpdate ¶
func SystemUpdate(c *eclcloud.ServiceClient, id string, opts SystemUpdateOptsBuilder) (r ActionResult)
SystemUpdate accepts a SystemUpdateOpts struct and performs action on a existing load balancer using the values provided.
type CancelStagedResult ¶
type CancelStagedResult struct {
eclcloud.ErrResult
}
CancelStagedResult represents the result of a CancelStaged operation. Call its ExtractErr method to determine if the request succeeded or failed.
func CancelStaged ¶
func CancelStaged(c *eclcloud.ServiceClient, id string) (r CancelStagedResult)
CancelStaged accepts a unique ID and deletes load balancer configurations associated with it.
type ConfigurationInResponse ¶
type ConfigurationInResponse struct { // - Syslog servers to which access logs are transferred // - Only access logs to listeners which `protocol` is either `"http"` or `"https"` are transferred // - When `protocol` of `syslog_servers` is `"tcp"` // - Access logs are transferred to all healthy syslog servers specified in `syslog_servers` // - When `protocol` of `syslog_servers` is `"udp"` // - Access logs are transferred to the syslog server specified first in `syslog_servers` as long as it is healthy // - Access logs are transferred to the syslog server specified second (last) in `syslog_servers` when the first syslog server is not healthy SyslogServers []SyslogServerInResponse `json:"syslog_servers,omitempty"` // - Interfaces that attached to the load balancer Interfaces []InterfaceInResponse `json:"interfaces,omitempty"` }
ConfigurationInResponse represents a configuration in a load balancer.
type CreateOpts ¶
type CreateOpts struct { // - Name of the load balancer Name string `json:"name,omitempty"` // - Description of the load balancer Description string `json:"description,omitempty"` // - Tags of the load balancer // - Must be specified as JSON object Tags map[string]string `json:"tags,omitempty"` // - ID of the plan PlanID string `json:"plan_id,omitempty"` // - Syslog servers to which access logs are transferred // - Only access logs to listeners which `protocol` is either `"http"` or `"https"` are transferred // - When `protocol` of `syslog_servers` is `"tcp"` // - Access logs are transferred to all healthy syslog servers specified in `syslog_servers` // - When `protocol` of `syslog_servers` is `"udp"` // - Access logs are transferred to the syslog server specified first in `syslog_servers` as long as it is healthy // - Access logs are transferred to the syslog server specified second (last) in `syslog_servers` when the first syslog server is not healthy SyslogServers *[]CreateOptsSyslogServer `json:"syslog_servers,omitempty"` // - Interfaces that attached to the load balancer // - `virtual_ip_address` and `reserved_fixed_ips` can not be changed once attached // - To change `virtual_ip_address` and `reserved_fixed_ips` , recreating the interface is needed Interfaces *[]CreateOptsInterface `json:"interfaces,omitempty"` }
CreateOpts represents options used to create a new load balancer.
func (CreateOpts) ToLoadBalancerCreateMap ¶
func (opts CreateOpts) ToLoadBalancerCreateMap() (map[string]interface{}, error)
ToLoadBalancerCreateMap builds a request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateOptsInterface ¶
type CreateOptsInterface struct { // - ID of the network that this interface belongs to // - Must be specified the unique network ID in `interfaces` // - Must be specified the network that plane is data // - Must not be specified the network that uses ISP shared address (RFC 6598) NetworkID string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc // - Must be specified the unique IP address in `virtual_ip_address` and `reserved_fixed_ips` // - Must not be specified the network IP address and broadcast IP address // - Must not be specified for existing interfaces VirtualIPAddress string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy // - Must not be specified for existing interfaces ReservedFixedIPs *[]CreateOptsReservedFixedIP `json:"reserved_fixed_ips"` }
CreateOptsInterface represents interface information in the load balancer creation.
type CreateOptsReservedFixedIP ¶
type CreateOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc // - Must be specified the unique IP address in `virtual_ip_address` and `reserved_fixed_ips` // - Must not be specified the network IP address and broadcast IP address IPAddress string `json:"ip_address"` }
CreateOptsReservedFixedIP represents reserved_fixed_ip information in the load balancer creation.
type CreateOptsSyslogServer ¶
type CreateOptsSyslogServer struct { // - IP address of the syslog server // - The load balancer sends ICMP to this IP address for health check purpose IPAddress string `json:"ip_address"` // - Port number of the syslog server Port int `json:"port,omitempty"` // - Protocol of the syslog server // - Must be specified same protocol in all syslog servers belongs to the same load balancer Protocol string `json:"protocol,omitempty"` }
CreateOptsSyslogServer represents syslog_server information in the load balancer creation.
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 LoadBalancer.
func Create ¶
func Create(c *eclcloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create accepts a CreateOpts struct and creates a new load balancer using the values provided.
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*LoadBalancer, error)
Extract is a function that accepts a result and extracts a LoadBalancer resource.
func (CreateResult) ExtractInto ¶
func (r CreateResult) ExtractInto(v interface{}) error
ExtractInto interprets any commonResult as a load balancer, if possible.
type CreateStagedOpts ¶
type CreateStagedOpts struct { // - Syslog servers to which access logs are transferred // - Only access logs to listeners which `protocol` is either `"http"` or `"https"` are transferred // - When `protocol` of `syslog_servers` is `"tcp"` // - Access logs are transferred to all healthy syslog servers specified in `syslog_servers` // - When `protocol` of `syslog_servers` is `"udp"` // - Access logs are transferred to the syslog server specified first in `syslog_servers` as long as it is healthy // - Access logs are transferred to the syslog server specified second (last) in `syslog_servers` when the first syslog server is not healthy SyslogServers *[]CreateStagedOptsSyslogServer `json:"syslog_servers,omitempty"` // - Interfaces that attached to the load balancer // - `virtual_ip_address` and `reserved_fixed_ips` can not be changed once attached // - To change `virtual_ip_address` and `reserved_fixed_ips` , recreating the interface is needed Interfaces *[]CreateStagedOptsInterface `json:"interfaces,omitempty"` }
CreateStagedOpts represents options used to create new load balancer configurations.
func (CreateStagedOpts) ToLoadBalancerCreateStagedMap ¶
func (opts CreateStagedOpts) ToLoadBalancerCreateStagedMap() (map[string]interface{}, error)
ToLoadBalancerCreateStagedMap builds a request body from CreateStagedOpts.
type CreateStagedOptsBuilder ¶
type CreateStagedOptsBuilder interface {
ToLoadBalancerCreateStagedMap() (map[string]interface{}, error)
}
CreateStagedOptsBuilder allows extensions to add additional parameters to the CreateStaged request.
type CreateStagedOptsInterface ¶
type CreateStagedOptsInterface struct { // - ID of the network that this interface belongs to // - Must be specified the unique network ID in `interfaces` // - Must be specified the network that plane is data // - Must not be specified the network that uses ISP shared address (RFC 6598) NetworkID string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc // - Must be specified the unique IP address in `virtual_ip_address` and `reserved_fixed_ips` // - Must not be specified the network IP address and broadcast IP address // - Must not be specified for existing interfaces VirtualIPAddress string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy // - Must not be specified for existing interfaces ReservedFixedIPs *[]CreateStagedOptsReservedFixedIP `json:"reserved_fixed_ips"` }
CreateStagedOptsInterface represents interface information in the load balancer configurations creation.
type CreateStagedOptsReservedFixedIP ¶
type CreateStagedOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc // - Must be specified the unique IP address in `virtual_ip_address` and `reserved_fixed_ips` // - Must not be specified the network IP address and broadcast IP address IPAddress string `json:"ip_address"` }
CreateStagedOptsReservedFixedIP represents reserved_fixed_ip information in the load balancer configurations creation.
type CreateStagedOptsSyslogServer ¶
type CreateStagedOptsSyslogServer struct { // - IP address of the syslog server // - The load balancer sends ICMP to this IP address for health check purpose IPAddress string `json:"ip_address"` // - Port number of the syslog server Port int `json:"port,omitempty"` // - Protocol of the syslog server // - Must be specified same protocol in all syslog servers belongs to the same load balancer Protocol string `json:"protocol,omitempty"` }
CreateStagedOptsSyslogServer represents syslog_server information in the load balancer configurations creation.
type CreateStagedResult ¶
type CreateStagedResult struct {
// contains filtered or unexported fields
}
CreateStagedResult represents the result of a CreateStaged operation. Call its Extract method to interpret it as a LoadBalancer.
func CreateStaged ¶
func CreateStaged(c *eclcloud.ServiceClient, id string, opts CreateStagedOptsBuilder) (r CreateStagedResult)
CreateStaged accepts a CreateStagedOpts struct and creates new load balancer configurations using the values provided.
func (CreateStagedResult) Extract ¶
func (r CreateStagedResult) Extract() (*LoadBalancer, error)
Extract is a function that accepts a result and extracts a LoadBalancer resource.
func (CreateStagedResult) ExtractInto ¶
func (r CreateStagedResult) ExtractInto(v interface{}) error
ExtractInto interprets any commonResult as a load balancer, if possible.
type DeleteResult ¶
type DeleteResult struct {
eclcloud.ErrResult
}
DeleteResult represents the result of a Delete operation. Call its ExtractErr method to determine if the request succeeded or failed.
func Delete ¶
func Delete(c *eclcloud.ServiceClient, id string) (r DeleteResult)
Delete accepts a unique ID and deletes the load balancer associated with it.
type InterfaceInResponse ¶
type InterfaceInResponse struct { // - ID of the network that this interface belongs to NetworkID string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc VirtualIPAddress string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy ReservedFixedIPs []ReservedFixedIPInResponse `json:"reserved_fixed_ips"` }
InterfaceInResponse represents a interface in a load balancer.
type ListOpts ¶
type ListOpts struct { // - ID of the resource ID string `q:"id"` // - Name of the resource Name string `q:"name"` // - Description of the resource Description string `q:"description"` // - Configuration status of the resource ConfigurationStatus string `q:"configuration_status"` // - Monitoring status of the load balancer MonitoringStatus string `q:"monitoring_status"` // - Operation status of the resource OperationStatus string `q:"operation_status"` // - The zone / group where the primary virtual server of load balancer is deployed PrimaryAvailabilityZone string `q:"primary_availability_zone"` // - The zone / group where the secondary virtual server of load balancer is deployed SecondaryAvailabilityZone string `q:"secondary_availability_zone"` // - Primary or secondary availability zone where the load balancer is currently running ActiveAvailabilityZone string `q:"active_availability_zone"` // - Revision of the load balancer Revision int `q:"revision"` // - ID of the plan PlanID string `q:"plan_id"` // - ID of the owner tenant of the resource TenantID string `q:"tenant_id"` }
ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the load balancer attributes you want to see returned.
func (ListOpts) ToLoadBalancerListQuery ¶
ToLoadBalancerListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type LoadBalancer ¶
type LoadBalancer struct { // - ID of the load balancer ID string `json:"id"` // - Name of the load balancer Name string `json:"name"` // - Description of the load balancer Description string `json:"description"` // - Tags of the load balancer (JSON object format) Tags map[string]string `json:"tags"` // - Configuration status of the load balancer // - `"ACTIVE"` // - There are no configurations of the load balancer that waiting to be applied // - `"CREATE_STAGED"` // - The load balancer has been added and waiting to be applied // - `"UPDATE_STAGED"` // - Changed configurations of the load balancer exists that waiting to be applied ConfigurationStatus string `json:"configuration_status"` // - Monitoring status of the load balancer // - `"ACTIVE"` // - The load balancer is operating normally // - `"INITIAL"` // - The load balancer is not deployed and does not monitored // - `"UNAVAILABLE"` // - The load balancer is not operating normally MonitoringStatus string `json:"monitoring_status"` // - Operation status of the load balancer // - `"NONE"` : // - There are no operations of the load balancer // - The load balancer and related resources can be operated // - `"PROCESSING"` // - The latest operation of the load balancer is processing // - The load balancer and related resources cannot be operated // - `"COMPLETE"` // - The latest operation of the load balancer has been succeeded // - The load balancer and related resources can be operated // - `"STUCK"` // - The latest operation of the load balancer has been stopped // - Operators of NTT Communications will investigate the operation // - The load balancer and related resources cannot be operated // - `"ERROR"` // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated OperationStatus string `json:"operation_status"` // - The zone / group where the primary virtual server of load balancer is deployed PrimaryAvailabilityZone string `json:"primary_availability_zone,omitempty"` // - The zone / group where the secondary virtual server of load balancer is deployed SecondaryAvailabilityZone string `json:"secondary_availability_zone,omitempty"` // - Primary or secondary availability zone where the load balancer is currently running // - Return `"UNDEFINED"` if can not define active availability zone ActiveAvailabilityZone string `json:"active_availability_zone"` // - Revision of the load balancer Revision int `json:"revision"` // - ID of the plan PlanID string `json:"plan_id"` // - Name of the plan PlanName string `json:"plan_name"` // - ID of the owner tenant of the load balancer TenantID string `json:"tenant_id"` // - Syslog servers to which access logs are transferred // - Only access logs to listeners which `protocol` is either `"http"` or `"https"` are transferred // - When `protocol` of `syslog_servers` is `"tcp"` // - Access logs are transferred to all healthy syslog servers specified in `syslog_servers` // - When `protocol` of `syslog_servers` is `"udp"` // - Access logs are transferred to the syslog server specified first in `syslog_servers` as long as it is healthy // - Access logs are transferred to the syslog server specified second (last) in `syslog_servers` when the first syslog server is not healthy SyslogServers []SyslogServerInResponse `json:"syslog_servers,omitempty"` // - Interfaces that attached to the load balancer Interfaces []InterfaceInResponse `json:"interfaces,omitempty"` // - Running configurations of the load balancer // - Return object when `changes` is `true` // - Return `null` when current configuration does not exist Current ConfigurationInResponse `json:"current"` // - Added or changed configurations of the load balancer that waiting to be applied // - Return object when `changes` is `true` // - Return `null` when staged configuration does not exist Staged ConfigurationInResponse `json:"staged"` }
LoadBalancer represents a load balancer.
func ExtractLoadBalancers ¶
func ExtractLoadBalancers(r pagination.Page) ([]LoadBalancer, error)
ExtractLoadBalancers accepts a Page struct, specifically a NetworkPage struct, and extracts the elements into a slice of LoadBalancer structs. In other words, a generic collection is mapped into a relevant slice.
type LoadBalancerPage ¶
type LoadBalancerPage struct {
pagination.LinkedPageBase
}
LoadBalancerPage is the page returned by a pager when traversing over a collection of load balancer.
func (LoadBalancerPage) IsEmpty ¶
func (r LoadBalancerPage) IsEmpty() (bool, error)
IsEmpty checks whether a LoadBalancerPage struct is empty.
type ReservedFixedIPInResponse ¶
type ReservedFixedIPInResponse struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc IPAddress string `json:"ip_address"` }
ReservedFixedIPInResponse represents a reserved fixed ip in a load balancer.
type ShowOpts ¶
type ShowOpts struct { // - When `true` is specified, `current` and `staged` are returned in response body Changes bool `q:"changes"` }
ShowOpts represents options used to show a load balancer.
func (ShowOpts) ToLoadBalancerShowQuery ¶
ToLoadBalancerShowQuery formats a ShowOpts into a query string.
type ShowOptsBuilder ¶
ShowOptsBuilder allows extensions to add additional parameters to the Show request.
type ShowResult ¶
type ShowResult struct {
// contains filtered or unexported fields
}
ShowResult represents the result of a Show operation. Call its Extract method to interpret it as a LoadBalancer.
func Show ¶
func Show(c *eclcloud.ServiceClient, id string, opts ShowOptsBuilder) (r ShowResult)
Show retrieves a specific load balancer based on its unique ID.
func (ShowResult) Extract ¶
func (r ShowResult) Extract() (*LoadBalancer, error)
Extract is a function that accepts a result and extracts a LoadBalancer resource.
func (ShowResult) ExtractInto ¶
func (r ShowResult) ExtractInto(v interface{}) error
ExtractInto interprets any commonResult as a load balancer, if possible.
type ShowStagedResult ¶
type ShowStagedResult struct {
// contains filtered or unexported fields
}
ShowStagedResult represents the result of a ShowStaged operation. Call its Extract method to interpret it as a LoadBalancer.
func ShowStaged ¶
func ShowStaged(c *eclcloud.ServiceClient, id string) (r ShowStagedResult)
ShowStaged retrieves specific load balancer configurations based on its unique ID.
func (ShowStagedResult) Extract ¶
func (r ShowStagedResult) Extract() (*LoadBalancer, error)
Extract is a function that accepts a result and extracts a LoadBalancer resource.
func (ShowStagedResult) ExtractInto ¶
func (r ShowStagedResult) ExtractInto(v interface{}) error
ExtractInto interprets any commonResult as a load balancer, if possible.
type SyslogServerInResponse ¶
type SyslogServerInResponse struct { // - IP address of the syslog server // - The load balancer sends ICMP to this IP address for health check purpose IPAddress string `json:"ip_address"` // - Port number of the syslog server Port int `json:"port"` // - Protocol of the syslog server Protocol string `json:"protocol"` }
SyslogServerInResponse represents a syslog server in a load balancer.
type SystemUpdateOpts ¶
type SystemUpdateOpts struct { // - ID of the system update that will be applied to the load balancer SystemUpdateID string `json:"system_update_id"` }
SystemUpdateOpts represents options used to perform action on a existing load balancer.
func (SystemUpdateOpts) ToLoadBalancerSystemUpdateMap ¶
func (opts SystemUpdateOpts) ToLoadBalancerSystemUpdateMap() (map[string]interface{}, error)
ToLoadBalancerSystemUpdateMap builds a request body from SystemUpdateOpts.
type SystemUpdateOptsBuilder ¶
type SystemUpdateOptsBuilder interface {
ToLoadBalancerSystemUpdateMap() (map[string]interface{}, error)
}
SystemUpdateOptsBuilder allows extensions to add additional parameters to the SystemUpdate request.
type UpdateOpts ¶
type UpdateOpts struct { // - Name of the load balancer Name *string `json:"name,omitempty"` // - Description of the load balancer Description *string `json:"description,omitempty"` // - Tags of the load balancer // - Must be specified as JSON object Tags *map[string]string `json:"tags,omitempty"` }
UpdateOpts represents options used to update a existing load balancer.
func (UpdateOpts) ToLoadBalancerUpdateMap ¶
func (opts UpdateOpts) ToLoadBalancerUpdateMap() (map[string]interface{}, error)
ToLoadBalancerUpdateMap builds a request body from UpdateOpts.
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 Update operation. Call its Extract method to interpret it as a LoadBalancer.
func Update ¶
func Update(c *eclcloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
Update accepts a UpdateOpts struct and updates a existing load balancer using the values provided.
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*LoadBalancer, error)
Extract is a function that accepts a result and extracts a LoadBalancer resource.
func (UpdateResult) ExtractInto ¶
func (r UpdateResult) ExtractInto(v interface{}) error
ExtractInto interprets any commonResult as a load balancer, if possible.
type UpdateStagedOpts ¶
type UpdateStagedOpts struct { // - Syslog servers to which access logs are transferred // - Only access logs to listeners which `protocol` is either `"http"` or `"https"` are transferred // - When `protocol` of `syslog_servers` is `"tcp"` // - Access logs are transferred to all healthy syslog servers specified in `syslog_servers` // - When `protocol` of `syslog_servers` is `"udp"` // - Access logs are transferred to the syslog server specified first in `syslog_servers` as long as it is healthy // - Access logs are transferred to the syslog server specified second (last) in `syslog_servers` when the first syslog server is not healthy SyslogServers *[]UpdateStagedOptsSyslogServer `json:"syslog_servers,omitempty"` // - Interfaces that attached to the load balancer // - `virtual_ip_address` and `reserved_fixed_ips` can not be changed once attached // - To change `virtual_ip_address` and `reserved_fixed_ips` , recreating the interface is needed Interfaces *[]UpdateStagedOptsInterface `json:"interfaces,omitempty"` }
UpdateStagedOpts represents options used to update existing Load Balancer configurations.
func (UpdateStagedOpts) ToLoadBalancerUpdateStagedMap ¶
func (opts UpdateStagedOpts) ToLoadBalancerUpdateStagedMap() (map[string]interface{}, error)
ToLoadBalancerUpdateStagedMap builds a request body from UpdateStagedOpts.
type UpdateStagedOptsBuilder ¶
type UpdateStagedOptsBuilder interface {
ToLoadBalancerUpdateStagedMap() (map[string]interface{}, error)
}
UpdateStagedOptsBuilder allows extensions to add additional parameters to the UpdateStaged request.
type UpdateStagedOptsInterface ¶
type UpdateStagedOptsInterface struct { // - ID of the network that this interface belongs to // - Must be specified the unique network ID in `interfaces` // - Must be specified the network that plane is data // - Must not be specified the network that uses ISP shared address (RFC 6598) NetworkID *string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc // - Must be specified the unique IP address in `virtual_ip_address` and `reserved_fixed_ips` // - Must not be specified the network IP address and broadcast IP address // - Must not be specified for existing interfaces VirtualIPAddress *string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy // - Must not be specified for existing interfaces ReservedFixedIPs *[]UpdateStagedOptsReservedFixedIP `json:"reserved_fixed_ips"` }
UpdateStagedOptsInterface represents interface information in load balancer configurations updation.
type UpdateStagedOptsReservedFixedIP ¶
type UpdateStagedOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc // - Must be specified the unique IP address in `virtual_ip_address` and `reserved_fixed_ips` // - Must not be specified the network IP address and broadcast IP address IPAddress *string `json:"ip_address"` }
UpdateStagedOptsReservedFixedIP represents reserved_fixed_ip information in load balancer configurations updation.
type UpdateStagedOptsSyslogServer ¶
type UpdateStagedOptsSyslogServer struct { // - IP address of the syslog server // - The load balancer sends ICMP to this IP address for health check purpose IPAddress *string `json:"ip_address"` // - Port number of the syslog server Port *int `json:"port,omitempty"` // - Protocol of the syslog server // - Must be specified same protocol in all syslog servers belongs to the same load balancer Protocol *string `json:"protocol,omitempty"` }
UpdateStagedOptsSyslogServer represents syslog_server information in load balancer configurations updation.
type UpdateStagedResult ¶
type UpdateStagedResult struct {
// contains filtered or unexported fields
}
UpdateStagedResult represents the result of a UpdateStaged operation. Call its Extract method to interpret it as a LoadBalancer.
func UpdateStaged ¶
func UpdateStaged(c *eclcloud.ServiceClient, id string, opts UpdateStagedOptsBuilder) (r UpdateStagedResult)
UpdateStaged accepts a UpdateStagedOpts struct and updates existing Load Balancer configurations using the values provided.
func (UpdateStagedResult) Extract ¶
func (r UpdateStagedResult) Extract() (*LoadBalancer, error)
Extract is a function that accepts a result and extracts a LoadBalancer resource.
func (UpdateStagedResult) ExtractInto ¶
func (r UpdateStagedResult) ExtractInto(v interface{}) error
ExtractInto interprets any commonResult as a load balancer, if possible.