Documentation ¶
Index ¶
- Variables
- func List(c *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func WaitForBackup(c *golangsdk.ServiceClient, instanceID, backupID string, status BackupStatus) error
- type Backup
- type BackupDatabase
- type BackupPage
- type BackupStatus
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type ListOpts
- type ListOptsBuilder
- type RestorePITROpts
- type RestorePITROptsBuilder
- type RestorePoint
- type RestoreResult
- type RestoreToNewOpts
- type RestoreToNewOptsBuilder
- type RestoreType
- type Source
- type Target
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
View Source
var RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"}, }
Functions ¶
func List ¶ added in v0.5.6
func List(c *golangsdk.ServiceClient, opts ListOptsBuilder) pagination.Pager
func WaitForBackup ¶ added in v0.5.6
func WaitForBackup(c *golangsdk.ServiceClient, instanceID, backupID string, status BackupStatus) error
Types ¶
type Backup ¶ added in v0.5.6
type Backup struct { ID string `json:"id"` InstanceID string `json:"instance_id"` Name string `json:"name"` Type string `json:"type"` Size int `json:"size"` Databases []BackupDatabase `json:"databases"` BeginTime string `json:"begin_time"` EndTime string `json:"end_time"` Datastore instances.Datastore `json:"datastore"` Status BackupStatus `json:"status"` }
func ExtractBackups ¶ added in v0.5.6
func ExtractBackups(r pagination.Page) ([]Backup, error)
type BackupDatabase ¶ added in v0.5.6
type BackupDatabase struct {
Name string `json:"name"`
}
type BackupPage ¶ added in v0.5.6
type BackupPage struct {
pagination.SinglePageBase
}
func (BackupPage) IsEmpty ¶ added in v0.5.6
func (p BackupPage) IsEmpty() (bool, error)
type BackupStatus ¶ added in v0.5.6
type BackupStatus string
const ( StatusBuilding BackupStatus = "BUILDING" StatusCompleted BackupStatus = "COMPLETED" StatusFailed BackupStatus = "FAILED" StatusDeleting BackupStatus = "DELETING" StatusDeleted BackupStatus = "DELETED" )
type CreateOpts ¶ added in v0.5.6
type CreateOpts struct { InstanceID string `json:"instance_id" required:"true"` Name string `json:"name" required:"true"` Description string `json:"description,omitempty"` Databases []BackupDatabase `json:"databases,omitempty"` }
func (CreateOpts) ToBackupCreateMap ¶ added in v0.5.6
func (opts CreateOpts) ToBackupCreateMap() (map[string]interface{}, error)
type CreateOptsBuilder ¶ added in v0.5.6
type CreateResult ¶ added in v0.5.6
type CreateResult struct {
golangsdk.Result
}
func Create ¶ added in v0.5.6
func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
func (CreateResult) Extract ¶ added in v0.5.6
func (r CreateResult) Extract() (*Backup, error)
type DeleteResult ¶ added in v0.5.6
type DeleteResult struct {
golangsdk.ErrResult
}
func Delete ¶ added in v0.5.6
func Delete(c *golangsdk.ServiceClient, id string) (r DeleteResult)
type ListOpts ¶ added in v0.5.6
type ListOpts struct { InstanceID string `q:"instance_id"` BackupID string `q:"backup_id"` BackupType string `q:"backup_type"` BeginTime string `q:"begin_time"` EndTime string `q:"end_time"` }
func (ListOpts) ToBackupListQuery ¶ added in v0.5.6
type ListOptsBuilder ¶ added in v0.5.6
type RestorePITROpts ¶ added in v0.5.8
func (RestorePITROpts) ToPITRRestoreMap ¶ added in v0.5.8
func (opts RestorePITROpts) ToPITRRestoreMap() (map[string]interface{}, error)
type RestorePITROptsBuilder ¶ added in v0.5.8
type RestorePoint ¶ added in v0.5.6
type RestorePoint struct { InstanceID string `json:"instance_id" required:"true"` Type RestoreType `json:"type" required:"true"` BackupID string `json:"backup_id,omitempty"` RestoreTime int `json:"restore_time,omitempty"` }
type RestoreResult ¶ added in v0.5.6
type RestoreResult struct {
instances.CreateResult
}
func RestorePITR ¶ added in v0.5.8
func RestorePITR(c *golangsdk.ServiceClient, opts RestorePITROptsBuilder) (r RestoreResult)
func RestoreToNew ¶ added in v0.5.6
func RestoreToNew(c *golangsdk.ServiceClient, opts RestoreToNewOptsBuilder) (r RestoreResult)
type RestoreToNewOpts ¶ added in v0.5.6
type RestoreToNewOpts struct { Name string `json:"name" required:"true"` Ha *instances.Ha `json:"ha,omitempty"` ConfigurationId string `json:"configuration_id,omitempty"` Port string `json:"port,omitempty"` Password string `json:"password" required:"true"` BackupStrategy *instances.BackupStrategy `json:"backup_strategy,omitempty"` DiskEncryptionId string `json:"disk_encryption_id,omitempty"` FlavorRef string `json:"flavor_ref" required:"true"` Volume *instances.Volume `json:"volume" required:"true"` AvailabilityZone string `json:"availability_zone" required:"true"` VpcId string `json:"vpc_id" required:"true"` SubnetId string `json:"subnet_id" required:"true"` SecurityGroupId string `json:"security_group_id" required:"true"` RestorePoint RestorePoint `json:"restore_point" required:"true"` }
func (RestoreToNewOpts) ToBackupRestoreMap ¶ added in v0.5.6
func (opts RestoreToNewOpts) ToBackupRestoreMap() (map[string]interface{}, error)
type RestoreToNewOptsBuilder ¶ added in v0.5.6
type RestoreType ¶ added in v0.5.6
type RestoreType string
const ( TypeBackup RestoreType = "backup" TypeTimestamp RestoreType = "timestamp" )
type Target ¶ added in v0.5.8
type Target struct {
InstanceID string `json:"instance_id" required:"true"`
}
type UpdateOpts ¶
type UpdateOpts struct { // Keep Days KeepDays *int `json:"keep_days" required:"true"` // Start Time StartTime string `json:"start_time,omitempty"` // Period Period string `json:"period,omitempty"` }
UpdateOpts contains all the values needed to update a Backup.
func (UpdateOpts) ToBackupUpdateMap ¶
func (opts UpdateOpts) ToBackupUpdateMap() (map[string]interface{}, error)
ToBackupUpdateMap builds a update request body from UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
golangsdk.ErrResult
}
UpdateResult represents the result of a update operation.
func Update ¶
func Update(c *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
Update accepts a UpdateOpts struct and uses the values to update a Backup.The response code from api is 200
Click to show internal directories.
Click to hide internal directories.