clients

package
v0.0.0-...-cfb3faf Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsClusterHealthy

func IsClusterHealthy(testClient *TestClient, namespace string) (bool, error)

IsClusterHealthy determines if the Rook cluster is currently healthy or not.

Types

type BlockImage

type BlockImage struct {
	Name       string `json:"imageName"`
	PoolName   string `json:"poolName"`
	Size       uint64 `json:"size"`
	Device     string `json:"device"`
	MountPoint string `json:"mountPoint"`
}

type BlockOperation

type BlockOperation struct {
	// contains filtered or unexported fields
}

BlockOperation is wrapper for k8s rook block operations

func CreateBlockOperation

func CreateBlockOperation(k8shelp *utils.K8sHelper, manifests installer.CephManifests) *BlockOperation

CreateBlockOperation - Constructor to create BlockOperation - client to perform rook Block operations on k8s

func (*BlockOperation) Create

func (b *BlockOperation) Create(manifest string, size int) (string, error)

BlockCreate Function to create a Block using Rook Input parameters - manifest - pod definition that creates a PVC in k8s - YAML should describe the name and size of the PVC being created size - not user for k8s implementation since it is described in the PVC YAML definition Output - k8s create PVC operation output and/or error

func (*BlockOperation) CreateClientPod

func (b *BlockOperation) CreateClientPod(manifest string) error

CreateClientPod starts a pod that should have a block PVC.

func (*BlockOperation) CreatePVC

func (b *BlockOperation) CreatePVC(namespace, claimName, storageClassName, mode, size string) error

func (*BlockOperation) CreatePVCClone

func (b *BlockOperation) CreatePVCClone(namespace, cloneClaimName, parentClaimName, storageClassName, mode, size string) error

func (*BlockOperation) CreatePVCRestore

func (b *BlockOperation) CreatePVCRestore(namespace, claimName, snapshotName, storageClassName, mode, size string) error

func (*BlockOperation) CreatePod

func (b *BlockOperation) CreatePod(podName, claimName, namespace, mountPoint string, readOnly bool) error

func (*BlockOperation) CreatePoolAndStorageClass

func (b *BlockOperation) CreatePoolAndStorageClass(pvcNamespace, poolName, storageClassName, reclaimPolicy string) error

func (*BlockOperation) CreateSnapshot

func (b *BlockOperation) CreateSnapshot(snapshotName, claimName, snapshotClassName, namespace string) error

func (*BlockOperation) CreateSnapshotClass

func (b *BlockOperation) CreateSnapshotClass(snapshotClassName, deletePolicy, namespace string) error

func (*BlockOperation) CreateStorageClass

func (b *BlockOperation) CreateStorageClass(csi bool, poolName, storageClassName, reclaimPolicy, namespace string) error

func (*BlockOperation) DeleteBlock

func (b *BlockOperation) DeleteBlock(manifest string) (string, error)

BlockDelete Function to delete a Block using Rook Input parameters - manifest - pod definition where pvc is described - delete is run on the yaml definition Output - k8s delete pvc operation output and/or error

func (*BlockOperation) DeleteBlockImage

func (b *BlockOperation) DeleteBlockImage(clusterInfo *client.ClusterInfo, image BlockImage) error

DeleteBlockImage Function to list all the blocks created/being managed by rook

func (*BlockOperation) DeletePVC

func (b *BlockOperation) DeletePVC(namespace, claimName string) error

func (*BlockOperation) DeleteSnapshot

func (b *BlockOperation) DeleteSnapshot(snapshotName, claimName, snapshotClassName, namespace string) error

func (*BlockOperation) DeleteSnapshotClass

func (b *BlockOperation) DeleteSnapshotClass(snapshotClassName, deletePolicy, namespace string) error

func (*BlockOperation) DeleteStorageClass

func (b *BlockOperation) DeleteStorageClass(storageClassName string) error

func (*BlockOperation) ListAllImages

func (b *BlockOperation) ListAllImages(clusterInfo *client.ClusterInfo) ([]BlockImage, error)

List Function to list all the block images in all pools

func (*BlockOperation) ListImagesInPool

func (b *BlockOperation) ListImagesInPool(clusterInfo *client.ClusterInfo, poolName string) ([]BlockImage, error)

List Function to list all the block images in a pool

type BucketOperation

type BucketOperation struct {
	// contains filtered or unexported fields
}

