lbaas

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: MPL-2.0 Imports: 13 Imported by: 1

README

Oracle Cloud Infrastructure Load Balancer Classic Client

Client implementation for the REST API for Oracle Cloud Infrastructure Load Balancing Classic

The LBaaSClient is the base client implementation for the Load Balancer Classic APIs, but is not intended to be use directly. Specialized clients are implemented for different LBaaS Service resources:

  • LBaaSClient - base implementation
    • SSLCertificateClient - for SSL Certificates
    • LoadBalancerClient - for the main Load Balancer resource
    • LBaaSResourceClient - base client implementation for child resources of a Load Balancer instance:
      • PolicyClient - for Policies
      • ListenerClient - for Listeners
      • OriginServerPoolClient - for Origin Server Pools

Testing

Setup the testing environment according as covered in Running the SDK Integration Tests

To run all the Load Balancer Classic client acceptance tests

$ make testacc TEST="./lbaas"

To run a single test

$ make testacc TEST="./lbaas" TESTARG="-run=TestAccLoadBalancerLifeCycle"
Settings the Test Region

The Load Balancer resources are created in a specific region. The default region used by the tests is uscom-central-1. To use a different region set the environment variable OCP_TEST_LBAAS_REGION e.g.

$ OPC_TEST_LBAAS_REGION=uscom-east-1  make testacc TEST="./lbaas"
Speeding up testing during development

The full Lifecycle tests of the Listener, Origin Server Pool and Policy resources each create a separate parent Load Balance instance. As the creation and destruction of the Load Balancer can take time a shortcut for development testing is provided:

To speed up testing of the Load Balancer child resources set the environment variable OPC_TEST_USE_EXISTING_LB to the ID of an existing Load Balancer instance in the format <region>/<name>, e.g.

$ OPC_TEST_USE_EXISTING_LB=uscom-central-1/lb1 make test acc TEST="./lbaas" TESTARG="-run=TestAccListenerLifeCycle"

Documentation

Index

Constants

View Source
const ContentTypeAppCookieSticinessPolicyJSON = "application/vnd.com.oracle.oracloud.lbaas.AppCookieStickinessPolicy+json"

Policy Specific ContentTypes for API REquests. Each type of Policy has its own ContentType

View Source
const ContentTypeCloudGatePolicyJSON = "application/vnd.com.oracle.oracloud.lbaas.CloudGatePolicy+json"
View Source
const ContentTypeLBCookieStickinessPolicyJSON = "application/vnd.com.oracle.oracloud.lbaas.LBCookieStickinessPolicy+json"
View Source
const ContentTypeListenerJSON = "application/vnd.com.oracle.oracloud.lbaas.Listener+json"

ContentType for Load Balancer Listener API requests

View Source
const ContentTypeLoadBalancingMechanismPolicyJSON = "application/vnd.com.oracle.oracloud.lbaas.LoadBalancingMechanismPolicy+json"
View Source
const ContentTypeOriginServerPoolJSON = "application/vnd.com.oracle.oracloud.lbaas.OriginServerPool+json"

ContentType for Load Balancer Origin Server Pool API requests

View Source
const ContentTypeRateLimitingRequestPolicyJSON = "application/vnd.com.oracle.oracloud.lbaas.RateLimitingRequestPolicy+json"
View Source
const ContentTypeRedirectPolicyJSON = "application/vnd.com.oracle.oracloud.lbaas.RedirectPolicy+json"
View Source
const ContentTypeResourceAccessControlPolicyJSON = "application/vnd.com.oracle.oracloud.lbaas.ResourceAccessControlPolicy+json"
View Source
const ContentTypeSSLNegotiationPolicyJSON = "application/vnd.com.oracle.oracloud.lbaas.SSLNegotiationPolicy+json"
View Source
const ContentTypeServerCertificateJSON = "application/vnd.com.oracle.oracloud.lbaas.ServerCertificate+json"

Supported ContentTypes for the SSL Certificate API requests

View Source
const ContentTypeSetRequestHeaderPolicyJSON = "application/vnd.com.oracle.oracloud.lbaas.SetRequestHeaderPolicy+json"
View Source
const ContentTypeTrustedCertificateJSON = "application/vnd.com.oracle.oracloud.lbaas.TrustedCertificate+json"
View Source
const ContentTypeTrustedCertificatePolicyJSON = "application/vnd.com.oracle.oracloud.lbaas.TrustedCertPolicy+json"
View Source
const ContentTypeVLBRJSON = "application/vnd.com.oracle.oracloud.lbaas.VLBR+json"

