Documentation ¶
Index ¶
- func ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type ForceDeleteResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type ResetStatusOpts
- type ResetStatusOptsBuilder
- type ResetStatusResult
- type Snapshot
- type SnapshotPage
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListDetail ¶
func ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
ListDetail returns []Snapshot optionally limited by the conditions provided in ListOpts.
Types ¶
type CreateOpts ¶
type CreateOpts struct { string `json:"share_id" required:"true"` // Defines the snapshot name Name string `json:"name,omitempty"` // Defines the snapshot description Description string `json:"description,omitempty"` // DisplayName is equivalent to Name. The API supports using both // This is an inherited attribute from the block storage API DisplayName string `json:"display_name,omitempty"` // DisplayDescription is equivalent to Description. The API supports using both // This is an inherited attribute from the block storage API DisplayDescription string `json:"display_description,omitempty"` }ShareID
CreateOpts contains the options for create a Snapshot. This object is passed to snapshots.Create(). For more information about these parameters, please refer to the Snapshot object, or the shared file systems API v2 documentation
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 ¶
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 *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create will create a new Snapshot based on the values in CreateOpts. To extract the Snapshot object from the response, call the Extract method on the CreateResult.
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
DeleteResult contains the response body and error from a Delete request.
func Delete ¶
func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult)
Delete will delete an existing Snapshot with the given UUID.
type ForceDeleteResult ¶ added in v1.6.0
type ForceDeleteResult struct {
gophercloud.ErrResult
}
ForceDeleteResult contains the response error from an ForceDelete request.
func ForceDelete ¶ added in v1.6.0
func ForceDelete(client *gophercloud.ServiceClient, id string) (r ForceDeleteResult)
ForceDelete will delete the existing snapshot in any state. ForceDeleteResult contains only the error. To extract it, call the ExtractErr method on the ForceDeleteResult.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult contains the response body and error from a Get request.
func Get ¶
func Get(client *gophercloud.ServiceClient, id string) (r GetResult)
Get will get a single snapshot with given UUID
type ListOpts ¶
type ListOpts struct { // (Admin only). Defines whether to list the requested resources for all projects. AllTenants bool `q:"all_tenants"` // The snapshot name. Name string `q:"name"` // Filter by a snapshot description. Description string `q:"description"` ShareID string `q:"share_id"` // Filters by a snapshot size in GB. Size int `q:"size"` // Filters by a snapshot status. Status string `q:"status"` // The maximum number of snapshots to return. Limit int `q:"limit"` // The offset to define start point of snapshot or snapshot group listing. Offset int `q:"offset"` // The key to sort a list of snapshots. SortKey string `q:"sort_key"` // The direction to sort a list of snapshots. SortDir string `q:"sort_dir"` // The UUID of the project in which the snapshot was created. Useful with all_tenants parameter. ProjectID string `q:"project_id"` // The name pattern that can be used to filter snapshots, snapshot snapshots, snapshot networks or snapshot groups. NamePattern string `q:"name~"` // The description pattern that can be used to filter snapshots, snapshot snapshots, snapshot networks or snapshot groups. DescriptionPattern string `q:"description~"` }
ListOpts holds options for listing Snapshots. It is passed to the snapshots.List function.
func (ListOpts) ToSnapshotListQuery ¶
ToSnapshotListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type ResetStatusOpts ¶ added in v1.6.0
type ResetStatusOpts struct { // Status is a snapshot status to reset to. Can be "available", "error", // "creating", "deleting", "manage_starting", "manage_error", // "unmanage_starting", "unmanage_error" or "error_deleting". Status string `json:"status"` }
ResetStatusOpts contains options for resetting a Snapshot status. For more information about these parameters, please, refer to the shared file systems API v2, Snapshot Actions, ResetStatus share documentation.
func (ResetStatusOpts) ToSnapshotResetStatusMap ¶ added in v1.6.0
func (opts ResetStatusOpts) ToSnapshotResetStatusMap() (map[string]interface{}, error)
ToSnapshotResetStatusMap assembles a request body based on the contents of a ResetStatusOpts.
type ResetStatusOptsBuilder ¶ added in v1.6.0
type ResetStatusOptsBuilder interface {
ToSnapshotResetStatusMap() (map[string]interface{}, error)
}
ResetStatusOptsBuilder allows extensions to add additional parameters to the ResetStatus request.
type ResetStatusResult ¶ added in v1.6.0
type ResetStatusResult struct {
gophercloud.ErrResult
}
ResetStatusResult contains the response error from an ResetStatus request.
func ResetStatus ¶ added in v1.6.0
func ResetStatus(client *gophercloud.ServiceClient, id string, opts ResetStatusOptsBuilder) (r ResetStatusResult)
ResetStatus will reset the existing snapshot status. ResetStatusResult contains only the error. To extract it, call the ExtractErr method on the ResetStatusResult.
type Snapshot ¶
type Snapshot struct { // The UUID of the snapshot ID string `json:"id"` // The name of the snapshot Name string `json:"name,omitempty"` // A description of the snapshot Description string `json:"description,omitempty"` ShareID string `json:"share_id"` ShareProto string `json:"share_proto"` ShareSize int `json:"share_size"` // Size of the snapshot in GB Size int `json:"size"` // The snapshot status Status string `json:"status"` // The UUID of the project in which the snapshot was created ProjectID string `json:"project_id"` // Timestamp when the snapshot was created CreatedAt time.Time `json:"-"` // Snapshot links for pagination Links []map[string]string `json:"links"` }
Snapshot contains all information associated with an OpenStack Snapshot
func ExtractSnapshots ¶
func ExtractSnapshots(r pagination.Page) ([]Snapshot, error)
ExtractSnapshots extracts and returns a Snapshot slice. It is used while iterating over a snapshots.List call.
func (*Snapshot) UnmarshalJSON ¶
type SnapshotPage ¶
type SnapshotPage struct {
pagination.MarkerPageBase
}
SnapshotPage is a pagination.pager that is returned from a call to the List function.
func (SnapshotPage) IsEmpty ¶
func (r SnapshotPage) IsEmpty() (bool, error)
IsEmpty satisifies the IsEmpty method of the Page interface
func (SnapshotPage) LastMarker ¶
func (r SnapshotPage) LastMarker() (string, error)
LastMarker returns the last offset in a ListResult.
func (SnapshotPage) NextPageURL ¶
func (r SnapshotPage) NextPageURL() (string, error)
NextPageURL generates the URL for the page of results after this one.
type UpdateOpts ¶
type UpdateOpts struct { // Snapshot name. Manila snapshot update logic doesn't have a "name" alias. DisplayName *string `json:"display_name,omitempty"` // Snapshot description. Manila snapshot update logic doesn't have a "description" alias. DisplayDescription *string `json:"display_description,omitempty"` }
UpdateOpts contain options for updating an existing Snapshot. This object is passed to the snapshot.Update function. For more information about the parameters, see the Snapshot object.
func (UpdateOpts) ToSnapshotUpdateMap ¶
func (opts UpdateOpts) ToSnapshotUpdateMap() (map[string]interface{}, error)
ToSnapshotUpdateMap assembles a request body based on the contents of an UpdateOpts.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult contains the response body and error from an Update request.
func Update ¶
func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
Update will update the Snapshot with provided information. To extract the updated Snapshot from the response, call the Extract method on the UpdateResult.