Documentation
¶
Index ¶
- func List(client *golangsdk.ServiceClient, opts ListInstanceBuilder) pagination.Pager
- func UpdateClientNetWorkRanges(c *golangsdk.ServiceClient, instanceId string, opts UpdateClientNetworkOpts) error
- func UpdateMaintenanceWindow(c *golangsdk.ServiceClient, instanceId string, ...) error
- func UpdateRemark(c *golangsdk.ServiceClient, instanceId string, opts RemarkOpts) error
- func UpdateSlowLogStatus(c *golangsdk.ServiceClient, instanceId string, slowLogStatus string) error
- type AvailabilityZoneOpts
- type AvailabilityZoneResp
- type BackupPolicyOpts
- type BackupPolicyResp
- type BackupStrategy
- type BackupStrategyOpt
- type BalancerActiveWindowOpts
- type BalancerResp
- type ChangeMaintenanceWindowOpts
- type ChargeInfo
- type CommonResp
- func RestartInstance(c *golangsdk.ServiceClient, instanceId string, opts RestartOpts) (*CommonResp, error)
- func UpdateBalancerActiveWindow(c *golangsdk.ServiceClient, instanceId string, opts BalancerActiveWindowOpts) (*CommonResp, error)
- func UpdateBalancerSwicth(c *golangsdk.ServiceClient, instanceId string, action string) (*CommonResp, error)
- func UpdateReplicaSetName(c *golangsdk.ServiceClient, instanceId string, opts ReplicaSetNameOpts) (*CommonResp, error)
- type Configuration
- type CreateInstanceBuilder
- type CreateOpts
- type CreateResult
- type DataStore
- type DeleteInstance
- type DeleteInstanceBuilder
- type DeleteInstanceResponse
- type DeleteInstanceResult
- type EnabledOpts
- type Flavor
- type FlavorOpt
- type Group
- type Instance
- type InstancePage
- type InstanceResponse
- type ListInstanceBuilder
- type ListInstanceOpts
- type ListInstanceResponse
- type ListInstanceResult
- type Nodes
- type PortOpts
- type PortUpdateResp
- type RemarkOpts
- type ReplicaSetNameOpts
- type RestartOpts
- type SlowLogStatusResp
- type SpecOpts
- type UpdateClientNetworkOpts
- type UpdateInstanceResult
- type UpdateNodeNumOpts
- type UpdateOpt
- type UpdateReplicaSetNodeNumOpts
- type UpdateResp
- type UpdateSpecOpts
- type UpdateVolumeOpts
- type Volume
- type VolumeOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *golangsdk.ServiceClient, opts ListInstanceBuilder) pagination.Pager
func UpdateClientNetWorkRanges ¶
func UpdateClientNetWorkRanges(c *golangsdk.ServiceClient, instanceId string, opts UpdateClientNetworkOpts) error
UpdateClientNetWorkRanges is a method to update client network ranges.
func UpdateMaintenanceWindow ¶
func UpdateMaintenanceWindow(c *golangsdk.ServiceClient, instanceId string, opts ChangeMaintenanceWindowOpts) error
UpdateMaintenanceWindow is a method to update maintenance time.
func UpdateRemark ¶
func UpdateRemark(c *golangsdk.ServiceClient, instanceId string, opts RemarkOpts) error
UpdateRemark is a method to update the description.
func UpdateSlowLogStatus ¶
func UpdateSlowLogStatus(c *golangsdk.ServiceClient, instanceId string, slowLogStatus string) error
UpdateSlowLogStatus is a method to update the slow log status.
Types ¶
type AvailabilityZoneOpts ¶
type AvailabilityZoneOpts struct {
TargetAzs string `json:"target_azs" required:"true"`
}
type AvailabilityZoneResp ¶
type AvailabilityZoneResp struct {
// Job ID.
JobId string `json:"job_id"`
}
func UpdateAvailabilityZone ¶
func UpdateAvailabilityZone(c *golangsdk.ServiceClient, instanceId string, opts AvailabilityZoneOpts) (*AvailabilityZoneResp, error)
UpdateAvailabilityZone is a method to update the AvailabilityZone.
type BackupPolicyOpts ¶
type BackupPolicyOpts struct {
BackupPolicy BackupStrategy `json:"backup_policy" required:"true"`
}
type BackupPolicyResp ¶
type BackupPolicyResp struct {
BackupPolicy BackupStrategy `json:"backup_policy"`
}
func CreateBackupPolicy ¶
func CreateBackupPolicy(c *golangsdk.ServiceClient, instanceId string, backPolicy BackupStrategy) (*BackupPolicyResp, error)
CreateBackupPolicy is a method to create the backup policy.
func GetBackupPolicy ¶
func GetBackupPolicy(c *golangsdk.ServiceClient, instanceId string) (*BackupPolicyResp, error)
GetBackupPolicy is a method to get the backup policy.
type BackupStrategy ¶
type BackupStrategyOpt ¶
type BalancerResp ¶
type BalancerResp struct {
IsOpen bool `json:"is_open"`
ActiveWindow BalancerActiveWindowOpts `json:"active_window"`
}
func GetBalancer ¶
func GetBalancer(c *golangsdk.ServiceClient, instanceId string) (*BalancerResp, error)
GetBalancer is a method to get the balancer configuration.
type ChargeInfo ¶
type CommonResp ¶
type CommonResp struct {
// Job ID.
JobId string `json:"job_id"`
}
func RestartInstance ¶
func RestartInstance(c *golangsdk.ServiceClient, instanceId string, opts RestartOpts) (*CommonResp, error)
func UpdateBalancerActiveWindow ¶
func UpdateBalancerActiveWindow(c *golangsdk.ServiceClient, instanceId string, opts BalancerActiveWindowOpts) (*CommonResp, error)
UpdateBalancerActiveWindow is a method to set the balancer active window.
func UpdateBalancerSwicth ¶
func UpdateBalancerSwicth(c *golangsdk.ServiceClient, instanceId string, action string) (*CommonResp, error)
UpdateBalancerSwicth is a method to enable or disable the balancer.
func UpdateReplicaSetName ¶
func UpdateReplicaSetName(c *golangsdk.ServiceClient, instanceId string, opts ReplicaSetNameOpts) (*CommonResp, error)
UpdateReplicaSetName is a method to update the replica set name.
type Configuration ¶
type CreateInstanceBuilder ¶
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,omitempty"`
Port string `json:"port,omitempty"`
DiskEncryptionId string `json:"disk_encryption_id,omitempty"`
Ssl string `json:"ssl_option,omitempty"`
Mode string `json:"mode" required:"true"`
Configuration []Configuration `json:"configurations,omitempty"`
Flavor []Flavor `json:"flavor" required:"true"`
BackupStrategy BackupStrategy `json:"backup_strategy,omitempty"`
EnterpriseProjectID string `json:"enterprise_project_id,omitempty"`
ChargeInfo *ChargeInfo `json:"charge_info,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 Create(client *golangsdk.ServiceClient, opts CreateInstanceBuilder) (r CreateResult)
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*Instance, error)
func (CreateResult) ExtractEnabled ¶
func (r CreateResult) ExtractEnabled() (*EnabledOpts, error)
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 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 ¶
func (r DeleteInstanceResult) Extract() (*DeleteInstanceResponse, error)
type EnabledOpts ¶
type EnabledOpts struct {
Enabled *bool `json:"enabled" required:"true"`
}
func GetSecondsLevelMonitoring ¶
func GetSecondsLevelMonitoring(c *golangsdk.ServiceClient, instanceId string) (*EnabledOpts, error)
GetSecondsLevelMonitoring is a method to get seconds level monitoring.
func UpdateSecondsLevelMonitoring ¶
func UpdateSecondsLevelMonitoring(c *golangsdk.ServiceClient, instanceId string, enabled bool) (*EnabledOpts, error)
UpdateSecondsLevelMonitoring is a method to update seconds level monitoring.
type Instance ¶
type Instance struct {
OrderId string `json:"order_id"`
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"`
Remark string `json:"remark"`
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"`
PayMode string `json:"pay_mode"`
}
type ListInstanceBuilder ¶
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 PortOpts ¶
type PortOpts struct {
Port int `json:"port"`
}
PortOpts is the structure required by the UpdatePort method to modify the database access port.
type PortUpdateResp ¶
type PortUpdateResp struct {
// Job ID.
JobId string `json:"job_id"`
// Database access port.
Port int `json:"port"`
}
PortUpdateResp is the structure that represents the detail of the database user.
func UpdatePort ¶
func UpdatePort(c *golangsdk.ServiceClient, instanceId string, port int) (*PortUpdateResp, error)
UpdatePort is a method to update the database access port using given parameters.
type RemarkOpts ¶
type RemarkOpts struct {
Remark string `json:"remark"`
}
type ReplicaSetNameOpts ¶
type ReplicaSetNameOpts struct {
Name string `json:"name" required:"true"`
}
func GetReplicaSetName ¶
func GetReplicaSetName(c *golangsdk.ServiceClient, instanceId string) (*ReplicaSetNameOpts, error)
GetReplicaSetName is a method to get the replica set name.
type RestartOpts ¶
type SlowLogStatusResp ¶
type SlowLogStatusResp struct {
// Status.
Status string `json:"status"`
}
func GetSlowLogStatus ¶
func GetSlowLogStatus(c *golangsdk.ServiceClient, instanceId string) (*SlowLogStatusResp, error)
GetSlowLogStatus is a method to get the slow log status.
type UpdateClientNetworkOpts ¶
type UpdateClientNetworkOpts struct {
ClientNetworkRanges *[]string `json:"client_network_ranges" required:"true"`
}
func GetClientNetWorkRanges ¶
func GetClientNetWorkRanges(c *golangsdk.ServiceClient, instanceId string) (*UpdateClientNetworkOpts, error)
GetClientNetWorkRanges is a method to get the client network ranges.
type UpdateInstanceResult ¶
type UpdateInstanceResult struct {
// contains filtered or unexported fields
}
func Update ¶
func Update(client *golangsdk.ServiceClient, instanceId string, opts []UpdateOpt) (r UpdateInstanceResult)
func (UpdateInstanceResult) Extract ¶
func (r UpdateInstanceResult) Extract() (*UpdateResp, error)
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 *VolumeOpts `json:"volume,omitempty"`
IsAutoPay bool `json:"is_auto_pay,omitempty"`
}
type UpdateOpt ¶
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 UpdateResp ¶
type UpdateSpecOpts ¶
type UpdateVolumeOpts ¶
type UpdateVolumeOpts struct {
Volume VolumeOpts `json:"volume" required:"true"`
IsAutoPay bool `json:"is_auto_pay,omitempty"`
}