snapshots

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

func Delete

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

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

func Disable

func Disable(client *golangsdk.ServiceClient, clusterId string) (err error)

Disable will disable the Snapshot function with the provided ID.

func Enable

func Enable(client *golangsdk.ServiceClient, clusterId string) (err error)

Enable will enable the Snapshot function with the provided ID.

func PolicyCreate

func PolicyCreate(client *golangsdk.ServiceClient, opts PolicyCreateOpts, clusterId string) (err error)

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

func UpdateConfiguration added in v0.5.0

func UpdateConfiguration(client *golangsdk.ServiceClient, clusterID string, opts UpdateConfigurationOpts) (err error)

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.

type DataStore

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

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"`
	SnapshotCmkID string `json:"snapshotCmkId"`
}

Policy contains all the information associated with a snapshot policy.

func PolicyGet

func PolicyGet(client *golangsdk.ServiceClient, clusterId string) (*Policy, error)

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.

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.

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.

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts, clusterId string) (*Snapshot, error)

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 List

func List(client *golangsdk.ServiceClient, clusterId string) ([]Snapshot, error)

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

type UpdateConfigurationOpts added in v0.5.0

type UpdateConfigurationOpts 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"`
	// IAM agency used to access OBS.
	Agency string `json:"agency" required:"true"`
	// Key ID used for snapshot encryption.
	SnapshotCmkID string `json:"snapshotCmkId,omitempty"`
}

Jump to

Keyboard shortcuts

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