Documentation ¶
Index ¶
- func Sync(cr CloudResource) error
- type APIAutoScalingGroupSpec
- type APIScalingStrategy
- type CloudAPIAutoscalingPolicy
- type CloudAPIScalingPolicy
- type CloudAPIScalingPolicyConfiguration
- type CloudResource
- type CsAutoscalingGroups
- func (us *CsAutoscalingGroups) Cache() []cerebralv1alpha1.AutoscalingGroup
- func (cr CsAutoscalingGroups) Endpoint() string
- func (us *CsAutoscalingGroups) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)
- func (cr CsAutoscalingGroups) Service() request.CloudService
- func (us *CsAutoscalingGroups) UnmarshalToCache(bytes []byte) error
- type CsAutoscalingPolicies
- func (us *CsAutoscalingPolicies) Cache() []cerebralv1alpha1.AutoscalingPolicy
- func (cr CsAutoscalingPolicies) Endpoint() string
- func (us *CsAutoscalingPolicies) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)
- func (cr CsAutoscalingPolicies) Service() request.CloudService
- func (us *CsAutoscalingPolicies) UnmarshalToCache(bytes []byte) error
- type CsPlugins
- type CsRegistries
- func (rs *CsRegistries) Cache() []csv3.RegistrySpec
- func (cr CsRegistries) Endpoint() string
- func (rs *CsRegistries) GetAuthToken(spec csv3.RegistrySpec) (csv3.AuthTokenDef, error)
- func (rs *CsRegistries) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)
- func (cr CsRegistries) Service() request.CloudService
- func (rs *CsRegistries) UnmarshalToCache(bytes []byte) error
- type CsUsers
- type NodePool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sync ¶
func Sync(cr CloudResource) error
Sync makes a request to cloud api for a resource and then writes the response to the resources cache
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 { // Endpoint returns the API endpoint associated with this cloud resource Endpoint() string // UnmarshalToCache unmarshals to the resource's underlying cache // TODO use stream not []byte for efficiency UnmarshalToCache(bytes []byte) error // 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 }
CloudResource defines an interface for resources to adhere to in order to be kept in sync with Containership Cloud
type CsAutoscalingGroups ¶
type CsAutoscalingGroups struct {
// contains filtered or unexported fields
}
CsAutoscalingGroups defines the Containership Cloud AutoscalingGroups resource
func NewCsAutoscalingGroups ¶
func NewCsAutoscalingGroups() *CsAutoscalingGroups
NewCsAutoscalingGroups constructs a new CsAutoscalingGroups
func (*CsAutoscalingGroups) Cache ¶
func (us *CsAutoscalingGroups) Cache() []cerebralv1alpha1.AutoscalingGroup
Cache return the containership AutoscalingGroup cache
func (*CsAutoscalingGroups) IsEqual ¶
func (us *CsAutoscalingGroups) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)
IsEqual compares a cloud AutoscalingGroupSpec to the cache AutoscalingGroup
func (CsAutoscalingGroups) Service ¶
func (cr CsAutoscalingGroups) Service() request.CloudService
func (*CsAutoscalingGroups) UnmarshalToCache ¶
func (us *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() *CsAutoscalingPolicies
NewCsAutoscalingPolicies constructs a new CsAutoscalingPolicies
func (*CsAutoscalingPolicies) Cache ¶
func (us *CsAutoscalingPolicies) Cache() []cerebralv1alpha1.AutoscalingPolicy
Cache returns the autoscalingEngines cache
func (*CsAutoscalingPolicies) IsEqual ¶
func (us *CsAutoscalingPolicies) IsEqual(specObj interface{}, parentSpecObj interface{}) (bool, error)
IsEqual compares a AutoscalingEngineSpec to another AutoscalingEngine new, cache
func (CsAutoscalingPolicies) Service ¶
func (cr CsAutoscalingPolicies) Service() request.CloudService
func (*CsAutoscalingPolicies) UnmarshalToCache ¶
func (us *CsAutoscalingPolicies) UnmarshalToCache(bytes []byte) error
UnmarshalToCache take the json returned from containership api and writes it to CsAutoscalingPolicies cache
type CsPlugins ¶
type CsPlugins struct {
// contains filtered or unexported fields
}
CsPlugins defines the Containership Cloud Plugins resource
func (*CsPlugins) Cache ¶
func (us *CsPlugins) Cache() []csv3.PluginSpec
Cache return the containership plugins cache
func (CsPlugins) Service ¶
func (cr CsPlugins) Service() request.CloudService
func (*CsPlugins) UnmarshalToCache ¶
UnmarshalToCache take the json returned from containership api and writes it to CsPlugins cache
type CsRegistries ¶
type CsRegistries struct {
// contains filtered or unexported fields
}
CsRegistries defines the Containership Cloud CsRegistries resource
func NewCsRegistries ¶
func NewCsRegistries() *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) Service ¶
func (cr CsRegistries) Service() request.CloudService
func (*CsRegistries) UnmarshalToCache ¶
func (rs *CsRegistries) UnmarshalToCache(bytes []byte) error
UnmarshalToCache take the json returned from containership api and writes it to CsRegistries cache
type CsUsers ¶
type CsUsers struct {
// contains filtered or unexported fields
}
CsUsers defines the Containership Cloud Users resource
func (CsUsers) Service ¶
func (cr CsUsers) Service() request.CloudService
func (*CsUsers) UnmarshalToCache ¶
UnmarshalToCache take the json returned from containership api and writes it to CsUsers cache
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