instances

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"},
}

Functions

This section is empty.

Types

type BackupStrategyInfor

type BackupStrategyInfor struct {
	StartTime string `json:"startTime"`
	KeepDays  int    `json:"keepDays"`
}

type BackupStrategyOps

type BackupStrategyOps struct {
	StartTime string `json:"startTime" required:"true"`
	KeepDays  int    `json:"keepDays,omitempty"`
}

type CreateOps

type CreateOps struct {
	Name string `json:"name" required:"true"`

	DataStore DataStoreOps `json:"datastore,omitempty"`

	FlavorRef string `json:"flavorRef" required:"true"`

	Volume VolumeOps `json:"volume,omitempty"`

	Region string `json:"region,omitempty"`

	AvailabilityZone string `json:"availabilityZone,omitempty"`

	Vpc string `json:"vpc,omitempty"`

	Nics NicsOps `json:"nics,omitempty"`

	SecurityGroup SecurityGroupOps `json:"securityGroup,omitempty"`

	DbPort string `json:"dbPort,omitempty"`

	BackupStrategy BackupStrategyOps `json:"backupStrategy,omitempty"`

	DbRtPd string `json:"dbRtPd,omitempty"`

	Ha HaOps `json:"ha,omitempty"`

	ReplicaOf string `json:"replicaOf,omitempty"`
}

CreateOps is a struct that contains all the parameters.

func (CreateOps) ToInstanceCreateMap

func (ops CreateOps) ToInstanceCreateMap() (map[string]interface{}, error)

type CreateOpsBuilder

type CreateOpsBuilder interface {
	ToInstanceCreateMap() (map[string]interface{}, error)
}

CreateOpsBuilder is used for creating instance parameters. any struct providing the parameters should implement this interface

type CreateResult

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

CreateResult contains the response body and error from a Create request.

func Create

func Create(client *golangsdk.ServiceClient, ops CreateOpsBuilder) (r CreateResult)

Create a instance with given parameters.

func (CreateResult) Extract

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

Extract will get the Instance object out of the commonResult object.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

type DataStoreInfo

type DataStoreInfo struct {
	Type    string `json:"type"`
	Version string `json:"version"`
}

type DataStoreOps

type DataStoreOps struct {
	Type    string `json:"type" required:"true"`
	Version string `json:"version" required:"true"`
}

type DeleteResult

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

func Delete

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

delete a instance via id

func (DeleteResult) Extract

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

Extract will get the Instance object out of the commonResult object.

func (DeleteResult) ExtractInto

func (r DeleteResult) ExtractInto(v interface{}) error

type ExtendParamInfo

type ExtendParamInfo struct {
	Jobs []Job `json:"jobs"`
}

type FlavorInfo

type FlavorInfo struct {
	Id string `json:"id"`
}

type GetResult

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

func Get

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

get a instance with detailed information by id

func (GetResult) Extract

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

Extract will get the Instance object out of the commonResult object.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type HaInfor

type HaInfor struct {
	Enable          bool   `json:"enable"`
	ReplicationMode string `json:"replicationMode"`
}

type HaOps

type HaOps struct {
	Enable          bool   `json:"enable" required:"true"`
	ReplicationMode string `json:"replicationMode" required:"true"`
}

type Instance

type Instance struct {
	ID               string              `json:"id"`
	Status           string              `json:"status"`
	Name             string              `json:"name"`
	Created          string              `json:"created"`
	HostName         string              `json:"hostname"`
	Type             string              `json:"type"`
	Region           string              `json:"region"`
	Updated          string              `json:"updated"`
	AvailabilityZone string              `json:"availabilityZone"`
	Vpc              string              `json:"vpc"`
	Nics             NicsInfor           `json:"nics"`
	SecurityGroup    SecurityGroupInfor  `json:"securityGroup"`
	Flavor           FlavorInfo          `json:"flavor"`
	Volume           VolumeInfor         `json:"volume"`
	DbPort           int                 `json:"dbPort"`
	DataStore        DataStoreInfo       `json:"dataStoreInfo"`
	ExtendParameters ExtendParamInfo     `json:"extendparam"`
	BackupStrategy   BackupStrategyInfor `json:"backupStrategy"`
	Ha               HaInfor             `json:"ha"`
	SlaveId          string              `json:"slaveId"`
}

type Job

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

type ListResult

type ListResult struct {
	golangsdk.Result
}

func List

func List(client *golangsdk.ServiceClient) (r ListResult)

list all the instances

func (ListResult) Extract

func (lr ListResult) Extract() ([]Instance, error)

type NicsInfor

type NicsInfor struct {
	SubnetId string `json:"subnetId"`
}

type NicsOps

type NicsOps struct {
	SubnetId string `json:"subnetId" required:"true"`
}

type SecurityGroupInfor

type SecurityGroupInfor struct {
	Id string `json:"id"`
}

type SecurityGroupOps

type SecurityGroupOps struct {
	Id string `json:"id" required:"true"`
}

type UpdateFlavorOps

type UpdateFlavorOps struct {
	FlavorRef string `json:"flavorRef"`
}

func (UpdateFlavorOps) ToInstanceFlavorUpdateMap

func (ops UpdateFlavorOps) ToInstanceFlavorUpdateMap() (map[string]interface{}, error)

type UpdateFlavorOpsBuilder

type UpdateFlavorOpsBuilder interface {
	ToInstanceFlavorUpdateMap() (map[string]interface{}, error)
}

type UpdateOps

type UpdateOps struct {
	Volume map[string]interface{} `json:"volume"`
}

func (UpdateOps) ToInstanceUpdateMap

func (ops UpdateOps) ToInstanceUpdateMap() (map[string]interface{}, error)

type UpdateOpsBuilder

type UpdateOpsBuilder interface {
	ToInstanceUpdateMap() (map[string]interface{}, error)
}

type UpdatePolicyOps

type UpdatePolicyOps struct {
	StartTime string `json:"starttime"`
	KeepDays  int    `json:"keepday"`
}

func (UpdatePolicyOps) ToInstanceUpdatePolicyMap

func (ops UpdatePolicyOps) ToInstanceUpdatePolicyMap() (map[string]interface{}, error)

type UpdatePolicyOpsBuilder

type UpdatePolicyOpsBuilder interface {
	ToInstanceUpdatePolicyMap() (map[string]interface{}, error)
}

type UpdateResult

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

func UpdateFlavorRef

func UpdateFlavorRef(client *golangsdk.ServiceClient, ops UpdateFlavorOpsBuilder, id string) (r UpdateResult)

func UpdatePolicy

func UpdatePolicy(client *golangsdk.ServiceClient, ops UpdatePolicyOpsBuilder, id string) (r UpdateResult)

func UpdateVolumeSize

func UpdateVolumeSize(client *golangsdk.ServiceClient, ops UpdateOpsBuilder, id string) (r UpdateResult)

func (UpdateResult) Extract

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

Extract will get the Instance object out of the commonResult object.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

type VolumeInfor

type VolumeInfor struct {
	Type string `json:"type"`
	Size int    `json:"size"`
}

type VolumeOps

type VolumeOps struct {
	Type string `json:"type" required:"true"`
	Size int    `json:"size" required:"true"`
}

Jump to

Keyboard shortcuts

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