instances

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachEip added in v0.5.26

func AttachEip(client *golangsdk.ServiceClient, opts AttachEipOpts) (err error)

func ChangeFailoverStrategy added in v0.5.26

func ChangeFailoverStrategy(client *golangsdk.ServiceClient, opts ChangeFailoverStrategyOpts) (err error)

func ChangeOpsWindow added in v0.5.26

func ChangeOpsWindow(client *golangsdk.ServiceClient, opts ChangeOpsWindowOpts) (err error)

func Delete

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

func EnlargeVolume

func EnlargeVolume(client *golangsdk.ServiceClient, opts EnlargeVolumeRdsOpts) (*string, error)

func ListCollations added in v0.5.26

func ListCollations(client *golangsdk.ServiceClient) ([]string, error)

func ManageAutoScaling added in v0.9.0

func ManageAutoScaling(client *golangsdk.ServiceClient, id string, opts ScalingOpts) error

func MigrateFollower added in v0.5.26

func MigrateFollower(client *golangsdk.ServiceClient, opts MigrateFollowerOpts) (*string, error)

func Resize

func Resize(client *golangsdk.ServiceClient, opts ResizeOpts) (*string, error)

func Restart

func Restart(client *golangsdk.ServiceClient, opts RestartOpts) (*string, error)

func SingleToHa

func SingleToHa(client *golangsdk.ServiceClient, opts SingleToHaOpts) (*string, error)

func StartupInstance added in v0.5.26

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

func StopInstance added in v0.5.26

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

func UpdateInstanceName added in v0.5.26

func UpdateInstanceName(client *golangsdk.ServiceClient, opts UpdateInstanceNameOpts) (err error)

func WaitForJobCompleted added in v0.1.0

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

func WaitForStateAvailable added in v0.1.0

func WaitForStateAvailable(client *golangsdk.ServiceClient, secs int, instanceID string) error

Types

type AttachEipOpts added in v0.5.26

type AttachEipOpts struct {
	InstanceId string `json:"-"`
	// NOTICE
	// When is_bind is true, public_ip is mandatory.
	// Specifies the EIP to be bound. The value must be in the standard IP address format.
	PublicIp string `json:"public_ip,omitempty"`
	// NOTICE
	// When is_bind is true, public_ip_id is mandatory.
	// Specifies the EIP ID. The value must be in the standard UUID format.
	PublicIpId string `json:"public_ip_id,omitempty"`
	// true: Bind an EIP.
	// false: Unbind an EIP.
	IsBind *bool `json:"is_bind" required:"true"`
}

type BackupStrategy

type BackupStrategy struct {
	// Specifies the backup time window. Automated backups will be triggered during the backup time window.
	// The value cannot be empty. It must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format.
	// The HH value must be 1 greater than the hh value.
	// The values of mm and MM must be the same and must be set to any of the following: 00, 15, 30, or 45.
	// Example value:
	// 08:15-09:15
	// 23:00-00:00
	StartTime string `json:"start_time" required:"true"`
	// Specifies the retention days for specific backup files.
	// The value range is from 0 to 732. If this parameter is not specified or set to 0, the automated backup policy is disabled. To extend the retention period, contact customer service. Automated backups can be retained for up to 2562 days.
	// NOTICE
	// Primary/standby DB instances and Cluster DB instances of Microsoft SQL Server do not support disabling the automated backup policy.
	KeepDays int `json:"keep_days,omitempty"`
}

type ChangeFailoverModeOpts added in v0.5.26

type ChangeFailoverModeOpts struct {
	InstanceId string `json:"-"`
	// Specifies the synchronize model.
	// For MySQL, the value can be any of the following:
	// async: asynchronous
	// semisync: semi-synchronous
	// For PostgreSQL, the value can be any of the following:
	// async: asynchronous
	// sync: synchronous
	Mode string `json:"mode" required:"true"`
}