ContentType for Load Balancer API requests

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationCookieStickinessPolicyInfo

type ApplicationCookieStickinessPolicyInfo struct {
	AppCookieName string `json:"app_cookie_name,omitempty"`
}

type Client

type Client struct {
	PollInterval time.Duration
	Timeout      time.Duration
	// contains filtered or unexported fields
}

Client implementation for Oracle Cloud Infrastructure Load Balancing Classic */

func GetTestClient

func GetTestClient(c *opc.Config) (*Client, error)

GetTestClient obtains a client for testing purposes

func NewClient

func NewClient(c *opc.Config) (*Client, error)

NewClient returns a new LBaaSClient

func (*Client) ListenerClient

func (c *Client) ListenerClient() *ListenerClient

ListenerClient returns an ListenerClient which is used to access the Load Balancer Listener API

func (*Client) LoadBalancerClient

func (c *Client) LoadBalancerClient() *LoadBalancerClient

LoadBalancerClient returns an ServiceInstanceClient which is used to access the Load Balancer API

func (*Client) OriginServerPoolClient

func (c *Client) OriginServerPoolClient() *OriginServerPoolClient

OriginServerPoolClient returns an Client which is used to access the Load Balancer Origin Server Pool API

func (*Client) PolicyClient

func (c *Client) PolicyClient() *PolicyClient

PolicyClient returns an PolicyClient which is used to access the Load Balancer Policy API

func (*Client) SSLCertificateClient

func (c *Client) SSLCertificateClient() *SSLCertificateClient

SSLCertificateClient returns an ServiceInstanceClient which is used to access the Load Balancer API

type CloudGatePolicyInfo

type CloudGatePolicyInfo struct {
	CloudGateApplication                string `json:"cloudgate_application,omitempty"`
	CloudGatePolicyName                 string `json:"cloudgate_policy_name,omitempty"`
	IdentityServiceInstanceGuid         string `json:"identity_service_instance_guid,omitempty"`
	VirtualHostnameForPolicyAttribution string `json:"virtual_hostname_for_policy_attribution,omitempty"`
}

type ComputeSecurityArtifactsInfo

type ComputeSecurityArtifactsInfo struct {
	AddressType  string `json:"address_type"`
	ArtifactType string `json:"artifact_type"`
	URI          string `json:"uri"`
}

type CreateListenerInput

type CreateListenerInput struct {
	BalancerProtocol     Protocol      `json:"balancer_protocol"`
	Disabled             LBaaSDisabled `json:"disabled,omitempty"`
	Name                 string        `json:"name"`
	OriginServerPool     string        `json:"origin_server_pool,omitempty"`
	OriginServerProtocol Protocol      `json:"origin_server_protocol"`
	PathPrefixes         []string      `json:"path_prefixes,omitempty"`
	Policies             []string      `json:"policies,omitempty"`
	Port                 int           `json:"port"`
	SSLCerts             []string      `json:"ssl_cert,omitempty"`
	Tags                 []string      `json:"tags,omitempty"`
	VirtualHosts         []string      `json:"virtual_hosts,omitempty"`
}

type CreateLoadBalancerInput

type CreateLoadBalancerInput struct {
	Description        string             `json:"description,omitempty"`
	Disabled           LBaaSDisabled      `json:"disabled"`
	IPNetworkName      string             `json:"ip_network_name,omitempty"`
	Name               string             `json:"name"`
	ParentLoadBalancer string             `json:"parent_vlbr,omitempty"`
	PermittedClients   []string           `json:"permitted_clients,omitempty"`
	PermittedMethods   []string           `json:"permitted_methods,omitempty"`
	Policies           []string           `json:"policies,omitempty"`
	Region             string             `json:"region"`
	Scheme             LoadBalancerScheme `json:"scheme"`
	OriginServerPool   string             `json:"origin_server_pool,omitempty"`
	Tags               []string           `json:"tags,omitempty"`
}

CreateLoadBalancerInput specifies the create request for a load balancer service instance

type CreateOriginServerInput

type CreateOriginServerInput struct {
	Status   LBaaSStatus `json:"status"`
	Hostname string      `json:"hostname"`
	Port     int         `json:"port"`
}

type CreateOriginServerPoolInput

