clients

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2018 License: Apache-2.0 Imports: 10 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) (model.StatusDetails, error)

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

Types

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, rookRestClient contracts.RestAPIOperator) *BlockOperation

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

func (*BlockOperation) BlockCreate

func (rb *BlockOperation) BlockCreate(name string, size int) (string, error)

BlockCreate Function to create a Block using Rook Input parameters - name - 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) BlockDelete

func (rb *BlockOperation) BlockDelete(name string) (string, error)

BlockDelete Function to delete a Block using Rook Input parameters - name - 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) BlockList

func (rb *BlockOperation) BlockList() ([]model.BlockImage, error)

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

func (*BlockOperation) BlockMap

func (rb *BlockOperation) BlockMap(name string, mountpath string) (string, error)

BlockMap Function to map a Block using Rook Input parameters - name - 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) BlockRead

func (rb *BlockOperation) BlockRead(name string, mountpath string, filename string, namespace string) (string, error)

BlockRead Function to read from block created by rook ,i.e. Read data from a pod that is using a pvc 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 (*BlockOperation) BlockUnmap

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

BlockUnmap Function to unmap a Block using Rook Input parameters - name - 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) BlockWrite

func (rb *BlockOperation) BlockWrite(name string, mountpath string, data string, filename string, namespace string) (string, error)

BlockWrite Function to write data to block created by rook ,i.e. write data to a pod that is using a pvc 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 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(k8shelp *utils.K8sHelper, rookRestClient contracts.RestAPIOperator) *FilesystemOperation

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

func (*FilesystemOperation) FSCreate added in v0.6.0

func (rfs *FilesystemOperation) FSCreate(name, namespace string, callAPI bool, k8sh *utils.K8sHelper) 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 rook rest API client

func (*FilesystemOperation) FSDelete added in v0.6.0

func (rfs *FilesystemOperation) FSDelete(name string) (string, error)

FSDelete Function to delete a filesystem in rook Input parameters - name - name of the shared file system to be deleted Output - output returned by rook rest API client

func (*FilesystemOperation) FSList added in v0.6.0

func (rfs *FilesystemOperation) FSList() ([]model.Filesystem, error)

FSList Function to list a filesystem in rook Output - output returned by rook rest API client

func (*FilesystemOperation) FSMount added in v0.6.0

func (rfs *FilesystemOperation) FSMount(name string, path string) (string, error)

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

func (rfs *FilesystemOperation) FSRead(name string, mountpath string, filename string, namespace string) (string, error)

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

func (rfs *FilesystemOperation) FSUnmount(name string) (string, error)

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

func (rfs *FilesystemOperation) FSWrite(name string, mountpath string, data string, filename string, namespace string) (string, error)

FSWrite 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(rookRestClient contracts.RestAPIOperator) *ObjectOperation

CreateObjectOperation creates new rook object client

func (*ObjectOperation) ObjectBucketList

func (ro *ObjectOperation) ObjectBucketList(storeName string) ([]model.ObjectBucket, error)

ObjectBucketList Function to get Buckets present in rook object store Input paramatres - None Output - output returned by rook Rest API client

func (*ObjectOperation) ObjectConnection

func (ro *ObjectOperation) ObjectConnection(storeName string) (*model.ObjectStoreConnectInfo, error)

ObjectConnection Function to get connection information for a user Input paramatres - None Output - output returned by rook Rest API client

func (*ObjectOperation) ObjectCreate

func (ro *ObjectOperation) ObjectCreate(namespace, storeName string, replicaCount int32, callAPI bool, k8sh *utils.K8sHelper) error

ObjectCreate Function to create a object store in rook Input parameters -None Output - output returned by rook Rest API client

func (*ObjectOperation) ObjectCreateUser

func (ro *ObjectOperation) ObjectCreateUser(storeName, userid string, displayname string) (*model.ObjectUser, error)

ObjectCreateUser Function to create user on rook object store Input paramatres - userId and display Name Output - output returned by rook Rest API client

func (*ObjectOperation) ObjectDelete added in v0.7.0

func (ro *ObjectOperation) ObjectDelete(namespace, storeName string, replicaCount int32, callAPI bool, k8sh *utils.K8sHelper) error

func (*ObjectOperation) ObjectDeleteUser

func (ro *ObjectOperation) ObjectDeleteUser(storeName, userid string) error

ObjectDeleteUser Function to delete user on rook object store Input paramatres - userId Output - output returned by rook Rest API client

func (*ObjectOperation) ObjectGetUser

func (ro *ObjectOperation) ObjectGetUser(storeName, userid string) (*model.ObjectUser, error)

ObjectGetUser Function to get a user on rook object store Input paramatres - userId Output - output returned by rook Rest API client

func (*ObjectOperation) ObjectListUser

func (ro *ObjectOperation) ObjectListUser(storeName string) ([]model.ObjectUser, error)

ObjectListUser Function to get all users on rook object store Input paramatres - none Output - output returned by rook Rest API client

func (*ObjectOperation) ObjectUpdateUser

func (ro *ObjectOperation) ObjectUpdateUser(storeName, userid string, displayname string, emailid string) (*model.ObjectUser, error)

ObjectUpdateUser Function to update a user on rook object store Input paramatres - userId,display Name and email address Output - output returned by rook Rest API client

type PoolClient

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

PoolClient is a wrapper for rook pool operations

func CreatePoolClient

func CreatePoolClient(rookRestClient contracts.RestAPIOperator) *PoolClient

CreatePoolClient creates a new pool client

