instances

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type BackupStrategy

type BackupStrategy struct {
	StartTime string `json:"start_time" required:"true"`
	KeepDays  *int   `json:"keep_days,omitempty"`
	Period    string `json:"period,omitempty"`
}

type BackupStrategyOpt

type BackupStrategyOpt struct {
	StartTime string `json:"start_time" required:"true"`
	KeepDays  string `json:"keep_days,omitempty"`
}

type CreateInstanceBuilder

type CreateInstanceBuilder interface {
	ToInstancesCreateMap() (map[string]interface{}, error)
}

type CreateOpts

type CreateOpts struct {
	Name                string         `json:"name"  required:"true"`
	DataStore           DataStore      `json:"datastore" required:"true"`
	Region              string         `json:"region" required:"true"`
	AvailabilityZone    string         `json:"availability_zone" required:"true"`
	VpcId               string         `json:"vpc_id" required:"true"`
	SubnetId            string         `json:"subnet_id" required:"true"`
	SecurityGroupId     string         `json:"security_group_id" required:"true"`
	Password            string         `json:"password" required:"true"`
	DiskEncryptionId    string         `json:"disk_encryption_id,omitempty"`
	Ssl                 string         `json:"ssl_option,omitempty"`
	Mode                string         `json:"mode" required:"true"`
	Flavor              []Flavor       `json:"flavor" required:"true"`
	BackupStrategy      BackupStrategy `json:"backup_strategy,omitempty"`
	EnterpriseProjectID string         `json:"enterprise_project_id,omitempty"`
}

func (CreateOpts) ToInstancesCreateMap

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

type CreateResult

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

func Create

func (CreateResult) Extract

func (r CreateResult) Extract() (*Instance, error)

type DataStore

type DataStore struct {
	Type          string `json:"type" required:"true"`
	Version       string `json:"version" required:"true"`
	StorageEngine string `json:"storage_engine" required:"true"`
}

type DeleteInstance

type DeleteInstance struct {
	InstanceId string `json:"instance_id" required:"true"`
}

func (DeleteInstance) ToInstancesDeleteMap

func (opts DeleteInstance) ToInstancesDeleteMap() (map[string]interface{}, error)

type DeleteInstanceBuilder

type DeleteInstanceBuilder interface {
	ToInstancesDeleteMap() (map[string]interface{}, error)
}

type DeleteInstanceResponse

type DeleteInstanceResponse struct {
	JobId string `json:"job_id"`
}

type DeleteInstanceResult

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

func Delete

func Delete(client *golangsdk.ServiceClient, instanceId string) (r DeleteInstanceResult)

func (DeleteInstanceResult) Extract

type Flavor

type Flavor struct {
	Type     string `json:"type" required:"true"`
	Num      int    `json:"num" required:"true"`
	Storage  string `json:"storage,omitempty"`
	Size     int    `json:"size,omitempty"`
	SpecCode string `json:"spec_code" required:"true"`
}

type FlavorOpt

type FlavorOpt struct {
	Type     string `json:"type" required:"true"`
	Num      string `json:"num" required:"true"`
	Storage  string `json:"storage,omitempty"`
	Size     string `json:"size,omitempty"`
	SpecCode string `json:"spec_code" required:"true"`
}

type Group

type Group struct {
	Type   string  `json:"type"`
	Id     string  `json:"id"`
	Name   string  `json:"name"`
	Status string  `json:"status"`
	Volume Volume  `json:"volume"`
	Nodes  []Nodes `json:"nodes"`
}

type Instance

type Instance struct {
	Id                  string            `json:"id"`
	Name                string            `json:"name"`
	DataStore           DataStore         `json:"datastore"`
	Status              string            `json:"status"`
	Region              string            `json:"region"`
	AvailabilityZone    string            `json:"availability_zone"`
	VpcId               string            `json:"vpc_id"`
	SubnetId            string            `json:"subnet_id"`
	SecurityGroupId     string            `json:"security_group_id"`
	DiskEncryptionId    string            `json:"disk_encryption_id"`
	Ssl                 string            `json:"ssl_option"`
	Mode                string            `json:"mode"`
	Flavor              []FlavorOpt       `json:"flavor"`
	BackupStrategy      BackupStrategyOpt `json:"backup_strategy"`
	EnterpriseProjectID string            `json:"enterprise_project_id"`
}

