Documentation
¶
Index ¶
Constants ¶
const ( // OpenStackType represents a OpenStack type OpenStackType string = "openstack" // PrometheusType is a Prometheus backend PrometheusType = "prometheus" FixedDelay = "fixed" BackoffDelay = "backoff" // DefaultCloudPrefix is the default etcd prefix for Cloud data DefaultCloudPrefix = "/clouds" DefaultHealerPrefix = "/healers" DefaultHealerQuery = "up{job=~\".*compute-cadvisor.*|.*compute-node.*\"} < 1" DefaultHealerInterval = "18s" DefaultHealerDuration = "3m" DefaultNResolverPrefix = "/nresolvers" DefaultNResolverQuery = "node_uname_info" DefaultNResolverInterval = "30s" // DefaultScalerPrefix is the etcd default prefix for scaler DefaultScalerPrefix = "/scalers" // DefaultSilencePrefix is default etcd prefix for Silences DefaultSilencePrefix = "/silences" DefaultSilenceValidationInterval = "30s" DefaultSyncSilencesInterval = "60s" DefaultSyncedSilenceName = "Auto sync silence from Alertmanger" DefaultSyncSilencePrefix = "[faythe]" // DefaultUserPrefix is default etcd prefix for Users DefaultUsersPrefix = "/users" // DefaultPoliciesPrefix is default etcd prefix for policies // This prefix is a bit different than others, it doesn't start with a slash '/' DefaultPoliciesPrefix = "policies" )
const ( // DefaultClusterPrefix is the etcd default prefix for cluster DefaultClusterPrefix string = "/cluster" )
const DefaultMaxNumberOfInstances int = 3
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionHTTP ¶
type ActionHTTP struct { Action URL URL `json:"url"` CloudAuthToken bool `json:"cloud_auth_token"` Method string `json:"method,omitempty"` Attempts uint `json:"attempts,omitempty"` Delay string `json:"delay,omitempty"` DelayType string `json:"delay_type,omitempty"` Header map[string]string `json:"header,omitempty"` Body interface{} `json:"body,omitempty"` }
ActionHTTP represents a HTTP request with retry logic.
func (*ActionHTTP) InfoLog ¶
func (a *ActionHTTP) InfoLog() []string
InfoLog returns type, url & method information.
func (*ActionHTTP) Validate ¶
func (a *ActionHTTP) Validate() error
Validate returns nil if all fields of the Action have valid values.
type ActionInterface ¶
type ActionMail ¶
type ActionMail struct { Action Receivers Receivers `json:"-"` Subject string `json:"subject"` Body string `json:"body"` }
ActionMail represents a Mail object.
func (*ActionMail) InfoLog ¶
func (a *ActionMail) InfoLog() []string
InfoLog returns type & receivers information.
func (*ActionMail) Validate ¶
func (a *ActionMail) Validate() error
Validate returns nil if all fields of the Action have valid values.
type ActionMistral ¶
type ActionMistral struct { Action WorkflowID string `json:"workflow_id"` Input map[string]interface{} `json:"-"` }
ActionMistral is the special action contains OpenStack Mistral workflow information.
func (*ActionMistral) InfoLog ¶
func (a *ActionMistral) InfoLog() []string
InfoLog returns Mistral workflow ID information
func (*ActionMistral) Validate ¶
func (a *ActionMistral) Validate() error
Validate returns nil if all fields of the Action have valid values.
type Cloud ¶
type Cloud struct { // The cloud provider type. OpenStack is the only provider supported by now Provider string `json:"provider"` ID string `json:"id,omitempty"` Endpoints map[string]URL `json:"endpoints"` Monitor Monitor `json:"monitor"` Tags []string `json:"tags"` CreatedBy string `json:"created_by"` }
Cloud represents Cloud information. Other cloud provider models have to inherited this struct
type Healer ¶
type Healer struct { Actions map[string]ActionInterface `json:"ractions"` ActionsRaw map[string]json.RawMessage `json:"actions"` Active bool `json:"active"` Alert Alert `json:"alert,omitempty"` CloudID string `json:"cloudid"` Description string `json:"description"` Duration string `json:"duration"` EvaluationLevel int `json:"evaluation_level"` ID string `json:"id,omitempty"` Interval string `json:"interval"` Receivers Receivers `json:"receivers"` Query string `json:"query"` Tags []string `json:"tags"` CreatedBy string `json:"created_by"` SyncSilences bool `json:"sync_silences"` }
Healer represents a Healer instance
type Member ¶
type Member struct { Name string `json:"name"` ID string `json:"id"` Address string `json:"address"` }
Member is the logical node
type Monitor ¶
type Monitor struct { Backend string `json:"backend"` Address URL `json:"address"` Metadata map[string]string `json:"metadata"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` }
Monitor represents a monitor backend
type NResolver ¶
type OpenStack ¶
type OpenStack struct { Cloud Auth OpenStackAuth `json:"auth"` }
OpenStack represents OpenStack information.
func (*OpenStack) BaseClient ¶
func (op *OpenStack) BaseClient() (*gophercloud.ProviderClient, error)
func (*OpenStack) NewWorkflowClient ¶
func (op *OpenStack) NewWorkflowClient() (*gophercloud.ServiceClient, error)
type OpenStackAuth ¶
type OpenStackAuth struct { // AuthURL specifies the HTTP endpoint that is required to work with // the Identity API of the appropriate version. While it's ultimately needed by // all of the identity services, it will often be populated by a provider-level // function. AuthURL string `json:"auth_url"` RegionName string `json:"region_name"` // Username is required if using Identity V2 API. Consult with your provider's // control panel to discover your account's username. In Identity V3, either // UserID or a combination of Username and DomainID or DomainName are needed. Username string `json:"username"` UserID string `json:"userid"` Password string `json:"password"` // At most one of DomainID and DomainName must be provided if using Username // with Identity V3. Otherwise, either are optional. DomainName string `json:"domain_name"` DomainID string `json:"domain_id"` // The ProjectID and ProjectName fields are optional for the Identity V2 API. // The same fields are known as project_id and project_name in the Identity // V3 API, but are collected as ProjectID and ProjectName here in both cases. // Some providers allow you to specify a ProjectName instead of the ProjectId. // Some require both. Your provider's authentication policies will determine // how these fields influence authentication. // If DomainID or DomainName are provided, they will also apply to ProjectName. // It is not currently possible to authenticate with Username and a Domain // and scope to a Project in a different Domain by using ProjectName. To // accomplish that, the ProjectID will need to be provided as the ProjectID // option. ProjectName string `json:"project_name"` ProjectID string `json:"project_id"` }
OpenStackAuth stores information needed to authenticate to an OpenStack Cloud.
type Scaler ¶
type Scaler struct { Query string `json:"query"` Duration string `json:"duration"` Description string `json:"description"` Interval string `json:"interval"` Actions map[string]ActionInterface `json:"ractions"` ActionsRaw map[string]json.RawMessage `json:"actions"` Tags []string `json:"tags"` Active bool `json:"active"` ID string `json:"id,omitempty"` Alert *Alert `json:"alert,omitempty"` Cooldown string `json:"cooldown"` CloudID string `json:"cloudid"` CreatedBy string `json:"created_by"` }
Scaler represents a Scaler object
type Silence ¶
type Silence struct { ID string `json:"id"` Name string `json:"name"` Pattern string `json:"pattern"` RegexPattern *regexp.Regexp `json:"-"` TTL string `json:"ttl"` Tags []string `json:"tags"` Description string `json:"description"` CreatedAt time.Time `json:"created_at"` ExpiredAt time.Time `json:"expired_at"` CreatedBy string `json:"created_by"` }