instances

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

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

func WaitForJobSuccess

func WaitForJobSuccess(client *golangsdk.ServiceClient, secs int, jobID string) error

Types

type BackupStrategy

type BackupStrategy struct {
	StartTime string `json:"start_time"`
	KeepDays  string `json:"keep_days"`
}

type BackupStrategyOpt

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

type ChargeInfoOpt

type ChargeInfoOpt structs.ChargeInfo

type CreateReplicaBuilder

type CreateReplicaBuilder interface {
	ToReplicaCreateMap() (map[string]interface{}, error)
}

type CreateReplicaOpts

type CreateReplicaOpts struct {
	Priorities []int `json:"priorities" required:"true"`
}

func (CreateReplicaOpts) ToReplicaCreateMap

func (opts CreateReplicaOpts) ToReplicaCreateMap() (map[string]interface{}, error)

type CreateResponse

type CreateResponse struct {
	Instance TaurusDBResponse `json:"instance"`
	JobId    string           `json:"job_id"`
	OrderId  string           `json:"order_id"`
}

type CreateResult

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

func Create

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

func (CreateResult) Extract

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

type CreateTaurusDBBuilder

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

type CreateTaurusDBOpts

type CreateTaurusDBOpts struct {
	Name                string             `json:"name" required:"true"`
	Region              string             `json:"region" required:"true"`
	Mode                string             `json:"mode" required:"true"`
	Flavor              string             `json:"flavor_ref" required:"true"`
	VpcId               string             `json:"vpc_id" required:"true"`
	SubnetId            string             `json:"subnet_id" required:"true"`
	SecurityGroupId     string             `json:"security_group_id,omitempty"`
	Password            string             `json:"password" required:"true"`
	TimeZone            string             `json:"time_zone" required:"true"`
	AZMode              string             `json:"availability_zone_mode" required:"true"`
	SlaveCount          int                `json:"slave_count" required:"true"`
	MasterAZ            string             `json:"master_availability_zone,omitempty"`
	ConfigurationId     string             `json:"configuration_id,omitempty"`
	EnterpriseProjectId string             `json:"enterprise_project_id,omitempty"`
	DataStore           DataStoreOpt       `json:"datastore" required:"true"`
	BackupStrategy      *BackupStrategyOpt `json:"backup_strategy,omitempty"`
	ChargeInfo          *ChargeInfoOpt     `json:"charge_info,omitempty"`
}

func (CreateTaurusDBOpts) ToInstancesCreateMap

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

type DataStore

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

type DataStoreOpt

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

type DeleteResponse

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

type DeleteResult

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

func Delete

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

func (DeleteResult) Extract

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

type GetResult

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

func Get

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

func (GetResult) Extract

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

type Job

type Job struct {
	Status     string `json:"status"`
	JobID      string `json:"id"`
	FailReason string `json:"fail_reason"`
}

type JobResponse

type JobResponse struct {
	JobID string `json:"job_id"`
}

type JobResult

type JobResult struct {
	golangsdk.Result
}

func CreateReplica

func CreateReplica(client *golangsdk.ServiceClient, instanceId string, opts CreateReplicaBuilder) (r JobResult)

func DeleteReplica

func DeleteReplica(client *golangsdk.ServiceClient, instanceId, nodeId string) (r JobResult)

func Resize

func Resize(client *golangsdk.ServiceClient, instanceId string, opts ResizeBuilder) (r JobResult)

func UpdateName

func UpdateName(client *golangsdk.ServiceClient, instanceId string, opts UpdateNameBuilder) (r JobResult)

func UpdatePass

func UpdatePass(client *golangsdk.ServiceClient, instanceId string, opts UpdatePassBuilder) (r JobResult)

func (JobResult) ExtractJobResponse

func (r JobResult) ExtractJobResponse() (*JobResponse, error)

func (JobResult) ExtractJobStatus

func (r JobResult) ExtractJobStatus() (*JobStatus, error)

type JobStatus

type JobStatus struct {
	Job Job `json:"job"`
}

type ListTaurusDBBuilder

type ListTaurusDBBuilder interface {
	ToTaurusDBListDetailQuery() (string, error)
}

type ListTaurusDBInstanceOpts

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

func (ListTaurusDBInstanceOpts) ToTaurusDBListDetailQuery

func (opts ListTaurusDBInstanceOpts) ToTaurusDBListDetailQuery() (string, error)

