model

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2018 License: Apache-2.0 Imports: 4 Imported by: 38

Documentation

Index

Constants

View Source
const (
	// ErrorBadRequest
	ErrorBadRequest = 400
	// ErrorUnauthorized
	ErrorUnauthorized = 401
	// ErrorForbidden
	ErrorForbidden = 403
	// ErrorNotFound
	ErrorNotFound = 404
	// ErrorInternalServer
	ErrorInternalServer = 500
	// ErrorNotImplemented
	ErrorNotImplemented = 501
)
View Source
const (
	VOLUME_CREATING           = "creating"
	VOLUME_AVAILABLE          = "available"
	VOLUME_RESERVED           = "reserved"
	VOLUME_ATTACHING          = "attaching"
	VOLUME_DETACHING          = "detaching"
	VOLUME_IN_USE             = "inUse"
	VOLUME_DELETING           = "deleting"
	VOLUME_ERROR              = "error"
	VOLUEM_ERROR_DELETING     = "errorDeleting"
	VOLUME_ERROR_EXTENDING    = "errorExtending"
	VOLUME_EXTENDING          = "extending"
	VOLUMESNAP_CREATING       = "creating"
	VOLUMESNAP_AVAILABLE      = "available"
	VOLUMESNAP_DELETING       = "deleting"
	VOLUMESNAP_ERROR          = "error"
	VOLUMESNAP_ERROR_DELETING = "errorDeleting"
	VOLUMESNAP_DELETED        = "deleted"
	VOLUMEATM_CREATING        = "creating"
	VOLUMEATM_AVAILABLE       = "available"
	VOLUMEATM_ERROR_DELETING  = "errorDeleting"
	VOLUMEATM_ERROR           = "error"
)

volume status

Variables

This section is empty.

Functions

func Current

func Current() string

func CurrentVersion

func CurrentVersion() string

func Deprecated

func Deprecated() string

func ErrorBadRequestStatus

func ErrorBadRequestStatus(message string) []byte

ErrorBadRequestStatus

func ErrorForbiddenStatus

func ErrorForbiddenStatus(message string) []byte

ErrorForbiddenStatus

func ErrorInternalServerStatus

func ErrorInternalServerStatus(message string) []byte

ErrorInternalServerStatus

func ErrorNotFoundStatus

func ErrorNotFoundStatus(message string) []byte

ErrorNotFoundStatus

func ErrorNotImplementedStatus

func ErrorNotImplementedStatus(message string) []byte

ErrorNotImplementedStatus

func ErrorUnauthorizedStatus

func ErrorUnauthorizedStatus(message string) []byte

ErrorUnauthorizedStatus

func HttpError added in v0.1.4

func HttpError(ctx *context.Context, code int, format string, a ...interface{}) error

func Supported

func Supported() string

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 DataProtectionLos added in v0.1.6

type DataProtectionLos struct{}

DataProtectionLoS describes a replica that protects data from loss. The requirements must be met collectively by the communication path and the replica. Currently it's empty.

type DataStorageLoS added in v0.1.6

type DataStorageLoS struct {
	// The enumeration literal specifies the time after a disaster that the
	// client shall regain conformant service level access to the primary
	// store.
	// The expectation is that the services required to implement this
	// capability are part of the advertising system.
	// +units:min
	RecoveryTimeObjective int64 `json:"recoveryTimeObjective,omitempty" yaml:"recoveryTimeObjective,omitempty"`

	// ProvisioningPolicy only supports "Fixed" and "Thin".
	ProvisioningPolicy string `json:"provisioningPolicy,omitempty" yaml:"provisioningPolicy,omitempty"`

	// IsSpaceEfficient indicates that the storage is compressed or deduplicated.
	// The default value for this prperty is false.
	IsSpaceEfficient bool `json:"isSpaceEfficient,omitempty" yaml:"isSpaceEfficient,omitempty"`
}

DataStorageLoS can be used to describe a service option covering storage provisioning and availability.

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 ExtendSpec added in v0.1.1

type ExtendSpec struct {
	NewSize int64 `json:"newSize,omitempty"`
}

ExtendSpec ...

type ExtendVolumeSpec added in v0.1.1

type ExtendVolumeSpec struct {
	Extend ExtendSpec `json:"extend,omitempty"`
}

ExtendVolumeSpec ...

type ExtraSpec

type ExtraSpec map[string]interface{}

ExtraSpec is a dictionary object that contains unique keys and json objects.

func (ExtraSpec) Encode

func (ext ExtraSpec) Encode() []byte

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 IOConnectivityLoS added in v0.1.6

type IOConnectivityLoS struct {
	// The Enumeration Literal shall specify the Access protocol for this
	// service option.
	AccessProtocol string `json:"accessProtocol,omitempty" yaml:"accessProtocol,omitempty"`

	// MaxIOPS shall be the maximum IOs per second that the connection shall
	// allow for the selected access protocol.
	// +units:[IO]/s
	MaxIOPS int64 `json:"maxIOPS,omitempty" yaml:"maxIOPS,omitempty"`

	// MaxBWS shall be the maximum amount of data that can be transmitted in a
	// fixed amount of time.
	// +units:[MB]/s
	MaxBWS int64 `json:"maxBWS,omitempty" yaml:"maxBWS,omitempty"`
}

IOConnectivityLoS can be used to specify the characteristics of storage connectivity.

type ProfileSpec

type ProfileSpec struct {
	*BaseModel
	// The uuid of project
	// + readOnly
	TenantId string `json:"TenantId"`

	// 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 specs
	// 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 StoragePoolExtraSpec added in v0.1.6

type StoragePoolExtraSpec struct {
	// DataStorage represents suggested some data storage capabilities.
	DataStorage DataStorageLoS `json:"dataStorage,omitempty" yaml:"dataStorage,omitempty"`
	// IOConnectivity represents some suggested IO connectivity capabilities.
	IOConnectivity IOConnectivityLoS `json:"ioConnectivity,omitempty" yaml:"ioConnectivity,omitempty"`
	// DataProtection represents some suggested data protection capabilities.
	DataProtection DataProtectionLos `json:"dataProtection,omitempty" yaml:"dataProtection,omitempty"`

	// Besides those basic suggested pool properties above, vendors can configure
	// some advanced features (diskType, IOPS, throughout, latency, etc)
	// themselves, all these properties can be exposed to controller scheduler
	// and filtered by selector in a extensible way.
	Advanced map[string]interface{} `json:"advanced,omitempty" yaml:"advanced,omitempty"`
}

type StoragePoolSpec

type StoragePoolSpec struct {
	*BaseModel
	// The uuid of project
	// + readOnly
	TenantId string `json:"tenantId"`

	// 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 storage pool.
	// One of: "block", "file" or "object".
	StorageType string `json:"storageType,omitempty"`

	// Map of keys and StoragePoolExtraSpec object that represents the properties
	// of the pool, such as supported capabilities.
	// +optional
	Extras StoragePoolExtraSpec `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.
	TenantId string `json:"tenantId,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.
	TenantId string `json:"tenantId,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.
	TenantId string `json:"tenantId,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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL