Documentation ¶
Index ¶
- Variables
- func GetOvirtNodeName(hostname string) (string, error)
- type AttachRequest
- type AttchResponse
- type Capabilities
- type Connection
- type Device
- type Disk
- type DiskAttachment
- type DiskAttachmentResult
- type DiskFormat
- type DiskResult
- type Ip
- type Nic
- type NotFound
- type Ovirt
- func (ovirt *Ovirt) Authenticate() error
- func (ovirt *Ovirt) CreateDisk(diskName string, storageDomainName string, readOnly bool, vmId string, ...) (DiskAttachment, error)
- func (ovirt *Ovirt) CreateUnattachedDisk(diskName string, storageDomainName string, sizeIbBytes int64, readOnly bool, ...) (Disk, error)
- func (ovirt *Ovirt) DefaultDiskParamsBy(storageDomainName string, thinProvisioned bool) (DiskFormat, Sparse, error)
- func (ovirt *Ovirt) Delete(path string) ([]byte, error)
- func (ovirt *Ovirt) DetachDiskFromVM(vmId string, diskId string) error
- func (ovirt *Ovirt) Get(path string) ([]byte, error)
- func (ovirt *Ovirt) GetConnectionDetails() Connection
- func (ovirt *Ovirt) GetDiskAttachment(vmId, diskId string) (DiskAttachment, error)
- func (ovirt *Ovirt) GetDiskAttachments(vmId string) ([]DiskAttachment, error)
- func (ovirt *Ovirt) GetDiskByName(diskName string) (DiskResult, error)
- func (ovirt *Ovirt) GetStorageDomainBy(name string) (StorageDomain, error)
- func (ovirt *Ovirt) GetVM(name string) (VM, error)
- func (ovirt *Ovirt) GetVMById(id string) (VM, error)
- func (ovirt *Ovirt) GetVMs(searchQuery string) ([]VM, error)
- func (ovirt *Ovirt) Post(path string, data interface{}) (string, error)
- type OvirtApi
- type Response
- type Sparse
- type Status
- type StorageDomain
- type StorageDomains
- type Token
- type VM
- type VMResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FailedResponse = Response{Status: Failure} SuccessfulResponse = Response{Status: Success, Message: "success"} NotSupportedResponse = Response{Status: NotSupported} )
View Source
var (
ErrNotExist = errors.New("resource does not exists")
)
ovirt api common errors
Functions ¶
func GetOvirtNodeName ¶
GetOvirtNodeName returns the k8s ExternalID as fetched by kubectl describe node IP One of its usages is to bridge the gap when invoking some flexdriver command and we need the name of the co-responding VM This call expects this label to be set on the node: $ovirtNodeNameLabel TODO fragile approach, what happens if the node is not deployed under its `hostname`? This must be communicated as well in the deployment section.
Types ¶
type AttachRequest ¶
type AttachRequest struct { StorageDomain string `json:"ovirtStorageDomain"` VolumeName string `json:"kubernetes.io/pvOrVolumeName,omitempty"` Size string `json:"capacity,omitempty"` FsType string `json:"kubernetes.io/fsType"` Mode string `json:"kubernetes.io/readwrite"` // TODO use k8s secret? Secret string `json:"kubernetes.io/secret,omitempty"` VolumeId string `json:"volumeID,omitempty"` CustomSize string `json:"size,omitempty"` }
func AttachRequestFrom ¶
func AttachRequestFrom(s string) (AttachRequest, error)
type AttchResponse ¶
type AttchResponse struct {
Response
}
type Capabilities ¶
type Capabilities struct { //"capabilities": <Only included as part of the Init response> Attach bool `json:"attach,omitempty"` //: <True/False (Return true if the driver implements attach and detach)> }
type Connection ¶
type Device ¶ added in v0.4.0
type Device struct { Ips struct { Ips []Ip `json:"ip"` } `json:"ips"` }
type Disk ¶
type Disk struct { Id string `json:"id,omitempty"` Name string `json:"name"` ActualSize uint64 `json:"actual_size,omitempty,string"` ProvisionedSize uint64 `json:"provisioned_size,string"` Status string `json:"status,omitempty"` Format DiskFormat `json:"format"` StorageDomains StorageDomains `json:"storage_domains"` Sparse Sparse `json:"sparse,string"` }
type DiskAttachment ¶
type DiskAttachmentResult ¶
type DiskAttachmentResult struct {
DiskAttachments []DiskAttachment `json:"disk_attachment"`
}
type DiskFormat ¶
type DiskFormat string
type DiskResult ¶
type DiskResult struct {
Disks []Disk `json:"disk"`
}
type Ovirt ¶
type Ovirt struct { Connection Connection // contains filtered or unexported fields }
func (*Ovirt) Authenticate ¶
func (*Ovirt) CreateDisk ¶
func (*Ovirt) CreateUnattachedDisk ¶
func (*Ovirt) DefaultDiskParamsBy ¶ added in v0.4.0
func (ovirt *Ovirt) DefaultDiskParamsBy(storageDomainName string, thinProvisioned bool) (DiskFormat, Sparse, error)
this logic is aligned with oVirt logic for determining disk format and spareness the combination are determined by the type of the storage domain.
func (*Ovirt) DetachDiskFromVM ¶
func (*Ovirt) GetConnectionDetails ¶ added in v0.4.0
func (ovirt *Ovirt) GetConnectionDetails() Connection
func (*Ovirt) GetDiskAttachment ¶
func (ovirt *Ovirt) GetDiskAttachment(vmId, diskId string) (DiskAttachment, error)
func (*Ovirt) GetDiskAttachments ¶
func (ovirt *Ovirt) GetDiskAttachments(vmId string) ([]DiskAttachment, error)
func (*Ovirt) GetDiskByName ¶
func (ovirt *Ovirt) GetDiskByName(diskName string) (DiskResult, error)
func (*Ovirt) GetStorageDomainBy ¶ added in v0.4.0
func (ovirt *Ovirt) GetStorageDomainBy(name string) (StorageDomain, error)
GetStorageDomainBy returns a storage domain type by name
type OvirtApi ¶
type OvirtApi interface { Authenticate() error Get(path string) ([]byte, error) Post(path string, data interface{}) (string, error) Delete(path string) ([]byte, error) GetVM(name string) (VM, error) GetVMById(id string) (VM, error) GetVMs(query string) ([]VM, error) GetDiskAttachment(vmId, diskId string) (DiskAttachment, error) GetDiskAttachments(vmId string) ([]DiskAttachment, error) DetachDiskFromVM(vmId string, diskId string) error GetDiskByName(diskName string) (DiskResult, error) CreateUnattachedDisk(diskName string, storageDomainName string, sizeIbBytes int64, readOnly bool, thinProvisioning bool) (Disk, error) CreateDisk( diskName string, storageDomainName string, readOnly bool, vmId string, diskId string, diskInterface string) (DiskAttachment, error) GetConnectionDetails() Connection }
type Response ¶
type Response struct { Status Status `json:"status"` //"status": "<Success/Failure/Not supported>", Message string `json:"message"` //"message": "<Reason for success/failure>", Device string `json:"device,omitempty"` //"device": "<Path to the device attached. This field is valid only for attach & waitforattach call-outs>" VolumeName string `json:"volumeName,omitempty"` //"volumeName": "<Cluster wide unique name of the volume. Valid only for getvolumename call-out>" Attached bool `json:"attached,omitempty"` //"attached": <True/False (Return true if volume is attached on the node. Valid only for isattached call-out)> Capabilities *Capabilities `json:",omitempty"` }
func FailedResponseFromError ¶
type StorageDomain ¶
type StorageDomains ¶
type StorageDomains struct {
Domains []StorageDomain `json:"storage_domain"`
}
Click to show internal directories.
Click to hide internal directories.