configurations

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 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
	ShareType    string
	ChargingMode string
}

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"`
}

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"`
}

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"`
	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
	Bandwidth BandwidthOpts `json:"-"`
}

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"`
	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"`
}

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,omitempty"`
	Personality []PersonalityOpts `json:"personality,omitempty"`
	PubicIp     PublicIpOpts      `json:"-"`
	// 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"` // TODO not sure the type
}

InstanceConfigOpts is an inner struct of CreateOpts

type ListOpts

type ListOpts struct {
	Name    string `q:"scaling_configuration_name"`
	ImageID string `q:"image_id"`
}

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:"-"`
}

Jump to

Keyboard shortcuts

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