instances

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

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

func RestorePassword

func RestorePassword(client *golangsdk.ServiceClient, opts RestorePasswordOptsBuilder, id string) (r golangsdk.Result)

Types

type BackupStrategyOpt

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

type ChargeInfo

type ChargeInfo struct {
	ChargeMode  string `json:"charge_mode" required:"true"`
	PeriodType  string `json:"period_type,omitempty"`
	PeriodNum   int    `json:"period_num,omitempty"`
	IsAutoRenew string `json:"is_auto_renew,omitempty"`
	IsAutoPay   string `json:"is_auto_pay,omitempty"`
}

type ChargeInfoResp

type ChargeInfoResp struct {
	ChargeMode string `json:"charge_mode"`
}

type Coordinator

type Coordinator struct {
	AzCode string `json:"az_code" required:"true"`
}

type CreateGaussDBBuilder

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

type CreateGaussDBOpts

type CreateGaussDBOpts struct {
	Ha             *HaOpt             `json:"ha,omitempty"`
	BackupStrategy *BackupStrategyOpt `json:"backup_strategy,omitempty"`
	ChargeInfo     *ChargeInfo        `json:"charge_info,omitempty"`
	RestorePoint   *RestorePointOpt   `json:"restore_point,omitempty"`

	AvailabilityZone    string       `json:"availability_zone" required:"true"`
	DataStore           DataStoreOpt `json:"datastore" required:"true"`
	Flavor              string       `json:"flavor_ref" required:"true"`
	Name                string       `json:"name" required:"true"`
	Password            string       `json:"password" required:"true"`
	Volume              VolumeOpt    `json:"volume" required:"true"`
	Region              string       `json:"region,omitempty"`
	VpcId               string       `json:"vpc_id,omitempty"`
	SubnetId            string       `json:"subnet_id,omitempty"`
	SecurityGroupId     string       `json:"security_group_id,omitempty"`
	Port                string       `json:"port,omitempty"`
	DiskEncryptionId    string       `json:"disk_encryption_id,omitempty"`
	TimeZone            string       `json:"time_zone,omitempty"`
	ConfigurationId     string       `json:"configuration_id,omitempty"`
	DsspoolId           string       `json:"dsspool_id,omitempty"`
	ReplicaOfId         string       `json:"replica_of_id,omitempty"`
	ShardingNum         int          `json:"sharding_num,omitempty"`
	CoordinatorNum      int          `json:"coordinator_num,omitempty"`
	EnterpriseProjectId string       `json:"enterprise_project_id,omitempty"`
	ReplicaNum          int          `json:"replica_num,omitempty"`
}

func (CreateGaussDBOpts) ToInstancesCreateMap

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

type CreateResponse

type CreateResponse struct {
	Instance GaussDBResponse `json:"instance"`
	OrderId  string          `json:"order_id"`
}

type CreateResult

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

func Create

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

func (CreateResult) Extract

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

type DataStoreOpt

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

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 GaussDBInstance

type GaussDBInstance struct {
	Id                string   `json:"id"`
	Name              string   `json:"name"`
	Status            string   `json:"status"`
	Type              string   `json:"type"`
	Port              int      `json:"port"`
	VpcId             string   `json:"vpc_id"`
	SubnetId          string   `json:"subnet_id"`
	SecurityGroupId   string   `json:"security_group_id"`
	TimeZone          string   `json:"time_zone"`
	Region            string   `json:"region"`
	FlavorRef         string   `json:"flavor_ref"`
	DbUserName        string   `json:"db_user_name"`
	DiskEncryptionId  string   `json:"disk_encryption_id"`
	DsspoolId         string   `json:"dsspool_id"`
	SwitchStrategy    string   `json:"switch_strategy"`
	MaintenanceWindow string   `json:"maintenance_window"`
	PublicIps         []string `json:"public_ips"`
	PrivateIps        []string `json:"private_ips"`
	ReplicaNum        int      `json:"replica_num"`

	Volume         VolumeOpt         `json:"volume"`
	Ha             HaOpt             `json:"ha"`
	Nodes          []Nodes           `json:"nodes"`
	DataStore      DataStoreOpt      `json:"datastore"`
	BackupStrategy BackupStrategyOpt `json:"backup_strategy"`
	ChargeInfo     ChargeInfoResp    `json:"charge_info"`

	EnterpriseProjectId string `json:"enterprise_project_id"`
}

func GetInstanceByID

func GetInstanceByID(client *golangsdk.ServiceClient, instanceId string) (GaussDBInstance, error)

func GetInstanceByName

func GetInstanceByName(client *golangsdk.ServiceClient, name string) (GaussDBInstance, error)

type GaussDBPage

type GaussDBPage struct {
	pagination.SinglePageBase
}

func (GaussDBPage) IsEmpty

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

type GaussDBResponse

type GaussDBResponse struct {
	Id     string `json:"id"`
	Status string `json:"status"`
}

