Documentation ¶
Index ¶
- type Client
- func (c *Client) CreateSnapshot(args CreateSnapshotSnapshotParams) (*CreateSnapshotResults, error)
- func (c *Client) CreateVolume(args CreateVolumeVolumeParams) (*CreateVolumeResults, error)
- func (c *Client) CreateVolumeType(args CreateVolumeTypeVolumeTypeParams) (*CreateVolumeTypeResults, error)
- func (c *Client) DeleteSnapshot(snapshotId string) error
- func (c *Client) DeleteVolume(volumeId string) error
- func (c *Client) DeleteVolumeType(volumeTypeId string) error
- func (c *Client) GetSnapshot(snapshotId string) (*GetSnapshotResults, error)
- func (c *Client) GetSnapshotsDetail() (*GetSnapshotsDetailResults, error)
- func (c *Client) GetSnapshotsSimple() (*GetSnapshotsSimpleResults, error)
- func (c *Client) GetVolume(volumeId string) (*GetVolumeResults, error)
- func (c *Client) GetVolumeType(volumeTypeId string) (*GetVolumeTypeResults, error)
- func (c *Client) GetVolumeTypes() (*GetVolumeTypesResults, error)
- func (c *Client) GetVolumesDetail() (*GetVolumesDetailResults, error)
- func (c *Client) GetVolumesSimple() (*GetVolumesSimpleResults, error)
- func (c *Client) ListExtensionsCinderV2() (*ListExtensionsCinderV2Results, error)
- func (c *Client) ListVersions() (*ListVersionsResults, error)
- func (c *Client) SetVolumeMetadata(volumeId string, metadata map[string]string) (map[string]string, error)
- func (c *Client) ShowSnapshotMetadata(snapshotId string) (*ShowSnapshotMetadataResults, error)
- func (c *Client) SnapshotStatusNotifier(snapId, status string, numAttempts int, waitDur time.Duration) <-chan error
- func (c *Client) UpdateSnapshot(snapshotId string, args UpdateSnapshotSnapshotParams) (*UpdateSnapshotResults, error)
- func (c *Client) UpdateSnapshotMetadata(snapshotId, key string) (*UpdateSnapshotMetadataResults, error)
- func (c *Client) UpdateVolume(volumeId string, args UpdateVolumeVolumeParams) (*UpdateVolumeResults, error)
- func (c *Client) UpdateVolumeType(volumeTypeId, volumeType string) (*UpdateVolumeTypeResults, error)
- func (c *Client) UpdateVolumeTypeExtraSpecs(volumeTypeId, volumeType, extraSpecs string) (*UpdateVolumeTypeExtraSpecsResults, error)
- func (c *Client) VersionDetails() (*VersionDetailsResults, error)
- func (c *Client) VolumeStatusNotifier(volId, status string, numAttempts int, waitDur time.Duration) <-chan error
- type CreateSnapshotParams
- type CreateSnapshotResults
- type CreateSnapshotSnapshotParams
- type CreateVolumeParams
- type CreateVolumeResults
- type CreateVolumeTypeParams
- type CreateVolumeTypeResults
- type CreateVolumeTypeVolumeTypeExtraSpecsParams
- type CreateVolumeTypeVolumeTypeParams
- type CreateVolumeVolumeParams
- type DeleteSnapshotParams
- type DeleteSnapshotResults
- type DeleteVolumeParams
- type DeleteVolumeResults
- type DeleteVolumeTypeParams
- type DeleteVolumeTypeResults
- type Extension
- type GetSnapshotParams
- type GetSnapshotResults
- type GetSnapshotsDetailParams
- type GetSnapshotsDetailResults
- type GetSnapshotsSimpleParams
- type GetSnapshotsSimpleResults
- type GetVolumeParams
- type GetVolumeResults
- type GetVolumeTypeParams
- type GetVolumeTypeResults
- type GetVolumeTypesParams
- type GetVolumeTypesResults
- type GetVolumesDetailParams
- type GetVolumesDetailResults
- type GetVolumesSimpleParams
- type GetVolumesSimpleResults
- type ListExtensionsCinderV2Params
- type ListExtensionsCinderV2Results
- type ListVersionsParams
- type ListVersionsResults
- type RequestHandlerFn
- type ShowSnapshotMetadataParams
- type ShowSnapshotMetadataResults
- type Snapshot
- type TokenFn
- type UpdateSnapshotMetadataMetadataParams
- type UpdateSnapshotMetadataParams
- type UpdateSnapshotMetadataResults
- type UpdateSnapshotParams
- type UpdateSnapshotResults
- type UpdateSnapshotSnapshotParams
- type UpdateVolumeMetadataParams
- type UpdateVolumeParams
- type UpdateVolumeResults
- type UpdateVolumeTypeExtraSpecsParams
- type UpdateVolumeTypeExtraSpecsResults
- type UpdateVolumeTypeParams
- type UpdateVolumeTypeResults
- type UpdateVolumeVolumeParams
- type Version
- type VersionDetailsParams
- type VersionDetailsResults
- type Volume
- type VolumeAttachment
- type VolumeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Cinder client.
func Basic ¶
Basic returns a basic Cinder client which will handle authorization of requests, and routing to the correct endpoint.
func NewClient ¶
func NewClient(tenantId string, endpoint *url.URL, handleRequest RequestHandlerFn) *Client
NewClient is the most flexible way to instantiate a Cinder Client. The handleRequest function will be responsible for modifying requests and dispatching them as needed. For an example of how to utilize this method, see the Basic function.
func (*Client) CreateSnapshot ¶
func (c *Client) CreateSnapshot(args CreateSnapshotSnapshotParams) (*CreateSnapshotResults, error)
CreateSnapshot creates a snapshot, which is a point-in-time complete copy of a volume. You can create a volume from the snapshot.
func (*Client) CreateVolume ¶
func (c *Client) CreateVolume(args CreateVolumeVolumeParams) (*CreateVolumeResults, error)
CreateVolume creates a volume. To create a bootable volume, include the image ID and set the bootable flag to true in the request body.
Preconditions:
- The user must have enough volume storage quota remaining to create a volume of size requested.
Asynchronous Postconditions:
- With correct permissions, you can see the volume status as available through API calls.
- With correct access, you can see the created volume in the storage system that OpenStack Block Storage manages.
Troubleshooting:
- If volume status remains creating or shows another error status, the request failed. Ensure you meet the preconditions then investigate the storage backend.
- Volume is not created in the storage system which OpenStack Block Storage manages.
- The storage node needs enough free storage space to match the specified size of the volume creation request.
func (*Client) CreateVolumeType ¶
func (c *Client) CreateVolumeType(args CreateVolumeTypeVolumeTypeParams) (*CreateVolumeTypeResults, error)
CreateVolumeType creates a volume type.
func (*Client) DeleteSnapshot ¶
DeleteSnapshot deletes a specified snapshot.
func (*Client) DeleteVolume ¶
DeleteVolume flags a volume for deletion. The volume managed by OpenStack Block Storage is not deleted from the storage system.
func (*Client) DeleteVolumeType ¶
DeleteVolumeType deletes a specified volume type.
func (*Client) GetSnapshot ¶
func (c *Client) GetSnapshot(snapshotId string) (*GetSnapshotResults, error)
GetSnapshot shows information for a specified snapshot.
func (*Client) GetSnapshotsDetail ¶
func (c *Client) GetSnapshotsDetail() (*GetSnapshotsDetailResults, error)
GetSnapshotsDetail lists detailed information for all Block Storage snapshots that the tenant who submits the request can access.
func (*Client) GetSnapshotsSimple ¶
func (c *Client) GetSnapshotsSimple() (*GetSnapshotsSimpleResults, error)
GetSnapshotsSimple lists summary information for all Block Storage snapshots that the tenant who submits the request can access.
func (*Client) GetVolume ¶
func (c *Client) GetVolume(volumeId string) (*GetVolumeResults, error)
GetVolume lists information about the volume with the given volumeId.
func (*Client) GetVolumeType ¶
func (c *Client) GetVolumeType(volumeTypeId string) (*GetVolumeTypeResults, error)
GetVolumeType shows information about a specified volume type.
func (*Client) GetVolumeTypes ¶
func (c *Client) GetVolumeTypes() (*GetVolumeTypesResults, error)
GetVolumeTypes lists volume types.
func (*Client) GetVolumesDetail ¶
func (c *Client) GetVolumesDetail() (*GetVolumesDetailResults, error)
GetVolumesDetail lists detailed information for all Block Storage volumes that the tenant who submits the request can access.
func (*Client) GetVolumesSimple ¶
func (c *Client) GetVolumesSimple() (*GetVolumesSimpleResults, error)
GetVolumesSimple lists summary information for all Block Storage volumes that the tenant who submits the request can access.
func (*Client) ListExtensionsCinderV2 ¶
func (c *Client) ListExtensionsCinderV2() (*ListExtensionsCinderV2Results, error)
ListExtensionsCinderV2 lists Block Storage API extensions.
func (*Client) ListVersions ¶
func (c *Client) ListVersions() (*ListVersionsResults, error)
ListVersion lists information about all Block Storage API versions.
func (*Client) SetVolumeMetadata ¶
func (c *Client) SetVolumeMetadata(volumeId string, metadata map[string]string) (map[string]string, error)
SetVolumeMetadata sets metadata on a server. Replaces metadata items that match keys - doesn't modify items that aren't in the request. Returns the complete, updated metadata for the volume.
func (*Client) ShowSnapshotMetadata ¶
func (c *Client) ShowSnapshotMetadata(snapshotId string) (*ShowSnapshotMetadataResults, error)
ShowSnapshotMetadata shows the metadata for a specified snapshot.
func (*Client) SnapshotStatusNotifier ¶
func (c *Client) SnapshotStatusNotifier(snapId, status string, numAttempts int, waitDur time.Duration) <-chan error
SnapshotStatusNotifier will check a volume's status to determine whether it matches the given status. After a check, it waits for "waitDur" before attempting again. If the status does not match after "numAttempts", an error is returned.
func (*Client) UpdateSnapshot ¶
func (c *Client) UpdateSnapshot(snapshotId string, args UpdateSnapshotSnapshotParams) (*UpdateSnapshotResults, error)
UpdateSnapshot updates a specified snapshot.
func (*Client) UpdateSnapshotMetadata ¶
func (c *Client) UpdateSnapshotMetadata(snapshotId, key string) (*UpdateSnapshotMetadataResults, error)
UpdateSnapshotMetadata updates the metadata for a specified snapshot.
func (*Client) UpdateVolume ¶
func (c *Client) UpdateVolume(volumeId string, args UpdateVolumeVolumeParams) (*UpdateVolumeResults, error)
UpdateVolume updates a volume.
func (*Client) UpdateVolumeType ¶
func (c *Client) UpdateVolumeType(volumeTypeId, volumeType string) (*UpdateVolumeTypeResults, error)
UpdateVolumeType updates a volume type.
func (*Client) UpdateVolumeTypeExtraSpecs ¶
func (c *Client) UpdateVolumeTypeExtraSpecs(volumeTypeId, volumeType, extraSpecs string) (*UpdateVolumeTypeExtraSpecsResults, error)
UpdateVolumeTypeExtraSpecs updates the extra specifications assigned to a volume type.
func (*Client) VersionDetails ¶
func (c *Client) VersionDetails() (*VersionDetailsResults, error)
VersionDetails shows details for Block Storage API v2.
func (*Client) VolumeStatusNotifier ¶
func (c *Client) VolumeStatusNotifier(volId, status string, numAttempts int, waitDur time.Duration) <-chan error
VolumeStatusNotifier will check a volume's status to determine whether it matches the given status. After a check, it waits for "waitDur" before attempting again. If the status does not match after "numAttempts", an error is returned.
type CreateSnapshotParams ¶
type CreateSnapshotParams struct { // Snapshot is required. // A partial representation of a snapshot used in the creation process. Snapshot CreateSnapshotSnapshotParams `json:"snapshot"` // // The unique identifier of the tenant or account. TenantId string `json:"-"` }
type CreateSnapshotResults ¶
type CreateSnapshotResults struct {
Snapshot Snapshot `json:"snapshot"`
}
type CreateSnapshotSnapshotParams ¶
type CreateSnapshotSnapshotParams struct { // [True/False] Indicate whether to snapshot, even if the volume is attached. Default==False. Force bool `json:"force,omitempty"` // Name of the snapshot. The default is None. Name string `json:"name,omitempty"` // Description of the snapshot. The default is None. Description string `json:"description,omitempty"` // VolumeId is required. // To create a snapshot from an existing volume, specify the ID of the existing volume. VolumeId string `json:"volume_id"` }
type CreateVolumeParams ¶
type CreateVolumeParams struct { Volume CreateVolumeVolumeParams `json:"volume"` // // The unique identifier of the tenant or account. TenantId string `json:"-"` }
type CreateVolumeResults ¶
type CreateVolumeResults struct {
Volume Volume `json:"volume"`
}
type CreateVolumeTypeParams ¶
type CreateVolumeTypeParams struct { // VolumeType is required. // A partial representation of a volume type used in the creation process. VolumeType CreateVolumeTypeVolumeTypeParams `json:"volume_type"` // // The unique identifier of the tenant or account. TenantId string `json:"-"` }
type CreateVolumeTypeResults ¶
type CreateVolumeTypeResults struct {
VolumeType VolumeType `json:"volume_type"`
}
type CreateVolumeTypeVolumeTypeExtraSpecsParams ¶
type CreateVolumeTypeVolumeTypeExtraSpecsParams struct {
Capabilities string `json:"capabilities,omitempty"`
}
type CreateVolumeTypeVolumeTypeParams ¶
type CreateVolumeTypeVolumeTypeParams struct { // The name of the volume type. Name string `json:"name,omitempty"` ExtraSpecs CreateVolumeTypeVolumeTypeExtraSpecsParams `json:"extra_specs,omitempty"` }
type CreateVolumeVolumeParams ¶
type CreateVolumeVolumeParams struct { // To create a volume from an existing volume, specify the ID of the existing volume. If specified, the volume is created with same size of the source volume. SourceVolid string `json:"source_volid,omitempty"` // To create a volume from an existing snapshot, specify the ID of the existing volume snapshot. If specified, the volume is created in same availability zone and with same size of the snapshot. SnapshotId string `json:"snapshot_id,omitempty"` // The ID of the image from which you want to create the volume. Required to create a bootable volume. ImageRef string `json:"imageRef,omitempty"` // The associated volume type. VolumeType string `json:"volume_type,omitempty"` // Enables or disables the bootable attribute. You can boot an instance from a bootable volume. Bootable bool `json:"bootable,omitempty"` // One or more metadata key and value pairs to associate with the volume. Metadata interface{} `json:"metadata,omitempty"` // The availability zone. AvailabilityZone string `json:"availability_zone,omitempty"` // The volume description. Description string `json:"description,omitempty"` // Size is required. // The size of the volume, in GBs. Size int `json:"size"` // The volume name. Name string `json:"name,omitempty"` }
type DeleteSnapshotParams ¶
type DeleteSnapshotResults ¶
type DeleteSnapshotResults struct { }
type DeleteVolumeParams ¶
type DeleteVolumeResults ¶
type DeleteVolumeResults struct { }
type DeleteVolumeTypeParams ¶
type DeleteVolumeTypeResults ¶
type DeleteVolumeTypeResults struct { }
type GetSnapshotParams ¶
type GetSnapshotResults ¶
type GetSnapshotResults struct {
Snapshot Snapshot `json:"snapshot"`
}
type GetSnapshotsDetailParams ¶
type GetSnapshotsDetailParams struct { // // The unique identifier of the tenant or account. TenantId string `json:"-"` }
type GetSnapshotsDetailResults ¶
type GetSnapshotsDetailResults struct {
Snapshots []Snapshot `json:"snapshots"`
}
type GetSnapshotsSimpleParams ¶
type GetSnapshotsSimpleParams struct { // // The unique identifier of the tenant or account. TenantId string `json:"-"` }
type GetSnapshotsSimpleResults ¶
type GetSnapshotsSimpleResults struct {
Snapshots []Snapshot `json:"snapshots"`
}
type GetVolumeParams ¶
type GetVolumeResults ¶
type GetVolumeResults struct {
Volume Volume `json:"volume"`
}
type GetVolumeTypeParams ¶
type GetVolumeTypeResults ¶
type GetVolumeTypeResults struct {
VolumeType VolumeType `json:"volume_type"`
}
type GetVolumeTypesParams ¶
type GetVolumeTypesParams struct { // // The unique identifier of the tenant or account. TenantId string `json:"-"` }
type GetVolumeTypesResults ¶
type GetVolumeTypesResults struct {
VolumeTypes []VolumeType `json:"volume_types"`
}
type GetVolumesDetailParams ¶
type GetVolumesDetailParams struct { // // The unique identifier of the tenant or account. TenantId string `json:"-"` }
type GetVolumesDetailResults ¶
type GetVolumesDetailResults struct {
Volumes []Volume `json:"volumes"`
}
type GetVolumesSimpleParams ¶
type GetVolumesSimpleParams struct { // // The unique identifier of the tenant or account. TenantId string `json:"-"` }
type GetVolumesSimpleResults ¶
type GetVolumesSimpleResults struct {
Volumes []Volume `json:"volumes"`
}
type ListExtensionsCinderV2Params ¶
type ListExtensionsCinderV2Params struct { }
type ListExtensionsCinderV2Results ¶
type ListExtensionsCinderV2Results struct {
Extensions []Extension `json:"extensions"`
}
type ListVersionsParams ¶
type ListVersionsParams struct { }
type ListVersionsResults ¶
type ListVersionsResults struct {
Versions []Version `json:"versions"`
}
type RequestHandlerFn ¶
RequestHandlerFn specifies a function signature which wadl2go will use to process the http.Request. What this means is up to the implementor.
func SetAuthHeaderFn ¶
func SetAuthHeaderFn(token TokenFn, wrappedHandler RequestHandlerFn) RequestHandlerFn
SetAuthHeaderFn returns a RequestHandlerFn which sets the authentication headers for a given request.
type ShowSnapshotMetadataResults ¶
type ShowSnapshotMetadataResults struct {
Snapshot Snapshot `json:"snapshot"`
}
type Snapshot ¶
type Snapshot struct { CreatedAt string `json:"created_at"` Description string `json:"description"` ID string `json:"id"` Metadata struct { Key string `json:"key"` } `json:"metadata"` Name string `json:"name"` Size int `json:"size"` Status string `json:"status"` VolumeID string `json:"volume_id"` Os_Extended_Snapshot_Attributes_Progress string `json:"os-extended-snapshot-attributes:progress"` Os_Extended_Snapshot_Attributes_ProjectID string `json:"os-extended-snapshot-attributes:project_id"` }
type TokenFn ¶
type TokenFn func() string
TokenFn represents a function signature which returns the user's authorization token when called.
type UpdateSnapshotMetadataMetadataParams ¶
type UpdateSnapshotMetadataMetadataParams struct {
Key string `json:"key"`
}
type UpdateSnapshotMetadataParams ¶
type UpdateSnapshotMetadataParams struct { // Metadata is required. // One or more metadata key and value pairs to set or unset for the snapshot. To unset a metadata key value, specify only the key name. To set a metadata key value, specify the key and value pair. The Block Storage server does not respect case-sensitive key names. For example, if you specify both "key": "v1" and "KEY": "V1", the server sets and returns only the KEY key and value pair. Metadata UpdateSnapshotMetadataMetadataParams `json:"metadata"` // // The unique identifier of the tenant or account. TenantId string `json:"-"` // SnapshotId is required. // // The unique identifier of an existing snapshot. SnapshotId string `json:"-"` }
type UpdateSnapshotMetadataResults ¶
type UpdateSnapshotMetadataResults struct { Metadata struct { Key string `json:"key"` } `json:"metadata"` }
type UpdateSnapshotParams ¶
type UpdateSnapshotParams struct { Snapshot UpdateSnapshotSnapshotParams `json:"snapshot"` // // The unique identifier of the tenant or account. TenantId string `json:"-"` // SnapshotId is required. // // The unique identifier of an existing snapshot. SnapshotId string `json:"-"` }
type UpdateSnapshotResults ¶
type UpdateSnapshotResults struct {
Snapshot Snapshot `json:"snapshot"`
}
type UpdateVolumeParams ¶
type UpdateVolumeParams struct { Volume UpdateVolumeVolumeParams `json:"volume"` // // The unique identifier of the tenant or account. TenantId string `json:"-"` // VolumeId is required. // // The unique identifier of an existing volume. VolumeId string `json:"-"` }
type UpdateVolumeResults ¶
type UpdateVolumeResults struct {
Volume Volume `json:"volume"`
}
type UpdateVolumeTypeExtraSpecsParams ¶
type UpdateVolumeTypeExtraSpecsParams struct { // VolumeType is required. // // A volume type offers a way to categorize or group volumes. VolumeType string `json:"volume_type"` // ExtraSpecs is required. // // A key:value pair that offers a way to show additional specifications associated with the volume type. Examples include capabilities, capacity, compression, and so on, depending on the storage driver in use. ExtraSpecs string `json:"extra_specs"` // // The unique identifier of the tenant or account. TenantId string `json:"-"` // VolumeTypeId is required. // // The unique identifier for an existing volume type. VolumeTypeId string `json:"-"` }
type UpdateVolumeTypeExtraSpecsResults ¶
type UpdateVolumeTypeExtraSpecsResults struct {
VolumeType VolumeType `json:"volume_type"`
}
type UpdateVolumeTypeParams ¶
type UpdateVolumeTypeParams struct { // VolumeType is required. // // A volume type offers a way to categorize or group volumes. VolumeType string `json:"volume_type"` // // The unique identifier of the tenant or account. TenantId string `json:"-"` // VolumeTypeId is required. // // The unique identifier for an existing volume type. VolumeTypeId string `json:"-"` }
type UpdateVolumeTypeResults ¶
type UpdateVolumeTypeResults struct {
VolumeType VolumeType `json:"volume_type"`
}
type VersionDetailsParams ¶
type VersionDetailsParams struct { }
type VersionDetailsResults ¶
type VersionDetailsResults struct {
Version Version `json:"version"`
}
type Volume ¶
type Volume struct { Attachments []VolumeAttachment `json:"attachments"` AvailabilityZone string `json:"availability_zone"` Bootable string `json:"bootable"` CreatedAt string `json:"created_at"` Description string `json:"description"` ID string `json:"id"` Links []struct { Href string `json:"href"` Rel string `json:"rel"` } `json:"links"` Metadata map[string]string `json:"metadata"` Name string `json:"name"` Os_Vol_Host_Attr_Host string `json:"os-vol-host-attr:host"` Os_Vol_Tenant_Attr_TenantID string `json:"os-vol-tenant-attr:tenant_id"` Size int `json:"size"` SnapshotID interface{} `json:"snapshot_id"` SourceVolid interface{} `json:"source_volid"` Status string `json:"status"` VolumeType string `json:"volume_type"` }