Documentation ¶
Overview ¶
Package rds defines the RDS services of BCE. The supported APIs are all defined in sub-package
rds.go - the rds APIs definition supported by the RDS service
util.go - define the utilities for api package of RDS service
Index ¶
- Constants
- func Aes128EncryptUseSecreteKey(sk string, data string) (string, error)
- type Account
- type BackupPolicy
- type Billing
- type Client
- func (c *Client) CreateAccount(instanceId string, args *CreateAccountArgs) error
- func (c *Client) CreateRds(args *CreateRdsArgs) (*CreateResult, error)
- func (c *Client) CreateRdsProxy(args *CreateRdsProxyArgs) (*CreateResult, error)
- func (c *Client) CreateReadReplica(args *CreateReadReplicaArgs) (*CreateResult, error)
- func (c *Client) DeleteAccount(instanceId, accountName string) error
- func (c *Client) DeleteRds(instanceIds string) error
- func (c *Client) GetAccount(instanceId, accountName string) (*Account, error)
- func (c *Client) GetBackupList(instanceId string, args *GetBackupListArgs) (*GetBackupListResult, error)
- func (c *Client) GetDetail(instanceId string) (*Instance, error)
- func (c *Client) GetZoneList() (*GetZoneListResult, error)
- func (c *Client) ListAccount(instanceId string) (*ListAccountResult, error)
- func (c *Client) ListRds(args *ListRdsArgs) (*ListRdsResult, error)
- func (c *Client) ListSubnets(args *ListSubnetsArgs) (*ListSubnetsResult, error)
- func (c *Client) ModifyEndpoint(instanceId string, args *ModifyEndpointArgs) error
- func (c *Client) ModifyPublicAccess(instanceId string, args *ModifyPublicAccessArgs) error
- func (c *Client) ModifySyncMode(instanceId string, args *ModifySyncModeArgs) error
- func (c *Client) RebootInstance(instanceId string) error
- func (c *Client) ResizeRds(instanceId string, args *ResizeRdsArgs) error
- func (c *Client) UpdateInstanceName(instanceId string, args *UpdateInstanceNameArgs) error
- type CreateAccountArgs
- type CreateRdsArgs
- type CreateRdsProxyArgs
- type CreateReadReplicaArgs
- type CreateResult
- type DatabasePrivilege
- type Endpoint
- type GetBackupListArgs
- type GetBackupListResult
- type GetZoneListResult
- type Instance
- type ListAccountResult
- type ListRdsArgs
- type ListRdsResult
- type ListSubnetsArgs
- type ListSubnetsResult
- type ModifyEndpointArgs
- type ModifyPublicAccessArgs
- type ModifySyncModeArgs
- type Reservation
- type ResizeRdsArgs
- type Subnet
- type SubnetMap
- type Topology
- type UpdateInstanceNameArgs
- type ZoneName
Constants ¶
const ( URI_PREFIX = bce.URI_PREFIX + "v1" DEFAULT_ENDPOINT = "rds.bj.baidubce.com" REQUEST_RDS_URL = "/instance" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackupPolicy ¶
type Billing ¶
type Billing struct { PaymentTiming string `json:"paymentTiming"` Reservation Reservation `json:"reservation,omitempty"` }
type Client ¶
Client of RDS service is a kind of BceClient, so derived from BceClient
func (*Client) CreateAccount ¶
func (c *Client) CreateAccount(instanceId string, args *CreateAccountArgs) error
CreateAccount - create a account with the specific parameters
PARAMS:
- instanceId: the specific instanceId
- args: the arguments to create a account
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) CreateRds ¶
func (c *Client) CreateRds(args *CreateRdsArgs) (*CreateResult, error)
CreateRds - create a RDS with the specific parameters
PARAMS:
- args: the arguments to create a rds
RETURNS:
- *InstanceIds: the result of create RDS, contains new RDS's instanceIds
- error: nil if success otherwise the specific error
func (*Client) CreateRdsProxy ¶
func (c *Client) CreateRdsProxy(args *CreateRdsProxyArgs) (*CreateResult, error)
CreateRdsProxy - create a proxy RDS with the specific parameters
PARAMS:
- args: the arguments to create a readReplica rds
RETURNS:
- *InstanceIds: the result of create a readReplica RDS, contains the readReplica RDS's instanceIds
- error: nil if success otherwise the specific error
func (*Client) CreateReadReplica ¶
func (c *Client) CreateReadReplica(args *CreateReadReplicaArgs) (*CreateResult, error)
CreateReadReplica - create a readReplica RDS with the specific parameters
PARAMS:
- args: the arguments to create a readReplica rds
RETURNS:
- *InstanceIds: the result of create a readReplica RDS, contains the readReplica RDS's instanceIds
- error: nil if success otherwise the specific error
func (*Client) DeleteAccount ¶
DeleteAccount - delete an account of a RDS instance
PARAMS:
- instanceIds: the specific instanceIds
- accountName: the specific account's name
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) DeleteRds ¶
DeleteRds - delete a rds
PARAMS:
- instanceIds: the specific instanceIds
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) GetAccount ¶
GetAccount - get an account of a RDS instance with the specific parameters
PARAMS:
- instanceId: the specific rds Instance's ID
- accountName: the specific account's name
RETURNS:
- *Account: the account's meta
- error: nil if success otherwise the specific error
func (*Client) GetBackupList ¶ added in v0.9.29
func (c *Client) GetBackupList(instanceId string, args *GetBackupListArgs) (*GetBackupListResult, error)
GetBackupList - get backup list of the instance
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
RETURNS:
- *GetBackupListResult: result of the backup list
- error: nil if success otherwise the specific error
func (*Client) GetDetail ¶
GetDetail - get a specific rds Instance's detail
PARAMS:
- instanceId: the specific rds Instance's ID
RETURNS:
- *Instance: the specific rdsInstance's detail
- error: nil if success otherwise the specific error
func (*Client) GetZoneList ¶ added in v0.9.29
func (c *Client) GetZoneList() (*GetZoneListResult, error)
GetZoneList - list all zone
PARAMS:
- cli: the client agent which can perform sending request
RETURNS:
- *GetZoneListResult: result of the zone list
- error: nil if success otherwise the specific error
func (*Client) ListAccount ¶
func (c *Client) ListAccount(instanceId string) (*ListAccountResult, error)
ListAccount - list all account of a RDS instance with the specific parameters
PARAMS:
- instanceId: the specific rds Instance's ID
RETURNS:
- *ListAccountResult: the result of list all account, contains all accounts' meta
- error: nil if success otherwise the specific error
func (*Client) ListRds ¶
func (c *Client) ListRds(args *ListRdsArgs) (*ListRdsResult, error)
ListRds - list all RDS with the specific parameters
PARAMS:
- args: the arguments to list all RDS
RETURNS:
- *ListRdsResult: the result of list all RDS, contains all rds' meta
- error: nil if success otherwise the specific error
func (*Client) ListSubnets ¶ added in v0.9.29
func (c *Client) ListSubnets(args *ListSubnetsArgs) (*ListSubnetsResult, error)
ListsSubnet - list all Subnets
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to list all subnets, not necessary
RETURNS:
- *ListSubnetsResult: result of the subnet list
- error: nil if success otherwise the specific error
func (*Client) ModifyEndpoint ¶ added in v0.9.29
func (c *Client) ModifyEndpoint(instanceId string, args *ModifyEndpointArgs) error
ModifyEndpoint - modify the prefix of endpoint
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
- args: the arguments to modify endpoint
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) ModifyPublicAccess ¶ added in v0.9.29
func (c *Client) ModifyPublicAccess(instanceId string, args *ModifyPublicAccessArgs) error
ModifyPublicAccess - modify public access
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
- args: the arguments to modify public access
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) ModifySyncMode ¶ added in v0.9.29
func (c *Client) ModifySyncMode(instanceId string, args *ModifySyncModeArgs) error
UpdateSyncMode - update sync mode of a specified instance
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
- args: the arguments to update syncMode
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) RebootInstance ¶ added in v0.9.29
RebootInstance - reboot a specified instance
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance to be rebooted
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) ResizeRds ¶
func (c *Client) ResizeRds(instanceId string, args *ResizeRdsArgs) error
ResizeRds - resize an RDS with the specific parameters
PARAMS:
- instanceId: the specific instanceId
- args: the arguments to resize an RDS
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) UpdateInstanceName ¶ added in v0.9.29
func (c *Client) UpdateInstanceName(instanceId string, args *UpdateInstanceNameArgs) error
UpdateInstanceName - update name of a specified instance
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
- args: the arguments to update instanceName
RETURNS:
- error: nil if success otherwise the specific error
type CreateAccountArgs ¶
type CreateAccountArgs struct { ClientToken string `json:"-"` AccountName string `json:"accountName"` Password string `json:"password"` AccountType string `json:"accountType,omitempty"` DatabasePrivileges []DatabasePrivilege `json:"databasePrivileges,omitempty"` Desc string `json:"desc,omitempty"` Type string `json:"type,omitempty"` }
type CreateRdsArgs ¶
type CreateRdsArgs struct { ClientToken string `json:"-"` Billing Billing `json:"billing"` PurchaseCount int `json:"purchaseCount,omitempty"` InstanceName string `json:"instanceName,omitempty"` Engine string `json:"engine"` EngineVersion string `json:"engineVersion"` Category string `json:"category,omitempty"` CpuCount int `json:"cpuCount"` MemoryCapacity float64 `json:"memoryCapacity"` VolumeCapacity int `json:"volumeCapacity"` ZoneNames []string `json:"zoneNames,omitempty"` VpcId string `json:"vpcId,omitempty"` IsDirectPay bool `json:"isDirectPay,omitempty"` Subnets []SubnetMap `json:"subnets,omitempty"` Tags []model.TagModel `json:"tags,omitempty"` }
type CreateRdsProxyArgs ¶
type CreateRdsProxyArgs struct { ClientToken string `json:"-"` Billing Billing `json:"billing"` SourceInstanceId string `json:"sourceInstanceId"` InstanceName string `json:"instanceName,omitempty"` NodeAmount int `json:"nodeAmount"` ZoneNames []string `json:"zoneNames,omitempty"` VpcId string `json:"vpcId,omitempty"` IsDirectPay bool `json:"isDirectPay,omitempty"` Subnets []SubnetMap `json:"subnets,omitempty"` Tags []model.TagModel `json:"tags,omitempty"` }
type CreateReadReplicaArgs ¶
type CreateReadReplicaArgs struct { ClientToken string `json:"-"` Billing Billing `json:"billing"` PurchaseCount int `json:"purchaseCount,omitempty"` SourceInstanceId string `json:"sourceInstanceId"` InstanceName string `json:"instanceName,omitempty"` CpuCount int `json:"cpuCount"` MemoryCapacity float64 `json:"memoryCapacity"` VolumeCapacity int `json:"volumeCapacity"` ZoneNames []string `json:"zoneNames,omitempty"` VpcId string `json:"vpcId,omitempty"` IsDirectPay bool `json:"isDirectPay,omitempty"` Subnets []SubnetMap `json:"subnets,omitempty"` Tags []model.TagModel `json:"tags,omitempty"` }
type CreateResult ¶
type CreateResult struct {
InstanceIds []string `json:"instanceIds"`
}
type DatabasePrivilege ¶
type GetBackupListArgs ¶ added in v0.9.29
type GetBackupListResult ¶ added in v0.9.29
type GetZoneListResult ¶ added in v0.9.29
type GetZoneListResult struct {
Zones []ZoneName `json:"zones"`
}
type Instance ¶
type Instance struct { InstanceId string `json:"instanceId"` InstanceName string `json:"instanceName"` Engine string `json:"engine"` EngineVersion string `json:"engineVersion"` Category string `json:"category"` InstanceStatus string `json:"instanceStatus"` CpuCount int `json:"cpuCount"` MemoryCapacity float64 `json:"memoryCapacity"` VolumeCapacity int `json:"volumeCapacity"` NodeAmount int `json:"nodeAmount"` UsedStorage float64 `json:"usedStorage"` PublicAccessStatus string `json:"publicAccessStatus"` InstanceCreateTime string `json:"instanceCreateTime"` InstanceExpireTime string `json:"instanceExpireTime"` Endpoint Endpoint `json:"endpoint"` SyncMode string `json:"syncMode"` BackupPolicy BackupPolicy `json:"backupPolicy"` Region string `json:"region"` InstanceType string `json:"instanceType"` SourceInstanceId string `json:"sourceInstanceId"` SourceRegion string `json:"sourceRegion"` ZoneNames []string `json:"zoneNames"` VpcId string `json:"vpcId"` Subnets []Subnet `json:"subnets"` Topology Topology `json:"topology"` PaymentTiming string `json:"paymentTiming"` }
type ListAccountResult ¶
type ListAccountResult struct {
Accounts []Account `json:"accounts"`
}
type ListRdsArgs ¶
type ListRdsResult ¶
type ListSubnetsArgs ¶ added in v0.9.29
type ListSubnetsResult ¶ added in v0.9.29
type ListSubnetsResult struct {
Subnets []Subnet `json:"subnets"`
}
type ModifyEndpointArgs ¶ added in v0.9.29
type ModifyEndpointArgs struct {
Address string `json:"address"`
}
type ModifyPublicAccessArgs ¶ added in v0.9.29
type ModifyPublicAccessArgs struct {
PublicAccess bool `json:"publicAccess"`
}
type ModifySyncModeArgs ¶ added in v0.9.29
type ModifySyncModeArgs struct {
SyncMode string `json:"syncMode"`
}
type Reservation ¶
type ResizeRdsArgs ¶
type UpdateInstanceNameArgs ¶ added in v0.9.29
type UpdateInstanceNameArgs struct {
InstanceName string `json:"instanceName"`
}