clients

package
v1.7.8 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsClusterHealthy added in v0.6.0

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

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

Types

type BlockImage added in v0.8.0

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 added in v0.9.0

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 added in v0.8.0

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 name and size of pvc being created size - not user for k8s implementation since its descried on the pvc yaml definition Output - k8s create pvc operation output and/or error

func (*BlockOperation) CreateClientPod added in v1.3.0

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

CreateClientPod starts a pod that should have a block PVC.

func (*BlockOperation) CreatePVC added in v1.3.0

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

func (*BlockOperation) CreatePVCClone added in v1.5.0

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

func (*BlockOperation) CreatePVCRestore added in v1.5.0

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

func (*BlockOperation) CreatePod added in v1.5.0

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

func (*BlockOperation) CreateSnapshot added in v1.5.0

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

func (*BlockOperation) CreateSnapshotClass added in v1.5.0

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

func (*BlockOperation) CreateStorageClass added in v0.9.0

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

func (*BlockOperation) CreateStorageClassAndPVC added in v1.3.0

func (b *BlockOperation) CreateStorageClassAndPVC(pvcNamespace, poolName, storageClassName, reclaimPolicy, blockName, mode string) error

func (*BlockOperation) DeleteBlock added in v0.8.0

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 the yaml definition Output - k8s delete pvc operation output and/or error

func (*BlockOperation) DeleteBlockImage added in v0.8.0

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 added in v1.3.0

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

func (*BlockOperation) DeleteSnapshot added in v1.5.0

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

func (*BlockOperation) DeleteSnapshotClass added in v1.5.0

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

func (*BlockOperation) DeleteStorageClass added in v0.9.0

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

func (*BlockOperation) ListAllImages added in v1.3.0

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

List Function to list all the block images in all pools

func (*BlockOperation) ListImagesInPool added in v1.3.0

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

List Function to list all the block images in a pool

type BucketOperation added in v1.1.0

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

BucketOperation is a wrapper for rook bucket operations

func CreateBucketOperation added in v1.1.0

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

CreateBucketOperation creates a new bucket client

func (*BucketOperation) CheckOBC added in v1.1.0

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 added in v1.7.2

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

Checks whether MaxObject is updated for ob

func (*BucketOperation) CreateBucketStorageClass added in v1.1.0

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

func (*BucketOperation) CreateObc added in v1.1.0

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

func (*BucketOperation) DeleteBucketStorageClass added in v1.1.0

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

func (*BucketOperation) DeleteObc added in v1.1.0

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

func (*BucketOperation) GetAccessKey added in v1.1.0

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

Fetch SecretKey, AccessKey for s3 client.

func (*BucketOperation) GetSecretKey added in v1.1.0

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

func (*BucketOperation) UpdateObc added in v1.7.2

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

type ClientOperation added in v1.2.0

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

ClientOperation is a wrapper for k8s rook file operations

func CreateClientOperation added in v1.2.0

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 added in v1.2.0

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

Create creates a client in Rook

func (*ClientOperation) Delete added in v1.2.0

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

Delete deletes a client in Rook

func (*ClientOperation) Get added in v1.2.0

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

Get shows user created in Rook

func (*ClientOperation) Update added in v1.2.0

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 added in v0.6.0

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

FilesystemOperation is a wrapper for k8s rook file operations

func CreateFilesystemOperation added in v0.9.0

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 added in v0.8.0

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

Create creates a filesystem in Rook

func (*FilesystemOperation) CreatePVC added in v1.5.0

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

func (*FilesystemOperation) CreatePVCClone added in v1.5.0

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

CreatePVCClone creates a pvc from pvc

func (*FilesystemOperation) CreatePVCRestore added in v1.5.0

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

CreatePVCRestore creates a pvc from snapshot

func (*FilesystemOperation) CreatePod added in v1.5.0

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

func (*FilesystemOperation) CreateSnapshot added in v1.5.0

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

CreateSnapshot creates a snapshot from pvc

func (*FilesystemOperation) CreateSnapshotClass added in v1.5.0

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

CreateSnapshotClass creates a snapshot class for CephFS clients

func (*FilesystemOperation) CreateStorageClass added in v1.3.0

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

CreateStorageClass creates a storage class for CephFS clients

func (*FilesystemOperation) Delete added in v0.8.0

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

Delete deletes a filesystem in Rook

func (*FilesystemOperation) DeletePVC added in v1.5.0

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

func (*FilesystemOperation) DeleteSnapshot added in v1.5.0

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

DeleteSnapshot deletes the snapshot

func (*FilesystemOperation) DeleteSnapshotClass added in v1.5.0

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

func (*FilesystemOperation) DeleteStorageClass added in v1.5.0

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

func (*FilesystemOperation) List added in v0.8.0

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

List lists filesystems in Rook

func (*FilesystemOperation) ScaleDown added in v0.9.0

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

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

type NFSOperation added in v1.0.0

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

NFSOperation is a wrapper for k8s rook file operations

func CreateNFSOperation added in v1.0.0

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 added in v1.0.0

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

Create creates a filesystem in Rook

func (*NFSOperation) Delete added in v1.0.0

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

Delete deletes a filesystem in Rook

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 added in v0.8.0

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

ObjectCreate Function to create a object store in rook

func (*ObjectOperation) Delete added in v0.8.0

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

func (*ObjectOperation) GetEndPointUrl added in v1.1.0

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

Need to improve the below function for better error handling

type ObjectUserOperation added in v0.9.0

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

ObjectUserOperation is wrapper for k8s rook object user operations

func CreateObjectUserOperation added in v0.9.0

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

CreateObjectUserOperation creates new rook object user client

func (*ObjectUserOperation) Create added in v0.9.0

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 added in v0.9.0

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

func (*ObjectUserOperation) GetUser added in v0.9.0

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 added in v0.9.0

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

UserSecretExists Function to check that user secret was created

type PoolOperation added in v0.8.0

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

PoolOperation is a wrapper for rook pool operations

func CreatePoolOperation added in v0.8.0

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

CreatePoolOperation creates a new pool client

func (*PoolOperation) CephPoolExists added in v0.8.0

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

func (*PoolOperation) Create added in v0.8.0

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

func (*PoolOperation) DeletePool added in v1.1.5

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 added in v0.8.0

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

func (*PoolOperation) ListCephPools added in v0.8.0

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

func (*PoolOperation) ListPoolCRDs added in v0.8.0

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

func (*PoolOperation) PoolCRDExists added in v0.8.0

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

func (*PoolOperation) Update added in v0.8.0

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

type RBDMirrorOperation added in v1.4.0

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

RBDMirrorOperation is a wrapper for k8s rook rbd mirror operations

func CreateRBDMirrorOperation added in v1.4.0

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 added in v1.4.0

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

Create creates a rbd-mirror in Rook

func (*RBDMirrorOperation) Delete added in v1.4.0

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

Delete deletes a rbd-mirror in Rook

type ReadWriteOperation added in v0.9.0

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

ReadWriteOperation is a wrapper for k8s rook file operations

func CreateReadWriteOperation added in v0.9.0

func CreateReadWriteOperation(k8sh *utils.K8sHelper) *ReadWriteOperation

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

func (*ReadWriteOperation) CreateWriteClient added in v0.9.0

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

CreateWriteClient Function to create a nfs client in rook

func (*ReadWriteOperation) Delete added in v0.9.0

func (f *ReadWriteOperation) Delete() error

Delete Function to delete a nfs consuming pod in rook

func (*ReadWriteOperation) Read added in v0.9.0

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
	// 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

Jump to

Keyboard shortcuts

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