loadbalancer

package
v0.0.0-...-d7b82ac Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Backup    bool   `json:"backup,omitempty"`
	Drain     bool   `json:"drain,omitempty"`
	IPAddress string `json:"ipAddress"`
	Name      string `json:"name,omitempty"`
	Offline   bool   `json:"offline,omitempty"`
	Port      int    `json:"port"`
	Weight    int    `json:"weight,omitempty"`
}

Backend reference from https://docs.us-phoenix-1.oraclecloud.com/api/#/en/loadbalancer/20170115/Backend/

type BackendSet

type BackendSet struct {
	Backends           []Backend                        `json:"backends,omitempty"`
	HealthChecker      *HealthChecker                   `json:"healthChecker,omitempty"`
	Name               string                           `json:"name"`
	Policy             string                           `json:"policy"`
	SSLConfig          *SSLConfiguration                `json:"sslConfiguration,omitempty"`
	SessionPersistence *SessionPersistenceConfiguration `json:"sessionPersistenceConfiguration,omitempty"`
}

BackendSet reference from https://docs.us-phoenix-1.oraclecloud.com/api/#/en/loadbalancer/20170115/BackendSet/

type Certificate

type Certificate struct {
	// A friendly name for the certificate bundle
	CertificateName string `json:"certificateName"`
	// The Certificate Authority certificate
	CACertificates string `json:"caCertificate,omitempty"`
	// The public certificate, in PEM format
	PublicCertificate string `json:"publicCertificate"`
}

Certificate represents the listener's configuration: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/loadbalancer/20170115/Certificate/

type Client

type Client struct {
	Client        *api.Client
	CompartmentID string
}

Client is a client for the load balancing services API.

func NewClient

func NewClient(c *api.Client, compartmentID string) *Client

NewClient provides a Client interface for all Compute API calls

func (*Client) CreateBackend

func (c *Client) CreateBackend(loadBalancerID string, backendSetName string, backend *Backend) (bool, *bmc.Error)

CreateBackend adds a backend set to a load balancer

func (*Client) CreateBackendSet

func (c *Client) CreateBackendSet(loadBalancerID string, backendSet *BackendSet) (bool, *bmc.Error)

CreateBackendSet adds a backend set to a load balancer

func (*Client) CreateListener

func (c *Client) CreateListener(loadBalancerID string, listener *Listener) (bool, *bmc.Error)

CreateListener adds a listener to a load balancer

func (*Client) DeleteBackend

func (c *Client) DeleteBackend(listener *Backend)

DeleteBackend deletes a backend set to a load balancer

func (*Client) DeleteBackendSet

func (c *Client) DeleteBackendSet(loadBalancerID string, backendSetName string) (bool, *bmc.Error)

DeleteBackendSet deletes a backend set to a load balancer

func (*Client) DeleteListener

func (c *Client) DeleteListener(loadBalancerID string, listenerName string) (bool, *bmc.Error)

DeleteListener deletes a listener from a load balancer

func (*Client) GetBackend

func (c *Client) GetBackend(loadBalancerID string, backendSetName string, backendName string) (Backend, *bmc.Error)

GetBackend gets the health check policy information for a given load balancer and backend set.

func (*Client) GetBackendSet

func (c *Client) GetBackendSet(loadBalancerID string, backendSetName string) (BackendSet, *bmc.Error)

GetBackendSet gets the health check policy information for a given load balancer and backend set.

func (*Client) GetHealthChecker

func (c *Client) GetHealthChecker(loadBalancerID string, backendSetName string) (HealthChecker, *bmc.Error)

GetHealthChecker gets the health check policy information for a given load balancer and backend set.

func (*Client) GetLoadBalancer

func (c *Client) GetLoadBalancer(loadBalancerID string) (LoadBalancer, *bmc.Error)

GetLoadBalancer gets the specified load balancer's configuration information

func (*Client) ListBackend

func (c *Client) ListBackend(loadBalancerID string, backendSetName string) ([]Backend, *bmc.Error)

ListBackend gets the health check policy information for a given load balancer and backend set.

func (*Client) ListBackendSet

func (c *Client) ListBackendSet(loadBalancerID string) ([]BackendSet, *bmc.Error)

ListBackendSet gets the health check policy information for a given load balancer and backend set.

