listeners

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List returns a Pager which allows you to iterate over a collection of routers. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Default policy settings return only those routers that are owned by the tenant who submits the request, unless an admin user submits the request.

Types

type CreateOpts

type CreateOpts struct {
	// Required.  Specifies the load balancer name.
	// The name is a string of 1 to 64 characters that consist of letters, digits, underscores (_), and hyphens (-).
	Name string `json:"name" required:"true"`
	// Optional. Provides supplementary information about the listener.
	// The value is a string of 0 to 128 characters and cannot contain angle brackets (<>).
	Description string `json:"description,omitempty"`
	// Required.  Specifies the ID of the load balancer to which the listener belongs.
	LoadbalancerID string `json:"loadbalancer_id" required:"true"`
	// Required.  Specifies the listening protocol used for layer 4 or 7.
	// A listener using UDP is not allowed for a private network load balancer.
	// The value can be HTTP, TCP, HTTPS, SSL, or UDP.
	// The protocol - can either be TCP, HTTP or HTTPS.
	Protocol Protocol `json:"protocol" required:"true"`
	// Required.  Specifies the listening port.
	// The value ranges from 1 to 65535.
	ProtocolPort int `json:"port" required:"true"`
	// Required.  Specifies the backend protocol.
	// If the value of protocol is UDP, the parameter value can only be UDP.
	// If the value of protocol is SSL, the parameter value can only be TCP.
	BackendProtocol Protocol `json:"backend_protocol" required:"true"`
	// Required.  Specifies the backend port.
	// The value ranges from 1 to 65535.
	BackendProtocolPort int `json:"backend_port" required:"true"`
	// Required.  Specifies the load balancing algorithm for the listener.
	// The value can be roundrobin, leastconn, or source.
	Algorithm string `json:"lb_algorithm" required:"true"`
	// Optional.  Specifies whether to enable sticky session.
	// The value can be true or false. Sticky session is enabled when the value is true.
	// If the value of protocol is SSL, the sticky session is not supported and the parameter is invalid.
	// If the value of protocol is HTTP, HTTPS, or TCP and the value of lb_algorithm is not roundrobin,
	// the parameter value can only be false.
	SessionSticky bool `json:"session_sticky,omitempty"`
	// Optional.  Specifies the cookie processing method. The value is insert.
	// insert indicates that the cookie is inserted by the load balancer.
	// This parameter is valid when protocol is set to HTTP and session_sticky to true.
	// The default value is insert. This parameter is invalid when protocol is set to TCP, SSL, or UDP,
	// which means the parameter is empty.
	// The ID of the default pool with which the Listener is associated.
	StickySessionType string `json:"sticky_session_type,omitempty"`
	// Optional.  Specifies the cookie timeout period (minutes). This parameter is valid when protocol is set to HTTP,
	// session_sticky to true, and sticky_session_type to insert. This parameter is invalid when protocol is set to
	// TCP, UDP, or SSL. The value ranges from 1 to 1440.
	CookieTimeout int `json:"cookie_timeout,omitempty"`
	// Optional.  Specifies the TCP timeout period (minutes). This parameter is valid when protocol is set to TCP.
	// The value ranges from 1 to 5.
	TcpTimeout int `json:"tcp_timeout,omitempty"`
	// Optional.  Specifies whether to maintain the TCP connection to the backend ECS after the ECS is deleted.
	// This parameter is valid when protocol is set to TCP.
	// The value can be true or false.
	TcpDraining bool `json:"tcp_draining,omitempty"`
	// Optional.  Specifies the timeout duration (minutes) for the TCP connection to the backend ECS after the ECS
	// is deleted. This parameter is valid when protocol is set to TCP and tcp_draining to true.
	// The value ranges from 0 to 60.
	TcpDrainingTimeout int `json:"tcp_draining_timeout,omitempty"`
	// Optional.  Specifies the certificate ID. This parameter is mandatory when protocol is set to HTTPS or SSL.
	// The value can be obtained by viewing details of the SSL certificate.
	CertificateID string `json:"certificate_id,omitempty"`
	// Optional.  Specifies the SSL certificate ID list if the value of protocol is HTTPS.
	// This parameter is mandatory in SNI scenarios.
	// This parameter is valid only when the load balancer is a public network load balancer.
	Certificates []string `json:"certificates,omitempty"`
	// Optional.  Specifies the UDP session timeout duration (minutes). This parameter is valid when protocol is set to UDP.
	// The value ranges from 1 to 1440.
	UDPTimeout int `json:"udp_timeout,omitempty"`
	// Optional.  Specifies the SSL protocol standard supported by a listener.
	// This parameter is used for enabling specified encryption protocols and valid only when the value of protocol
	// is set to HTTPS or SSL.  The value is TLSv1.2 or TLSv1.2 TLSv1.1 TLSv1. The default value is TLSv1.2.
	SSLProtocols string `json:"ssl_protocols,omitempty"`
	// Optional.  Specifies the cipher suite of an encryption protocol. This parameter is valid only when the value of protocol is set
	// to HTTPS or SSL. The value is Default, Extended, or Strict.
	// The value of Default is ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:
	// ECDHE-RSA-AES128-SHA256.
	// The value of Extended is ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:AES128-SHA256:AES256-SHA256:
	// ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:
	// ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-SHA:AES256-SHA:DHE-DSS-AES128-SHA:CAMELLIA128-SHA:
	// EDH-RSA-DES-CBC3-SHA:DES-CBC3-SHA:ECDHE-RSA-RC4-SHA:RC4-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:
	// DHE-RSA-CAMELLIA256-SHA:DHE-DSS-CAMELLIA256-SHA:CAMELLIA256-SHA:EDH-DSS-DES-CBC3-SHA:DHE-RSA-CAMELLIA128-SHA:
	// DHE-DSS-CAMELLIA128-SHA.
	// The value of Strict is ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256.
	// The default value is Default. The value can only be set to Extended if the value of ssl_protocols is set to
	// TLSv1.2 TLSv1.1 TLSv1.
	SSLCiphers string `json:"ssl_ciphers,omitempty"`
}

