commons

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FailureFieldReadPattern   = "failed reading field %v - %#v"
	FailureFieldCreatePattern = "failed creating field %v - %#v"
	FailureFieldUpdatePattern = "failed updating field %v - %#v"

	FieldUpdateNotAllowedPattern = "field [%v] is immutable, cannot be changed post group creation"

	ProviderToken   FieldName = "token"
	ProviderAccount FieldName = "account"

	Subscription ResourceAffinity = "Subscription"

	ElastigroupAWS                 ResourceAffinity = "Elastigroup_AWS"
	ElastigroupInstanceType        ResourceAffinity = "Elastigroup_Instance_Type"
	ElastigroupStrategy            ResourceAffinity = "Elastigroup_Strategy"
	ElastigroupStateful            ResourceAffinity = "Elastigroup_Stateful"
	ElastigroupLaunchConfiguration ResourceAffinity = "Elastigroup_Launch_Configuration"
	ElastigroupNetworkInterface    ResourceAffinity = "Elastigroup_Network_Interface"
	ElastigroupScheduledTask       ResourceAffinity = "Elastigroup_Scheduled_Task"
	ElastigroupBlockDevices        ResourceAffinity = "Elastigroup_Block_Device"
	ElastigroupScalingPolicies     ResourceAffinity = "Elastigroup_Scaling_Policies"
	ElastigroupIntegrations        ResourceAffinity = "Elastigroup_Integrations"

	ResourceFieldOnRead   LogFormat = "onRead() -> %s -> %s"
	ResourceFieldOnCreate LogFormat = "onCreate() -> %s -> %s"
	ResourceFieldOnUpdate LogFormat = "onUpdate() -> %s -> %s"

	ResourceOnDelete LogFormat = "onDelete() -> %s -> started for %s..."
	ResourceOnUpdate LogFormat = "onUpdate() -> %s -> started for %s..."
	ResourceOnRead   LogFormat = "onRead() -> %s -> started for %s..."
	ResourceOnCreate LogFormat = "onCreate() -> %s -> started..."
)

Variables

View Source
var StatusEbsBlockDeviceUpdated = false
View Source
var StatusElbUpdated = false

Load Balancers

View Source
var StatusEphemeralBlockDeviceUpdated = false

Block Devices

View Source
var StatusMlbUpdated = false
View Source
var StatusTgUpdated = false

Functions

func NullifyStates

func NullifyStates()

func ToJson

func ToJson(object interface{}) (string, error)

Types

type ElastigroupResource

type ElastigroupResource struct {
	GenericResource // embedding
	// contains filtered or unexported fields
}
var SpotinstElastigroup *ElastigroupResource

func NewElastigroupResource

func NewElastigroupResource(fieldsMap map[FieldName]*GenericField) *ElastigroupResource

func (*ElastigroupResource) GetElastigroup

func (res *ElastigroupResource) GetElastigroup() *aws.Group

func (*ElastigroupResource) OnCreate

func (res *ElastigroupResource) OnCreate(
	resourceData *schema.ResourceData,
	meta interface{}) error

func (*ElastigroupResource) OnUpdate

func (res *ElastigroupResource) OnUpdate(
	resourceData *schema.ResourceData,
	meta interface{}) (bool, error)

type FieldName

type FieldName string

type GenericField

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

func NewGenericField

func NewGenericField(
	resourceAffinity ResourceAffinity,
	fieldName FieldName,
	schema *schema.Schema,
	onRead onFieldRead,
	onCreate onFieldCreate,
	onUpdate onFieldUpdate,
	hasChangeCustom hasFieldChange) *GenericField

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Constructors

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

func (*GenericField) GetSchema

func (field *GenericField) GetSchema() *schema.Schema

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Methods: GenericField

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

type GenericFields

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

func NewGenericFields

func NewGenericFields(fieldsMap map[FieldName]*GenericField) *GenericFields

type GenericResource

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

func (*GenericResource) GetField

func (res *GenericResource) GetField(fieldName FieldName) *GenericField

func (*GenericResource) GetName

func (res *GenericResource) GetName() string

func (*GenericResource) GetSchemaMap

func (res *GenericResource) GetSchemaMap() map[string]*schema.Schema

func (*GenericResource) GetTerraformData

func (res *GenericResource) GetTerraformData() *TerraformData

func (*GenericResource) OnRead

func (res *GenericResource) OnRead(
	resourceObject interface{}) error

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Methods: GenericResource

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

func (*GenericResource) SetTerraformData

func (res *GenericResource) SetTerraformData(data *TerraformData)

type LogFormat

type LogFormat string

type ResourceAffinity

type ResourceAffinity string

type ResourceName

type ResourceName string
const (
	ElastigroupAwsResourceName ResourceName = "spotinst_elastigroup_aws"
)

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Variables

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

const (
	SubscriptionResourceName ResourceName = "spotinst_subscription"
)

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Variables

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

type SubscriptionResource

type SubscriptionResource struct {
	GenericResource // embedding
	// contains filtered or unexported fields
}
var SpotinstSubscription *SubscriptionResource

func NewSubscriptionResource

func NewSubscriptionResource(
	fieldsMap map[FieldName]*GenericField) *SubscriptionResource

func (*SubscriptionResource) GetSubscription

func (res *SubscriptionResource) GetSubscription() *subscription.Subscription

func (*SubscriptionResource) OnCreate

func (res *SubscriptionResource) OnCreate(
	resourceData *schema.ResourceData,
	meta interface{}) error

func (*SubscriptionResource) OnUpdate

func (res *SubscriptionResource) OnUpdate(
	resourceData *schema.ResourceData,
	meta interface{}) (bool, error)

type TerraformData

type TerraformData struct {
	ResourceData *schema.ResourceData
	Meta         interface{}
}

Jump to

Keyboard shortcuts

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