snapshots

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

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 UpdateSnapshotSetting

func UpdateSnapshotSetting(c *golangsdk.ServiceClient, clusterId string, opts UpdateSnapshotSettingReq) (*golangsdk.Result, error)

UpdateSnapshotSetting

Types

type CreateOpts

type CreateOpts struct {
	Name        string `json:"name" required:"true"`
	Description string `json:"description,omitempty"`
	Indices     string `json:"indices,omitempty"`
}

CreateOpts contains options for creating a snapshot. This object is passed to the snapshots.Create function.

func (CreateOpts) ToSnapshotCreateMap

func (opts CreateOpts) ToSnapshotCreateMap() (map[string]interface{}, error)

ToSnapshotCreateMap assembles a request body based on the contents of a CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToSnapshotCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult contains the response body and error from a Create request.

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder, clusterId string) (r CreateResult)

Create will create a new snapshot based on the values in CreateOpts. To extract the result from the response, call the Extract method on the CreateResult.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Snapshot, error)

Extract will get the Snapshot object out of the CreateResult object.

type DataStore

type DataStore struct {
	Type    string `json:"type"`
	Version string `json:"version"`
}

type ErrorResult

type ErrorResult struct {
	golangsdk.ErrResult
}

ErrorResult contains the response body and error from a request.

func Delete

func Delete(client *golangsdk.ServiceClient, clusterId, id string) (r ErrorResult)

Delete will delete the existing Snapshot ID with the provided ID.

func Disable

func Disable(client *golangsdk.ServiceClient, clusterId string) (r ErrorResult)

Disable will disable the Snapshot function with the provided ID.

func Enable

func Enable(client *golangsdk.ServiceClient, clusterId string) (r ErrorResult)

Enable will enable the Snapshot function with the provided ID.

func PolicyCreate

func PolicyCreate(client *golangsdk.ServiceClient, opts CreateOptsBuilder, clusterId string) (r ErrorResult)

PolicyCreate will create a new snapshot policy based on the values in PolicyCreateOpts.

type ListResult

type ListResult struct {
	// contains filtered or unexported fields
}

ListResult contains the response body and error from a List request.

func List

func List(client *golangsdk.ServiceClient, clusterId string) (r ListResult)

List retrieves the Snapshots with the provided ID. To extract the Snapshot objects from the response, call the Extract method on the GetResult.

func (ListResult) Extract

func (r ListResult) Extract() ([]Snapshot, error)

Extract will get all Snapshot objects out of the ListResult object.

type Policy

type Policy struct {
	KeepDay  int    `json:"keepday"`
	Period   string `json:"period"`
	Prefix   string `json:"prefix"`
	Bucket   string `json:"bucket"`
	BasePath string `json:"basePath"`
	Agency   string `json:"agency"`
	Enable   string `json:"enable"`
}

Policy contains all the information associated with a snapshot policy.

type PolicyCreateOpts

type PolicyCreateOpts struct {
	Prefix     string `json:"prefix" required:"true"`
	Period     string `json:"period" required:"true"`
	KeepDay    int    `json:"keepday" required:"true"`
	Enable     string `json:"enable" required:"true"`
	DeleteAuto string `json:"deleteAuto,omitempty"`
}

PolicyCreateOpts contains options for creating a snapshot policy. This object is passed to the snapshots.PolicyCreate function.

func (PolicyCreateOpts) ToSnapshotCreateMap

func (opts PolicyCreateOpts) ToSnapshotCreateMap() (map[string]interface{}, error)

ToSnapshotCreateMap assembles a request body based on the contents of a PolicyCreateOpts.

type PolicyResult

type PolicyResult struct {
	// contains filtered or unexported fields
}

PolicyResult contains the response body and error from a policy request.

func PolicyGet

func PolicyGet(client *golangsdk.ServiceClient, clusterId string) (r PolicyResult)

PolicyGet retrieves the snapshot policy with the provided cluster ID. To extract the snapshot policy object from the response, call the Extract method on the GetResult.

func (PolicyResult) Extract

func (r PolicyResult) Extract() (*Policy, error)

Extract will get the Policy object out of the PolicyResult object.

type Snapshot

type Snapshot struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	Type          string `json:"backupType"`
	Method        string `json:"backupMethod"`
	Description   string `json:"description"`
	ClusterID     string `json:"clusterId"`
	ClusterName   string `json:"clusterName"`
	Indices       string `json:"indices"`
	TotalShards   int    `json:"totalShards"`
	FailedShards  int    `json:"failedShards"`
	KeepDays      int    `json:"backupKeepDay"`
	Period        string `json:"backupPeriod"`
	Bucket        string `json:"bucketName"`
	Version       string `json:"version"`
	Status        string `json:"status"`
	RestoreStatus string `json:"restoreStatus"`

	// type of the data search engine
	DataStore DataStore `json:"datastore"`

	// the information about times
	ExpectedStartTime time.Time `json:"-"`
	StartTime         time.Time `json:"-"`
	EndTime           time.Time `json:"-"`
	Created           string    `json:"created"`
	Updated           string    `json:"updated"`
}

Snapshot contains all the information associated with a Cluster Snapshot.

type UpdateSnapshotSettingReq

type UpdateSnapshotSettingReq struct {
	// OBS bucket used for index data backup. If there is snapshot data in an OBS bucket, only the OBS bucket is used
	// and cannot be changed.
	Bucket   string `json:"bucket" required:"true"`
	BasePath string `json:"basePath" required:"true"` // Storage path of the snapshot in the OBS bucket.
	Agency   string `json:"agency" required:"true"`   // IAM agency used to access OBS.
}

Jump to

Keyboard shortcuts

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