backups

package
v0.0.0-...-57791d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, backupId string) error

Delete is a method to delete an specified backup by its ID.

Types

type BackupExtendInfo

type BackupExtendInfo struct {
	// Whether the backup is automatically generated.
	AutoTrigger bool `json:"auto_trigger"`
	// Whether the backup is a system disk backup.
	Bootable bool `json:"bootable"`
	// Whether the backup is an incremental backup.
	Incremental bool `json:"incremental"`
	// Snapshot ID of the disk backup.
	SnapshotId string `json:"snapshot_id"`
	// Whether to allow lazyloading for fast restoration.
	SupportLld bool `json:"support_lld"`
	// The restoration mode.
	SupportRestoreMode string `json:"supported_restore_mode"`
	// The ID list of images created using backups.
	OsImagesData []ImageData `json:"os_image_data"`
	// Whether the VM backup data contains system disk data.
	ContainSystemDisk bool `json:"contain_system_disk"`
	// Whether the backup is encrypted.
	Encrypted bool `json:"encrypted"`
	// Whether the disk is a system disk.
	SystemDisk bool `json:"system_disk"`
}

BackupExtendInfo is an object that represents the extended information of the backup.

type BackupPage

type BackupPage struct {
	pagination.OffsetPageBase
}

BackupPage is a single page maximum result representing a query by offset page.

func (BackupPage) IsEmpty

func (b BackupPage) IsEmpty() (bool, error)

IsEmpty checks whether a ChannelPage struct is empty.

type BackupResp

type BackupResp struct {
	// The restore point ID
	CheckpointId string `json:"checkpoint_id"`
	// The creation time of the backup.
	CreatedAt string `json:"created_at"`
	// The backup description.
	Description string `json:"description"`
	// The expiration time of the backup.
	ExpiredAt string `json:"expired_at"`
	// The extended information.
	ExtendInfo BackupExtendInfo `json:"extend_info"`
	// The backup ID.
	ID string `json:"id"`
	// The backup type.
	ImageType string `json:"image_type"`
	// The backup name.
	Name string `json:"name"`
	// The parent backup ID.
	ParentId string `json:"parent_id"`
	// The project ID to which the backup belongs.
	ProjectId string `json:"project_id"`
	// Backup time.
	ProtectedAt string `json:"protected_at"`
	// The availability zone where the backup resource is located.
	ResourceAz string `json:"resource_az"`
	// The backup resource ID.
	ResourceId string `json:"resource_id"`
	// The backup resource name.
	ResourceName string `json:"resource_name"`
	// The backup resource size, in GB.
	ResourceSize int `json:"resource_size"`
	// The backup resource type.
	ResourceType string `json:"resource_type"`
	// The backup status.
	Status string `json:"status"`
	// The latest update time of the backup.
	UpdatedAt string `json:"updated_at"`
	// The vault to which the backup resource belongs.
	VaultId string `json:"vault_id"`
	// The replication records.
	ReplicationRecords []ReplicationRecord `json:"replication_record"`
	// The enterprise project to which the backup resource belongs.
	EnterpriseProjectId string `json:"enterprise_project_id"`
	// The provider ID.
	ProviderId string `json:"provider_id"`
	// The backup list of the child resources.
	Children []BackupResp `json:"children"`
}

BackupResp is the structure that represents the backup detail.

func ExtractBackups

func ExtractBackups(r pagination.Page) ([]BackupResp, error)

ExtractBackups is a method to extract the list of backups.

func Get

func Get(client *golangsdk.ServiceClient, backupId string) (*BackupResp, error)

Get is a method to obtain an specified backup by its ID.

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]BackupResp, error)

List is a method used to query backup list under specified checkpoint using given parameters.

type ImageData

type ImageData struct {
	// Backup image ID.
	ImageId string `json:"image_id"`
}

ImageData is an object that represents the backup image detail.

type ListOpts