type ChangeFailoverModeResponse added in v0.5.26

type ChangeFailoverModeResponse struct {
	// Indicates the DB instance ID.
	InstanceId string `json:"instanceId,omitempty"`
	// Indicates the replication mode.
	ReplicationMode string `json:"replicationMode,omitempty"`
	// Indicates the workflow ID.
	WorkflowId string `json:"workflowId,omitempty"`
}

func ChangeFailoverMode added in v0.5.26

type ChangeFailoverStrategyOpts added in v0.5.26

type ChangeFailoverStrategyOpts struct {
	InstanceId string `json:"-"`
	// Specifies the failover priority. Valid value:
	// reliability: Data reliability is preferentially ensured during the failover to minimize the amount of lost data. It is recommended for services that require high data consistency.
	// availability: Data availability is preferentially ensured during the failover to recover services quickly. It is recommended for services that have high requirements on the database online duration.
	RepairStrategy string `json:"repairStrategy"`
}

type ChangeOpsWindowOpts added in v0.5.26

type ChangeOpsWindowOpts struct {
	InstanceId string `json:"-"`
	// Specifies the start time.
	// The value must be a valid value in the "HH:MM" format. The current time is in the UTC format.
	StartTime string `json:"start_time"`
	// Specifies the end time.
	// The value must be a valid value in the "HH:MM" format. The current time is in the UTC format.
	// NOTE
	// The interval between the start time and end time must be four hours.
	EndTime string `json:"end_time"`
}

type ChargeInfo