type ListTaurusDBResponse

type ListTaurusDBResponse struct {
	Instances  []TaurusDBInstance `json:"instances"`
	TotalCount int                `json:"total_count"`
}

func ExtractTaurusDBInstances

func ExtractTaurusDBInstances(r pagination.Page) (ListTaurusDBResponse, error)

ExtractTaurusDBInstances is a function that takes a ListResult and returns the services' information.

type ListTaurusDBResult

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

type Nodes

type Nodes struct {
	Id               string   `json:"id"`
	Name             string   `json:"name"`
	Type             string   `json:"type"`
	Status           string   `json:"status"`
	PrivateIps       []string `json:"private_read_ips"`
	Port             int      `json:"port"`
	Flavor           string   `json:"flavor_ref"`
	Region           string   `json:"region_code"`
	AvailabilityZone string   `json:"az_code"`
}

type ResizeBuilder

type ResizeBuilder interface {
	ToResizeMap() (map[string]interface{}, error)
}

type ResizeOpts

type ResizeOpts struct {
	Spec string `json:"spec_code" required:"true"`
}

func (ResizeOpts) ToResizeMap

func (opts ResizeOpts) ToResizeMap() (map[string]interface{}, error)

type TaurusDBInstance

type TaurusDBInstance struct {
	Id              string   `json:"id"`
	Name            string   `json:"name"`
	Status          string   `json:"status"`
	Type            string   `json:"type"`
	Port            string   `json:"port"`
	NodeCount       int      `json:"node_count"`
	VpcId           string   `json:"vpc_id"`
	SubnetId        string   `json:"subnet_id"`
	SecurityGroupId string   `json:"security_group_id"`
	ConfigurationId string   `json:"configuration_id"`
	AZMode          string   `json:"az_mode"`
	MasterAZ        string   `json:"master_az_code"`
	TimeZone        string   `json:"time_zone"`
	ProjectId       string   `json:"project_id"`
	DbUserName      string   `json:"db_user_name"`
	PublicIps       string   `json:"public_ips"`
	PrivateIps      []string `json:"private_write_ips"`
	Created         string   `json:"-"`
	Updated         string   `json:"-"`

	Volume         Volume         `json:"volume"`
	Nodes          []Nodes        `json:"nodes"`
	DataStore      DataStore      `json:"datastore"`
	BackupStrategy BackupStrategy `json:"backup_strategy"`

	EnterpriseProjectId string `json:"enterprise_project_id"`
}

type TaurusDBPage

type TaurusDBPage struct {
	pagination.SinglePageBase
}

func (TaurusDBPage) IsEmpty

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

type TaurusDBResponse

type TaurusDBResponse struct {
	Id              string `json:"id"`
	Name            string `json:"name"`
	Status          string `json:"status"`
	Region          string `json:"region"`
	Mode            string `json:"mode"`
	Port            string `json:"port"`
	VpcId           string `json:"vpc_id"`
	SubnetId        string `json:"subnet_id"`
	SecurityGroupId string `json:"security_group_id"`
	ConfigurationId string `json:"configuration_id"`
	AZMode          string `json:"availability_zone_mode"`
	MasterAZ        string `json:"master_availability_zone"`
	SlaveCount      int    `json:"slave_count"`

	DataStore      DataStore          `json:"datastore"`
	BackupStrategy BackupStrategy     `json:"backup_strategy"`
	ChargeInfo     structs.ChargeInfo `json:"charge_info"`

	EnterpriseProjectId string `json:"enterprise_project_id"`
}

type UpdateNameBuilder

type UpdateNameBuilder interface {
	ToNameUpdateMap() (map[string]interface{}, error)
}

type UpdateNameOpts

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

func (UpdateNameOpts) ToNameUpdateMap

func (opts UpdateNameOpts) ToNameUpdateMap() (map[string]interface{}, error)

type UpdatePassBuilder

type UpdatePassBuilder interface {
	ToPassUpdateMap() (map[string]interface{}, error)
}

type UpdatePassOpts

type UpdatePassOpts struct {
	Password string `json:"password" required:"true"`
}

func (UpdatePassOpts) ToPassUpdateMap

func (opts UpdatePassOpts) ToPassUpdateMap() (map[string]interface{}, error)

type Volume

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

Jump to

Keyboard shortcuts

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