func (*Client) ListCertificates

func (c *Client) ListCertificates(loadBalancerID string) ([]Certificate, *bmc.Error)

ListCertificates lists all load balancers in the specified compartment

func (*Client) ListLoadBalancers

func (c *Client) ListLoadBalancers() ([]LoadBalancer, *bmc.Error)

ListLoadBalancers lists all load balancers in the specified compartment

func (*Client) Request

func (c *Client) Request(method string, reqURL string, body interface{}) (*http.Response, error)

Request builds the API endpoint given a URL and sends it to the API request

func (*Client) UpdateBackend

func (c *Client) UpdateBackend(listener *Backend)

UpdateBackend updates a backend set to a load balancer

func (*Client) UpdateBackendSet

func (c *Client) UpdateBackendSet(listener *BackendSet)

UpdateBackendSet updates a backend set to a load balancer

func (*Client) UpdateListener

func (c *Client) UpdateListener(listener *Listener)

UpdateListener updates a listener from a load balancer

type HealthChecker

type HealthChecker struct {
	Interval   int    `json:"intervalInMillis,omitempty"`
	Port       int    `json:"port,omitempty"`
	Protocol   string `json:"protocol"`                    // HTTP or TCP
	Response   string `json:"responseBodyRegex,omitempty"` // ^(500|40[1348])$
	Retries    int    `json:"retries,omitempty"`
	ReturnCode int    `json:"returnCode,omitempty"`
	Timeout    int    `json:"timeoutInMillis,omitempty"`
	URLPath    string `json:"urlPath"`
}

HealthChecker reference from https://docs.us-phoenix-1.oraclecloud.com/api/#/en/loadbalancer/20170115/HealthChecker/

type IP

type IP struct {
	Address string `json:"ipAddress"`
	Public  bool   `json:"isPublic"`
}

IP is a load balancer IP address

type Listener

type Listener struct {
	BackendSetName string            `json:"defaultBackendSetName"`
	Name           string            `json:"name"`
	Port           int               `json:"port"`
	Protocol       string            `json:"protocol"` // HTTP or TCP
	SSLConfig      *SSLConfiguration `json:"sslConfiguration,omitempty"`
}

Listener represents the listener's configuration: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/loadbalancer/20170115/Listener/

type LoadBalancer

type LoadBalancer struct {
	// A mapping of strings to BackendSet objects
	BackendSets map[string]BackendSet `json:"backendSets,omitempty"`
	// A user-friendly name
	DisplayName string `json:"displayName"`
	// A mapping of strings to Certificate objects
	Certificates map[string]Certificate `json:"certificates,omitempty"`
	// The OCID of the compartment containing the load balancer
	CompartmentID string `json:"compartmentId"`
	// The OCID of the load balancer
	ID string `json:"id"`
	// An array of IP addresses
	IPAddresses []IP `json:"ipAddresses"`
	// Whether the load balancer has a VCN-local (private) IP address
	Private bool `json:"isPrivate"`
	// The current state of the instance.
	// CREATING | ACTIVE
	// FAILED | DELETING | DELETED
	LifeCycleState string `json:"lifecycleState"`
	// A mapping of strings to Listener objects
	Listeners map[string]Listener `json:"listeners"`
	// A template that determines the total pre-provisioned bandwidth
	ShapeName string `json:"shapeName"` // HTTP or TCP
	// An array of subnet OCIDs
	SubnetIDs []string `json:"subnetIds"`
	// The date and time the instance was created (RFC3339)
	TimeCreated string `json:"timeCreated"`
}

LoadBalancer represents the listener's configuration: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/loadbalancer/20170115/LoadBalancer/

type SSLConfiguration

type SSLConfiguration struct {
	CertName    string `json:"certificateName"`
	VerifyDepth int    `json:"verifyDepth"`
	VerifyPeer  bool   `json:"verifyPeerCertificate"`
}

SSLConfiguration for the struct within the Listener

type SessionPersistenceConfiguration

type SessionPersistenceConfiguration struct {
	CookieName      string `json:"cookieName"`
	DisableFallback bool   `json:"disableFallback"`
}

SessionPersistenceConfiguration for the struct within the BackendSet

Jump to

Keyboard shortcuts

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