Documentation ¶
Index ¶
- Constants
- func Current() string
- func CurrentVersion() string
- func Deprecated() string
- func ErrorBadRequestStatus(message string) []byte
- func ErrorForbiddenStatus(message string) []byte
- func ErrorInternalServerStatus(message string) []byte
- func ErrorNotFoundStatus(message string) []byte
- func ErrorNotImplementedStatus(message string) []byte
- func ErrorUnauthorizedStatus(message string) []byte
- func Supported() string
- type BaseModel
- type ConnectionInfo
- type DockSpec
- type ErrorSpec
- type ExtraSpec
- type HostInfo
- type ProfileSpec
- type StoragePoolSpec
- type VersionSpec
- type VolumeAttachmentSpec
- type VolumeSnapshotSpec
- type VolumeSpec
Constants ¶
const ( // ErrorBadRequest ErrorBadRequest = 400 ErrorUnauthorized = 401 // ErrorForbidden ErrorForbidden = 403 // ErrorNotFound ErrorNotFound = 404 // ErrorInternalServer ErrorInternalServer = 500 // ErrorNotImplemented ErrorNotImplemented = 501 )
Variables ¶
This section is empty.
Functions ¶
func CurrentVersion ¶
func CurrentVersion() string
func Deprecated ¶
func Deprecated() string
func ErrorBadRequestStatus ¶
ErrorBadRequestStatus
func ErrorInternalServerStatus ¶
ErrorInternalServerStatus
func ErrorNotImplementedStatus ¶
ErrorNotImplementedStatus
func ErrorUnauthorizedStatus ¶
ErrorUnauthorizedStatus
Types ¶
type BaseModel ¶
type BaseModel struct { // The uuid of the object, it's unique in the context and generated by system // on successful creation of the object. It's not allowed to be modified by // the user. // +readOnly Id string `json:"id"` // CreateAt representing the server time when the object was created successfully. // Now, it's represented as a time string in RFC8601 format. // +readOnly CreatedAt string `json:"createdAt"` // UpdatedAt representing the server time when the object was updated successfully. // Now, it's represented as a time string in RFC8601 format. // +readOnly UpdatedAt string `json:"updatedAt"` }
type ConnectionInfo ¶
type ConnectionInfo struct { DriverVolumeType string `json:"driverVolumeType,omitempty"` ConnectionData map[string]interface{} `json:"data,omitempty"` AdditionalProperties map[string]interface{} `json:"additionalProperties,omitempty"` }
ConnectionInfo is a structure for all properties of connection when create a volume attachment.
func (*ConnectionInfo) EncodeConnectionData ¶
func (con *ConnectionInfo) EncodeConnectionData() []byte
type DockSpec ¶
type DockSpec struct { *BaseModel // The name of the dock. Name string `json:"name,omitempty"` // The description of the dock. // +optional Description string `json:"description,omitempty"` // The status of the dock. // One of: "available" or "unavailable". Status string `json:"status,omitempty"` // The storage type of the dock. // One of: "block", "file" or "object". StorageType string `json:"storageType,omitempty"` // Endpoint represents the dock server's access address. Endpoint string `json:"endpoint,omitempty"` // DriverName represents the dock provider. // Currently One of: "cinder", "ceph", "lvm", "default". DriverName string `json:"driverName,omitempty"` }
DockSpec is initialized by specific driver configuration. Each backend can be regarded as a docking service between SDS controller and storage service.
type ErrorSpec ¶
type ErrorSpec struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` }
ErrorSpec describes Detailed HTTP error response, which consists of a HTTP status code, and a custom error message unique for each failure case.
type ExtraSpec ¶
type ExtraSpec map[string]interface{}
ExtraSpec is a dictionary object that contains unique keys and json objects.
type HostInfo ¶
type HostInfo struct { Platform string `json:"platform,omitempty"` OsType string `json:"osType,omitempty"` Ip string `json:"ip,omitempty"` Host string `json:"host,omitempty"` Initiator string `json:"initiator,omitempty"` }
HostInfo is a structure for all properties of host when create a volume attachment.
type ProfileSpec ¶
type ProfileSpec struct { *BaseModel // The name of the profile. Name string `json:"name,omitempty"` // The description of the profile. // +optional Description string `json:"description,omitempty"` // The storage type of the profile. // One of: "block", "file" or "object". StorageType string `json:"storageType,omitempty"` // Map of keys and json object that represents the extra epecs // of the profile, such as requested capabilities. // +optional Extras ExtraSpec `json:"extras,omitempty"` }
An OpenSDS profile is identified by a unique name and ID. With adding extra properties, each profile can contains a set of tags of storage capabilities which are desirable features for a class of applications.
type StoragePoolSpec ¶
type StoragePoolSpec struct { *BaseModel // The name of the pool. Name string `json:"name,omitempty"` // The description of the pool. // +optional Description string `json:"description,omitempty"` // The status of the pool. // One of: "available" or "unavailable". Status string `json:"status,omitempty"` // The uuid of the dock which the pool belongs to. DockId string `json:"dockId,omitempty"` // The locality that pool belongs to. AvailabilityZone string `json:"availabilityZone,omitempty"` // The total capacity of the pool. // Default unit of TotalCapacity is GB. TotalCapacity int64 `json:"totalCapacity,omitempty"` // The free capaicty of the pool. // Default unit of FreeCapacity is GB. FreeCapacity int64 `json:"freeCapacity,omitempty"` // The storage type of the dock. // One of: "block", "file" or "object". StorageType string `json:"storageType,omitempty"` // Map of keys and json object that represents the extra epecs // of the pool, such as supported capabilities. // +optional Extras ExtraSpec `json:"extras,omitempty"` }
A pool is discoveried and updated by a dock service. Each pool can be regarded as a physical storage pool or a virtual storage pool. It's a logical and atomic pool and can be abstracted from any storage platform.
type VersionSpec ¶
type VersionSpec struct { // Name is an API version string that consists of a ‘v’ + number, // or ‘v’ + number + ‘alpha’ or ‘beta’ + number. // +readOnly Name string `json:"name,omitempty"` // The status of the api version. // One of: "CURRENT", "SUPPORTED", "DEPRECATED". // +readOnly:true Status string `json:"status,omitempty"` // UpdatedAt representing the server time when the api version was updated // successfully. Now, it's represented as a time string in RFC8601 format. // +readOnly UpdatedAt string `json:"updatedAt,omitempty"` }
An API version is a string that consists of a ‘v’ + number, or ‘v’ + number + ‘alpha’ or ‘beta’ + number.
type VolumeAttachmentSpec ¶
type VolumeAttachmentSpec struct { *BaseModel // The uuid of the project that the volume belongs to. ProjectId string `json:"projectId,omitempty"` // The uuid of the user that the volume belongs to. // +optional UserId string `json:"userId,omitempty"` // The uuid of the volume which the attachment belongs to. VolumeId string `json:"volumeId,omitempty"` // The locaility when the volume was attached to a host. Mountpoint string `json:"mountpoint,omitempty"` // The status of the attachment. // One of: "attaching", "attached", "error", etc. Status string `json:"status,omitempty"` // Metadata should be kept until the scemantics between opensds volume // attachment and backend attached storage resouce description are clear. // +optional Metadata map[string]string `json:"metadata,omitempty"` // See details in `HostInfo` HostInfo `json:"hostInfo,omitempty"` // See details in `ConnectionInfo` ConnectionInfo `json:"connectionInfo,omitempty"` }
VolumeAttachmentSpec is a description of volume attached resource.
type VolumeSnapshotSpec ¶
type VolumeSnapshotSpec struct { *BaseModel // The uuid of the project that the volume snapshot belongs to. ProjectId string `json:"projectId,omitempty"` // The uuid of the user that the volume snapshot belongs to. // +optional UserId string `json:"userId,omitempty"` // The name of the volume snapshot. Name string `json:"name,omitempty"` // The description of the volume snapshot. // +optional Description string `json:"description,omitempty"` // The size of the volume which the snapshot belongs to. // Default unit of volume Size is GB. Size int64 `json:"size,omitempty"` // The status of the volume snapshot. // One of: "available", "error", etc. Status string `json:"status,omitempty"` // The uuid of the volume which the snapshot belongs to. VolumeId string `json:"volumeId,omitempty"` // Metadata should be kept until the scemantics between opensds volume // snapshot and backend storage resouce snapshot description are clear. // +optional Metadata map[string]string `json:"metadata,omitempty"` }
VolumeSnapshotSpec is a description of volume snapshot resource.
type VolumeSpec ¶
type VolumeSpec struct { *BaseModel // The uuid of the project that the volume belongs to. ProjectId string `json:"projectId,omitempty"` // The uuid of the user that the volume belongs to. // +optional UserId string `json:"userId,omitempty"` // The name of the volume. Name string `json:"name,omitempty"` // The description of the volume. // +optional Description string `json:"description,omitempty"` // The size of the volume requested by the user. // Default unit of volume Size is GB. Size int64 `json:"size,omitempty"` // The locality that volume belongs to. AvailabilityZone string `json:"availabilityZone,omitempty"` // The status of the volume. // One of: "available", "error", "in-use", etc. Status string `json:"status,omitempty"` // The uuid of the pool which the volume belongs to. // +readOnly PoolId string `json:"poolId,omitempty"` // The uuid of the profile which the volume belongs to. ProfileId string `json:"profileId,omitempty"` // Metadata should be kept until the scemantics between opensds volume // and backend storage resouce description are clear. // +optional Metadata map[string]string `json:"metadata,omitempty"` }
VolumeSpec is an block device created by storage service, it can be attached to physical machine or virtual machine instance.