resources

package
v0.0.0-...-a606d81 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 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 hks 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 HKS 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 HKS Cloud

type HksAuthorizationRoleBindings

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

HksAuthorizationRoleBindings defines the HKS Cloud AuthorizationRoleBindings resource

func NewHksAuthorizationRoleBindings

func NewHksAuthorizationRoleBindings(cloud hkscloud.Interface) *HksAuthorizationRoleBindings

NewHksAuthorizationRoleBindings constructs a new HksAuthorizationRoleBindings

func (*HksAuthorizationRoleBindings) Cache

Cache return the hks authorizationRoleBindings cache

func (*HksAuthorizationRoleBindings) IsEqual

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

IsEqual compares a AuthorizationRoleBindingSpec to another AuthorizationRoleBinding

func (*HksAuthorizationRoleBindings) Sync

Sync implements the CloudResource interface

type HksAuthorizationRoles

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

HksAuthorizationRoles defines the HKS Cloud AuthorizationRoles resource

func NewHksAuthorizationRoles

func NewHksAuthorizationRoles(cloud hkscloud.Interface) *HksAuthorizationRoles

NewHksAuthorizationRoles constructs a new HksAuthorizationRoles

func (*HksAuthorizationRoles) Cache

Cache return the hks authorizationRoles cache

func (*HksAuthorizationRoles) IsEqual

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

IsEqual compares a AuthorizationRoleSpec to another AuthorizationRole

func (*HksAuthorizationRoles) Sync

func (l *HksAuthorizationRoles) Sync() error

Sync implements the CloudResource interface

type HksAutoscalingGroups

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

HksAutoscalingGroups defines the HKS Cloud AutoscalingGroups resource

func NewHksAutoscalingGroups

func NewHksAutoscalingGroups(cloud hkscloud.Interface) *HksAutoscalingGroups

NewHksAutoscalingGroups constructs a new HksAutoscalingGroups

func (*HksAutoscalingGroups) Cache

Cache return the hks AutoscalingGroup cache

func (*HksAutoscalingGroups) IsEqual

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

IsEqual compares a cloud AutoscalingGroupSpec to the cache AutoscalingGroup

func (*HksAutoscalingGroups) Sync

func (ag *HksAutoscalingGroups) Sync() error

Sync implements the CloudResource interface

func (*HksAutoscalingGroups) UnmarshalToCache

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

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

type HksAutoscalingPolicies

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

HksAutoscalingPolicies defines the HKS Cloud AutoscalingEngines resource

func NewHksAutoscalingPolicies

func NewHksAutoscalingPolicies(cloud hkscloud.Interface) *HksAutoscalingPolicies

NewHksAutoscalingPolicies constructs a new HksAutoscalingPolicies

func (*HksAutoscalingPolicies) Cache

Cache returns the autoscalingEngines cache

func (*HksAutoscalingPolicies) IsEqual

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

IsEqual compares a AutoscalingEngineSpec to another AutoscalingEngine new, cache

func (*HksAutoscalingPolicies) Sync

func (ap *HksAutoscalingPolicies) Sync() error

Sync implements the CloudResource interface

func (*HksAutoscalingPolicies) UnmarshalToCache

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

UnmarshalToCache take the json returned from hks api and writes it to HksAutoscalingPolicies cache

type HksClusterLabels

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

HksClusterLabels defines the HKS Cloud ClusterLabels resource

func NewHksClusterLabels

func NewHksClusterLabels(cloud hkscloud.Interface) *HksClusterLabels

NewHksClusterLabels constructs a new HksClusterLabels

func (*HksClusterLabels) Cache

Cache return the hks clusterLabels cache

func (*HksClusterLabels) IsEqual

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

IsEqual compares a ClusterLabelSpec to another ClusterLabel

func (*HksClusterLabels) Sync

func (l *HksClusterLabels) Sync() error

Sync implements the CloudResource interface

type HksNodePoolLabels

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

HksNodePoolLabels defines the HKS Cloud NodePoolLabels resource

func NewHksNodePoolLabels

func NewHksNodePoolLabels(cloud hkscloud.Interface) *HksNodePoolLabels

NewHksNodePoolLabels constructs a new HksNodePoolLabels

func (*HksNodePoolLabels) Cache

Cache return the hks nodePoolLabels cache

func (*HksNodePoolLabels) IsEqual

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

IsEqual compares a NodePoolLabelSpec to another NodePoolLabel

func (*HksNodePoolLabels) Sync

func (l *HksNodePoolLabels) Sync() error

Sync implements the CloudResource interface

type HksPlugins

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

HksPlugins defines the HKS Cloud Plugins resource

func NewHksPlugins

func NewHksPlugins(cloud hkscloud.Interface) *HksPlugins

NewHksPlugins constructs a new HksPlugins

func (*HksPlugins) Cache

func (cp *HksPlugins) Cache() []hksv3.PluginSpec

Cache return the hks plugins cache

func (*HksPlugins) IsEqual

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

IsEqual compares a PluginSpec to another Plugin

func (*HksPlugins) Sync

func (cp *HksPlugins) Sync() error

Sync implements the CloudResource interface

type HksRegistries

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

HksRegistries defines the HKS Cloud HksRegistries resource

func NewHksRegistries

func NewHksRegistries(cloud hkscloud.Interface) *HksRegistries

NewHksRegistries constructs a new HksRegistries

func (*HksRegistries) Cache

func (rs *HksRegistries) Cache() []hksv3.RegistrySpec

Cache returns HksRegistries cache

func (*HksRegistries) GetAuthToken

func (rs *HksRegistries) GetAuthToken(spec hksv3.RegistrySpec) (hksv3.AuthTokenDef, error)

GetAuthToken return the AuthToken Generated by the registry generator

func (*HksRegistries) IsEqual

func (rs *HksRegistries) 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 (*HksRegistries) Sync

func (rs *HksRegistries) Sync() error

Sync implements the CloudResource interface

type HksUsers

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

HksUsers defines the HKS Cloud Users resource

func NewHksUsers

func NewHksUsers(cloud hkscloud.Interface) *HksUsers

NewHksUsers constructs a new HksUsers

func (*HksUsers) Cache

func (us *HksUsers) Cache() []hksv3.UserSpec

Cache return the hks users cache

func (*HksUsers) IsEqual

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

IsEqual compares a UserSpec to another User

func (*HksUsers) Sync

func (us *HksUsers) 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