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 ¶
- func Delete(client *golangsdk.ServiceClient, id string) error
- func IDFromName(client *golangsdk.ServiceClient, name string) (string, error)
- func UpdateMetadata(client *golangsdk.ServiceClient, id string, opts UpdateMetadataOpts) (*map[string]string, error)
- func WaitForStatus(c *golangsdk.ServiceClient, id, status string, secs int) error
- type CreateOpts
- type ListOpts
- type ListResponse
- type Snapshot
- type SnapshotPage
- type UpdateMetadataOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IDFromName ¶
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]string, error)
func WaitForStatus ¶
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 ListOpts ¶
type ListOpts struct {
Marker string `q:"marker"`
Offset int `q:"offset"`
Limit int `q:"limit"`
Name string `q:"name"`
SortDir string `q:"sort_dir"`
Status string `q:"status"`
VolumeID string `q:"volume_id"`
NameLike string `q:"name~"`
StatusLike string `q:"status~"`
VolumeIDLike string `q:"volume_id~"`
SortKey string `q:"sort_key"`
WithCount bool `q:"with_count"`
}
type ListResponse ¶ added in v0.9.9
type ListResponse struct {
Snapshots []Snapshot `json:"snapshots"`
SnapshotsLinks []golangsdk.Link `json:"snapshots_links"`
Count int `json:"count"`
}
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 (*Snapshot) UnmarshalJSON ¶
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 ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.