type ChargeInfo struct {
	// Indicates the billing information, which is pay-per-use.
	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 CreateRds

type CreateRds struct {
	// Indicates the DB instance information.
	Instance Instance `json:"instance"`
	// Indicates the ID of the DB instance creation task.
	JobId string `json:"job_id"`

	OrderId string `json:"order_id"`
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateRdsOpts) (*CreateRds, error)

func CreateReplica

func CreateReplica(client *golangsdk.ServiceClient, opts CreateReplicaOpts) (*CreateRds, error)

CreateReplica (Only Microsoft SQL Server 2017 EE supports read replicas and does not support single DB instances.)

type CreateRdsOpts

type CreateRdsOpts struct {
	// Specifies the DB instance name.
	// DB instances of the same type can have same names under the same tenant.
	// The value must be 4 to 64 characters in length and start with a letter.
	// It is case-sensitive and can contain only letters, digits, hyphens (-), and underscores (_).
	Name string `json:"name"  required:"true"`
	// Specifies the database information.
	Datastore *Datastore `json:"datastore" required:"true"`
	// Specifies the HA configuration parameters, which are used when creating primary/standby DB instances.
	Ha *Ha `json:"ha,omitempty"`
	// Specifies the parameter template ID.
	ConfigurationId string `json:"configuration_id,omitempty"`
	// Specifies the database port information.
	// The MySQL database port ranges from 1024 to 65535 (excluding 12017 and 33071, which are occupied by the RDS system and cannot be used).
	// The PostgreSQL database port ranges from 2100 to 9500.
	// The Microsoft SQL Server database port is 1433 or ranges from 2100 to 9500 (excluding 5355 and 5985).
	// If this parameter is not set, the default value is as follows:
	// For MySQL, the default value is 3306.
	// For PostgreSQL, the default value is 5432.
	// For Microsoft SQL Server, the default value is 1433.
	Port string `json:"port,omitempty"`
	// Specifies the database password.
	// Valid value:
	// The value cannot be empty and should contain 8 to 32 characters, including uppercase and lowercase letters, digits, and the following special characters: ~!@#%^*-_=+?
	// You are advised to enter a strong password to improve security, preventing security risks such as brute force cracking.
	// If provided password will be considered by system as weak, you will receive an error and you should provide stronger password.
	Password string `json:"password" required:"true"`
	// Specifies the advanced backup policy.
	BackupStrategy *BackupStrategy `json:"backup_strategy,omitempty"`
	// Specifies the key ID for disk encryption. The default value is empty.
	DiskEncryptionId string `json:"disk_encryption_id,omitempty"`
	// Specifies the specification code. The value cannot be empty.
	FlavorRef string `json:"flavor_ref" required:"true"`
	// Specifies the volume information.
	Volume *Volume `json:"volume" required:"true"`
	// Specifies the region ID. The value cannot be empty.
	Region string `json:"region" required:"true"`
	// Specifies the AZ ID. If the DB instance is not a single instance, you need to specify an AZ for each node of the instance and separate the AZs with commas (,). For details, see the example.
	// The value cannot be empty. For details about how to obtain this parameter value, see Regions and Endpoints.
	AvailabilityZone string `json:"availability_zone" required:"true"`
	// Specifies the VPC ID. To obtain this parameter value, use either of the following methods:
	// Method 1: Log in to VPC console and view the VPC ID in the VPC details.
	// Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference.
	VpcId string `json:"vpc_id" required:"true"`
	// Specifies the network ID. To obtain this parameter value, use either of the following methods:
	// Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the network ID on the displayed page.
	// Method 2: See the "Querying Subnets" section under "APIs" or the "Querying Networks" section under "OpenStack Neutron APIs" in Virtual Private Cloud API Reference.
	SubnetId string `json:"subnet_id" required:"true"`
	// Specifies the private IP address of a DB instance. You can use the following methods to obtain the private IP address:
	// Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the subnet CIDR block on the displayed page.
	// Method 2: See the "Querying Subnets" section under "APIs" in the Virtual Private Cloud API Reference.
	DataVip string `json:"data_vip,omitempty"`
	// Specifies the security group which the RDS DB instance belongs to. To obtain this parameter value, use either of the following methods:
	// Method 1: Log in to VPC console. Choose Access Control > Security Groups in the navigation pane on the left. On the displayed page, click the target security group. You can view the security group ID on the displayed page.
	// Method 2: See the "Querying Security Groups" section in the Virtual Private Cloud API Reference.
	SecurityGroupId string `json:"security_group_id" required:"true"`
	// Specifies the billing information, which is pay-per-use. By default, pay-per-use is used.
	ChargeInfo *ChargeInfo `json:"charge_info,omitempty"`
	// This parameter applies only to Microsoft SQL Server DB instances.
	Collation         string `json:"collation,omitempty"`
	UnchangeableParam *Param `json:"unchangeable_param,omitempty"`
}

type CreateReplicaOpts

type CreateReplicaOpts struct {
	// Specifies the DB instance name.
	// DB instances of the same type can have same names under the same tenant.
	// The value must be 4 to 64 characters in length and start with a letter. It is case-sensitive and can contain only letters, digits, hyphens (-), and underscores (_).
	Name string `json:"name"  required:"true"`
	// Specifies the DB instance ID, which is used to create a read replica.
	ReplicaOfId string `json:"replica_of_id" required:"true"`
	// Specifies the key ID for disk encryption. The default value is empty.
	EnterpriseProjectId string `json:"enterprise_project_id,omitempty"`
	// Specifies the key ID for disk encryption. The default value is empty.
	DiskEncryptionId string `json:"disk_encryption_id,omitempty"`
	// Specifies the specification code. The value cannot be empty.
	FlavorRef string `json:"flavor_ref" required:"true"`
	// Specifies the volume information.
	Volume *Volume `json:"volume" required:"true"`
	// Specifies the region ID. Currently, read replicas can be created only in the same region as that of the primary DB instance.
	// The value cannot be empty.
	Region string `json:"region"`
	// Specifies the AZ ID.
	AvailabilityZone string `json:"availability_zone" required:"true"`
	// Specifies the billing information, which is pay-per-use. By default, pay-per-use is used.
	ChargeInfo *ChargeInfo `json:"charge_info,omitempty"`
}

type Datastore

type Datastore struct {
	// Specifies the DB engine. Value:
	// MySQL
	// PostgreSQL
	// SQLServer
	Type string `json:"type,omitempty"`
	// Specifies the database version.
	// MySQL databases support 5.6, 5.7, and 8.0. Example value: 5.7
	// PostgreSQL databases support 9.5, 9.6, 10, 11, 12, 13 and 14. Example value: 9.6
	// Microsoft SQL Server databases only support 2014 SE, 2016 SE, 2016 EE, 2017 SE, 2017 EE, 2019 SE and 2109 EE. Example value: 2014_SE
	// For details about supported database versions, see section Querying Version Information About a DB Engine.
	Version string `json:"version,omitempty"`
	// Indicates the complete version number. This parameter is returned only when the DB engine is PostgreSQL.
	CompleteVersion string `json:"complete_version,omitempty"`
}

type EnlargeVolumeRdsOpts

type EnlargeVolumeRdsOpts struct {
	InstanceId string `json:"-"`
	// The minimum start value of each scaling is 10 GB. A DB instance can be scaled up only by a multiple of 10 GB. Value range: 10 GB to 4000 GB
	Size int `json:"size" required:"true"`
}

type Ha

type Ha struct {
	// Specifies the primary/standby or cluster instance type. The value is Ha (case-insensitive).
	Mode string `json:"mode,omitempty"`
	// Specifies the replication mode for the standby DB instance.
	// Value:
	// For MySQL, the value is async or semisync.
	// For PostgreSQL, the value is async or sync.
	// For Microsoft SQL Server, the value is sync.
	// NOTE
	// async indicates the asynchronous replication mode.
	// semisync indicates the semi-synchronous replication mode.
	// sync indicates the synchronous replication mode.
	ReplicationMode string `json:"replication_mode,omitempty"`
}

type Instance

type Instance struct {
	// Indicates the DB instance ID.
	// NOTE
	// The v3 DB instance ID is incompatible with the v1 DB instance ID.
	Id string `json:"id"`
	// Indicates the DB instance name. Indicates the DB instance name. DB instances of the same type can have same names under the same tenant.
	// The value must be 4 to 64 characters in length and start with a letter. It is case-insensitive and can contain only letters, digits, hyphens (-), and underscores (_).
	Name string `json:"name"`
	// Indicates the DB instance status. For example, BUILD indicates that the DB instance is being created.
	Status string `json:"status"`
	// Indicates the database information.
	Datastore Datastore `json:"datastore"`
	// Indicates the HA configuration parameters. This parameter is returned only when primary/standby DB instances are created
	Ha Ha `json:"ha"`
	// Indicates the parameter template ID. This parameter is returned only when a custom parameter template is used during DB instance creation.
	ConfigurationId string `json:"configuration_id"`
	// Indicates the database port, which is the same as the request parameter.
	Port string `json:"port"`
	// Indicates the automated backup policy.
	BackupStrategy BackupStrategy `json:"backup_strategy"`
	// Indicates the key ID for disk encryption. By default, this parameter is empty and is returned only when it is specified during the DB instance creation.
	DiskEncryptionId string `json:"disk_encryption_id"`
	// Indicates the specification code. The value cannot be empty.
	FlavorRef string `json:"flavor_ref"`
	// Indicates the volume information.
	Volume Volume `json:"volume"`
	// Indicates the region ID.
	Region string `json:"region"`
	// Indicates the AZ ID.
	AvailabilityZone string `json:"availability_zone"`
	// Indicates the VPC ID. To obtain this parameter value, use either of the following methods:
	// Method 1: Log in to VPC console and view the VPC ID in the VPC details.
	// Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference.
	VpcId string `json:"vpc_id"`
	// Indicates the network ID. To obtain this parameter value, use either of the following methods:
	// Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the network ID on the displayed page.
	// Method 2: See the "Querying Subnets" section under "APIs" or the "Querying Networks" section under "OpenStack Neutron APIs" in Virtual Private Cloud API Reference.
	SubnetId string `json:"subnet_id"`
	// Indicates the security group which the RDS DB instance belongs to. To obtain this parameter value, use either of the following methods:
	// Method 1: Log in to VPC console. Choose Access Control > Security Groups in the navigation pane on the left. On the displayed page, click the target security group. You can view the security group ID on the displayed page.
	// Method 2: See the "Querying Security Groups" section in the Virtual Private Cloud API Reference.
	SecurityGroupId string `json:"security_group_id"`
	// Indicates the billing information, which is pay-per-use.
	ChargeInfo ChargeInfo `json:"charge_info"`
	// Indicates the Collation set for Microsoft SQL Server.
	Collation string `json:"collation"`
}

type InstanceResponse added in v0.5.26

type InstanceResponse struct {
	// Indicates the DB instance ID.
	Id string `json:"id"`
	// Indicates the created DB instance name.
	Name string `json:"name"`
	// Indicates the DB instance status.
	// Value:
	// If the value is BUILD, the instance is being created.
	// If the value is ACTIVE, the instance is normal.
	// If the value is FAILED, the instance is abnormal.
	// If the value is MODIFYING, the instance is being scaled up.
	// If the value is REBOOTING, the instance is being rebooted.
	// If the value is RESTORING, the instance is being restored.
	// If the value is MODIFYING INSTANCE TYPE, the instance is changing from primary to standby.
	// If the value is SWITCHOVER, the primary/standby switchover is being performed.
	// If the value is MIGRATING, the instance is being migrated.
	// If the value is BACKING UP, the instance is being backed up.
	// If the value is MODIFYING DATABASE PORT, the database port is being changed.
	// If the value is SHUTDOWN, the DB instance is stopped.
	Status string `json:"status"`
	// Indicates the DB instance alias.
	Alias string `json:"alias"`
	// Indicates the private IP address list. It is a blank string until an ECS is created.
	PrivateIps []string `json:"private_ips"`
	// Indicates the public IP address list.
	PublicIps []string `json:"public_ips"`
	// Indicates the database port number.
	// The MySQL database port ranges from 1024 to 65535 (excluding 12017 and 33071, which are occupied by the RDS system and cannot be used).
	// The PostgreSQL database port ranges from 2100 to 9500.
	// The Microsoft SQL Server database port is 1433 or ranges from 2100 to 9500 (excluding 5355 and 5985).
	// If this parameter is not set, the default value is as follows:
	// For MySQL, the default value is 3306.
	// For PostgreSQL, the default value is 5432.
	// For Microsoft SQL Server, the default value is 1433.
	Port int `json:"port"`
	// The value is Single, Ha, or Replica, which correspond to single instance, primary/standby instances, and read replica, respectively.
	Type string `json:"type"`
	// Indicates the primary/standby DB instance information. Returned only when you obtain a primary/standby DB instance list.
	Ha Ha `json:"ha"`
	// Indicates the region where the DB instance is deployed.
	Region string `json:"region"`
	// Indicates the database information.
	DataStore Datastore `json:"datastore"`
	// Indicates the creation time in the "yyyy-mm-ddThh:mm:ssZ" format.
	// T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset.
	// The value is empty when the DB instance is being created. After the DB instance is created, the value is not empty.
	Created string `json:"created"`
	// Indicates the update time. The format is the same as that of the created field.
	// The value is empty when the DB instance is being created. After the DB instance is created, the value is not empty.
	Updated string `json:"updated"`
	// Indicates the default username.
	DbUserName string `json:"db_user_name"`
	// Indicates the VPC ID.
	VpcId string `json:"vpc_id"`
	// Indicates the network ID of the subnet.
	SubnetId string `json:"subnet_id"`
	// Indicates the security group ID.
	SecurityGroupId string `json:"security_group_id"`
	// Indicates the number of CPUs. For example, the value 1 indicates 1 vCPU.
	Cpu string `json:"cpu"`
	// Indicates the memory size in GB.
	Mem string `json:"mem"`
	// Indicates the specification code.
	FlavorRef string `json:"flavor_ref"`
	// Indicates the volume information.
	Volume Volume `json:"volume"`
	// Indicates the database switchover policy. The value can be reliability or availability, indicating the reliability first and availability first, respectively.
	SwitchStrategy string `json:"switch_strategy"`
	// Indicates the backup policy.
	BackupStrategy BackupStrategy `json:"backup_strategy"`
	// Indicates the start time of the maintenance time window in the UTC format.
	MaintenanceWindow string `json:"maintenance_window"`
	// Indicates the primary/standby DB instance information.
	Nodes []Nodes `json:"nodes"`
	// Indicates the list of associated DB instances
	RelatedInstance []RelatedInstance `json:"related_instance"`
	// Indicates the disk encryption key ID.
	DiskEncryptionId string `json:"disk_encryption_id"`
	// Indicates the time zone.
	TimeZone string `json:"time_zone"`
	// Indicates the billing information, which is pay-per-use.
	ChargeInfo ChargeInfo `json:"charge_info"`
	// Indicates the tag list. If there is no tag in the list, an empty array is returned.
	Tags []tags.ResourceTag `json:"tags"`
	// Indicates whether a DDM instance has been associated.
	AssociatedWithDdm bool `json:"associated_with_ddm"`
	// Indicates whether SSL is enabled for an instance
	EnableSSL *bool `json:"enable_ssl,omitempty"`
}

type JobId added in v0.5.26

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

type ListOpts added in v0.5.11

type ListOpts struct {
	// Specifies the DB instance ID.
	// The asterisk (*) is reserved for the system. If the instance ID starts with *, it indicates that fuzzy match is performed based on the value following * Otherwise, the exact match is performed based on the instance ID. The value cannot contain only asterisks (*).
	Id string `q:"id"`
	// Specifies the DB instance name.
	// The asterisk (*) is reserved for the system. If the instance name starts with *, it indicates that fuzzy match is performed based on the value following * Otherwise, the exact match is performed based on the instance name. The value cannot contain only asterisks (*).
	Name string `q:"name"`
	// Specifies the instance type based query. The value is Single, Ha, or Replica, which correspond to single instance, primary/standby instances, and read replica, respectively.
	Type string `q:"type"`
	// Specifies the database type. Its value can be any of the following and is case-sensitive:
	// MySQL
	// PostgreSQL
	// SQLServer
	DataStoreType string `q:"datastore_type"`
	// Specifies the VPC ID.
	// Method 1: Log in to VPC console and view the VPC ID in the VPC details.
	// Method 2: See the "Querying VPCs" section in the Virtual Private Cloud API Reference.
	VpcId string `q:"vpc_id"`
	// Specifies the network ID of the subnet.
	// Method 1: Log in to VPC console and click the target subnet on the Subnets page. You can view the network ID on the displayed page.
	// Method 2: See the "Querying Subnets" section under "APIs" or the "Querying Networks" section under "OpenStack Neutron APIs" in Virtual Private Cloud API Reference.
	SubnetId string `q:"subnet_id"`
	// Specifies the index position. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value must be a positive number.
	Offset int `q:"offset"`
	// Specifies the number of records to be queried. The default value is 100. The value cannot be a negative number. The minimum value is 1 and the maximum value is 100.
	Limit int `q:"limit"`
}

type ListResponse added in v0.5.26

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

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) (*ListResponse, error)