BucketOperation is a wrapper for rook bucket operations

func CreateBucketOperation

func CreateBucketOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *BucketOperation

CreateBucketOperation creates a new bucket client

func (*BucketOperation) CheckBucketNotificationSetonRGW

func (b *BucketOperation) CheckBucketNotificationSetonRGW(namespace, storeName, obcName, bucketname, notificationName string, helper *TestClient, tlsEnabled bool) bool

Checks the bucket notifications set on RGW backend bucket

func (*BucketOperation) CheckOBC

func (b *BucketOperation) CheckOBC(obcName, check string) bool

CheckOBC, returns true if the obc, secret and configmap are all in the "check" state, and returns false if any of these resources are not in the "check" state. Check state values:

"created", all must exist,
"bound", all must exist and OBC in Bound phase
"deleted", all must be missing.

func (*BucketOperation) CheckOBMaxObject

func (b *BucketOperation) CheckOBMaxObject(obcName, maxobject string) bool

Checks whether MaxObject is updated for ob

func (*BucketOperation) CreateBucketStorageClass

func (b *BucketOperation) CreateBucketStorageClass(namespace string, storeName string, storageClassName string, reclaimPolicy string) error

func (*BucketOperation) CreateObc

func (b *BucketOperation) CreateObc(obcName string, storageClassName string, bucketName string, maxObject string, createBucket bool) error

func (*BucketOperation) CreateObcNotification

func (b *BucketOperation) CreateObcNotification(obcName string, storageClassName string, bucketName string, notification string, createBucket bool) error

func (*BucketOperation) DeleteBucketStorageClass

func (b *BucketOperation) DeleteBucketStorageClass(namespace string, storeName string, storageClassName string, reclaimPolicy string) error

func (*BucketOperation) DeleteObc

func (b *BucketOperation) DeleteObc(obcName string, storageClassName string, bucketName string, maxObject string, createBucket bool) error

func (*BucketOperation) GetAccessKey

func (b *BucketOperation) GetAccessKey(obcName string) (string, error)

Fetch SecretKey, AccessKey for s3 client.

func (*BucketOperation) GetSecretKey

func (b *BucketOperation) GetSecretKey(obcName string) (string, error)

func (*BucketOperation) UpdateObc

func (b *BucketOperation) UpdateObc(obcName string, storageClassName string, bucketName string, maxObject string, createBucket bool) error

func (*BucketOperation) UpdateObcNotificationAdd

func (b *BucketOperation) UpdateObcNotificationAdd(obcName string, storageClassName string, bucketName string, notification string, createBucket bool) error

func (*BucketOperation) UpdateObcNotificationRemove

func (b *BucketOperation) UpdateObcNotificationRemove(obcName string, storageClassName string, bucketName string, maxObject string, createBucket bool) error

type COSIOperation

type COSIOperation struct {
	// contains filtered or unexported fields
}

func CreateCOSIOperation

func CreateCOSIOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *COSIOperation

func (*COSIOperation) CreateBucketClaim

func (c *COSIOperation) CreateBucketClaim(name, bucketClassName string) error

func (*COSIOperation) CreateBucketClass

func (c *COSIOperation) CreateBucketClass(name, objectStoreUserSecretName, deletionPolicy string) error

func (*COSIOperation) CreateCOSI

func (c *COSIOperation) CreateCOSI() error

func (*COSIOperation) DeleteBucketClaim

func (c *COSIOperation) DeleteBucketClaim(name, bucketClassName string) error

func (*COSIOperation) DeleteBucketClass

func (c *COSIOperation) DeleteBucketClass(name, objectStoreUserSecretName, deletionPolicy string) error

func (*COSIOperation) DeleteCOSI

func (c *COSIOperation) DeleteCOSI() error

type ClientOperation

type ClientOperation struct {
	// contains filtered or unexported fields
}

ClientOperation is a wrapper for k8s rook file operations

func CreateClientOperation

func CreateClientOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *ClientOperation

CreateClientOperation Constructor to create ClientOperation - client to perform rook file system operations on k8s

func (*ClientOperation) Create

func (c *ClientOperation) Create(name, namespace string, caps map[string]string) error

Create creates a client in Rook

func (*ClientOperation) Delete

func (c *ClientOperation) Delete(name, namespace string) error

Delete deletes a client in Rook

func (*ClientOperation) Get