type CreateOriginServerPoolInput struct {
	Name          string                    `json:"name"`
	OriginServers []CreateOriginServerInput `json:"origin_servers,omitempty"`
	HealthCheck   *HealthCheckInfo          `json:"health_check,omitempty"`
	Status        LBaaSStatus               `json:"status,omitempty"`
	Tags          []string                  `json:"tags,omitempty"`
	VnicSetName   string                    `json:"vnic_set_name,omitempty"`
}

type CreateSSLCertificateInput

type CreateSSLCertificateInput struct {
	Name             string `json:"name"`
	Certificate      string `json:"certificate"`
	CertificateChain string `json:"certificate_chain,omitempty"`
	PrivateKey       string `json:"private_key,omitempty"`
	Trusted          bool   `json:"trusted"`
}

type EffectiveOriginServersInfo

type EffectiveOriginServersInfo struct {
	OperationDetails                string                          `json:"operation_details"`
	OriginServerPool                string                          `json:"origin_server_pool"`
	OriginServerSourceInheritedFrom OriginServerSourceInheritedFrom `json:"origin_server_source_inherited_from"`
}

type HealthCheckInfo

type HealthCheckInfo struct {
	AcceptedReturnCodes []string `json:"accepted_return_codes"`
	Enabled             string   `json:"enabled"`
	HealthyThreshold    int      `json:"healthy_threshold"`
	Interval            int      `json:"interval"`
	Path                string   `json:"path"`
	Timeout             int      `json:"timeout"`
	Type                string   `json:"type"`
	UnhealthyThreshold  int      `json:"unhealthy_threshold"`
}

type HttpMethod

type HttpMethod string

HttpMethods

const (
	HttpCOPY      HttpMethod = "COPY"
	HttpDELETE    HttpMethod = "DELETE"
	HttpGET       HttpMethod = "GET"
	HttpHEAD      HttpMethod = "HEAD"
	HttpLOCK      HttpMethod = "LOCK"
	HttpMKCOL     HttpMethod = "MKCOL"
	HttpMOVE      HttpMethod = "MOVE"
	HttpOPTIONS   HttpMethod = "OPTIONS"
	HttpPATCH     HttpMethod = "PATCH"
	HttpPOST      HttpMethod = "POST"
	HttpPROPFIND  HttpMethod = "PROPFIND"
	HttpPROPPATCH HttpMethod = "PROPPATCH"
	HttpPUT       HttpMethod = "PUT"
	HttpUNLOCK    HttpMethod = "UNLOCK"
)

type LBaaSDisabled

type LBaaSDisabled string

LBaaSDisabled common Disabled State type for all LBaaS service resources

const (
	LBaaSDisabledTrue        LBaaSDisabled = "TRUE"
	LBaaSDisabledFalse       LBaaSDisabled = "FALSE"
	LBaaSDisabledMaintenance LBaaSDisabled = "MAINTENANCE_MODE"
)

type LBaaSResourceClient

type LBaaSResourceClient struct {
	*Client
	ContainerPath    string
	ResourceRootPath string
	Projection       string
	Accept           string
	ContentType      string
}

LBaaSResourceClient is an AuthenticatedClient with some additional information about the resources to be addressed.

type LBaaSState

type LBaaSState string

LBaaSState common State type for all LBaaS service resources

const (
	LBaaSStateCreationInProgress              LBaaSState = "CREATION_IN_PROGRESS"
	LBaaSStateCreated                         LBaaSState = "CREATED"
	LBaaSStateHealthy                         LBaaSState = "HEALTHY"
	LBaaSStateAdministratorInterventionNeeded LBaaSState = "ADMINISTRATOR_INTERVENTION_NEEDED"
	LBaaSStateDeletionInProgress              LBaaSState = "DELETION_IN_PROGRESS"
	LBaaSStateDeleted                         LBaaSState = "DELETED"
	LBaaSStateModificationInProgress          LBaaSState = "MODIFICATION_IN_PROGRESS"
	LBaaSStateCreationFailed                  LBaaSState = "CREATION_FAILED"
	LBaaSStateModificaitonFailed              LBaaSState = "MODIFICATION_FAILED"
	LBaaSStateDeletionFailed                  LBaaSState = "DELETION_FAILED"
	LBaaSStateAccessDenied                    LBaaSState = "ACCESS_DENIED"
	LBaaSStateAbandon                         LBaaSState = "ABANDON"
	LBaaSStateAutoAbandoned                   LBaaSState = "AUTO_ABANDONED"
	LBaaSStatePause                           LBaaSState = "PAUSE"
	LBaaSStateForcePaused                     LBaaSState = "FORCE_PAUSED"
	LBaaSStateResume                          LBaaSState = "RESUME"
)

