healthcheck

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TypePING  = "PING"
	TypeTCP   = "TCP"
	TypeHTTP  = "HTTP"
	TypeHTTPS = "HTTPS"
)

Constants that represent approved monitoring types.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	// Required.  Specifies the ID of the listener to which the health check task belongs.
	ListenerID string `json:"listener_id" required:"true"`
	// Optional. Specifies the protocol used for the health check. The value can be HTTP or TCP (case-insensitive).
	HealthcheckProtocol string `json:"healthcheck_protocol,omitempty"`
	// Optional. Specifies the URI for health check. This parameter is valid when healthcheck_ protocol is HTTP.
	// The value is a string of 1 to 80 characters that must start with a slash (/) and can only contain letters, digits,
	// and special characters, such as -/.%?#&.
	HealthcheckUri string `json:"healthcheck_uri,omitempty"`
	// Optional. Specifies the port used for the health check.  The value ranges from 1 to 65535.
	HealthcheckConnectPort int `json:"healthcheck_connect_port,omitempty"`
	// Optional. MSpecifies the threshold at which the health check result is success, that is, the number of consecutive successful
	// health checks when the health check result of the backend server changes from fail to success.
	// The value ranges from 1 to 10.
	HealthyThreshold int `json:"healthy_threshold,omitempty"`
	// Optional. Specifies the threshold at which the health check result is fail, that is, the number of consecutive
	// failed health checks when the health check result of the backend server changes from success to fail.
	// The value ranges from 1 to 10.
	UnhealthyThreshold int `json:"unhealthy_threshold,omitempty"`
	// Optional. Specifies the maximum timeout duration (s) for the health check.
	// The value ranges from 1 to 50.
	HealthcheckTimeout int `json:"healthcheck_timeout,omitempty"`
	// Optional. Specifies the maximum interval (s) for health check.
	// The value ranges from 1 to 5.
	HealthcheckInterval int `json:"healthcheck_interval,omitempty"`
}

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

func (CreateOpts) ToHealthCreateMap

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

ToHealthCreateMap casts a CreateOpts struct to a map.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToHealthCreateMap() (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

func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create is an operation which provisions a new Health Monitor. There are different types of Monitor you can provision: PING, TCP or HTTP(S). Below are examples of how to create each one.

Here is an example config struct to use when creating a PING or TCP Monitor:

CreateOpts{Type: TypePING, Delay: 20, Timeout: 10, MaxRetries: 3} CreateOpts{Type: TypeTCP, Delay: 20, Timeout: 10, MaxRetries: 3}

Here is an example config struct to use when creating a HTTP(S) Monitor:

CreateOpts{Type: TypeHTTP, Delay: 20, Timeout: 10, MaxRetries: 3, HttpMethod: "HEAD", ExpectedCodes: "200", PoolID: "2c946bfc-1804-43ab-a2ff-58f6a762b505"}

func (CreateResult) Extract

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

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

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 Health 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 Health Monitor based on its unique ID.

func (GetResult) Extract

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

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

type Health

type Health struct {
	// Specifies the maximum interval (s) for health check.
	HealthcheckInterval int `json:"healthcheck_interval,omitempty"`
	// Specifies the ID of the listener to which the health check task belongs.
	ListenerID string `json:"listener_id" required:"true"`
	// Specifies the health check ID.
	ID string `json:"id"`
	// Specifies the protocol used for the health check. The value can be HTTP or TCP (case-insensitive).
	HealthcheckProtocol string `json:"healthcheck_protocol,omitempty"`
	// Specifies the threshold at which the health check result is fail, that is, the number of consecutive
	// failed health checks when the health check result of the backend server changes from success to fail.
	UnhealthyThreshold int `json:"unhealthy_threshold,omitempty"`
	// Specifies the time when information about the health check was updated.
	UpdateTime string `json:"update_time"`
	// Specifies the time when the health check was created.
	CreateTime string `json:"create_time"`
	// Specifies the port used for the health check.  The value ranges from 1 to 65535.
	HealthcheckConnectPort int `json:"healthcheck_connect_port,omitempty"`
	// Specifies the maximum timeout duration (s) for the health check.
	HealthcheckTimeout int `json:"healthcheck_timeout,omitempty"`
	// Specifies the URI for health check.
	HealthcheckUri string `json:"healthcheck_uri,omitempty"`
	// Specifies the threshold at which the health check result is success, that is, the number of consecutive successful
	// health checks when the health check result of the backend server changes from fail to success.
	HealthyThreshold int `json:"healthy_threshold,omitempty"`
}

Health represents a load balancer health check. A health monitor is used to determine whether or not back-end members of the VIP's pool are usable for processing a request. A pool can have several health monitors associated with it. There are different types of health monitors supported:

PING: used to ping the members using ICMP. TCP: used to connect to the members using TCP. HTTP: used to send an HTTP request to the member. HTTPS: used to send a secure HTTP request to the member.

When a pool has several monitors associated with it, each member of the pool is monitored by all these monitors. If any monitor declares the member as unhealthy, then the member status is changed to INACTIVE and the member won't participate in its pool's load balancing. In other words, ALL monitors must declare the member to be healthy for it to stay ACTIVE.

type UpdateOpts

type UpdateOpts struct {
	// Optional. Specifies the protocol used for the health check. The value can be HTTP or TCP (case-insensitive).
	HealthcheckProtocol string `json:"healthcheck_protocol,omitempty"`
	// Optional. Specifies the URI for health check. This parameter is valid when healthcheck_ protocol is HTTP.
	// The value is a string of 1 to 80 characters that must start with a slash (/) and can only contain letters, digits,
	// and special characters, such as -/.%?#&.
	HealthcheckUri string `json:"healthcheck_uri,omitempty"`
	// Optional. Specifies the port used for the health check.  The value ranges from 1 to 65535.
	HealthcheckConnectPort int `json:"healthcheck_connect_port,omitempty"`
	// Optional. MSpecifies the threshold at which the health check result is success, that is, the number of consecutive successful
	// health checks when the health check result of the backend server changes from fail to success.
	// The value ranges from 1 to 10.
	HealthyThreshold int `json:"healthy_threshold,omitempty"`
	// Optional. Specifies the threshold at which the health check result is fail, that is, the number of consecutive
	// failed health checks when the health check result of the backend server changes from success to fail.
	// The value ranges from 1 to 10.
	UnhealthyThreshold int `json:"unhealthy_threshold,omitempty"`
	// Optional. Specifies the maximum timeout duration (s) for the health check.
	// The value ranges from 1 to 50.
	HealthcheckTimeout int `json:"healthcheck_timeout,omitempty"`
	// Optional. Specifies the maximum interval (s) for health check.
	// The value ranges from 1 to 5.
	HealthcheckInterval int `json:"healthcheck_interval,omitempty"`
}

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

func (UpdateOpts) ToHealthUpdateMap

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

ToHealthpdateMap casts a UpdateOpts struct to a map.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToHealthUpdateMap() (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 UpdateOptsBuilder) (r UpdateResult)

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

func (UpdateResult) Extract

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

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

Jump to

Keyboard shortcuts

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