snapshots

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 4 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"`
	Frequency                  string `json:"frequency"`
	Indices                    string `json:"indices"`
	MaxSnapshotBytesPerSeconds string `json:"maxSnapshotBytesPerSeconds"`
	MaxRestoreBytesPerSeconds  string `json:"maxRestoreBytesPerSeconds"`
}

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 {
	// Whether to enable the automatic snapshot creation policy.
	Enable string `json:"enable" required:"true"`
	// Snapshot name prefix. Mandatory when Enable is set to true.
	// It must be 1 to 32 characters and can contain only lowercase letters, digits, hyphens (-), and underscores (_).
	Prefix string `json:"prefix,omitempty"`
	// Time when a snapshot is created every day. Mandatory when Enable is set to true.
	// Format is HH:mm z, e.g. 00:00 GMT+08:00.
	Period string `json:"period,omitempty"`
	// Number of days for which automatically created snapshots are reserved. Mandatory when Enable is set to true.
	// Value range: 1 to 90.
	KeepDay int `json:"keepday,omitempty"`
	// Snapshot creation frequency.
	// Options: HOUR, DAY, SUN, MON, TUE, WED, THU, FRI, SAT. Default: DAY.
	Frequency string `json:"frequency,omitempty"`
	// Whether to delete all automatically created snapshots when the automatic snapshot creation policy is disabled.
	// Default: false.
	DeleteAuto string `json:"delete_auto,omitempty"`
	// Name of the index to be backed up. Supports wildcards, e.g. index*.
	Indices string `json:"indices,omitempty"`
}

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"`
	// Storage path of the snapshot in the OBS bucket.
	BasePath string `json:"basePath" 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