CreateOpts is the common options struct used in this package's Create operation.

func (CreateOpts) ToListenerCreateMap

func (opts CreateOpts) ToListenerCreateMap() (map[string]interface{}, error)

ToListenerCreateMap casts a CreateOpts struct to a map.

type CreateOptsBuilder

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

CreateOptsBuilder is the interface options structs have to satisfy in order to be used in the main Create operation in this package. Since many extensions decorate or modify the common logic, it is useful for them to satisfy a basic interface in order for them to be used.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents the result of a create operation.

func Create

Create is an operation which provisions a new Listeners based on the configuration defined in the CreateOpts struct. Once the request is validated and progress has started on the provisioning process, a CreateResult will be returned.

Users with an admin role can create Listeners on behalf of other tenants by specifying a TenantID attribute different than their own.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Listener, error)

Extract is a function that accepts a result and extracts a router.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a delete operation.

func Delete

func Delete(c *golangsdk.ServiceClient, id string) (r DeleteResult)

Delete will permanently delete a particular Listeners based on its unique ID.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a get operation.

func Get

func Get(c *golangsdk.ServiceClient, id string) (r GetResult)

Get retrieves a particular Listeners based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Listener, error)

Extract is a function that accepts a result and extracts a router.

type ListOpts

type ListOpts struct {
	LoadbalancerId string `q:"loadbalancer_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 floating IP attributes you want to see returned. SortKey allows you to sort by a particular listener attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.

func (ListOpts) ToListenerListQuery

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

ToListenerListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

type Listener

type Listener struct {
	// Specifies the time when information about the listener was updated.
	UpdateTime string `json:"update_time"`
	// Specifies the backend port.
	BackendProtocolPort int `json:"backend_port"`
	// Specifies the listener ID.
	ID string `json:"id"`
	// Specifies the backend protocol.
	BackendProtocol Protocol `json:"backend_protocol"`
	// Specifies the cookie processing method. The value is insert.
	StickySessionType string `json:"sticky_session_type"`
	// Provides supplementary information about the listener.
	Description string `json:"description"`
	// Specifies the ID of the load balancer to which the listener belongs.
	LoadbalancerID string `json:"loadbalancer_id"`
	// Specifies the time when the listener was created.
	CreateTime string `json:"create_time"`
	// Specifies the listener status. The value can be ACTIVE, PENDING_CREATE, or ERROR.
	Status string `json:"status"`
	// Specifies the listening protocol used for layer 4 or 7.
	Protocol Protocol `json:"protocol"`
	// Specifies the listening port.
	ProtocolPort int `json:"port"`
	// Specifies the cookie timeout period (minutes).
	CookieTimeout int `json:"cookie_timeout"`
	// Specifies the status of the load balancer.
	AdminStateUp bool `json:"admin_state_up"`
	// Specifies the quantity of backend ECSs.
	MemberNumber int `json:"member_number"`
	// Specifies the health check task ID.
	HealthCheckID string `json:"healthcheck_id"`
	// Specifies whether to enable sticky session.
	SessionSticky bool `json:"session_sticky,omitempty"`
	// Specifies the load balancing algorithm for the listener.
	Algorithm string `json:"lb_algorithm"`
	// Specifies the load balancer name.
	Name string `json:"name"`
	// Specifies the certificate ID.
	CertificateID string `json:"certificate_id"`
	// Specifies the SSL certificate ID list if the value of protocol is HTTPS.
	Certificates []string `json:"certificates"`
	// Specifies the TCP timeout period (minutes).
	TcpTimeout int `json:"tcp_timeout"`
	// Specifies the UDP session timeout duration (minutes).
	UDPTimeout int `json:"udp_timeout"`
	// Specifies the SSL protocol standard supported by a listener.
	SSLProtocols string `json:"ssl_protocols"`
	// Specifies the cipher suite of an encryption protocol.
	SSLCiphers string `json:"ssl_ciphers"`
	// Secifies whether to maintain the TCP connection to the backend ECS after the ECS is deleted.
	TcpDraining bool `json:"tcp_draining"`
	// Specifies the timeout duration (minutes) for the TCP connection to the backend ECS after the ECS
	TcpDrainingTimeout int `json:"tcp_draining_timeout"`
}

Listener is the primary load balancing configuration object that specifies the loadbalancer and port on which client traffic is received, as well as other details such as the load balancing method to be use, protocol, etc.

func ExtractListeners

func ExtractListeners(r pagination.Page) ([]Listener, error)

ExtractListeners accepts a Page struct, specifically a ListenerPage struct, and extracts the elements into a slice of Listener structs. In other words, a generic collection is mapped into a relevant slice.

type ListenerPage

type ListenerPage struct {
	pagination.LinkedPageBase
}

ListenerPage is the page returned by a pager when traversing over a collection of routers.

func (ListenerPage) IsEmpty

func (r ListenerPage) IsEmpty() (bool, error)

IsEmpty checks whether a RouterPage struct is empty.

func (ListenerPage) NextPageURL

func (r ListenerPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of routers 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 LoadBalancerID

type LoadBalancerID struct {
	ID string `json:"id"`
}

type Protocol

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

Supported attributes for create/update operations.

type UpdateOpts

type UpdateOpts struct {
	// Required.  Specifies the load balancer name.
	// The name is a string of 1 to 64 characters that consist of letters, digits, underscores (_), and hyphens (-).
	Name string `json:"name,omitempty"`
	// Optional. Provides supplementary information about the listener.
	// The value is a string of 0 to 128 characters and cannot contain angle brackets (<>).
	Description string `json:"description,omitempty"`
	// Required.  Specifies the listening port.
	// The value ranges from 1 to 65535.
	ProtocolPort int `json:"port,omitempty"`
	// Required.  Specifies the backend port.
	// The value ranges from 1 to 65535.
	BackendProtocolPort int `json:"backend_port,omitempty"`
	// Required.  Specifies the load balancing algorithm for the listener.
	// The value can be roundrobin, leastconn, or source.
	Algorithm string `json:"lb_algorithm,omitempty"`
	// Optional.  Specifies the TCP timeout period (minutes). This parameter is valid when protocol is set to TCP.
	// The value ranges from 1 to 5.
	TcpTimeout int `json:"tcp_timeout,omitempty"`
	// Optional.  Specifies whether to maintain the TCP connection to the backend ECS after the ECS is deleted.
	// This parameter is valid when protocol is set to TCP.
	// The value can be true or false.
	TcpDraining bool `json:"tcp_draining,omitempty"`
	// Optional.  Specifies the timeout duration (minutes) for the TCP connection to the backend ECS after the ECS
	// is deleted. This parameter is valid when protocol is set to TCP and tcp_draining to true.
	// The value ranges from 0 to 60.
	TcpDrainingTimeout int `json:"tcp_draining_timeout,omitempty"`
	// Optional.  Specifies the UDP session timeout duration (minutes). This parameter is valid when protocol is set to UDP.
	// The value ranges from 1 to 1440.
	UDPTimeout int `json:"udp_timeout,omitempty"`
	// Optional.  Specifies the SSL protocol standard supported by a listener.
	// This parameter is used for enabling specified encryption protocols and valid only when the value of protocol
	// is set to HTTPS or SSL.  The value is TLSv1.2 or TLSv1.2 TLSv1.1 TLSv1. The default value is TLSv1.2.
	SSLProtocols string `json:"ssl_protocols,omitempty"`
	// Optional.  Specifies the cipher suite of an encryption protocol. This parameter is valid only when the value of protocol is set
	// to HTTPS or SSL. The value is Default, Extended, or Strict.
	// The value of Default is ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:
	// ECDHE-RSA-AES128-SHA256.
	// The value of Extended is ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:AES128-SHA256:AES256-SHA256:
	// ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:
	// ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-SHA:AES256-SHA:DHE-DSS-AES128-SHA:CAMELLIA128-SHA:
	// EDH-RSA-DES-CBC3-SHA:DES-CBC3-SHA:ECDHE-RSA-RC4-SHA:RC4-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:
	// DHE-RSA-CAMELLIA256-SHA:DHE-DSS-CAMELLIA256-SHA:CAMELLIA256-SHA:EDH-DSS-DES-CBC3-SHA:DHE-RSA-CAMELLIA128-SHA:
	// DHE-DSS-CAMELLIA128-SHA.
	// The value of Strict is ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256.
	// The default value is Default. The value can only be set to Extended if the value of ssl_protocols is set to
	// TLSv1.2 TLSv1.1 TLSv1.
	SSLCiphers string `json:"ssl_ciphers,omitempty"`
}

UpdateOpts is the common options struct used in this package's Update operation.

func (UpdateOpts) ToListenerUpdateMap

func (opts UpdateOpts) ToListenerUpdateMap() (map[string]interface{}, error)

ToListenerUpdateMap casts a UpdateOpts struct to a map.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToListenerUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder is the interface options structs have to satisfy in order to be used in the main Update operation in this package. Since many extensions decorate or modify the common logic, it is useful for them to satisfy a basic interface in order for them to be used.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents the result of an update operation.

func Update

func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (r UpdateResult)

Update is an operation which modifies the attributes of the specified Listener.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Listener, error)

Extract is a function that accepts a result and extracts a router.

Jump to

Keyboard shortcuts

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