Documentation
¶
Index ¶
- func GetBackupPolicy(client *golangsdk.ServiceClient, instanceId string) (*instances.BackupStrategy, error)
- func SetBackupPolicy(client *golangsdk.ServiceClient, opts ModifyBackupPolicyOpts) (err error)
- type Backup
- type BackupLinkOpts
- type BackupsResponse
- type CreateOpts
- type Files
- type Job
- type LinkResponse
- type ListBackupsOpts
- type ListResponse
- type ModifyBackupPolicyOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBackupPolicy ¶
func GetBackupPolicy(client *golangsdk.ServiceClient, instanceId string) (*instances.BackupStrategy, error)
func SetBackupPolicy ¶
func SetBackupPolicy(client *golangsdk.ServiceClient, opts ModifyBackupPolicyOpts) (err error)
Types ¶
type Backup ¶
type Backup struct {
// Specifies the instance ID, which can be obtained by calling the API for querying instances.
// If you do not have an instance, you can call the API used for creating an instance.
InstanceId string `json:"instance_id" required:"true"`
// Specifies the manual backup name.
// The value must be 4 to 64 characters in length and start with a letter (from A to Z or from a to z).
// It is case-sensitive and can contain only letters, digits (from 0 to 9), hyphens (-), and underscores (_).
Name string `json:"name" required:"true"`
// Specifies the manual backup description.
// The description must consist of a maximum of 256 characters and cannot
// contain the following special characters: >!<"&'=
Description string `json:"description,omitempty"`
}
type BackupLinkOpts ¶
type BackupsResponse ¶
type BackupsResponse struct {
// Indicates the backup ID.
ID string `json:"id"`
// Indicates the backup name.
Name string `json:"name"`
// Indicates the ID of the DB instance from which the backup was created.
InstanceId string `json:"instance_id"`
// Indicates the name of the DB instance for which the backup is created.
InstanceName string `json:"instance_name"`
// Indicates the database version.
Datastore instances.DataStore `json:"datastore"`
// Indicates the backup type.
Type string `json:"type"`
// Indicates the backup start time. The format of the start time is yyyy-mm-dd hh:mm:ss. The value is in UTC format.
BeginTime string `json:"begin_time"`
// Indicates the backup end time. The format of the end time is yyyy-mm-dd hh:mm:ss. The value is in UTC format.
EndTime string `json:"end_time"`
// Indicates the backup status. Valid value:
// BUILDING: Backup in progress
// COMPLETED: Backup completed
// FAILED: Backup failed
// DISABLED: Backup being deleted
Status string `json:"status"`
// Indicates the backup size in KB.
Size int64 `json:"size"`
// Indicates the backup description.
Description string `json:"description"`
}
type CreateOpts ¶
type CreateOpts struct {
Backup *Backup `json:"backup" required:"true"`
}
type Files ¶
type Files struct {
// Indicates the file name.
Name string `json:"name"`
// Indicates the file size in KB.
Size int64 `json:"size"`
// Indicates the link for downloading the backup file.
DownloadLink string `json:"download_link"`
// Indicates the link expiration time.
LinkExpiredTime string `json:"link_expired_time"`
}
type Job ¶
func Create ¶
func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*Job, error)
type LinkResponse ¶
func ListBackupDownloadLinks ¶
func ListBackupDownloadLinks(client *golangsdk.ServiceClient, opts BackupLinkOpts) (*LinkResponse, error)
type ListBackupsOpts ¶
type ListBackupsOpts struct {
// Index offset.
// If offset is set to N, the resource query starts from the N+1 piece of data. The default value is 0, indicating that the query starts from the first piece of data.
// The value must be a positive integer.
Offset int `q:"offset"`
// Maximum number of specifications that can be queried
// Value range: 1-100
// If this parameter is not transferred, the first 100 pieces of specification information can be queried by default.
Limit int `q:"limit"`
// Instance id.
InstanceId string `q:"instance_id"`
// Specifies the backup ID.
BackupId string `q:"backup_id"`
// Specifies the backup type.
// Auto: indicates automated full backup.
// Manual indicates manual full backup.
BackupType string `q:"backup_type"`
// Specifies the start time of the query. The format is yyyy-mm-dd hh:mm:ss. The value is in UTC format.
BeginTime string `q:"begin_time"`
// Specifies the end time of the query. The format is "yyyy-mm-dd hh:mm:ss". The value is in UTC format.
EndTime string `q:"end_time"`
// Specifies the DB instance mode.
// Valid value:
// Sharding
// ReplicaSet
// Single
Mode string `q:"mode"`
}
type ListResponse ¶
type ListResponse struct {
Backups []BackupsResponse `json:"backups"`
TotalCount int `json:"total_count"`
}
func List ¶
func List(client *golangsdk.ServiceClient, opts ListBackupsOpts) (*ListResponse, error)
type ModifyBackupPolicyOpts ¶
type ModifyBackupPolicyOpts struct {
InstanceId string `json:"-"`
BackupPolicy *instances.BackupStrategy `json:"backup_policy" required:"true"`
}
Click to show internal directories.
Click to hide internal directories.