type LBaaSStatus

type LBaaSStatus string

LBaaaSStatus common Status type for all LBaaS service resources

const (
	LBaaSStatusEnabled  LBaaSStatus = "ENABLED"
	LBaaSStatusDisabled LBaaSStatus = "DISABLED"
)

type ListenerClient

type ListenerClient struct {
	LBaaSResourceClient
}

ListenerClient is a client for the Load Balancer Listener resources.

func (*ListenerClient) CreateListener

func (c *ListenerClient) CreateListener(lb LoadBalancerContext, input *CreateListenerInput) (*ListenerInfo, error)

CreateListener creates a new listener

func (*ListenerClient) DeleteListener

func (c *ListenerClient) DeleteListener(lb LoadBalancerContext, name string) (*ListenerInfo, error)

DeleteListener deletes the listener with the specified input

func (*ListenerClient) GetListener

func (c *ListenerClient) GetListener(lb LoadBalancerContext, name string) (*ListenerInfo, error)

GetListener fetchs the listener details

func (*ListenerClient) UpdateListener

func (c *ListenerClient) UpdateListener(lb LoadBalancerContext, name string, input *UpdateListenerInput) (*ListenerInfo, error)

UpdateListener updated the listener

func (*ListenerClient) WaitForListenerState

func (c *ListenerClient) WaitForListenerState(lb LoadBalancerContext, name string, desiredStates, errorStates []LBaaSState) (*ListenerInfo, error)

WaitForListenerState waits for the resource to be in one of a set of desired states

type ListenerInfo

type ListenerInfo struct {
	BalancerProtocol       Protocol                   `json:"balancer_protocol"`
	Disabled               LBaaSDisabled              `json:"disabled"`
	EffectiveOriginServers EffectiveOriginServersInfo `json:"effective_origin_servers"`
	EffectiveState         LBaaSDisabled              `json:"effective_state"`
	InlinePolicies         []string                   `json:"inline_policies"`
	Name                   string                     `json:"name"`
	OperationDetails       string                     `json:"operation_details"`
	OriginServerPool       string                     `json:"origin_server_pool"`
	OriginServerProtocol   Protocol                   `json:"origin_server_protocol"`
	ParentListener         string                     `json:"parent_listener"`
	PathPrefixes           []string                   `json:"path_prefixes"`
	Policies               []string                   `json:"policies"`
	Port                   int                        `json:"port"`
	SSLCerts               []string                   `json:"ssl_cert"`
	State                  LBaaSState                 `json:"state"`
	Tags                   []string                   `json:"tags"`
	URI                    string                     `json:"uri"`
	VirtualHosts           []string                   `json:"virtual_hosts"`
}

type LoadBalancerClient

type LoadBalancerClient struct {
	*Client
	ContainerPath    string
	ResourceRootPath string
	Accept           string
	ContentType      string
}

LoadBalancerClient is an AuthenticatedClient with some additional information about the resources to be addressed.

func (*LoadBalancerClient) CreateLoadBalancer

func (c *LoadBalancerClient) CreateLoadBalancer(input *CreateLoadBalancerInput) (*LoadBalancerInfo, error)

CreateLoadBalancer creates a new Load Balancer instance

func (*LoadBalancerClient) DeleteLoadBalancer

func (c *LoadBalancerClient) DeleteLoadBalancer(lb LoadBalancerContext) (*LoadBalancerInfo, error)

DeleteLoadBalancer deletes the service instance with the specified input

func (*LoadBalancerClient) GetLoadBalancer

func (c *LoadBalancerClient) GetLoadBalancer(lb LoadBalancerContext) (*LoadBalancerInfo, error)

GetLoadBalancer fetchs the instance details of the Load Balancer

func (*LoadBalancerClient) UpdateLoadBalancer

UpdateLoadBalancer fetchs the instance details of the Load Balancer

func (*LoadBalancerClient) WaitForLoadBalancerState

func (c *LoadBalancerClient) WaitForLoadBalancerState(lb LoadBalancerContext, desiredStates, errorStates []LBaaSState, info *LoadBalancerInfo) error

WaitForLoadBalancerState waits for the resource to be in one of a set of desired states

type LoadBalancerContext

type LoadBalancerContext struct {
	Region string
	Name   string
}

LoadBalancerContext represents a specific loadbalancer instance by region/name context

type LoadBalancerCookieStickinessPolicyInfo

type LoadBalancerCookieStickinessPolicyInfo struct {
	CookieExpirationPeriod int `json:"cookie_expiration_period,omitempty"`
}

