backups

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

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

func DeleteSharingMember added in v0.9.4

func DeleteSharingMember(client *golangsdk.ServiceClient, id, memberID string) (err error)

func RestoreBackup

func RestoreBackup(client *golangsdk.ServiceClient, backupID string, opts RestoreBackupOpts) (err error)

Types

type Backup

type Backup struct {
	CheckpointID string            `json:"checkpoint_id"`
	CreatedAt    string            `json:"created_at"`
	Description  string            `json:"description"`
	ExpiredAt    string            `json:"expired_at"`
	ExtendInfo   *BackupExtendInfo `json:"extend_info"`
	ID           string            `json:"id"`
	ImageType    string            `json:"image_type"`
	Name         string            `json:"name"`
	ParentID     string            `json:"parent_id"`
	ProjectID    string            `json:"project_id"`
	ProtectedAt  string            `json:"protected_at"`
	ResourceAZ   string            `json:"resource_az"`
	ResourceID   string            `json:"resource_id"`
	ResourceName string            `json:"resource_name"`
	ResourceSize int               `json:"resource_size"`
	ResourceType string            `json:"resource_type"`
	Status       string            `json:"status"`
	UpdatedAt    string            `json:"updated_at"`
	VaultId      string            `json:"vault_id"`
	ProviderID   string            `json:"provider_id"`
	Children     []BackupResp      `json:"children"`
}

func ExtractBackups

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

func Get

func Get(client *golangsdk.ServiceClient, id string) (*Backup, error)

func List

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

type BackupExtendInfo

type BackupExtendInfo struct {
	AutoTrigger          bool        `json:"auto_trigger"`
	Bootable             bool        `json:"bootable"`
	Incremental          bool        `json:"incremental"`
	SnapshotID           string      `json:"snapshot_id"`
	SupportLld           bool        `json:"support_lld"`
	SupportedRestoreMode string      `json:"supported_restore_mode"`
	OsImagesData         []ImageData `json:"os_images_data"`
	ContainSystemDisk    bool        `json:"contain_system_disk"`
	Encrypted            bool        `json:"encrypted"`
	SystemDisk           bool        `json:"system_disk"`
}

type BackupPage

type BackupPage struct {
	pagination.LinkedPageBase
}

func (BackupPage) IsEmpty

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

func (BackupPage) NextPageURL

func (r BackupPage) NextPageURL() (string, error)

type BackupResp

type BackupResp struct {
	CheckpointID string            `json:"checkpoint_id"`
	CreatedAt    string            `json:"created_at"`
	Description  string            `json:"description"`
	ExpiredAt    string            `json:"expired_at"`
	ExtendInfo   *BackupExtendInfo `json:"extend_info"`
	ID           string            `json:"id"`
	ImageType    string            `json:"image_type"`
	Name         string            `json:"name"`
	ParentID     string            `json:"parent_id"`
	ProjectID    string            `json:"project_id"`
	ProtectedAt  string            `json:"protected_at"`
	ResourceAZ   string            `json:"resource_az"`
	ResourceID   string            `json:"resource_id"`
	ResourceName string            `json:"resource_name"`
	ResourceSize int               `json:"resource_size"`
	ResourceType string            `json:"resource_type"`
	Status       string            `json:"status"`
	UpdatedAt    string            `json:"updated_at"`
	VaultID      string            `json:"vault_id"`
	ProviderID   string            `json:"provider_id"`
}

type BackupRestoreServer

type BackupRestoreServer struct {
	BackupID string `json:"backup_id"`
	VolumeID string `json:"volume_id"`
}

type ImageData

type ImageData struct {
	ImageID string `json:"image_id"`
}

type ListMemberOpts added in v0.9.4

type ListMemberOpts struct {
	ID             string
	CheckpointID   string `q:"checkpoint_id"`
	DedicatedCloud bool   `q:"dec"`
	EndTime        string `q:"end_time"`
	ImageType      string `q:"image_type"`
	Limit          string `q:"limit"`
	Marker         string `q:"marker"`
	MemberStatus   string `q:"member_status"`
	Name           string `q:"name"`
	Offset         string `q:"offset"`
	OwningType     string `q:"own_type"`
	ParentID       string `q:"parent_id"`
	ResourceAZ     string `q:"resource_az"`
	ResourceID     string `q:"resource_id"`
	ResourceName   string `q:"resource_name"`
	ResourceType   string `q:"resource_type"`
	Sort           string `q:"sort"`
	StartTime      string `q:"start_time"`
	Status         string `q:"status"`
	UsedPercent    string `q:"used_percent"`
	VaultID        string `q:"vault_id"`
}

type ListOpts