type MigrateFollowerOpts added in v0.5.26

type MigrateFollowerOpts struct {
	InstanceId string `json:"-"`
	// Specifies the ID of the standby DB instance.
	NodeId string `json:"nodeId"`
	// Specifies the code of the AZ to which the standby DB instance is to be migrated.
	AzCode string `json:"azCode"`
}

type Nodes

type Nodes struct {
	// Indicates the node ID.
	Id string `json:"id"`
	// Indicates the node name.
	Name string `json:"name"`
	// Indicates the node type. The value can be master, slave, or readreplica, indicating the primary node, standby node, and read replica node, respectively.
	Role string `json:"role"`
	// Indicates the node status.
	Status string `json:"status"`
	// Indicates the AZ.
	AvailabilityZone string `json:"availability_zone"`
}

type Param added in v0.8.0

type Param struct {
	LowerCaseTableNames string `json:"lower_case_table_names"`
}

type RelatedInstance

type RelatedInstance struct {
	// Indicates the associated DB instance ID.
	Id string `json:"id"`
	// Indicates the associated DB instance type.
	// replica_of: indicates the primary DB instance.
	// replica: indicates read replicas.
	Type string `json:"type"`
}

type ResizeOpts added in v0.5.26

type ResizeOpts struct {
	InstanceId string `json:"-"`
	// Specifies the resource specification code. Use rds.mysql.m1.xlarge as an example. rds indicates RDS, mysql indicates the DB engine, and m1.xlarge indicates the performance specification (large-memory). The parameter containing rr indicates the read replica specifications. The parameter not containing rr indicates the single or primary/standby DB instance specifications.
	SpecCode string `json:"spec_code" required:"true"`
}

