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) GetDetail(instanceId string) (*Instance, error)
- func (c *Client) ListAccount(instanceId string) (*ListAccountResult, error)
- func (c *Client) ListRds(args *ListRdsArgs) (*ListRdsResult, error)
- func (c *Client) ResizeRds(instanceId string, args *ResizeRdsArgs) error
- type CreateAccountArgs
- type CreateRdsArgs
- type CreateRdsProxyArgs
- type CreateReadReplicaArgs
- type CreateResult
- type DatabasePrivilege
- type Endpoint
- type Instance
- type ListAccountResult
- type ListRdsArgs
- type ListRdsResult
- type Reservation
- type ResizeRdsArgs
- type Subnet
- type SubnetMap
- type Topology
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) 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) 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
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 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"`
}