Documentation
¶
Index ¶
- func RandomFail(name string, probability uint8) error
- type Config
- type Definition
- type Driver
- func (d *Driver) Allocate(definition string, metadata map[string]interface{}) (string, string, error)
- func (d *Driver) Deallocate(res_id string) error
- func (d *Driver) Name() string
- func (d *Driver) Prepare(config []byte) error
- func (d *Driver) Snapshot(res_id string, full bool) (string, error)
- func (d *Driver) Status(res_id string) string
- func (d *Driver) ValidateDefinition(definition string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomFail ¶
Types ¶
type Config ¶
type Config struct {
FailConfigApply uint8 `json:"fail_config_apply"` // Fail on config Apply (0 - not, 1-254 random, 255-yes)
FailConfigValidate uint8 `json:"fail_config_validate"` // Fail on config Validation (0 - not, 1-254 random, 255-yes)
FailStatus uint8 `json:"fail_status"` // Fail on Status (0 - not, 1-254 random, 255-yes)
FailSnapshot uint8 `json:"fail_snapshot"` // Fail on Snapshot (0 - not, 1-254 random, 255-yes)
FailDeallocate uint8 `json:"fail_deallocate"` // Fail on Deallocate (0 - not, 1-254 random, 255-yes)
ResourcesLimit int `json:"resources_limit"` // How many resources available in the driver (0 unlimited, -1 none)
}
type Definition ¶
type Definition struct {
FailDefinitionApply uint8 `json:"fail_definition_apply"` // Fail on definition Apply (0 - not, 1-254 random, 255-yes)
FailDefinitionValidate uint8 `json:"fail_definition_validate"` // Fail on definition Validate (0 - not, 1-254 random, 255-yes)
FailAllocate uint8 `json:"fail_allocate"` // Fail on Allocate (0 - not, 1-254 random, 255-yes)
}
func (*Definition) Apply ¶
func (d *Definition) Apply(definition string) error
func (*Definition) Validate ¶
func (d *Definition) Validate() error
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Implements drivers.ResourceDriver interface
func (*Driver) Allocate ¶
func (d *Driver) Allocate(definition string, metadata map[string]interface{}) (string, string, error)
*
- Pretend to Allocate (actually not) the Resource
func (*Driver) Deallocate ¶
func (*Driver) ValidateDefinition ¶
Click to show internal directories.
Click to hide internal directories.