func (c *ClientOperation) Get(clusterInfo *client.ClusterInfo, clientName string) (key string, error error)

Get shows user created in Rook

func (*ClientOperation) Update

func (c *ClientOperation) Update(clusterInfo *client.ClusterInfo, clientName string, caps map[string]string) (updatedcaps map[string]string, error error)

Update updates provided user capabilities

type FilesystemOperation

type FilesystemOperation struct {
	// contains filtered or unexported fields
}

FilesystemOperation is a wrapper for k8s rook file operations

func CreateFilesystemOperation

func CreateFilesystemOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *FilesystemOperation

CreateFilesystemOperation Constructor to create FilesystemOperation - client to perform rook file system operations on k8s

func (*FilesystemOperation) Create

func (f *FilesystemOperation) Create(name, namespace string, activeCount int) error

Create creates a filesystem in Rook

func (*FilesystemOperation) CreatePVC

func (f *FilesystemOperation) CreatePVC(namespace, claimName, storageClassName, mode, size string) error

func (*FilesystemOperation) CreatePVCClone

func (f *FilesystemOperation) CreatePVCClone(namespace, cloneClaimName, parentClaimName, storageClassName, mode, size string) error

CreatePVCClone creates a pvc from pvc

func (*FilesystemOperation) CreatePVCRestore

func (f *FilesystemOperation) CreatePVCRestore(namespace, claimName, snapshotName, storageClassName, mode, size string) error

CreatePVCRestore creates a pvc from snapshot

func (*FilesystemOperation) CreatePod

func (f *FilesystemOperation) CreatePod(podName, claimName, namespace, mountPoint string, readOnly bool) error

func (*FilesystemOperation) CreateSnapshot

func (f *FilesystemOperation) CreateSnapshot(snapshotName, claimName, snapshotClassName, namespace string) error

CreateSnapshot creates a snapshot from pvc

func (*FilesystemOperation) CreateSnapshotClass

func (f *FilesystemOperation) CreateSnapshotClass(snapshotClassName, reclaimPolicy, namespace string) error

CreateSnapshotClass creates a snapshot class for CephFS clients

func (*FilesystemOperation) CreateStorageClass

func (f *FilesystemOperation) CreateStorageClass(fsName, systemNamespace, namespace, storageClassName string) error

CreateStorageClass creates a storage class for CephFS clients

func (*FilesystemOperation) CreateSubvolumeGroup

func (f *FilesystemOperation) CreateSubvolumeGroup(fsName, groupName string) error

func (*FilesystemOperation) Delete

func (f *FilesystemOperation) Delete(name, namespace string) error

Delete deletes a filesystem in Rook

func (*FilesystemOperation) DeletePVC

func (f *FilesystemOperation) DeletePVC(namespace, claimName string) error

func (*FilesystemOperation) DeleteSnapshot

func (f *FilesystemOperation) DeleteSnapshot(snapshotName, claimName, snapshotClassName, namespace string) error

DeleteSnapshot deletes the snapshot

func (*FilesystemOperation) DeleteSnapshotClass

func (f *FilesystemOperation) DeleteSnapshotClass(snapshotClassName, deletePolicy, namespace string) error

func (*FilesystemOperation) DeleteStorageClass

func (f *FilesystemOperation) DeleteStorageClass(storageClassName string) error

func (*FilesystemOperation) DeleteSubvolumeGroup

func (f *FilesystemOperation) DeleteSubvolumeGroup(fsName, groupName string) error

func (*FilesystemOperation) List

func (f *FilesystemOperation) List(namespace string) ([]client.CephFilesystem, error)

List lists filesystems in Rook

func (*FilesystemOperation) ScaleDown

func (f *FilesystemOperation) ScaleDown(name, namespace string) error

ScaleDown scales down the number of active metadata servers of a filesystem in Rook

type NFSOperation

type NFSOperation struct {
	// contains filtered or unexported fields
}

NFSOperation is a wrapper for k8s rook file operations

func CreateNFSOperation

func CreateNFSOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *NFSOperation

CreateNFSOperation Constructor to create NFSOperation - client to perform ceph nfs operations on k8s

func (*NFSOperation) Create

func (n *NFSOperation) Create(namespace, name string, daemonCount int) error

Create creates a filesystem in Rook

func (*NFSOperation) CreateSnapshotClass

func (f *NFSOperation) CreateSnapshotClass(fsName, snapshotClassName string) error