func (*PoolClient) PoolCreate

func (rp *PoolClient) PoolCreate(pool model.Pool) (string, error)

PoolCreate creates new pool

func (*PoolClient) PoolList

func (rp *PoolClient) PoolList() ([]model.Pool, error)

PoolList returns all pools in rook

type RestAPIClient

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

RestAPIClient is wrapper for rook rest api client

func CreateRestAPIClient

func CreateRestAPIClient(k8sHelper *utils.K8sHelper, namespace string) *RestAPIClient

CreateRestAPIClient Create Rook REST API client

func (*RestAPIClient) CreateBlockImage

func (a *RestAPIClient) CreateBlockImage(image model.BlockImage) (string, error)

CreateBlockImage creates a new block image in rook

func (*RestAPIClient) CreateFilesystem

func (a *RestAPIClient) CreateFilesystem(fsmodel model.FilesystemRequest) (string, error)

CreateFilesystem creates file system on rook

func (*RestAPIClient) CreateObjectStore

func (a *RestAPIClient) CreateObjectStore(store model.ObjectStore) (string, error)

CreateObjectStore creates object store

func (*RestAPIClient) CreateObjectUser

func (a *RestAPIClient) CreateObjectUser(storeName string, user model.ObjectUser) (*model.ObjectUser, error)

CreateObjectUser creates new user in object store

func (*RestAPIClient) CreatePool

func (a *RestAPIClient) CreatePool(pool model.Pool) (string, error)

CreatePool creates a new pool

func (*RestAPIClient) DeleteBlockImage

func (a *RestAPIClient) DeleteBlockImage(image model.BlockImage) (string, error)

DeleteBlockImage deletes a block image from rook

func (*RestAPIClient) DeleteFilesystem

func (a *RestAPIClient) DeleteFilesystem(fsmodel model.FilesystemRequest) (string, error)

DeleteFilesystem deletes file system from rook

func (*RestAPIClient) DeleteObjectStore added in v0.6.0

func (a *RestAPIClient) DeleteObjectStore(storeName string) error

DeleteObjectStore creates object store

func (*RestAPIClient) DeleteObjectUser

func (a *RestAPIClient) DeleteObjectUser(storeName, id string) error

DeleteObjectUser deletes user from object store

func (*RestAPIClient) GetBlockImages

func (a *RestAPIClient) GetBlockImages() ([]model.BlockImage, error)

GetBlockImages returns list of a block images

func (*RestAPIClient) GetClientAccessInfo

func (a *RestAPIClient) GetClientAccessInfo() (model.ClientAccessInfo, error)

GetClientAccessInfo returns rook REST API client info

func (*RestAPIClient) GetFilesystems

func (a *RestAPIClient) GetFilesystems() ([]model.Filesystem, error)

GetFilesystems returns rook filesystem

func (*RestAPIClient) GetNodes

func (a *RestAPIClient) GetNodes() ([]model.Node, error)

GetNodes returns all rook nodes

func (*RestAPIClient) GetObjectStoreConnectionInfo

func (a *RestAPIClient) GetObjectStoreConnectionInfo(storeName string) (*model.ObjectStoreConnectInfo, error)

GetObjectStoreConnectionInfo returns object store connection info

func (*RestAPIClient) GetObjectUser

func (a *RestAPIClient) GetObjectUser(storeName, id string) (*model.ObjectUser, error)

GetObjectUser returns a object user from object store

func (*RestAPIClient) GetPools

func (a *RestAPIClient) GetPools() ([]model.Pool, error)

GetPools returns all pools in rook

func (*RestAPIClient) GetStatusDetails

func (a *RestAPIClient) GetStatusDetails() (model.StatusDetails, error)

GetStatusDetails reruns rook status details

func (*RestAPIClient) ListBuckets

func (a *RestAPIClient) ListBuckets(storeName string) ([]model.ObjectBucket, error)

ListBuckets lists all buckets in object store

func (*RestAPIClient) ListObjectUsers

func (a *RestAPIClient) ListObjectUsers(storeName string) ([]model.ObjectUser, error)

ListObjectUsers returns all object store users

func (*RestAPIClient) URL

func (a *RestAPIClient) URL() string

URL returns URL for rookAPI

func (*RestAPIClient) UpdateObjectUser

func (a *RestAPIClient) UpdateObjectUser(storeName string, user model.ObjectUser) (*model.ObjectUser, error)

UpdateObjectUser updates user in object store

type TestClient

type TestClient struct {
	// 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) GetBlockClient

func (c TestClient) GetBlockClient() contracts.BlockOperator

GetBlockClient returns Block client for platform in context

func (TestClient) GetFileSystemClient

func (c TestClient) GetFileSystemClient() contracts.FileSystemOperator

GetFileSystemClient returns fileSystem client for platform in context

func (TestClient) GetObjectClient

func (c TestClient) GetObjectClient() contracts.ObjectOperator

GetObjectClient returns Object client for platform in context

func (TestClient) GetPoolClient

func (c TestClient) GetPoolClient() contracts.PoolOperator

GetPoolClient returns pool client for platform in context

func (TestClient) GetRestAPIClient

func (c TestClient) GetRestAPIClient() contracts.RestAPIOperator

GetRestAPIClient returns RestAPI client for platform in context

func (TestClient) Node

func (c TestClient) Node() ([]model.Node, error)

Node returns list of rook nodes

func (TestClient) Status

func (c TestClient) Status() (model.StatusDetails, error)

Status returns rook status details

Jump to

Keyboard shortcuts

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