Documentation ¶
Index ¶
Constants ¶
View Source
const ( // VolumeTypeStandard represents a general purpose volume. VolumeTypeStandard = "standard" // VolumeTypeHighSpeed represents a high spped volume (randomly select type A or B) VolumeTypeHighSpeed = "high-speed" // VolumeTypeHighSpeedA represents a high speed volume (only use type A). VolumeTypeHighSpeedA = "high-speed-a" // VolumeTypeHighSpeedB represents a high speed volume (only use type B). VolumeTypeHighSpeedB = "high-speed-b" // VolumeTypeFlash represents a flash volume. VolumeTypeFlash = "flash" // VolumeTypeStandardFlash represents a standard flash volume (randomly select type A or B) VolumeTypeStandardFlash = "standard-flash" // VolumeTypeStandardFlashA represents a standard flash volume (only use type A) VolumeTypeStandardFlashA = "standard-flash-a" // VolumeTypeStandardFlashB represents a standard flash volume (only use type B) VolumeTypeStandardFlashB = "standard-flash-b" // VolumeTypeHighSpeedFlash represents a high spped flash volume (randomly select type A or B) VolumeTypeHighSpeedFlash = "high-speed-flash" // VolumeTypeHighSpeedFlashA represents a high spped flash volume (only use type A) VolumeTypeHighSpeedFlashA = "high-speed-flash-a" // VolumeTypeHighSpeedFlashB represents a high spped flash volume (only use type B) VolumeTypeHighSpeedFlashB = "high-speed-flash-b" )
View Source
const ( // AccountingTypeMonthly represents an accounting type monthly. AccountingTypeMonthly = "monthly" // AccountingTypeHourly represents an accounting type hourly. AccountingTypeHourly = "hourly" )
View Source
const ( // DefaultVolumeSize represents the default volume size. DefaultVolumeSize int64 = 100 * util.GiB // DefaultVolumeType specifies which storage to use for newly created volumes. DefaultVolumeType = VolumeTypeStandardFlashA // DefaultVolumeType specifies which storage to use for newly created volumes. DefaultAccountingType = AccountingTypeHourly )
Variables ¶
View Source
var ( // ErrMultiDisks is an error that is returned when multiple // disks are found with the same volume name. ErrMultiDisks = errors.New("Multiple disks with same name") // ErrDiskExistsDiffSize is an error that is returned if a disk with a given // name, but different size, is found. ErrDiskExistsDiffSize = errors.New("There is already a disk with same name and different size") // ErrNotFound is returned when a resource is not found. ErrNotFound = errors.New("Resource was not found") // ErrAlreadyExists is returned when a resource is already existent. ErrAlreadyExists = errors.New("Resource already exists") // ErrInvalidMaxResults is returned when a MaxResults pagination parameter is between 1 and 4 ErrInvalidMaxResults = errors.New("MaxResults parameter must be 0 or greater than or equal to 5") )
View Source
var ( // VolumeTypeMapping converts the volume identifier from volume type. // More info: https://pfs.nifcloud.com/api/rest/CreateVolume.htm AccountingTypeMapping = map[string]types.AccountingTypeOfCreateVolumeRequest{ AccountingTypeMonthly: types.AccountingTypeOfCreateVolumeRequestMonthly, AccountingTypeHourly: types.AccountingTypeOfCreateVolumeRequestHourly, } )
View Source
var ( // VolumeTypeMapping converts the volume identifier from volume type. // More info: https://pfs.nifcloud.com/api/rest/CreateVolume.htm VolumeTypeMapping = map[string]types.DiskTypeOfCreateVolumeRequest{ VolumeTypeStandard: types.DiskTypeOfCreateVolumeRequestStandardStorage, VolumeTypeHighSpeedA: types.DiskTypeOfCreateVolumeRequestHighSpeedStorageA, VolumeTypeHighSpeedB: types.DiskTypeOfCreateVolumeRequestHighSpeedStorageB, VolumeTypeFlash: types.DiskTypeOfCreateVolumeRequestFlashDrive, VolumeTypeStandardFlashA: types.DiskTypeOfCreateVolumeRequestStandardFlashStorageA, VolumeTypeStandardFlashB: types.DiskTypeOfCreateVolumeRequestStandardFlashStorageB, VolumeTypeHighSpeedFlashA: types.DiskTypeOfCreateVolumeRequestHighSpeedFlashStorageA, VolumeTypeHighSpeedFlashB: types.DiskTypeOfCreateVolumeRequestHighSpeedFlashStorageB, } )
Functions ¶
This section is empty.
Types ¶
type Cloud ¶
type Cloud interface { CreateDisk(ctx context.Context, volumeName string, diskOptions *DiskOptions) (disk *Disk, err error) DeleteDisk(ctx context.Context, volumeID string) (success bool, err error) AttachDisk(ctx context.Context, volumeID string, nodeID string) (devicePath string, err error) DetachDisk(ctx context.Context, volumeID string, nodeID string) (err error) ResizeDisk(ctx context.Context, volumeID string, size int64) (newSize int64, err error) ListDisks(ctx context.Context) (disks []*Disk, err error) WaitForAttachmentState(ctx context.Context, volumeID, state string) error GetDiskByName(ctx context.Context, name string, capacityBytes int64) (disk *Disk, err error) GetDiskByID(ctx context.Context, volumeID string) (disk *Disk, err error) IsExistInstance(ctx context.Context, nodeID string) (success bool) GetInstanceByName(ctx context.Context, name string) (*Instance, error) }
Cloud is interface for cloud api manipulator
type Disk ¶
type Disk struct { VolumeID string CapacityGiB int64 AvailabilityZone string AttachedInstanceID string }
Disk represents a NIFCLOUD additional storage
type DiskOptions ¶
DiskOptions represents parameters to create an NIFCLOUD additional storage
Click to show internal directories.
Click to hide internal directories.