CreateSnapshotClass creates a Snapshot class for NFS clients

func (*NFSOperation) CreateStorageClass

func (f *NFSOperation) CreateStorageClass(fsName, nfsClusterName, systemNamespace, namespace, storageClassName string) error

CreateStorageClass creates a storage class for NFS clients

func (*NFSOperation) Delete

func (n *NFSOperation) Delete(namespace, name string) error

Delete deletes a filesystem in Rook

func (*NFSOperation) DeleteSnapshotClass

func (f *NFSOperation) DeleteSnapshotClass(fsName, snapshotClassName string) error

DeleteSnapshotClass deletes a Snapshot class for NFS clients

type NotificationOperation

type NotificationOperation struct {
	// contains filtered or unexported fields
}

TopicOperation is a wrapper for rook notification operations

func CreateNotificationOperation

func CreateNotificationOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *NotificationOperation

CreateTopicOperation creates a new topic client

func (*NotificationOperation) CheckNotificationCR

func (t *NotificationOperation) CheckNotificationCR(notificationName string) bool

CheckNotification if notification was set

func (*NotificationOperation) CheckNotificationFromHTTPEndPoint

func (t *NotificationOperation) CheckNotificationFromHTTPEndPoint(appLabel, eventName, fileName string) (bool, error)

func (*NotificationOperation) CreateNotification

func (n *NotificationOperation) CreateNotification(notificationName string, topicName string) error

func (*NotificationOperation) DeleteNotification

func (n *NotificationOperation) DeleteNotification(notificationName string, topicName string) error

func (*NotificationOperation) UpdateNotification

func (n *NotificationOperation) UpdateNotification(notificationName string, topicName string) error

type ObjectOperation

type ObjectOperation struct {
	// contains filtered or unexported fields
}

ObjectOperation is wrapper for k8s rook object operations

func CreateObjectOperation

func CreateObjectOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *ObjectOperation

CreateObjectOperation creates new rook object client

func (*ObjectOperation) Create

func (o *ObjectOperation) Create(namespace, storeName string, replicaCount int32, tlsEnable bool) error

ObjectCreate Function to create a object store in rook

func (*ObjectOperation) Delete

func (o *ObjectOperation) Delete(namespace, storeName string) error

func (*ObjectOperation) GetEndPointUrl

func (o *ObjectOperation) GetEndPointUrl(namespace string, storeName string) (string, error)

Need to improve the below function for better error handling

type ObjectUserOperation

type ObjectUserOperation struct {
	// contains filtered or unexported fields
}

ObjectUserOperation is wrapper for k8s rook object user operations

func CreateObjectUserOperation

func CreateObjectUserOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *ObjectUserOperation

CreateObjectUserOperation creates new rook object user client

func (*ObjectUserOperation) Create

func (o *ObjectUserOperation) Create(userid, displayName, store, usercaps, maxsize string, maxbuckets, maxobjects int) error

ObjectUserCreate Function to create a object store user in rook

func (*ObjectUserOperation) Delete

func (o *ObjectUserOperation) Delete(namespace string, userid string) error

func (*ObjectUserOperation) GetUser

func (o *ObjectUserOperation) GetUser(namespace string, store string, userid string) (*rgw.ObjectUser, error)

ObjectUserGet Function to get the details of an object user from radosgw

func (*ObjectUserOperation) UserSecretExists

func (o *ObjectUserOperation) UserSecretExists(namespace string, store string, userid string) bool

UserSecretExists Function to check that user secret was created

type PoolOperation

type PoolOperation struct {
	// contains filtered or unexported fields
}

PoolOperation is a wrapper for rook pool operations

func CreatePoolOperation

func CreatePoolOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *PoolOperation

CreatePoolOperation creates a new pool client

func (*PoolOperation) CephPoolExists

func (p *PoolOperation) CephPoolExists(namespace, name string) (bool, error)

func (*PoolOperation) Create

func (p *PoolOperation) Create(name, namespace string, replicas int) error

func (*PoolOperation) DeletePool

func (p *PoolOperation) DeletePool(blockClient *BlockOperation, clusterInfo *client.ClusterInfo, poolName string) error

DeletePool deletes a pool after deleting all the block images contained by the pool

func (*PoolOperation) GetCephPoolDetails

func (p *PoolOperation) GetCephPoolDetails(clusterInfo *client.ClusterInfo, name string) (client.CephStoragePoolDetails, error)