type InstancePage

type InstancePage struct {
	pagination.SinglePageBase
}

func (InstancePage) IsEmpty

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

type InstanceResponse

type InstanceResponse struct {
	Id                  string         `json:"id"`
	Name                string         `json:"name"`
	Status              string         `json:"status"`
	Port                string         `json:"port"`
	Mode                string         `json:"mode"`
	Region              string         `json:"region"`
	DataStore           DataStore      `json:"datastore"`
	Engine              string         `json:"engine"`
	Created             string         `json:"created"`
	Updated             string         `json:"updated"`
	DbUserName          string         `json:"db_user_name"`
	Ssl                 int            `json:"ssl"`
	VpcId               string         `json:"vpc_id"`
	SubnetId            string         `json:"subnet_id"`
	SecurityGroupId     string         `json:"security_group_id"`
	BackupStrategy      BackupStrategy `json:"backup_strategy"`
	MaintenanceWindow   string         `json:"maintenance_window"`
	Groups              []Group        `json:"groups"`
	DiskEncryptionId    string         `json:"disk_encryption_id"`
	TimeZone            string         `json:"time_zone"`
	Actions             []string       `json:"actions"`
	EnterpriseProjectID string         `json:"enterprise_project_id"`
}

type ListInstanceBuilder

type ListInstanceBuilder interface {
	ToInstanceListDetailQuery() (string, error)
}

type ListInstanceOpts

type ListInstanceOpts struct {
	Id            string `q:"id"`
	Name          string `q:"name"`
	Mode          string `q:"mode"`
	DataStoreType string `q:"datastore_type"`
	VpcId         string `q:"vpc_id"`
	SubnetId      string `q:"subnet_id"`
	Offset        int    `q:"offset"`
	Limit         int    `q:"limit"`
}

func (ListInstanceOpts) ToInstanceListDetailQuery

func (opts ListInstanceOpts) ToInstanceListDetailQuery() (string, error)

type ListInstanceResponse

type ListInstanceResponse struct {
	Instances  []InstanceResponse `json:"instances"`
	TotalCount int                `json:"total_count"`
}

func ExtractInstances

func ExtractInstances(r pagination.Page) (ListInstanceResponse, error)

type ListInstanceResult

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

type Nodes

type Nodes struct {
	Id               string `json:"id"`
	Name             string `json:"name"`
	Status           string `json:"status"`
	Role             string `json:"role"`
	PrivateIP        string `json:"private_ip"`
	PublicIP         string `json:"public_ip"`
	SpecCode         string `json:"spec_code"`
	AvailabilityZone string `json:"availability_zone"`
}

type UpdateInstanceResult

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

func Update

func Update(client *golangsdk.ServiceClient, instanceId string, opts []UpdateOpt) (r UpdateInstanceResult)

type UpdateNodeNumOpts

type UpdateNodeNumOpts struct {
	Type     string            `json:"type" required:"true"`
	SpecCode string            `json:"spec_code" required:"true"`
	Num      int               `json:"num" required:"true"`
	Volume   *UpdateVolumeOpts `json:"volume,omitempty"`
}

type UpdateOpt

type UpdateOpt struct {
	Param  string
	Value  interface{}
	Action string
	Method string
}

UpdateOpt defines the basic information for update APIs URI: <Method> base_url/<Action> Request body: {<Param>: <Value>} the supported value for Method including: "post" and "put"

type UpdateSpecOpts

type UpdateSpecOpts struct {
	TargetType     string `json:"target_type,omitempty"`
	TargetID       string `json:"target_id" required:"true"`
	TargetSpecCode string `json:"target_spec_code" required:"true"`
}

type UpdateVolumeOpts

type UpdateVolumeOpts struct {
	GroupID string `json:"group_id,omitempty"`
	Size    *int   `json:"size,omitempty"`
}

type Volume

type Volume struct {
	Size string `json:"size"`
	Used string `json:"used"`
}

Jump to

Keyboard shortcuts

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