Documentation ¶
Index ¶
- func Detail(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func IDFromName(client *gophercloud.ServiceClient, name string) (string, error)
- func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func WaitForStatus(c *gophercloud.ServiceClient, id, status string, secs int) error
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteMetadataKeyResult
- type DeleteResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type MetadataKeyOpts
- type MetadataKeyOptsBuilder
- type MetadataKeyResult
- type MetadataOpts
- type MetadataOptsBuilder
- type MetadataResult
- type Snapshot
- type SnapshotList
- type SnapshotPage
- type UpdateMetadataOpts
- type UpdateMetadataOptsBuilder
- type UpdateMetadataResult
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Detail ¶ added in v1.0.21
func Detail(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
func IDFromName ¶
func IDFromName(client *gophercloud.ServiceClient, name string) (string, error)
IDFromName is a convienience function that returns a snapshot's ID given its name.
func List ¶
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List returns Snapshots optionally limited by the conditions provided in ListOpts.
func WaitForStatus ¶
func WaitForStatus(c *gophercloud.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 { //Create a snapshot source EVS UUID. VolumeID string `json:"volume_id" required:"true"` //Forced to create a snapshot, the default is false. Force bool `json:"force,omitempty"` //Snapshot name Name string `json:"name,omitempty"` //Snapshot description Description string `json:"description,omitempty"` //Metadata information of the cloud disk snapshot. Metadata map[string]string `json:"metadata,omitempty"` }
CreateOpts contains options for creating a Snapshot. This object is passed to the snapshots.Create function. For more information about these parameters, see the Snapshot object.
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 DeleteMetadataKeyResult ¶ added in v1.0.21
type DeleteMetadataKeyResult struct {
gophercloud.ErrResult
}
DeleteMetadataResult contains the response body and error from a DeleteMetadata request.
func DeleteMetadataKey ¶ added in v1.0.21
func DeleteMetadataKey(client *gophercloud.ServiceClient, id, key string) (r DeleteMetadataKeyResult)
DeleteMetadataKey delete specific key in metadata
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 the existing Snapshot with the provided ID.
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 retrieves the Snapshot with the provided ID. To extract the Snapshot object from the response, call the Extract method on the GetResult.
type ListOpts ¶
type ListOpts struct { // Name will filter by the specified snapshot name. Name string `q:"name"` // Status will filter by the specified status. Status string `q:"status"` // VolumeID will filter by a specified volume ID. VolumeID string `q:"volume_id"` //Used when paginating snapshots, used in conjunction with limit. Offset int `q:"offset"` //Returns the number of results limit, an integer greater than 0. The default is 1000. Limit int `q:"limit"` AvailabilityZone string `q:"availability_zone"` }
ListOpts hold 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 MetadataKeyOpts ¶ added in v1.0.21
func (MetadataKeyOpts) ToSnapshotMetadataKeyMap ¶ added in v1.0.21
func (opts MetadataKeyOpts) ToSnapshotMetadataKeyMap() (map[string]interface{}, error)
type MetadataKeyOptsBuilder ¶ added in v1.0.21
type MetadataKeyResult ¶ added in v1.0.21
type MetadataKeyResult struct {
// contains filtered or unexported fields
}
func GetMetadataKey ¶ added in v1.0.21
func GetMetadataKey(client *gophercloud.ServiceClient, id, key string) (r MetadataKeyResult)
GetMetadataKey return specific key value in metadata.
func UpdateMetadataKey ¶ added in v1.0.21
func UpdateMetadataKey(client *gophercloud.ServiceClient, id, key string, opts MetadataKeyOptsBuilder) (r MetadataKeyResult)
UpdateMetadataKey update sepcific key to the given map key value.
func (MetadataKeyResult) Extract ¶ added in v1.0.21
Extract will get the Snapshot object out of the commonResult object.
func (MetadataKeyResult) ExtractMetadataKey ¶ added in v1.0.21
func (r MetadataKeyResult) ExtractMetadataKey() (map[string]interface{}, error)
type MetadataOpts ¶ added in v1.0.21
MetadataOpts contain options for creating or updating an existing Voulme. This object is passed to the volumes create and update function. For more information about the parameters, see the Snapshot object.
func (MetadataOpts) ToSnapshotMetadataMap ¶ added in v1.0.21
func (opts MetadataOpts) ToSnapshotMetadataMap() (map[string]interface{}, error)
ToSnapshotMetadataMap assembles a request body based on the contents of an MetadataOpts.
type MetadataOptsBuilder ¶ added in v1.0.21
MetadataOptsBuilder allows extensions to add additional parameters to the meatadata requests.
type MetadataResult ¶ added in v1.0.21
type MetadataResult struct {
// contains filtered or unexported fields
}
MetadataResult contains the response body and error from a Metadata request.
func CreateMetadata ¶ added in v1.0.21
func CreateMetadata(client *gophercloud.ServiceClient, id string, opts MetadataOptsBuilder) (r MetadataResult)
CreateMetadata create metadata for Snapshot.
func GetMetadata ¶ added in v1.0.21
func GetMetadata(client *gophercloud.ServiceClient, id string) (r MetadataResult)
GetMetadata returns exist metadata of Snapshot.
func (MetadataResult) Extract ¶ added in v1.0.21
Extract will get the Snapshot object out of the commonResult object.
func (MetadataResult) ExtractMetadata ¶ added in v1.0.21
func (r MetadataResult) ExtractMetadata() (map[string]interface{}, error)
ExtractMetadata returns the metadata from a response from Metadata requests.
type Snapshot ¶
type Snapshot struct { // Unique identifier. ID string `json:"id"` // Date created. CreatedAt time.Time `json:"-"` // Date updated. UpdatedAt time.Time `json:"-"` // Display name. Name string `json:"name"` // Display description. Description string `json:"description"` // ID of the Volume from which this Snapshot was created. VolumeID string `json:"volume_id"` // Currect status of the Snapshot. Status string `json:"status"` // Size of the Snapshot, in GB. Size int `json:"size"` // User-defined key-value pairs. Metadata map[string]string `json:"metadata"` // ID of Project ProjectID string `json:"os-extended-snapshot-attributes:project_id"` // Progress of snapshot Progress string `json:"os-extended-snapshot-attributes:progress"` }
Snapshot contains all the information associated with a Cinder Snapshot.
func (*Snapshot) UnmarshalJSON ¶
type SnapshotList ¶
type SnapshotList struct { Snapshots []Snapshot `json:"snapshots"` SnapshotsLinks []map[string]string `json:"snapshots_links"` }
func ExtractSnapshots ¶
func ExtractSnapshots(r pagination.Page) (SnapshotList, error)
ExtractSnapshots extracts and returns Snapshots. It is used while iterating over a snapshots.List call.
type SnapshotPage ¶
type SnapshotPage struct {
pagination.SinglePageBase
}
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 returns true if a SnapshotPage contains no Snapshots.
type UpdateMetadataOpts ¶
type UpdateMetadataOpts struct {
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
UpdateMetadataOpts contain options for updating an existing Snapshot. This object is passed to the snapshots.Update function. For more information about the parameters, see the Snapshot object.
func (UpdateMetadataOpts) ToSnapshotUpdateMetadataMap ¶
func (opts UpdateMetadataOpts) ToSnapshotUpdateMetadataMap() (map[string]interface{}, error)
ToSnapshotUpdateMetadataMap assembles a request body based on the contents of an UpdateMetadataOpts.
type UpdateMetadataOptsBuilder ¶
type UpdateMetadataOptsBuilder interface {
ToSnapshotUpdateMetadataMap() (map[string]interface{}, error)
}
UpdateMetadataOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateMetadataResult ¶
type UpdateMetadataResult struct {
// contains filtered or unexported fields
}
UpdateMetadataResult contains the response body and error from an UpdateMetadata request.
func UpdateMetadata ¶
func UpdateMetadata(client *gophercloud.ServiceClient, id string, opts UpdateMetadataOptsBuilder) (r UpdateMetadataResult)
UpdateMetadata will update the Snapshot with provided information. To extract the updated Snapshot from the response, call the ExtractMetadata method on the UpdateMetadataResult.
func (UpdateMetadataResult) Extract ¶
Extract will get the Snapshot object out of the commonResult object.
func (UpdateMetadataResult) ExtractMetadata ¶
func (r UpdateMetadataResult) ExtractMetadata() (map[string]interface{}, error)
ExtractMetadata returns the metadata from a response from snapshots.UpdateMetadata.
type UpdateOpts ¶ added in v1.0.21
type UpdateOpts struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` DisplayName string `json:"display_name,omitempty"` DisplayDescription string `json:"display_description,omitempty"` }
func (UpdateOpts) ToSnapshotUpdateMap ¶ added in v1.0.21
func (opts UpdateOpts) ToSnapshotUpdateMap() (map[string]interface{}, error)
type UpdateOptsBuilder ¶ added in v1.0.21
type UpdateResult ¶ added in v1.0.21
type UpdateResult struct {
// contains filtered or unexported fields
}
func Update ¶ added in v1.0.21
func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)