func (*PoolOperation) ListCephPools

func (p *PoolOperation) ListCephPools(clusterInfo *client.ClusterInfo) ([]client.CephStoragePoolSummary, error)

func (*PoolOperation) ListPoolCRDs

func (p *PoolOperation) ListPoolCRDs(namespace string) ([]cephv1.CephBlockPool, error)

func (*PoolOperation) PoolCRDExists

func (p *PoolOperation) PoolCRDExists(namespace, name string) (bool, error)

func (*PoolOperation) Update

func (p *PoolOperation) Update(name, namespace string, replicas int) error

type RBDMirrorOperation

type RBDMirrorOperation struct {
	// contains filtered or unexported fields
}

RBDMirrorOperation is a wrapper for k8s rook rbd mirror operations

func CreateRBDMirrorOperation

func CreateRBDMirrorOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *RBDMirrorOperation

CreateRBDMirrorOperation Constructor to create RBDMirrorOperation - client to perform ceph rbd mirror operations on k8s

func (*RBDMirrorOperation) Create

func (r *RBDMirrorOperation) Create(namespace, name string, daemonCount int) error

Create creates a rbd-mirror in Rook

func (*RBDMirrorOperation) Delete

func (r *RBDMirrorOperation) Delete(namespace, name string) error

Delete deletes a rbd-mirror in Rook

type ReadWriteOperation

type ReadWriteOperation struct {
	// contains filtered or unexported fields
}

ReadWriteOperation is a wrapper for k8s rook file operations

func CreateReadWriteOperation

func CreateReadWriteOperation(k8sh *utils.K8sHelper) *ReadWriteOperation

CreateReadWriteOperation Constructor to create ReadWriteOperation - client to perform rook file system operations on k8s

func (*ReadWriteOperation) CreateWriteClient

func (f *ReadWriteOperation) CreateWriteClient(volName string) ([]string, error)

CreateWriteClient Function to create a nfs client in rook

func (*ReadWriteOperation) Delete

func (f *ReadWriteOperation) Delete() error

Delete Function to delete a nfs consuming pod in rook

func (*ReadWriteOperation) Read

func (f *ReadWriteOperation) Read(name string) (string, error)

Read Function to read from nfs mount point created by rook ,i.e. Read data from a pod that has an nfs export mounted

type TestClient

type TestClient struct {
	BlockClient        *BlockOperation
	FSClient           *FilesystemOperation
	NFSClient          *NFSOperation
	ObjectClient       *ObjectOperation
	ObjectUserClient   *ObjectUserOperation
	PoolClient         *PoolOperation
	BucketClient       *BucketOperation
	UserClient         *ClientOperation
	RBDMirrorClient    *RBDMirrorOperation
	TopicClient        *TopicOperation
	NotificationClient *NotificationOperation
	COSIClient         *COSIOperation
	// contains filtered or unexported fields
}

TestClient is a wrapper for test client, containing interfaces for all rook operations

func CreateTestClient

func CreateTestClient(k8sHelper *utils.K8sHelper, manifests installer.CephManifests) *TestClient

CreateTestClient creates new instance of test client for a platform

func (TestClient) Status

func (c TestClient) Status(namespace string) (client.CephStatus, error)

Status returns rook status details

type TopicOperation

type TopicOperation struct {
	// contains filtered or unexported fields
}

TopicOperation is a wrapper for rook topic operations

func CreateTopicOperation

func CreateTopicOperation(k8sh *utils.K8sHelper, manifests installer.CephManifests) *TopicOperation

CreateTopicOperation creates a new topic client

func (*TopicOperation) CheckTopic

func (t *TopicOperation) CheckTopic(topicName string) bool

CheckTopic if topic has an ARN set in its status

func (*TopicOperation) CreateHTTPServer

func (t *TopicOperation) CreateHTTPServer(serverName, namespace, port string) error

func (*TopicOperation) CreateTopic

func (t *TopicOperation) CreateTopic(topicName string, storeName string, httpEndpointService string) error

func (*TopicOperation) DeleteTopic

func (t *TopicOperation) DeleteTopic(topicName string, storeName string, httpEndpointService string) error

func (*TopicOperation) UpdateTopic

func (t *TopicOperation) UpdateTopic(topicName string, storeName string, httpEndpointService string) error

Jump to

Keyboard shortcuts

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