snapshots

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package snapshots provides information and interaction with snapshots in the OpenStack Block Storage service. A snapshot is a point in time copy of the data contained in an external storage volume, and can be controlled programmatically.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

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

func IDFromName

func IDFromName(client *golangsdk.ServiceClient, name string) (string, error)

IDFromName is a convenience function that returns a snapshot's ID given its name.

func UpdateMetadata

func UpdateMetadata(client *golangsdk.ServiceClient, id string, opts UpdateMetadataOpts) (*map[string]interface{}, error)

func WaitForStatus

func WaitForStatus(c *golangsdk.ServiceClient, id, status string, secs int) error

WaitForStatus will continually poll the resource, checking for a particular status. It will do this for the amount of seconds defined.

Types

type CreateOpts

type CreateOpts struct {
	VolumeID    string            `json:"volume_id" required:"true"`
	Force       bool              `json:"force,omitempty"`
	Name        string            `json:"name,omitempty"`
	Description string            `json:"description,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

type ListOpts

type ListOpts struct {
	AllTenants bool   `q:"all_tenants"`
	Name       string `q:"name"`
	Status     string `q:"status"`
	TenantID   string `q:"project_id"`
	VolumeID   string `q:"volume_id"`
	Marker     string `q:"marker"`
	Offset     int    `q:"offset"`
	Limit      int    `q:"limit"`
}

type ListResponse added in v0.9.9

type ListResponse struct {
	Snapshots      []Snapshot       `json:"snapshots"`
	SnapshotsLinks []golangsdk.Link `json:"snapshots_links"`
}

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) (*ListResponse, error)

type Snapshot

type Snapshot struct {
	ID          string            `json:"id"`
	CreatedAt   time.Time         `json:"-"`
	UpdatedAt   time.Time         `json:"-"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	VolumeID    string            `json:"volume_id"`
	Status      string            `json:"status"`
	Size        int               `json:"size"`
	Metadata    map[string]string `json:"metadata"`
}

func Create

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

func Get

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

func (*Snapshot) UnmarshalJSON

func (r *Snapshot) UnmarshalJSON(b []byte) error

type SnapshotPage

type SnapshotPage struct {
	pagination.NewPageResult
}

func (SnapshotPage) NewIsEmpty added in v0.9.9

func (p SnapshotPage) NewIsEmpty() (bool, error)

func (SnapshotPage) NewNextPageURL added in v0.9.9

func (p SnapshotPage) NewNextPageURL() (string, error)

type UpdateMetadataOpts

type UpdateMetadataOpts struct {
	Metadata map[string]interface{} `json:"metadata" required:"true"`
}

Directories

Path Synopsis
snapshots_v2
snapshots_v2

Jump to

Keyboard shortcuts

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