type ListOpts struct {
	// Restore point ID.
	CheckpointId string `q:"checkpoint_id"`
	// Dedicated cloud tag, which only takes effect in dedicated cloud scenarios.
	Dec bool `q:"dec"`
	// Time when the backup ends, in %YYYY-%mm-%ddT%HH:%MM:%SSZ format. For example, 2018-02-01T12:00:00Z.
	EndTime string `q:"end_time"`
	// Enterprise project ID or all_granted_eps. all_granted_eps indicates querying the IDs of all enterprise projects
	// on which the user has permissions.
	EnterpriseProjectId string `q:"enterprise_project_id"`
	// Backup type, which can be backup or replication.
	ImageType string `q:"image_type"`
	// Whether incremental backup is used.
	// Default: false
	Incremental bool `q:"incremental"`
	// Number of records displayed per page.
	// The value must be a positive integer.
	Limit int `q:"limit"`
	// ID of the last record displayed on the previous page.
	Marker string `q:"marker"`
	// Backup sharing status
	// Enumeration values:
	// + pending
	// + accepted
	// + rejected
	MemberStatus string `q:"member_status"`
	// Backup name.
	Name string `q:"name"`
	// Offset value. The value must be a positive integer.
	Offset int `q:"offset"`
	// Owning type of a backup. private backups are queried by default.
	// Enumeration values:
	// + all_granted
	// + private
	// + shared
	// Default: private
	OwnType string `q:"own_type"`
	// Parent backup ID.
	ParentId string `q:"parent_id"`
	// AZ-based filtering is supported.
	ResourceAZ string `q:"resource_az"`
	// Resource ID.
	ResourceId string `q:"resource_id"`
	// Resource name.
	ResourceName string `q:"resource_name"`
	// Resource type, which can be:
	// + OS::Nova::Server
	// + OS::Cinder::Volume
	// + OS::Ironic::BareMetalServer
	// + OS::Native::Server
	// + OS::Sfs::Turbo
	// + OS::Workspace::DesktopV2
	ResourceType string `q:"resource_type"`
	// Whether to show replication records.
	// Default: false
	ShowReplication bool `q:"show_replication"`
	// A group of properties separated by commas (,) and sorting directions.
	// The value is in the format of <key1>[:<direction>],<key2>[:<direction>], where the value of direction is
	// asc (ascending order) or desc (descending order).
	// If a direction is not specified, the default sorting direction is desc.
	// The value of sort can contain a maximum of 255 characters.
	// The key can be as follows: created_at, updated_at, name, status, protected_at, id
	Sort string `q:"sort"`
	// Time when the backup starts, in %YYYY-%mm-%ddT%HH:%MM:%SSZ format.
	// For example, 2018-02-01T12:00:00Z.
	StartTime string `q:"start_time"`
	// Status When the API is called, multiple statuses can be transferred for filtering.
	// for example, status=available&status=error.
	// Enumeration values:
	// + available
	// + protecting
	// + deleting
	// + restoring
	// + error
	// + waiting_protect
	// + waiting_delete
	// + waiting_restore
	Status string `q:"status"`
	// Backups are filtered based on the occupied vault capacity.
	// The value ranges from 1 to 100.
	// For example, if used_percent is set to 80, all backups who occupied 80% or more of the vault capacity are
	// displayed.
	UsedPercent string `q:"used_percent"`
	// Vault ID.
	VaultId string `q:"vault_id"`
}

ListOpts is the structure that used to query backup list using given parameters.

type ReplicationRecord

type ReplicationRecord struct {
	// The creation time of the replication.
	CreatedAt string `json:"created_at"`
	// The ID of the destination backup used for replication.
	DestinationBackupId string `json:"destination_backup_id"`
	// The record ID of the destination backup used for replication.
	DestinationCheckpointId string `json:"destination_checkpoint_id"`
	// The ID of the replication destination project.
	DestinationProjectId string `json:"destination_project_id"`
	// The replication destination region.
	DestinationRegion string `json:"destination_region"`
	// The destination vault ID.
	DestinationVaultId string `json:"destination_vault_id"`
	// The additional information of the replication.
	ExtraInfo ReplicationRecordExtraInfo `json:"extra_info"`
	// The replication record ID.
	ID string `json:"id"`
	// The ID of the source backup used for replication.
	SourceBackupId string `json:"source_backup_id"`
	// The ID of the source backup record used for replication.
	SourceCheckpointId string `json:"source_checkpoint_id"`
	// The ID of the replication source project.
	SourceProjectId string `json:"source_project_id"`
	// The replication source region.
	SourceRegion string `json:"source_region"`
	// The replication status.
	Status string `json:"status"`
	// The ID of the vault where the backup resides.
	VaultId string `json:"vault_id"`
}

ReplicationRecord is an object that represents the replication record detail.

type ReplicationRecordExtraInfo

type ReplicationRecordExtraInfo struct {
	// The replication progress.
	Progress int `json:"progress"`
	// The error code.
	FailCode string `json:"fail_code"`
	// The error cause.
	FailReason string `json:"fail_reason"`
	// Whether replication is automatically scheduled.
	AutoTrigger bool `json:"auto_trigger"`
	// The destination vault ID.
	DestinationVaultId string `json:"destination_vault_id"`
}

ReplicationRecordExtraInfo is an object that represents the additional information of the replication.

Jump to

Keyboard shortcuts

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