type LoadBalancerEffectiveState

type LoadBalancerEffectiveState string

LoadBalancerEffectiveState

const (
	LoadBalancerEffectiveStateTrue        LoadBalancerEffectiveState = "TRUE"
	LoadBalancerEffectiveStateFalse       LoadBalancerEffectiveState = "FALSE"
	LoadBalancerEffectiveStateMaintenance LoadBalancerEffectiveState = "MAINTENANCE_MODE"
)

type LoadBalancerInfo

type LoadBalancerInfo struct {
	BalancerVIPs             []string                       `json:"balancer_vips"`
	CanonicalHostName        string                         `json:"canonical_host_name"`
	CloudgateCapable         string                         `json:"cloudgate_capable"`
	ComputeSecurityArtifacts []ComputeSecurityArtifactsInfo `json:"compute_security_artifacts"`
	ComputeSite              string                         `json:"compute_site"`
	CreatedOn                string                         `json:"created_on"`
	Description              string                         `json:"description"`
	Disabled                 LBaaSDisabled                  `json:"disabled"`
	DisplayName              string                         `json:"display_name"`
	HealthCheck              HealthCheckInfo                `json:"health_check"`
	IPNetworkName            string                         `json:"ip_network_name"`
	IsDisabledEffectively    string                         `json:"is_disabled_effectively"`
	Listeners                []ListenerInfo                 `json:"listeners"`
	ModifiedOn               string                         `json:"modified_on"`
	Name                     string                         `json:"name"`
	Owner                    string                         `json:"owner"`
	ParentLoadBalancer       string                         `json:"parent_vlbr"`
	PermittedClients         []string                       `json:"permitted_clients"`
	PermittedMethods         []string                       `json:"permitted_methods"`
	Policies                 []string                       `json:"policies"`
	Region                   string                         `json:"region"`
	RestURIs                 []RestURIInfo                  `json:"rest_uri"`
	Scheme                   LoadBalancerScheme             `json:"scheme"`
	OriginServerPool         string                         `json:"origin_server_pool"`
	State                    LBaaSState                     `json:"state"`
	Tags                     []string                       `json:"tags"`
	URI                      string                         `json:"uri"`
}

LoadBalancerInfo specifies the Load Balancer obtained from a GET request

type LoadBalancerScheme

type LoadBalancerScheme string

LoadBalancerScheme Scheme types

const (
	LoadBalancerSchemeInternetFacing LoadBalancerScheme = "INTERNET_FACING"
	LoadBalancerSchemeInternal       LoadBalancerScheme = "INTERNAL"
)

type LoadBalancingMechanismPolicyInfo

type LoadBalancingMechanismPolicyInfo struct {
	LoadBalancingMechanism string `json:"load_balancing_mechanism,omitempty"`
}

type OriginServerInfo

type OriginServerInfo struct {
	Hostname string        `json:"hostname"`
	Port     int           `json:"port"`
	Status   LBaaSDisabled `json:"status"`
}

type OriginServerPoolClient

type OriginServerPoolClient struct {
	LBaaSResourceClient
}

OriginServerPoolClient is a client for the Load Balancer Origin Server Pool resources.

func (*OriginServerPoolClient) CreateOriginServerPool

CreateOriginServerPool creates a new server pool

func (*OriginServerPoolClient) DeleteOriginServerPool

func (c *OriginServerPoolClient) DeleteOriginServerPool(lb LoadBalancerContext, name string) (*OriginServerPoolInfo, error)

DeleteOriginServerPool deletes the server pool with the specified input

func (*OriginServerPoolClient) GetOriginServerPool

func (c *OriginServerPoolClient) GetOriginServerPool(lb LoadBalancerContext, name string) (*OriginServerPoolInfo, error)

GetOriginServerPool fetchs the server pool details

func (*OriginServerPoolClient) UpdateOriginServerPool

UpdateOriginServerPool fetchs the server pool details

func (*OriginServerPoolClient) WaitForOriginServerPoolState

func (c *OriginServerPoolClient) WaitForOriginServerPoolState(lb LoadBalancerContext, name string, desiredStates, errorStates []LBaaSState, pollInterval, timeoutSeconds time.Duration) (*OriginServerPoolInfo, error)

WaitForOriginServerPoolState waits for the resource to be in one of a set of desired states

type OriginServerPoolInfo

