api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MPL-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(config *Config) (*Client, error)

func (*Client) Policies

func (c *Client) Policies() *Policies

func (*Client) Scale

func (c *Client) Scale() *Scale

func (*Client) System

func (c *Client) System() *System

type Config

type Config struct {
	Address   string
	TLSConfig *TLSConfig
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig(cfg *clientCfg.Config) *Config

func (*Config) ConfigureTLS

func (c *Config) ConfigureTLS() error

type EventDetails added in v0.1.0

type EventDetails struct {
	Count     int
	Direction string
}

type ExternalCheck added in v0.4.0

type ExternalCheck struct {
	Enabled            bool
	Provider           string
	Query              string
	ComparisonOperator string
	ComparisonValue    int
	Action             string
}

ExternalCheck represents an individual external check within a group scaling policy.

type HealthResp

type HealthResp struct {
	Status string
}

type InfoResp

type InfoResp struct {
	NomadAddress              string
	PolicyEngine              string
	StorageBackend            string
	InternalAutoScalingEngine bool
	StrictPolicyChecking      bool
}

type JobGroupPolicy

type JobGroupPolicy struct {
	Enabled                           bool
	Cooldown                          int
	MaxCount                          int
	MinCount                          int
	ScaleOutCount                     int
	ScaleInCount                      int
	ScaleOutCPUPercentageThreshold    *int
	ScaleOutMemoryPercentageThreshold *int
	ScaleInCPUPercentageThreshold     *int
	ScaleInMemoryPercentageThreshold  *int
	ExternalChecks                    map[string]*ExternalCheck
}

JobGroupPolicy represents an individual job group scaling policy.

type LeaderResp added in v0.2.0

type LeaderResp struct {
	IsSelf               bool
	HAEnabled            bool
	LeaderAddress        string
	LeaderClusterAddress string
}

LeaderResp is the response from the Leader API call.

type Policies

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

func (*Policies) DeleteJobGroupPolicy

func (p *Policies) DeleteJobGroupPolicy(job, group string) error

func (*Policies) DeleteJobPolicy

func (p *Policies) DeleteJobPolicy(job string) error

func (*Policies) List

func (p *Policies) List() (*map[string]map[string]*JobGroupPolicy, error)

func (*Policies) ReadJobGroupPolicy

func (p *Policies) ReadJobGroupPolicy(job, group string) (*JobGroupPolicy, error)

func (*Policies) ReadJobPolicy

func (p *Policies) ReadJobPolicy(job string) (*map[string]*JobGroupPolicy, error)

func (*Policies) WriteJobGroupPolicy

func (p *Policies) WriteJobGroupPolicy(job, group string, policy *JobGroupPolicy) error

func (*Policies) WriteJobPolicy

func (p *Policies) WriteJobPolicy(job string, policy *map[string]*JobGroupPolicy) error

type QueryOptions

type QueryOptions struct {

	// Params are HTTP parameters on the query URL.
	Params map[string]string
}

QueryOptions are used to create a query which includes query params. This is used for GET, POST and PUT calls.

type Scale

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

func (*Scale) Info added in v0.1.0

func (s *Scale) Info(id string) (map[string]*ScalingEvent, error)

func (*Scale) JobGroupIn

func (s *Scale) JobGroupIn(job, group string, count int, meta map[string]string) (*ScaleResp, error)

func (*Scale) JobGroupOut

func (s *Scale) JobGroupOut(job, group string, count int, meta map[string]string) (*ScaleResp, error)

func (*Scale) List added in v0.1.0

func (s *Scale) List(latest bool) (map[uuid.UUID]map[string]*ScalingEvent, error)

type ScaleReq

type ScaleReq struct {
	Count int
}

type ScaleResp

type ScaleResp struct {
	ID           uuid.UUID
	EvaluationID string
}

type ScalingEvent added in v0.1.0

type ScalingEvent struct {
	ID      string
	EvalID  string
	Source  string
	Time    int64
	Status  string
	Details EventDetails
	Meta    map[string]string
}

type System

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

func (*System) Health

func (s *System) Health() (*HealthResp, error)

func (*System) Info

func (s *System) Info() (*InfoResp, error)

func (*System) Leader added in v0.2.0

func (s *System) Leader() (*LeaderResp, error)

func (*System) Metrics

func (s *System) Metrics() (*metrics.MetricsSummary, error)

type TLSConfig

type TLSConfig struct {
	CACert        string
	ClientCert    string
	ClientCertKey string
}

Jump to

Keyboard shortcuts

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