clients

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: Apache-2.0 Imports: 11 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) 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 CreateK8BlockOperation

func CreateK8BlockOperation(k8shelp *utils.K8sHelper) *BlockOperation

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

func (*BlockOperation) BlockMap

func (b *BlockOperation) BlockMap(manifest string, mountpath string) (string, error)

BlockMap Function to map a Block using Rook Input parameters - manifest - Pod definition - pod should be defined to use a pvc that was created earlier mountpath - not used in this impl since mountpath is defined in the pod definition Output - k8s create pod operation output and/or error

func (*BlockOperation) BlockUnmap

func (b *BlockOperation) BlockUnmap(name string, mountpath string) (string, error)

BlockUnmap Function to unmap a Block using Rook Input parameters - manifest - pod definition - the pod described in yaml file is deleted mountpath - not used in this impl since mountpath is defined in the pod definition Output - k8s delete pod operation output and/or error

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) 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(image BlockImage, namespace string) error

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

func (*BlockOperation) List added in v0.8.0

func (b *BlockOperation) List(namespace string) ([]BlockImage, error)

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

func (*BlockOperation) Read added in v0.8.0

func (b *BlockOperation) Read(name string, mountpath string, filename string, namespace string) (string, error)

Read Function to read from block created by rook ,i.e. Read data from a pod that is using a pvc Input parameters - manifest - path to a yaml file that creates a pod - pod should be defined to use a pvc that was created earlier mountpath - folder on the pod were data is supposed to be written(should match the mountpath described in the pod definition) filename - file to be read namespace - optional param - namespace of the pod Output - k8s exec pod operation output and/or error

func (*BlockOperation) Write added in v0.8.0

func (b *BlockOperation) Write(name string, mountpath string, data string, filename string, namespace string) (string, error)

Write Function to write data to block created by rook ,i.e. write data to a pod that is using a pvc Input parameters - manifest - path to a yaml file that creates a pod - pod should be defined to use a pvc that was created earlier mountpath - folder on the pod were data is supposed to be written(should match the mountpath described in the pod definition) data - data to be written filename - file where data is written to namespace - optional param - namespace of the pod Output - k8s exec pod operation output and/or error

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

func CreateK8sFilesystemOperation(k8sh *utils.K8sHelper) *FilesystemOperation

CreateK8sFilesystemOperation 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) error

FSCreate Function to create a filesystem in rook Input parameters -

name -  name of the shared file system to be created
Output - output returned by the ceph command

func (*FilesystemOperation) Delete added in v0.8.0

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

Delete Function to delete a filesystem in rook Input parameters - name - name of the shared file system to be deleted Output - output returned by the call

func (*FilesystemOperation) List added in v0.8.0

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

List Function to list a filesystem in rook Output - output returned by the call

func (*FilesystemOperation) Mount added in v0.8.0

func (f *FilesystemOperation) Mount(name string, path string) (string, error)

Mount Function to Mount a file system created by rook(on a pod) Input parameters - name - path to the yaml definition file - definition of pod to be created that mounts existing file system path - ignored in this case - moount path is defined in the path definition output - output returned by k8s create pod operaton and/or error

func (*FilesystemOperation) Read added in v0.8.0

func (f *FilesystemOperation) Read(name string, mountpath string, filename string, namespace string) (string, error)

Read Function to write read from file system created by rook ,i.e. Read data from a pod that filesystem mounted Input parameters - name - path to a yaml file that creates a pod - pod should be defined to use a pvc that was created earlier mountpath - folder on the pod were data is supposed to be written(should match the mountpath described in the pod definition) filename - file to be read namespace - optional param - namespace of the pod Output - k8s exec pod operation output and/or error

func (*FilesystemOperation) Unmount added in v0.8.0

func (f *FilesystemOperation) Unmount(name string) (string, error)

Unmount Function to UnMount a file system created by rook(delete pod) Input parameters - name - path to the yaml definition file - definition of pod to be deleted that has a file system mounted path - ignored in this case - moount path is defined in the path definition output - output returned by k8s delete pod operaton and/or error

func (*FilesystemOperation) Write added in v0.8.0

func (f *FilesystemOperation) Write(name string, mountpath string, data string, filename string, namespace string) (string, error)

Write Function to write data to file system created by rook ,i.e. write data to a pod that has filesystem mounted Input parameters - name - path to a yaml file that creates a pod - pod should be defined to use a pvc that was created earlier mountpath - folder on the pod were data is supposed to be written(should match the mountpath described in the pod definition) data - data to be written filename - file where data is written to namespace - optional param - namespace of the pod Output - k8s exec pod operation output and/or 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) *ObjectOperation

CreateObjectOperation creates new rook object client

func (*ObjectOperation) Create added in v0.8.0

func (ro *ObjectOperation) Create(namespace, storeName string, replicaCount int32) error

ObjectCreate Function to create a object store in rook

func (*ObjectOperation) Delete added in v0.8.0

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

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) *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(pool model.Pool, namespace string) (string, error)

func (*PoolOperation) GetCephPoolDetails added in v0.8.0

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

func (*PoolOperation) ListCephPools added in v0.8.0

func (p *PoolOperation) ListCephPools(namespace string) ([]client.CephStoragePoolSummary, error)

func (*PoolOperation) ListPoolCRDs added in v0.8.0

func (p *PoolOperation) ListPoolCRDs(namespace string) ([]cephv1beta1.Pool, 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(pool model.Pool, namespace string) (string, error)

type TestClient

type TestClient struct {
	BlockClient  *BlockOperation
	FSClient     *FilesystemOperation
	ObjectClient *ObjectOperation
	PoolClient   *PoolOperation
	// 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, namespace string) (*TestClient, error)

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