type OriginServerPoolInfo struct {
	Consumers          string             `json:"consumers"`
	HealthCheck        HealthCheckInfo    `json:"health_check"`
	Name               string             `json:"name"`
	OperationDetails   string             `json:"operation_details"`
	OriginServers      []OriginServerInfo `json:"origin_servers"`
	ReasonForDisabling string             `json:"reason_for_disabling"`
	State              LBaaSState         `json:"state"`
	Status             LBaaSStatus        `json:"status"`
	Tags               []string           `json:"tags"`
	URI                string             `json:"uri"`
	VnicSetName        string             `json:"vnic_set_name"`
}

type OriginServerSourceInheritedFrom

type OriginServerSourceInheritedFrom string
const (
	OriginServerSourceInheritedFromSelf   OriginServerSourceInheritedFrom = "SELF"
	OriginServerSourceInheritedFromVLBR   OriginServerSourceInheritedFrom = "VLBR"
	OriginServerSourceInheritedFromParent OriginServerSourceInheritedFrom = "PARENT_LISTENER"
)

type PolicyClient

type PolicyClient struct {
	LBaaSResourceClient
}

PolicyClient is a client for the Load Balancer Policy resources.

func (*PolicyClient) CreatePolicy

func (c *PolicyClient) CreatePolicy(lb LoadBalancerContext, input *CreatePolicyInput) (*PolicyInfo, error)

CreatePolicy creates a new listener

func (*PolicyClient) DeletePolicy

func (c *PolicyClient) DeletePolicy(lb LoadBalancerContext, name string) (*PolicyInfo, error)

DeletePolicy deletes the listener with the specified input

func (*PolicyClient) GetPolicy

func (c *PolicyClient) GetPolicy(lb LoadBalancerContext, name string) (*PolicyInfo, error)

GetPolicy fetchs the listener details

func (*PolicyClient) UpdatePolicy

func (c *PolicyClient) UpdatePolicy(lb LoadBalancerContext, name, policyType string, input *UpdatePolicyInput) (*PolicyInfo, error)

GetPolicy fetchs the listener details

func (*PolicyClient) WaitForPolicyState

func (c *PolicyClient) WaitForPolicyState(lb LoadBalancerContext, name string, desiredStates, errorStates []LBaaSState, pollInterval, timeoutSeconds time.Duration) (*PolicyInfo, error)

WaitForPolicyState waits for the resource to be in one of a set of desired states

type PolicyInfo

type PolicyInfo struct {
	Name  string     `json:"name,omitempty"`
	State LBaaSState `json:"state,omitempty"`
	Type  string     `json:"type,omitempty"`
	URI   string     `json:"uri,omitempty"`

	// ApplicationCookieStickinessPolicy
	AppCookieName string `json:"app_cookie_name,omitempty"`

	// CloudGatePolicy
	CloudGateApplication                string `json:"cloudgate_application,omitempty"`
	CloudGatePolicyName                 string `json:"cloudgate_policy_name,omitempty"`
	IdentityServiceInstanceGuid         string `json:"identity_service_instance_guid,omitempty"`
	VirtualHostnameForPolicyAttribution string `json:"virtual_hostname_for_policy_attribution,omitempty"`

	// LoadBalancerCookieStickinessPolicy
	CookieExpirationPeriod int `json:"cookie_expiration_period,omitempty"`

	// LoadBalancingMechanismPolicy
	LoadBalancingMechanism string `json:"load_balancing_mechanism,omitempty"`

	// RateLimitingRequestPolicy
	BurstSize                   int    `json:"burst_size,omitempty"`
	DoNotDelayExcessiveRequests bool   `json:"do_not_delay_excessive_requests,omitempty"`
	HttpStatusErrorCode         int    `json:"http_status_error_code,omitempty"`
	LogLevel                    string `json:"log_level,omitempty"`
	RateLimitingCriteria        string `json:"rate_limiting_criteria,omitempty"`
	RequestsPerSecond           int    `json:"requests_per_second,omitempty"`
	StorageSize                 int    `json:"storage_size_in_mb,omitempty"`
	Zone                        string `json:"zone,omitempty"`

	// RedirectPolicy
	RedirectURI  string `json:"redirect_uri,omitempty"`
	ResponseCode int    `json:"response_code,omitempty"`

	// ResourceAccessControlPolicy
	Disposition      string   `json:"disposition,omitempty"`
	DeniedClients    []string `json:"denied_clients,omitempty"`
	PermittedClients []string `json:"permitted_clients,omitempty"`

	// SetRequestHeaderPolicy
	HeaderName                 string   `json:"header_name,omitempty"`
	Value                      string   `json:"value,omitempty"`
	ActionWhenHeaderExists     string   `json:"action_when_hdr_exists,omitempty"`
	ActionWhenHeaderValueIs    []string `json:"action_when_hdr_value_is,omitempty"`
	ActionWhenHeaderValueIsNot []string `json:"action_when_hdr_value_is_not,omitempty"`

	// SSLNegotiationPolicy
	Port                  int      `json:"port,omitempty"`
	ServerOrderPreference string   `json:"server_order_preference,omitempty"`
	SSLProtocol           []string `json:"ssl_protocol,omitempty"`
	SSLCiphers            []string `json:"ssl_ciphers,omitempty"`

	// TrustedCertificatePolicy
	TrustedCertificate string `json:"cert,omitempty"`
}

