backup

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: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backup

type Backup struct {
	// Backup ID
	Id string `json:"id"`
	// Backup name
	Name string `json:"name"`
	// Backup description
	Description string `json:"description"`
	// Backup start time in the "yyyy-mm-ddThh:mm:ssZ" format,
	// where "T" indicates the start time of the time field, and "Z" indicates the time zone offset.
	BeginTime string `json:"begin_time"`
	// Backup status
	// Valid value:
	// BUILDING: Backup in progress
	// COMPLETED: Backup completed
	// FAILED: Backup failed
	// AVAILABLE: Backup available
	Status string `json:"status"`
	// Backup type
	// Valid value:
	// manual: manual full backup
	Type string `json:"type"`
	// Instance ID
	InstanceId string `json:"instance_id"`
}

type BackupListOpts

type BackupListOpts struct {
	// Instance ID
	InstanceId string `q:"instance_id"`
	// Backup ID
	BackupId string `q:"backup_id"`
	// Backup type
	// auto: automated full backup
	// manual: manual full backup
	BackupType string `q:"backup_type"`
	// 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 string `q:"offset"`
	// Number of records to be queried. The default value is 100.
	// The value must be a positive integer. The minimum value is 1 and the maximum value is 100.
	Limit string `q:"limit"`
	// Query start time. The format is "yyyy-mm-ddThh:mm:ssZ".
	BeginTime string `q:"begin_time"`
	// Query end time. The format is "yyyy-mm-ddThh:mm:ssZ" and the end time must be later than the start time.
	EndTime string `q:"end_time"`
}

type BackupListResponse

type BackupListResponse struct {
	// Backup information
	Backups []Backups `json:"backups"`
	// Total number of backup files
	TotalCount int `json:"total_count"`
}

func ListBackups

func ListBackups(client *golangsdk.ServiceClient, opts BackupListOpts) (*BackupListResponse, error)

type BackupPolicy

type BackupPolicy struct {
	// Backup retention days
	KeepDays int32 `json:"keep_days"`
	// Backup time window. The creation of an automated backup will be triggered during the backup time window.
	StartTime string `json:"start_time"`
	// Backup cycle configuration. Data will be automatically backed up on the selected days every week.
	Period string `json:"period"`
	// Number of retained level-1 backups. This parameter is returned when level-1 backup is enabled
	RetentionNumBackupLevel1 int32 `json:"retention_num_backup_level1"`
}

func GetPolicy

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

type Backups

type Backups struct {
	// Backup ID
	Id string `json:"id"`
	// Backup name
	Name string `json:"name"`
	// Backup start time in the "yyyy-mm-ddThh:mm:ssZ" format.
	BeginTime string `json:"begin_time"`
	// Backup end time in the "yyyy-mm-ddThh:mm:ssZ" format.
	EndTime string `json:"end_time"`
	// Backup status. Value:
	// BUILDING: Backup in progress
	// COMPLETED: Backup completed
	// FAILED: Backup failed
	// AVAILABLE: Backup available
	Status string `json:"status"`
	// Backup duration in minutes
	TakeUpTime int32 `json:"take_up_time"`
	// Backup type
	// auto: automated full backup
	// manual: manual full backup
	Type string `json:"type"`
	// Backup size in MB.
	Size int64 `json:"size"`
	// Database information
	Datastore MysqlDatastore `json:"datastore"`
	// Instance ID
	InstanceId string `json:"instance_id"`
	// Backup level. This parameter is returned when the level-1 backup function is enabled. Value:
	// 1: level-1 backup
	// 2: level-2 backup
	// 0: Backup being created or creation failed
	BackupLevel string `json:"backup_level"`
	// Description of the backup file
	Description string `json:"description"`
}

type CreateBackupOpts

type CreateBackupOpts struct {
	// Instance ID, which is compliant with the UUID format.
	InstanceId string `json:"instance_id"`
	// Backup name
	// The name consists of 4 to 64 characters and starts with a letter.
	// It is case-sensitive and can contain only letters, digits, hyphens (-), and underscores (_).
	Name string `json:"name"`
	// Backup description. It contains up to 256 characters and cannot contain the following special characters: >!<"&'=
	Description string `json:"description,omitempty"`
}

type CreateBackupResponse

type CreateBackupResponse struct {
	Backup Backup `json:"backup"`
	JobId  string `json:"job_id"`
}

type MysqlDatastore

type MysqlDatastore struct {
	// DB engine. Currently, only gaussdb-mysql is supported.
	Type string `json:"type"`
	// DB engine version
	Version string `json:"version"`
}

type UpdateBackupPolicy

type UpdateBackupPolicy struct {
	// Backup time window. The creation of an automated backup 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 00. Example value: 21:00-22:00
	StartTime string `json:"start_time"`
	// Backup retention days
	KeepDays int `json:"keep_days"`
	// Backup cycle configuration. Data will be automatically backed up on the selected days every week. Value range:
	// The value is a number separated by commas (,), indicating the days of the week.
	// For example, the value 1,2,3,4 indicates that the backup period is every Monday, Tuesday,Wednesday, and Thursday.
	Period string `json:"period"`
}

type UpdatePolicyOpts

type UpdatePolicyOpts struct {
	// Instance ID, which is compliant with the UUID format.
	InstanceId   string
	BackupPolicy UpdateBackupPolicy `json:"backup_policy"`
}

type UpdatepPolicyResponse

type UpdatepPolicyResponse struct {
	// Backup status. Value:
	// BUILDING: Modification in progress
	// COMPLETED: Modification completed
	// FAILED: Modification failed
	Status string `json:"status"`
	// Instance ID
	InstanceId string `json:"instance_id"`
	// Instance name
	InstanceName string `json:"instance_name"`
}

Jump to

Keyboard shortcuts

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