type RestartOpts added in v0.5.26

type RestartOpts struct {
	InstanceId string `json:"-"`
	// This parameter is left blank.
	Restart struct{} `json:"restart"`
}

type ScalingOpts added in v0.9.0

type ScalingOpts struct {
	SwitchOption     bool `json:"switch_option" required:"true"`
	LimitSize        *int `json:"limit_size,omitempty"`
	TriggerThreshold *int `json:"trigger_threshold,omitempty"`
}

func GetAutoScaling added in v0.9.0

func GetAutoScaling(client *golangsdk.ServiceClient, id string) (*ScalingOpts, error)

type SingleToHaOpts added in v0.5.26

type SingleToHaOpts struct {
	InstanceId string `json:"-"`
	// Specifies the AZ code of the DB instance node.
	AzCodeNewNode string `json:"az_code_new_node" required:"true"`
	// This parameter is mandatory only when a Microsoft SQL Server DB instance type is changed from single to primary/standby.
	Password string `json:"password,omitempty"`
}

type StartFailoverResponse added in v0.5.26

type StartFailoverResponse struct {
	// Indicates the DB instance ID.
	InstanceId string `json:"instanceId,omitempty"`
	// Indicates former slave node that becomes a master node.
	NodeId string `json:"nodeId,omitempty"`
	// Indicates the workflow ID.
	WorkflowId string `json:"workflowId,omitempty"`
}

func StartFailover added in v0.5.26

func StartFailover(client *golangsdk.ServiceClient, instanceId string) (*StartFailoverResponse, error)

type UpdateInstanceNameOpts added in v0.5.26

type UpdateInstanceNameOpts struct {
	InstanceId string `json:"-"`
	// Specifies the DB instance name.
	// DB instances of the same type can have same names under the same tenant.
	// The parameter must be 4 to 64 characters long, start with a letter, and contain only letters (case-sensitive), digits, hyphens (-), and underscores (_).
	Name string `json:"name"`
}

type Volume

type Volume struct {
	// Indicates the volume type.
	// Its value can be any of the following and is case-sensitive:
	// COMMON: indicates the SATA type.
	// ULTRAHIGH: indicates the SSD type.
	Type string `json:"type" required:"true"`
	// Indicates the volume size.
	// Its value range is from 40 GB to 4000 GB. The value must be a multiple of 10.
	Size int `json:"size,omitempty"`
}

Jump to

Keyboard shortcuts

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