type Protocol

type Protocol string
const (
	ProtocolHTTP  Protocol = "HTTP"
	ProtocolHTTPS Protocol = "HTTPS"
)

type QueryProjection

type QueryProjection string

Projections can be specified when retrieving collection of resources as well as when retrieving a specific resource. There are of four types : MINIMAL, CONSOLE, FULL, and DETAILED

const (
	QueryMinimal  QueryProjection = "MINIMAL"
	QueryConsol   QueryProjection = "CONSOLE"
	QueryFull     QueryProjection = "FULL"
	QueryDetailed QueryProjection = "DETAILED"
)

type RateLimitingRequestPolicyInfo

type RateLimitingRequestPolicyInfo struct {
	BurstSize                   int    `json:"burst_size,omitempty"`
	DoNotDelayExcessiveRequests bool   `json:"do_not_delay_excessive_requests,omitempty"`
	HttpStatusErrorCode         int    `json:"http_status_error_code,omitempty"`
	LogLevel                    string `json:"log_level,omitempty"`
	RateLimitingCriteria        string `json:"rate_limiting_criteria,omitempty"`
	RequestsPerSecond           int    `json:"requests_per_second,omitempty"`
	StorageSize                 int    `json:"storage_size_in_mb,omitempty"`
	Zone                        string `json:"zone,omitempty"`
}

type RedirectPolicyInfo

type RedirectPolicyInfo struct {
	RedirectURI  string `json:"redirect_uri,omitempty"`
	ResponseCode int    `json:"response_code,omitempty"`
}

type ResourceAccessControlPolicyInfo

type ResourceAccessControlPolicyInfo struct {
	Disposition      string   `json:"disposition,omitempty"`
	DeniedClients    []string `json:"denied_clients,omitempty"`
	PermittedClients []string `json:"permitted_clients,omitempty"`
}

type ResourceAccessControlPolicyUpdate

type ResourceAccessControlPolicyUpdate struct {
	Disposition      string    `json:"disposition,omitempty"`
	DeniedClients    *[]string `json:"denied_clients,omitempty"`
	PermittedClients *[]string `json:"permitted_clients,omitempty"`
}

use pointer for nilable fields on update

type RestURIInfo

type RestURIInfo struct {
	Type string `json:"type"`
	URI  string `json:"uri"`
}

type SSLCertificateClient

type SSLCertificateClient struct {
	*Client
	ContainerPath    string
	ResourceRootPath string
	Accept           string
	ContentType      string
}

SSLCertificateClient is an AuthenticatedClient with some additional information about the resources to be addressed.

func (*SSLCertificateClient) CreateSSLCertificate

func (c *SSLCertificateClient) CreateSSLCertificate(input *CreateSSLCertificateInput) (*SSLCertificateInfo, error)

CreateSSLCertificate creates a new SSL certificate

func (*SSLCertificateClient) DeleteSSLCertificate

func (c *SSLCertificateClient) DeleteSSLCertificate(name string) (*SSLCertificateInfo, error)

DeleteSSLCertificate deletes the SSL certificate with the specified name

func (*SSLCertificateClient) GetSSLCertificate

func (c *SSLCertificateClient) GetSSLCertificate(name string) (*SSLCertificateInfo, error)

GetSSLCertificate fetch the SSL Certificate details

func (*SSLCertificateClient) WaitForSSLCertificateState

func (c *SSLCertificateClient) WaitForSSLCertificateState(name string, desiredStates, errorStates []LBaaSState, pollInterval, timeoutSeconds time.Duration, info *SSLCertificateInfo) error

WaitForSSLCertificateState waits for the resource to be in one of a set of desired states

type SSLCertificateInfo