type HaOpt

type HaOpt struct {
	Mode            string `json:"mode" required:"true"`
	ReplicationMode string `json:"replication_mode" required:"true"`
	Consistency     string `json:"consistency,omitempty"`
}

type ListGaussDBBuilder

type ListGaussDBBuilder interface {
	ToGaussDBListDetailQuery() (string, error)
}

type ListGaussDBInstanceOpts

type ListGaussDBInstanceOpts 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 (ListGaussDBInstanceOpts) ToGaussDBListDetailQuery

func (opts ListGaussDBInstanceOpts) ToGaussDBListDetailQuery() (string, error)

type ListGaussDBResponse

type ListGaussDBResponse struct {
	Instances  []GaussDBInstance `json:"instances"`
	TotalCount int               `json:"total_count"`
}

func ExtractGaussDBInstances

func ExtractGaussDBInstances(r pagination.Page) (ListGaussDBResponse, error)

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

type ListGaussDBResult

type ListGaussDBResult 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"`
	AvailabilityZone string `json:"availability_zone"`
}

type RenameOpts

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

func (RenameOpts) ToRenameMap

func (opts RenameOpts) ToRenameMap() (map[string]interface{}, error)

type RenameOptsBuilder

type RenameOptsBuilder interface {
	ToRenameMap() (map[string]interface{}, error)
}

type RenameResponse

type RenameResponse struct {
	Instance GaussDBResponse `json:"instance"`
	JobId    string          `json:"job_id"`
}

type RenameResult

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

func Rename

func Rename(client *golangsdk.ServiceClient, opts RenameOptsBuilder, id string) (r RenameResult)

func (RenameResult) Extract

func (r RenameResult) Extract() (*RenameResponse, error)

type RestorePasswordOpts

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

func (RestorePasswordOpts) ToRestorePasswordMap

func (opts RestorePasswordOpts) ToRestorePasswordMap() (map[string]interface{}, error)

type RestorePasswordOptsBuilder

type RestorePasswordOptsBuilder interface {
	ToRestorePasswordMap() (map[string]interface{}, error)
}

type RestorePointOpt

type RestorePointOpt struct {
	InstanceId   string            `json:"instance_id" required:"true"`
	Type         string            `json:"type" required:"true"`
	BackupId     string            `json:"backup_id,omitempty"`
	RestoreTime  int               `json:"restore_time,omitempty"`
	DatabaseName map[string]string `json:"database_name,omitempty"`
}

type Shard

type Shard struct {
	Count int `json:"count" required:"true"`
}

type UpdateClusterOpts

type UpdateClusterOpts struct {
	Shard        *Shard        `json:"shard,omitempty"`
	Coordinators []Coordinator `json:"coordinators,omitempty"`
}

func (UpdateClusterOpts) ToClusterUpdateMap

func (opts UpdateClusterOpts) ToClusterUpdateMap() (map[string]interface{}, error)

type UpdateClusterOptsBuilder

type UpdateClusterOptsBuilder interface {
	ToClusterUpdateMap() (map[string]interface{}, error)
}

type UpdateOpts

type UpdateOpts struct {
	// Configuration required to expand sharding number or coordinator number.
	ExpandCluster *UpdateClusterOpts `json:"expand_cluster,omitempty"`
	// Configuration required to expand volume size.
	EnlargeVolume *UpdateVolumeOpts `json:"enlarge_volume,omitempty"`
	// Whether to automatically pay from the account, defaults to false.
	IsAutoPay string `json:"is_auto_pay,omitempty"`
}

UpdateOpts is the structure that used to expand sharding number, coordinator number or volume size.

type UpdateResponse

type UpdateResponse struct {
	JobId   string `json:"job_id"`
	OrderId string `json:"order_id"`
}

func Update

func Update(c *golangsdk.ServiceClient, instanceId string, opts UpdateOpts) (*UpdateResponse, error)

Update is a method to update sharding number, coordinator number and volume configuration. Note: The sharding number and the coordinator number can be updated at the same time, but neither of them can be updated at the same time as volume

type UpdateResult

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

func UpdateCluster

func UpdateCluster(client *golangsdk.ServiceClient, opts UpdateClusterOptsBuilder, id string) (r UpdateResult)

func UpdateVolume

func UpdateVolume(client *golangsdk.ServiceClient, opts UpdateVolumeOptsBuilder, id string) (r UpdateResult)

type UpdateVolumeOpts

type UpdateVolumeOpts struct {
	Size int `json:"size" required:"true"`
}

func (UpdateVolumeOpts) ToVolumeUpdateMap

func (opts UpdateVolumeOpts) ToVolumeUpdateMap() (map[string]interface{}, error)

type UpdateVolumeOptsBuilder

type UpdateVolumeOptsBuilder interface {
	ToVolumeUpdateMap() (map[string]interface{}, error)
}

type VolumeOpt

type VolumeOpt 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