Documentation ¶
Overview ¶
Copyright IBM Corp. 2018, 2019.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright IBM Corp. 2018, 2019.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( OpInit = "init" OpGetVolumeName = "getvolumename" OpIsAttached = "isattached" OpAttach = "attach" OpWaitForAttach = "waitforattach" OpMountDevice = "mountdevice" OpMount = "mount" OpDetach = "detach" OpWaitForDetach = "waitfordetach" OpUnmountDevice = "unmountdevice" OpUnmount = "unmount" // Operation params NodeName = "nodename" DevicePath = "devicePath" MountPath = "mountPath" MountDir = "mountDir" DriverJSONArgs = "jsonArgs" // Kuberenets args K8sArgFSType = "kubernetes.io/fsType" K8sArgMountRW = "kubernetes.io/readwrite" K8sArgSecret = "kubernetes.io/secret" K8sArgFSGroup = "kubernetes.io/fsGroup" K8sArgMountDir = "kubernetes.io/mountsDir" K8sArgPV = "kubernetes.io/pvOrVolumeName" K8sCreatedBy = "kubernetes.io/createdby" // Openstack args OsArgsVolID = "volumeID" OsArgsVolWWN = "wwn" OsArgsMountRW = "actualReadWrite" OsK8sVolumeNameMeta = "k8s_pvOrVolumeName" // Result status ResultStatusSuccess = "Success" ResultStatusFailed = "Failed" ResultStatusUnsupported = "Not supported" ResultMsgOpSuccess = "Operation Success" // HTTP constants RespStatus200 = "200 OK" RespStatus201 = "201 Created" RespStatus202 = "202 Accepted" RespStatus401 = "401 Unauthorized" RespStatus500 = "500 Internal Server Error" HypTypeLibvirt = "libvirt" HypTypeKVM = "kvm" HypTypePhyp = "phyp" HypTypePvm = "powervm" HypTypePvmKVM = "novalink-kvm" StorageHostTypeGPFS = "gpfs" StorageHostTypeXIV = "xiv" FlexPluginVendor = "ibm" ScsiPath = "/sys/class/scsi_host/" AttachedVolumeDir = "/dev/disk/by-id/" DirNamePVMVIOS = "wwn-0x" DirNamePrefixPVMLIO = "wwn-0x6001405" DirNamePrefixPVMXIV = "scsi-2" DirNamePrefixKVM = "scsi-0QEMU_QEMU_HARDDISK_" PathPVMVIOS = AttachedVolumeDir + DirNamePVMVIOS CMDSudo = "/usr/bin/sudo" CMDLsBlk = "/bin/lsblk" CMDMkDir = "/bin/mkdir" CMDMkFS = "/sbin/mkfs." CMDMount = "/bin/mount" CMDUnmount = "/bin/umount" CMDGrep = "/bin/grep" CMDMultipath = "/usr/sbin/multipath" CMDUdevAdm = "/sbin/udevadm" CMDUdevAdmParamSettle = "settle" CMDUdevAdmParamTrigger = "trigger" OSUser = "OS_USERNAME" OSPassword = "OS_PASSWORD" OSUserDomain = "OS_USER_DOMAIN_NAME" OSProjectDomain = "OS_PROJECT_DOMAIN_NAME" OSProjectName = "OS_TENANT_NAME" OSProjectID = "OS_TENANT_ID" OSAuthURL = "OS_AUTH_URL" OSCACert = "OS_CACERT" URIProjects = "/v3/projects" MaxAttemptsToFindVolume = 24 MaxAttemptsToTryLock = 24 ScsiScanLock = "power-openstack-k8s-scsiscan.lck" )
Constants
Variables ¶
var FSTYPES = []string{"ext2", "ext3", "ext4", "jfs", "ReiserFS", "XFS", "Btrfs"}
FSTYPES : All linux file systems
var FlexPluginDriver, FlexPluginVendorDriver, ProvisionerNameOnly, ProvisionerName, GlobalMountsDir string
Functions ¶
func UpdateDriverPrefix ¶
func UpdateDriverPrefix(prefix string)
Utility to allow the caller to initialize the FlexVolume driver and provisioner to use a different naming scheme
Types ¶
type Hypervisor ¶
type Hypervisor struct { // Status of the hypervisor, either "enabled" or "disabled". Status string `json:"status"` // State of the hypervisor, either "up" or "down". State string `json:"state"` // HostIP is the hypervisor's IP address. HostIP string `json:"host_ip"` // FreeRAMMB is the free RAM in the hypervisor, measured in MB. FreeRamMB int `json:"free_ram_mb"` // HypervisorHostname is the hostname of the hypervisor. HypervisorHostname string `json:"hypervisor_hostname"` // HypervisorType is the type of hypervisor. HypervisorType string `json:"hypervisor_type"` // HypervisorVersion is the version of the hypervisor. HypervisorVersion int `json:"-"` // ID is the unique ID of the hypervisor. ID int `json:"id"` // MemoryMB is the total memory of the hypervisor, measured in MB. MemoryMB int `json:"memory_mb"` // MemoryMBUsed is the used memory of the hypervisor, measured in MB. MemoryMBUsed int `json:"memory_mb_used"` // RunningVMs is the The number of running vms on the hypervisor. RunningVMs int `json:"running_vms"` // VCPUs is the total number of vcpus on the hypervisor. VCPUs int `json:"vcpus"` // VCPUsUsed is the number of used vcpus on the hypervisor. VCPUsUsed int `json:"vcpus_used"` }
Hypervisor : Structure representing hypervisor
type OSServer ¶
type OSServer struct { servers.Server OSServerAttrsExt }
OSServer : Extend gophercloud Server to get VM's host as part of result
type OSServerAttrsExt ¶
type OSServerAttrsExt struct {
HypervisorHostname string `json:"OS-EXT-SRV-ATTR:hypervisor_hostname"`
}
OSServerAttrsExt : Extension to base Server object
type OSVolume ¶
type OSVolume struct { volumes_v3.Volume OSVolumeAttrsExt }
OSVolume : Extend gophercloud Volume to get Volume's Storage host
type OSVolumeAttrsExt ¶
type OSVolumeAttrsExt struct {
BackendHost string `json:"backend_host"`
}
OSVolumeAttrsExt : Extension to base Volume object
type Response ¶
type Response struct { // Response status Status string `json:"status"` // Response message Message string `json:"message,omitempty"` // Device name to be returned as part of attach operation DeviceName string `json:"device,omitempty"` // Volume name to be returned as part of getvolumename operation VolumeName string `json:"volumeName,omitempty"` // Attached device name to be returned as part of attach operation Attached *bool `json:"attached,omitempty"` // List of capabilities to be returned as part of init operation Capabilities map[string]bool `json:"capabilities,omitempty"` }
Response structure that defines attributes of expected response
type StorageRegistration ¶
type StorageRegistration struct { HostName string `json:"host_display_name"` AccessIP string `json:"access_ip"` HostType string `json:"host_type"` DriverType string `json:"driver_volume_type"` AccessState string `json:"access_state"` }
StorageRegistration : structure representing the registration information of storage host