type SSLCertificateInfo struct {
	Name             string     `json:"name"`
	Certificate      string     `json:"certificate"`
	CertificateChain string     `json:"certificate_chain"`
	State            LBaaSState `json:"state"`
	Trusted          bool       `json:"trusted"`
	URI              string     `json:"uri"`
}

type SSLNegotiationPolicyInfo

type SSLNegotiationPolicyInfo struct {
	Port                  int      `json:"port,omitempty"`
	ServerOrderPreference string   `json:"server_order_preference,omitempty"`
	SSLProtocol           []string `json:"ssl_protocol,omitempty"`
	SSLCiphers            []string `json:"ssl_ciphers,omitempty"`
}

type SetRequestHeaderPolicyInfo

type SetRequestHeaderPolicyInfo struct {
	HeaderName                 string   `json:"header_name,omitempty"`
	Value                      string   `json:"value,omitempty"`
	ActionWhenHeaderExists     string   `json:"action_when_hdr_exists,omitempty"`
	ActionWhenHeaderValueIs    []string `json:"action_when_hdr_value_is,omitempty"`
	ActionWhenHeaderValueIsNot []string `json:"action_when_hdr_value_is_not,omitempty"`
}

type SetRequestHeaderPolicyUpdate

type SetRequestHeaderPolicyUpdate struct {
	HeaderName                 string    `json:"header_name,omitempty"`
	Value                      *string   `json:"value,omitempty"`
	ActionWhenHeaderExists     string    `json:"action_when_hdr_exists,omitempty"`
	ActionWhenHeaderValueIs    *[]string `json:"action_when_hdr_value_is,omitempty"`
	ActionWhenHeaderValueIsNot *[]string `json:"action_when_hdr_value_is_not,omitempty"`
}

use pointer for niable fields on update

type TrustedCertificatePolicyInfo

type TrustedCertificatePolicyInfo struct {
	TrustedCertificate string `json:"cert,omitempty"`
}

type UpdateListenerInput

type UpdateListenerInput struct {
	BalancerProtocol     Protocol      `json:"balancer_protocol,omitempty"`
	Disabled             LBaaSDisabled `json:"disabled,omitempty"`
	Name                 string        `json:"name"`
	OriginServerPool     *string       `json:"origin_server_pool,omitempty"`
	OriginServerProtocol Protocol      `json:"origin_server_protocol,omitempty"`
	PathPrefixes         *[]string     `json:"path_prefixes,omitempty"`
	Policies             *[]string     `json:"policies,omitempty"`
	Port                 int           `json:"port,omitempty"`
	SSLCerts             *[]string     `json:"ssl_cert,omitempty"`
	Tags                 *[]string     `json:"tags,omitempty"`
	VirtualHosts         *[]string     `json:"virtual_hosts,omitempty"`
}

use pointer for attributes that can be unset

type UpdateLoadBalancerInput

type UpdateLoadBalancerInput struct {
	Description        *string       `json:"description,omitempty"`
	Disabled           LBaaSDisabled `json:"disabled,omitempty"`
	IPNetworkName      *string       `json:"ip_network_name,omitempty"`
	Name               string        `json:"name,omitempty"`
	ParentLoadBalancer *string       `json:"parent_vlbr,omitempty"`
	PermittedClients   *[]string     `json:"permitted_clients,omitempty"`
	PermittedMethods   *[]string     `json:"permitted_methods,omitempty"`
	Policies           *[]string     `json:"policies,omitempty"`
	OriginServerPool   *string       `json:"origin_server_pool,omitempty"`
	Tags               *[]string     `json:"tags,omitempty"`
}

UpdateLoadBalancerInput specifies the create request for a load balancer service instance using pointer for options items where empty string needs to be passed to clear if previously set

type UpdateOriginServerPoolInput

type UpdateOriginServerPoolInput struct {
	Name          string                     `json:"name"`
	OriginServers *[]CreateOriginServerInput `json:"origin_servers,omitempty"`
	HealthCheck   *HealthCheckInfo           `json:"health_check,omitempty"`
	Status        LBaaSStatus                `json:"status,omitempty"`
	Tags          *[]string                  `json:"tags,omitempty"`
	VnicSetName   *string                    `json:"vnic_set_name,omitempty"`
}

use pointer for attributes that can be unset

type UpdateSSLCertificateInput

type UpdateSSLCertificateInput struct {
	Name        string `json:"name"`
	Certificate string `json:"certificate"`
	PrivateKey  string `json:"private_key,omitempty"`
}

Jump to

Keyboard shortcuts

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