avs

package
v0.0.0-...-4b7ff4e Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EvaluationIdKey = "avs_bridge.config.evaluations.cluster.id"
	AvsBridgeAPIKey = "avs_bridge.config.availabilityService.apiKey"
	ComponentName   = "avs-bridge"
)
View Source
const (
	DefinitionType = "BASIC"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicEvaluationCreateRequest

type BasicEvaluationCreateRequest struct {
	DefinitionType   string `json:"definition_type"`
	Name             string `json:"name"`
	Description      string `json:"description"`
	Service          string `json:"service"`
	URL              string `json:"url"`
	CheckType        string `json:"check_type"`
	Interval         int32  `json:"interval"`
	TesterAccessId   int64  `json:"tester_access_id"`
	Timeout          int    `json:"timeout"`
	ReadOnly         bool   `json:"read_only"`
	ContentCheck     string `json:"content_check"`
	ContentCheckType string `json:"content_check_type"`
	Threshold        string `json:"threshold"`
	GroupId          int64  `json:"group_id"`
	Visibility       string `json:"visibility"`
	ParentId         int64  `json:"parent_id"`
	Tags             []*Tag `json:"tags"`
}

type BasicEvaluationCreateResponse

type BasicEvaluationCreateResponse struct {
	DefinitionType   string `json:"definition_type"`
	Name             string `json:"name"`
	Description      string `json:"description"`
	Service          string `json:"service"`
	URL              string `json:"url"`
	CheckType        string `json:"check_type"`
	Interval         int32  `json:"interval"`
	TesterAccessId   int64  `json:"tester_access_id"`
	Timeout          int    `json:"timeout"`
	ReadOnly         bool   `json:"read_only"`
	ContentCheck     string `json:"content_check"`
	ContentCheckType string `json:"content_check_type"`
	Threshold        int64  `json:"threshold"`
	GroupId          int64  `json:"group_id"`
	Visibility       string `json:"visibility"`

	DateCreated                int64  `json:"dateCreated"`
	DateChanged                int64  `json:"dateChanged"`
	Owner                      string `json:"owner"`
	Status                     string `json:"status"`
	Alerts                     []int  `json:"alerts"`
	Tags                       []*Tag `json:"tags"`
	Id                         int64  `json:"id"`
	LegacyCheckId              int64  `json:"legacy_check_id"`
	InternalInterval           int64  `json:"internal_interval"`
	AuthType                   string `json:"auth_type"`
	IndividualOutageEventsOnly bool   `json:"individual_outage_events_only"`
	IdOnTester                 string `json:"id_on_tester"`
}

type Client

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

func NewClient

func NewClient(ctx context.Context, avsConfig Config) (*Client, error)

func (*Client) CreateEvaluation

func (c *Client) CreateEvaluation(evaluationRequest *BasicEvaluationCreateRequest) (*BasicEvaluationCreateResponse, error)

func (*Client) DeleteEvaluation

func (c *Client) DeleteEvaluation(evaluationId int64) error

func (*Client) RemoveReferenceFromParentEval

func (c *Client) RemoveReferenceFromParentEval(evaluationId int64) error

type Config

type Config struct {
	OauthTokenEndpoint     string
	OauthUsername          string
	OauthPassword          string
	OauthClientId          string
	ApiEndpoint            string
	DefinitionType         string `envconfig:"default=BASIC"`
	ApiKey                 string
	Disabled               bool `envconfig:"default=false"`
	InternalTesterAccessId int64
	InternalTesterService  string `envconfig:"optional"`
	InternalTesterTags     []*Tag `envconfig:"optional"`
	GroupId                int64
	ExternalTesterAccessId int64
	ExternalTesterService  string `envconfig:"optional"`
	ExternalTesterTags     []*Tag `envconfig:"optional"`
	ParentId               int64
}

type Delegator

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

func NewDelegator

func NewDelegator(client *Client, avsConfig Config, operationsStorage storage.Operations) *Delegator

func (*Delegator) CreateEvaluation

func (del *Delegator) CreateEvaluation(logger logrus.FieldLogger, operation internal.ProvisioningOperation, evalAssistant EvalAssistant, url string) (internal.ProvisioningOperation, time.Duration, error)

func (*Delegator) DeleteAvsEvaluation

func (del *Delegator) DeleteAvsEvaluation(deProvisioningOperation internal.DeprovisioningOperation, logger logrus.FieldLogger, assistant EvalAssistant) (internal.DeprovisioningOperation, error)

type EvalAssistant

type EvalAssistant interface {
	CreateBasicEvaluationRequest(operations internal.ProvisioningOperation, configForModel *configForModel, url string) (*BasicEvaluationCreateRequest, error)
	AppendOverrides(inputCreator internal.ProvisionInputCreator, evaluationId int64)
	IsAlreadyCreated(lifecycleData internal.AvsLifecycleData) bool
	SetEvalId(lifecycleData *internal.AvsLifecycleData, evalId int64)
	IsAlreadyDeleted(lifecycleData internal.AvsLifecycleData) bool
	GetEvaluationId(lifecycleData internal.AvsLifecycleData) int64
	// contains filtered or unexported methods
}

type ExternalEvalAssistant

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

func NewExternalEvalAssistant

func NewExternalEvalAssistant(avsConfig Config) *ExternalEvalAssistant

func (*ExternalEvalAssistant) AppendOverrides

func (eea *ExternalEvalAssistant) AppendOverrides(inputCreator internal.ProvisionInputCreator, evaluationId int64)

func (*ExternalEvalAssistant) CreateBasicEvaluationRequest

func (eea *ExternalEvalAssistant) CreateBasicEvaluationRequest(operations internal.ProvisioningOperation, configForModel *configForModel, url string) (*BasicEvaluationCreateRequest, error)

func (*ExternalEvalAssistant) GetEvaluationId

func (eea *ExternalEvalAssistant) GetEvaluationId(lifecycleData internal.AvsLifecycleData) int64

func (*ExternalEvalAssistant) IsAlreadyCreated

func (eea *ExternalEvalAssistant) IsAlreadyCreated(lifecycleData internal.AvsLifecycleData) bool

func (*ExternalEvalAssistant) IsAlreadyDeleted

func (eea *ExternalEvalAssistant) IsAlreadyDeleted(lifecycleData internal.AvsLifecycleData) bool

func (*ExternalEvalAssistant) ProvideCheckType

func (eea *ExternalEvalAssistant) ProvideCheckType() string

func (*ExternalEvalAssistant) ProvideNewOrDefaultServiceName

func (eea *ExternalEvalAssistant) ProvideNewOrDefaultServiceName(defaultServiceName string) string

func (*ExternalEvalAssistant) ProvideSuffix

func (eea *ExternalEvalAssistant) ProvideSuffix() string

func (*ExternalEvalAssistant) ProvideTags

func (eea *ExternalEvalAssistant) ProvideTags() []*Tag

func (*ExternalEvalAssistant) ProvideTesterAccessId

func (eea *ExternalEvalAssistant) ProvideTesterAccessId() int64

func (*ExternalEvalAssistant) SetEvalId

func (eea *ExternalEvalAssistant) SetEvalId(lifecycleData *internal.AvsLifecycleData, evalId int64)

type InternalEvalAssistant

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

func NewInternalEvalAssistant

func NewInternalEvalAssistant(avsConfig Config) *InternalEvalAssistant

func (*InternalEvalAssistant) AppendOverrides

func (iec *InternalEvalAssistant) AppendOverrides(inputCreator internal.ProvisionInputCreator, evaluationId int64)

func (*InternalEvalAssistant) CreateBasicEvaluationRequest

func (iec *InternalEvalAssistant) CreateBasicEvaluationRequest(operations internal.ProvisioningOperation, configForModel *configForModel, url string) (*BasicEvaluationCreateRequest, error)

func (*InternalEvalAssistant) GetEvaluationId

func (iec *InternalEvalAssistant) GetEvaluationId(lifecycleData internal.AvsLifecycleData) int64

func (*InternalEvalAssistant) IsAlreadyCreated

func (iec *InternalEvalAssistant) IsAlreadyCreated(lifecycleData internal.AvsLifecycleData) bool

func (*InternalEvalAssistant) IsAlreadyDeleted

func (iec *InternalEvalAssistant) IsAlreadyDeleted(lifecycleData internal.AvsLifecycleData) bool

func (*InternalEvalAssistant) ProvideCheckType

func (iec *InternalEvalAssistant) ProvideCheckType() string

func (*InternalEvalAssistant) ProvideNewOrDefaultServiceName

func (iec *InternalEvalAssistant) ProvideNewOrDefaultServiceName(defaultServiceName string) string

func (*InternalEvalAssistant) ProvideSuffix

func (iec *InternalEvalAssistant) ProvideSuffix() string

func (*InternalEvalAssistant) ProvideTags

func (iec *InternalEvalAssistant) ProvideTags() []*Tag

func (*InternalEvalAssistant) ProvideTesterAccessId

func (iec *InternalEvalAssistant) ProvideTesterAccessId() int64

func (*InternalEvalAssistant) SetEvalId

func (iec *InternalEvalAssistant) SetEvalId(lifecycleData *internal.AvsLifecycleData, evalId int64)

type ModelConfigurator

type ModelConfigurator interface {
	ProvideSuffix() string
	ProvideTesterAccessId() int64
	ProvideTags() []*Tag
	ProvideNewOrDefaultServiceName(defaultServiceName string) string
	ProvideCheckType() string
}

type RetryConfig

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

type Tag

type Tag struct {
	Content      string `json:"content"`
	TagClassId   int    `json:"tag_class_id"`
	TagClassName string `json:"tag_class_name"`
}

Jump to

Keyboard shortcuts

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