resources

package
v7.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIAutoScalingGroupSpec

type APIAutoScalingGroupSpec struct {
	NodeSelector    map[string]string   `json:"node_selector"`
	Enabled         bool                `json:"enabled"`
	Policies        []string            `json:"policies"`
	Engine          string              `json:"engine"`
	CooldownPeriod  int                 `json:"cooldown_period"`
	Suspended       bool                `json:"suspended"`
	MinNodes        int                 `json:"min_nodes"`
	MaxNodes        int                 `json:"max_nodes"`
	ScalingStrategy *APIScalingStrategy `json:"scaling_strategy,omitempty"`
}

APIAutoScalingGroupSpec allows us to get the snake_case version of the Autoscaling Group from containership API and transform the object to be of the Cerebral AutoscalingGroup type

type APIScalingStrategy

type APIScalingStrategy struct {
	ScaleUp   string `json:"scale_up"`
	ScaleDown string `json:"scale_down"`
}

APIScalingStrategy is part of the APIAutoScalingGroupSpec

type CloudAPIAutoscalingPolicy

type CloudAPIAutoscalingPolicy struct {
	ID                  string                `json:"id"`
	MetricsBackend      string                `json:"metrics_backend"`
	Metric              string                `json:"metric"`
	MetricConfiguration map[string]string     `json:"metric_configuration"`
	ScalingPolicy       CloudAPIScalingPolicy `json:"scaling_policy"`
	PollInterval        int                   `json:"poll_interval"`
	SamplePeriod        int                   `json:"sample_period"`
}

CloudAPIAutoscalingPolicy is the spec for a autoscaling group

type CloudAPIScalingPolicy

type CloudAPIScalingPolicy struct {
	ScaleUp   *CloudAPIScalingPolicyConfiguration `json:"scale_up"`
	ScaleDown *CloudAPIScalingPolicyConfiguration `json:"scale_down"`
}

CloudAPIScalingPolicy holds the policy configurations for scaling up and down

type CloudAPIScalingPolicyConfiguration

type CloudAPIScalingPolicyConfiguration struct {
	Threshold          float64 `json:"threshold"`
	ComparisonOperator string  `json:"comparison_operator"`
	AdjustmentType     string  `json:"adjustment_type"`
	AdjustmentValue    float64 `json:"adjustment_value"`
}

A CloudAPIScalingPolicyConfiguration defines the criterion for triggering a scale event

type CloudResource

type CloudResource interface {
	// IsEqual compares a spec to it's parent object spec
	IsEqual(spec interface{}, parentSpecObj interface{}) (bool, error)
	// Service returns the request.CloudService type of the API to make a request to
	Service() request.CloudService
	// Sync grabs its resources from Containership Cloud and writes them to cache
	Sync() error
}

CloudResource defines an interface for resources to adhere to in order to be kept in sync with Containership Cloud

type CsAuthorizationRoleBindings

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

CsAuthorizationRoleBindings defines the Containership Cloud AuthorizationRoleBindings resource

func NewCsAuthorizationRoleBindings

func NewCsAuthorizationRoleBindings(cloud cscloud.Interface) *CsAuthorizationRoleBindings

NewCsAuthorizationRoleBindings constructs a new CsAuthorizationRoleBindings

func (*CsAuthorizationRoleBindings) Cache

Cache return the containership authorizationRoleBindings cache

func (*CsAuthorizationRoleBindings) IsEqual

func (l *CsAuthorizationRoleBindings) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual compares a AuthorizationRoleBindingSpec to another AuthorizationRoleBinding

func (*CsAuthorizationRoleBindings) Sync

Sync implements the CloudResource interface

type CsAuthorizationRoles

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

CsAuthorizationRoles defines the Containership Cloud AuthorizationRoles resource

func NewCsAuthorizationRoles

func NewCsAuthorizationRoles(cloud cscloud.Interface) *CsAuthorizationRoles

NewCsAuthorizationRoles constructs a new CsAuthorizationRoles

func (*CsAuthorizationRoles) Cache

Cache return the containership authorizationRoles cache

func (*CsAuthorizationRoles) IsEqual

func (l *CsAuthorizationRoles) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual compares a AuthorizationRoleSpec to another AuthorizationRole

func (*CsAuthorizationRoles) Sync

func (l *CsAuthorizationRoles) Sync() error

Sync implements the CloudResource interface

type CsAutoscalingGroups

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

CsAutoscalingGroups defines the Containership Cloud AutoscalingGroups resource

func NewCsAutoscalingGroups

func NewCsAutoscalingGroups(cloud cscloud.Interface) *CsAutoscalingGroups

NewCsAutoscalingGroups constructs a new CsAutoscalingGroups

func (*CsAutoscalingGroups) Cache

Cache return the containership AutoscalingGroup cache

func (*CsAutoscalingGroups) IsEqual

func (ag *CsAutoscalingGroups) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual compares a cloud AutoscalingGroupSpec to the cache AutoscalingGroup

func (*CsAutoscalingGroups) Sync

func (ag *CsAutoscalingGroups) Sync() error

Sync implements the CloudResource interface