type ListOpts struct {
	ID             string
	CheckpointID   string `q:"checkpoint_id"`
	DedicatedCloud bool   `q:"dec"`
	EndTime        string `q:"end_time"`
	ImageType      string `q:"image_type"`
	Limit          string `q:"limit"`
	Marker         string `q:"marker"`
	MemberStatus   string `q:"member_status"`
	Name           string `q:"name"`
	Offset         string `q:"offset"`
	OwningType     string `q:"own_type"`
	ParentID       string `q:"parent_id"`
	ResourceAZ     string `q:"resource_az"`
	ResourceID     string `q:"resource_id"`
	ResourceName   string `q:"resource_name"`
	ResourceType   string `q:"resource_type"`
	Sort           string `q:"sort"`
	StartTime      string `q:"start_time"`
	Status         string `q:"status"`
	UsedPercent    string `q:"used_percent"`
	VaultID        string `q:"vault_id"`
}

ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the flavor attributes you want to see returned.

type Member added in v0.9.4

type Member struct {
	// Backup sharing status
	Status string `json:"status"`
	// Backup sharing time
	CreatedAt string `json:"created_at"`
	// Update time
	UpdatedAt string `json:"updated_at"`
	// Backup ID
	BackupId string `json:"backup_id"`
	// ID of the image created by using the accepted shared backup
	ImageId string `json:"image_id"`
	// ID of the project with which the backup is shared
	DestProjectId string `json:"dest_project_id"`
	// ID of the vault where the shared backup is stored
	VaultId string `json:"vault_id"`
	// ID of the shared record
	ID string `json:"id"`
}

func ExtractMembers added in v0.9.4

func ExtractMembers(r pagination.NewPage) ([]Member, error)

func GetSharingMember added in v0.9.4

func GetSharingMember(client *golangsdk.ServiceClient, id, memberID string) (*Member, error)

func ListSharingMembers added in v0.9.4

func ListSharingMembers(client *golangsdk.ServiceClient, backupId string, opts ListMemberOpts) ([]Member, error)

func UpdateSharingMember added in v0.9.4

func UpdateSharingMember(client *golangsdk.ServiceClient, memberID string, opts UpdateOpts) (*Member, error)

type MemberPage added in v0.9.4

type MemberPage struct {
	pagination.NewSinglePageBase
}

type Members added in v0.9.4

type Members struct {
	// Backup sharing status
	Status string `json:"status"`
	// Backup sharing time
	CreatedAt string `json:"created_at"`
	// Update time
	UpdatedAt string `json:"updated_at"`
	// Backup ID
	BackupId string `json:"backup_id"`
	// ID of the image created by using the accepted shared backup
	ImageId string `json:"image_id"`
	// ID of the project with which the backup is shared
	DestProjectId string `json:"dest_project_id"`
	// Replication record ID
	VaultId string `json:"vault_id"`
	// ID of the shared record
	ID string `json:"id"`
}

func AddSharingMember added in v0.9.4

func AddSharingMember(client *golangsdk.ServiceClient, backupID string, opts MembersOpts) ([]Members, error)

type MembersOpts added in v0.9.4

type MembersOpts struct {
	// Project IDs of the backup share members to be added
	Members []string `json:"members" required:"true"`
}

type Replicate added in v0.9.4

type Replicate struct {
	// ID of the source backup used for replication
	BackupId string `json:"backup_id"`
	// ID of the replication destination project
	DestinationProjectId string `json:"destination_project_id"`
	// Replication destination region
	DestinationRegion string `json:"destination_region"`
	// ID of the vault in the replication destination region
	DestinationVaultId string `json:"destination_vault_id"`
	// ID of the project where replication is performed
	ProjectId string `json:"project_id"`
	// Resource type ID
	ProviderId string `json:"provider_id"`
	// Replication record ID
	ReplicationRecordId string `json:"replication_record_id"`
	// Replication source region
	SourceRegion string `json:"source_region"`
}

func ReplicateBackup added in v0.9.4

func ReplicateBackup(client *golangsdk.ServiceClient, backupID string, opts ReplicateBackupOpts) (*Replicate, error)

type ReplicateBackupOpts added in v0.9.4

type ReplicateBackupOpts struct {
	// Replica description
	Description string `json:"description,omitempty"`
	// ID of the replication destination project
	DestinationProjectId string `json:"destination_project_id" required:"true"`
	// Replication destination region
	DestinationRegion string `json:"destination_region" required:"true"`
	// ID of the vault in the replication destination region
	DestinationVaultId string `json:"destination_vault_id" required:"true"`
	// Replica name
	Name string `json:"name,omitempty"`
}

type RestoreBackupOpts

type RestoreBackupOpts struct {
	Mappings []BackupRestoreServer `json:"mappings,omitempty"`
	PowerOn  bool                  `json:"power_on,omitempty"`
	ServerID string                `json:"server_id,omitempty"`
	VolumeID string                `json:"volume_id,omitempty"`
}

type UpdateOpts added in v0.9.4

type UpdateOpts struct {
	BackupID string `json:"_"`
	// Status of a shared backup
	Status string `json:"status" required:"true"`
	// Vault in which the shared backup is to be stored
	VaultId string `json:"vault_id,omitempty"`
}

Jump to

Keyboard shortcuts

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