gophercloud: github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas_v2/monitors Index | Files

package monitors

import "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas_v2/monitors"

Index

Package Files

requests.go results.go urls.go

Constants

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

Constants that represent approved monitoring types.

func ExtractMonitors Uses

func ExtractMonitors(page pagination.Page) ([]Monitor, error)

ExtractMonitors accepts a Page struct, specifically a MonitorPage struct, and extracts the elements into a slice of Monitor structs. In other words, a generic collection is mapped into a relevant slice.

func List Uses

func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

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

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

type CreateOpts Uses

type CreateOpts monitorOpts

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

func (CreateOpts) ToMonitorCreateMap Uses

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

ToMonitorCreateMap casts a CreateOpts struct to a map.

type CreateOptsBuilder Uses

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

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

CreateResult represents the result of a create operation.

func Create Uses

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

func (CreateResult) Extract Uses

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

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

type DeleteResult Uses

type DeleteResult struct {
    gophercloud.ErrResult
}

DeleteResult represents the result of a delete operation.

func Delete Uses

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

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

type GetResult Uses

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

GetResult represents the result of a get operation.

func Get Uses

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

Get retrieves a particular Health Monitor based on its unique ID.

func (GetResult) Extract Uses

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

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

type ListOpts Uses

type ListOpts struct {
    ID            string `q:"id"`
    Name          string `q:"name"`
    TenantID      string `q:"tenant_id"`
    PoolID        string `q:"pool_id"`
    Type          string `q:"type"`
    Delay         int    `q:"delay"`
    Timeout       int    `q:"timeout"`
    MaxRetries    int    `q:"max_retries"`
    HTTPMethod    string `q:"http_method"`
    URLPath       string `q:"url_path"`
    ExpectedCodes string `q:"expected_codes"`
    AdminStateUp  *bool  `q:"admin_state_up"`
    Status        string `q:"status"`
    Limit         int    `q:"limit"`
    Marker        string `q:"marker"`
    SortKey       string `q:"sort_key"`
    SortDir       string `q:"sort_dir"`
}

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 Monitor attributes you want to see returned. SortKey allows you to sort by a particular Monitor attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.

func (ListOpts) ToMonitorListQuery Uses

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

ToMonitorListQuery formats a ListOpts into a query string.

type ListOptsBuilder Uses

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

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

type Monitor Uses

type Monitor struct {
    // The unique ID for the Monitor.
    ID  string

    // The Name of the Monitor.
    Name string

    // Only an administrative user can specify a tenant ID
    // other than its own.
    TenantID string `json:"tenant_id" mapstructure:"tenant_id"`

    // The type of probe sent by the load balancer to verify the member state,
    // which is PING, TCP, HTTP, or HTTPS.
    Type string

    // The time, in seconds, between sending probes to members.
    Delay int

    // The maximum number of seconds for a monitor to wait for a connection to be
    // established before it times out. This value must be less than the delay value.
    Timeout int

    // Number of allowed connection failures before changing the status of the
    // member to INACTIVE. A valid value is from 1 to 10.
    MaxRetries int `json:"max_retries" mapstructure:"max_retries"`

    // The HTTP method that the monitor uses for requests.
    HTTPMethod string `json:"http_method" mapstructure:"http_method"`

    // The HTTP path of the request sent by the monitor to test the health of a
    // member. Must be a string beginning with a forward slash (/).
    URLPath string `json:"url_path" mapstructure:"url_path"`

    // Expected HTTP codes for a passing HTTP(S) monitor.
    ExpectedCodes string `json:"expected_codes" mapstructure:"expected_codes"`

    // The administrative state of the health monitor, which is up (true) or down (false).
    AdminStateUp bool `json:"admin_state_up" mapstructure:"admin_state_up"`

    // The status of the health monitor. Indicates whether the health monitor is
    // operational.
    Status string

    // List of pools that are associated with the health monitor.
    Pools []PoolID `mapstructure:"pools" json:"pools"`
}

Monitor represents a load balancer health monitor. 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 MonitorPage Uses

type MonitorPage struct {
    pagination.LinkedPageBase
}

MonitorPage is the page returned by a pager when traversing over a collection of health monitors.

func (MonitorPage) IsEmpty Uses

func (p MonitorPage) IsEmpty() (bool, error)

IsEmpty checks whether a PoolPage struct is empty.

func (MonitorPage) NextPageURL Uses

func (p MonitorPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of monitors 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 Pool Uses

type Pool struct {
}

type PoolID Uses

type PoolID struct {
    ID string `mapstructure:"id" json:"id"`
}

type UpdateOpts Uses

type UpdateOpts monitorOpts

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

func (UpdateOpts) ToMonitorUpdateMap Uses

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

ToMonitorUpdateMap casts a UpdateOpts struct to a map.

type UpdateOptsBuilder Uses

type UpdateOptsBuilder interface {
    ToMonitorUpdateMap() (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 Uses

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

UpdateResult represents the result of an update operation.

func Update Uses

func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult

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

func (UpdateResult) Extract Uses

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

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

Package monitors imports 4 packages (graph) and is imported by 26 packages. Updated 2016-07-23. Refresh now. Tools for package owners.