func (*CsAutoscalingGroups) UnmarshalToCache

func (ag *CsAutoscalingGroups) UnmarshalToCache(bytes []byte) error

UnmarshalToCache take the json returned from containership API and gets the AutoscalingPolicy associated with them, then writes the AutoscalingGroup to the CsAutoscalingGroups cache

type CsAutoscalingPolicies

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

CsAutoscalingPolicies defines the Containership Cloud AutoscalingEngines resource

func NewCsAutoscalingPolicies

func NewCsAutoscalingPolicies(cloud cscloud.Interface) *CsAutoscalingPolicies

NewCsAutoscalingPolicies constructs a new CsAutoscalingPolicies

func (*CsAutoscalingPolicies) Cache

Cache returns the autoscalingEngines cache

func (*CsAutoscalingPolicies) IsEqual

func (ap *CsAutoscalingPolicies) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual compares a AutoscalingEngineSpec to another AutoscalingEngine new, cache

func (*CsAutoscalingPolicies) Sync

func (ap *CsAutoscalingPolicies) Sync() error

Sync implements the CloudResource interface

func (*CsAutoscalingPolicies) UnmarshalToCache

func (ap *CsAutoscalingPolicies) UnmarshalToCache(cloudAutoscalingPolicies []types.AutoscalingPolicy) error

UnmarshalToCache take the json returned from containership api and writes it to CsAutoscalingPolicies cache

type CsClusterLabels

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

CsClusterLabels defines the Containership Cloud ClusterLabels resource

func NewCsClusterLabels

func NewCsClusterLabels(cloud cscloud.Interface) *CsClusterLabels

NewCsClusterLabels constructs a new CsClusterLabels

func (*CsClusterLabels) Cache

func (l *CsClusterLabels) Cache() []csv3.ClusterLabelSpec

Cache return the containership clusterLabels cache

func (*CsClusterLabels) IsEqual

func (l *CsClusterLabels) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual compares a ClusterLabelSpec to another ClusterLabel

func (*CsClusterLabels) Sync

func (l *CsClusterLabels) Sync() error

Sync implements the CloudResource interface

type CsNodePoolLabels

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

CsNodePoolLabels defines the Containership Cloud NodePoolLabels resource

func NewCsNodePoolLabels

func NewCsNodePoolLabels(cloud cscloud.Interface) *CsNodePoolLabels

NewCsNodePoolLabels constructs a new CsNodePoolLabels

func (*CsNodePoolLabels) Cache

Cache return the containership nodePoolLabels cache

func (*CsNodePoolLabels) IsEqual

func (l *CsNodePoolLabels) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual compares a NodePoolLabelSpec to another NodePoolLabel

func (*CsNodePoolLabels) Sync

func (l *CsNodePoolLabels) Sync() error

Sync implements the CloudResource interface

type CsPlugins

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

CsPlugins defines the Containership Cloud Plugins resource

func NewCsPlugins

func NewCsPlugins(cloud cscloud.Interface) *CsPlugins

NewCsPlugins constructs a new CsPlugins

func (*CsPlugins) Cache

func (cp *CsPlugins) Cache() []csv3.PluginSpec

Cache return the containership plugins cache

func (*CsPlugins) IsEqual

func (cp *CsPlugins) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual compares a PluginSpec to another Plugin

func (*CsPlugins) Sync

func (cp *CsPlugins) Sync() error

Sync implements the CloudResource interface

type CsRegistries

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

CsRegistries defines the Containership Cloud CsRegistries resource

func NewCsRegistries

func NewCsRegistries(cloud cscloud.Interface) *CsRegistries

NewCsRegistries constructs a new CsRegistries

func (*CsRegistries) Cache

func (rs *CsRegistries) Cache() []csv3.RegistrySpec

Cache returns CsRegistries cache

func (*CsRegistries) GetAuthToken

func (rs *CsRegistries) GetAuthToken(spec csv3.RegistrySpec) (csv3.AuthTokenDef, error)

GetAuthToken return the AuthToken Generated by the registry generator

func (*CsRegistries) IsEqual

func (rs *CsRegistries) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual take a Registry Spec and compares it to a Registry to see if they are equal, returns an error if the objects are of an incorrect type

func (*CsRegistries) Sync

func (rs *CsRegistries) Sync() error

Sync implements the CloudResource interface

type CsUsers

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

CsUsers defines the Containership Cloud Users resource

func NewCsUsers

func NewCsUsers(cloud cscloud.Interface) *CsUsers

NewCsUsers constructs a new CsUsers

func (*CsUsers) Cache

func (us *CsUsers) Cache() []csv3.UserSpec

Cache return the containership users cache

func (*CsUsers) IsEqual

func (us *CsUsers) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)

IsEqual compares a UserSpec to another User

func (*CsUsers) Sync

func (us *CsUsers) Sync() error

Sync implements the CloudResource interface

type NodePool

type NodePool struct {
	ID          string                  `json:"id"`
	Autoscaling APIAutoScalingGroupSpec `json:"autoscaling"`
}

NodePool is the API object that is returned that contains the information about autoscaling groups

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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