configurations

package
v0.5.17 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager

List is method that can be able to list all configurations of autoscaling service

Types

type Bandwidth

type Bandwidth struct {
	Size         int    `json:"size"`
	ShareType    string `json:"share_type"`
	ChargingMode string `json:"charging_mode"`
}

type BandwidthOpts

type BandwidthOpts struct {
	Size         int    `json:"size" required:"true"`
	ShareType    string `json:"share_type" required:"true"`
	ChargingMode string `json:"charging_mode" required:"true"`
}

type Configuration

type Configuration struct {
	ID             string         `json:"scaling_configuration_id"`
	Tenant         string         `json:"tenant"`
	Name           string         `json:"scaling_configuration_name"`
	InstanceConfig InstanceConfig `json:"instance_config"`
	CreateTime     string         `json:"create_time"`
}

func ExtractConfigurations added in v0.2.7

func ExtractConfigurations(r pagination.Page) ([]Configuration, error)

ExtractConfigurations returns a slice of AS Configurations contained in a single page of results.

type ConfigurationPage

type ConfigurationPage struct {
	pagination.SinglePageBase
}

func (ConfigurationPage) Extract

func (r ConfigurationPage) Extract() ([]Configuration, error)

func (ConfigurationPage) IsEmpty

func (r ConfigurationPage) IsEmpty() (bool, error)

IsEmpty returns true if a ListResult contains no Volumes.

type CreateOpts

type CreateOpts struct {
	Name           string             `json:"scaling_configuration_name" required:"true"`
	InstanceConfig InstanceConfigOpts `json:"instance_config" required:"true"`
}

func (CreateOpts) ToConfigurationCreateMap

func (opts CreateOpts) ToConfigurationCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToConfigurationCreateMap() (map[string]interface{}, error)
}

type CreateResult

type CreateResult struct {
	golangsdk.Result
}

CreateResult is a struct that contains all the return parameters of creation

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create is a method by which can be able to access to create a configuration of autoscaling

func (CreateResult) Extract

func (r CreateResult) Extract() (string, error)

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult)

Delete

type Disk

type Disk struct {
	Size               int                    `json:"size"`
	VolumeType         string                 `json:"volume_type"`
	DiskType           string                 `json:"disk_type"`
	DedicatedStorageID string                 `json:"dedicated_storage_id"`
	DataDiskImageID    string                 `json:"data_disk_image_id"`
	SnapshotID         string                 `json:"snapshot_id"`
	Metadata           map[string]interface{} `json:"metadata"`
}

type DiskOpts

type DiskOpts struct {
	Size               int               `json:"size" required:"true"`
	VolumeType         string            `json:"volume_type" required:"true"`
	DiskType           string            `json:"disk_type" required:"true"`
	DedicatedStorageID string            `json:"dedicated_storage_id,omitempty"`
	DataDiskImageID    string            `json:"data_disk_image_id,omitempty"`
	SnapshotID         string            `json:"snapshot_id,omitempty"`
	Metadata           map[string]string `json:"metadata,omitempty"`
}

DiskOpts is an inner struct of InstanceConfigOpts

type Eip

type Eip struct {
	Type      string    `json:"ip_type"`
	Bandwidth Bandwidth `json:"bandwidth"`
}

type EipOpts

type EipOpts struct {
	IpType    string        `json:"ip_type" required:"true"`
	Bandwidth BandwidthOpts `json:"bandwidth" required:"true"`
}

type GetResult

type GetResult struct {
	golangsdk.Result
}

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

Get is a method by which can be able to access to get a configuration of autoscaling detailed information

func (GetResult) Extract

func (r GetResult) Extract() (Configuration, error)

type InstanceConfig

type InstanceConfig struct {
	FlavorRef                 string                 `json:"flavorRef"`
	ImageRef                  string                 `json:"imageRef"`
	Disk                      []Disk                 `json:"disk"`
	SSHKey                    string                 `json:"key_name"`
	KeyFingerprint            string                 `json:"key_fingerprint"`
	InstanceName              string                 `json:"instance_name"`
	InstanceID                string                 `json:"instance_id"`
	AdminPass                 string                 `json:"adminPass"`
	Personality               []Personality          `json:"personality"`
	PublicIp                  PublicIp               `json:"public_ip"`
	UserData                  string                 `json:"user_data"`
	Metadata                  map[string]interface{} `json:"metadata"`
	SecurityGroups            []SecurityGroup        `json:"security_groups"`
	ServerGroupID             string                 `json:"server_group_id"`
	Tenancy                   string                 `json:"tenancy"`
	DedicatedHostID           string                 `json:"dedicated_host_id"`
	MarketType                string                 `json:"market_type"`
	MultiFlavorPriorityPolicy string                 `json:"multi_flavor_priority_policy"`
}

type InstanceConfigOpts

type InstanceConfigOpts struct {
	ID          string            `json:"instance_id,omitempty"`
	FlavorRef   string            `json:"flavorRef,omitempty"`
	ImageRef    string            `json:"imageRef,omitempty"`
	Disk        []DiskOpts        `json:"disk,omitempty"`
	SSHKey      string            `json:"key_name" required:"true"`
	Personality []PersonalityOpts `json:"personality,omitempty"`
	PubicIp     *PublicIpOpts     `json:"public_ip,omitempty"`
	// UserData contains configuration information or scripts to use upon launch.
	// Create will base64-encode it for you, if it isn't already.
	UserData       []byte                 `json:"-"`
	Metadata       map[string]interface{} `json:"metadata,omitempty"`
	SecurityGroups []SecurityGroupOpts    `json:"security_groups,omitempty"`
	MarketType     string                 `json:"market_type,omitempty"`
}

InstanceConfigOpts is an inner struct of CreateOpts

type ListOpts

type ListOpts struct {
	Name        string `q:"scaling_configuration_name"`
	ImageID     string `q:"image_id"`
	StartNumber int    `q:"start_number"`
	Limit       int    `q:"limit"`
}

func (ListOpts) ToConfigurationListQuery

func (opts ListOpts) ToConfigurationListQuery() (string, error)

type ListOptsBuilder

type ListOptsBuilder interface {
	ToConfigurationListQuery() (string, error)
}

type Personality

type Personality struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}

type PersonalityOpts

type PersonalityOpts struct {
	Path    string `json:"path" required:"true"`
	Content string `json:"content" required:"true"`
}

type PublicIp

type PublicIp struct {
	Eip Eip `json:"eip"`
}

type PublicIpOpts

type PublicIpOpts struct {
	Eip EipOpts `json:"eip" required:"true"`
}

type SecurityGroup added in v0.2.7

type SecurityGroup struct {
	ID string `json:"id"`
}

type SecurityGroupOpts added in v0.2.7

type SecurityGroupOpts struct {
	ID string `json:"id" required:"true"`
}

Jump to

Keyboard shortcuts

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