cteraclient

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CteraClient

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

CteraClient wrapper on top the actual ctera-openapi

func GetAuthenticatedCteraClient

func GetAuthenticatedCteraClient(ctx context.Context, logger Logger, filerAddress, username, password string) (*CteraClient, error)

GetAuthenticatedCteraClient Create a CteraClient object and login to the filer with the provided credentials

func NewCteraClient

func NewCteraClient(logger Logger, filerAddress string) (*CteraClient, error)

NewCteraClient Get an unauthenticated CteraClient object

func (*CteraClient) AddTrustedNfsClient

func (c *CteraClient) AddTrustedNfsClient(shareName, address, netmask string, perm ctera.FileAccessMode) error

AddTrustedNfsClient adds a trusted NFS client definition to the share

func (*CteraClient) Authenticate

func (c *CteraClient) Authenticate(ctx context.Context, username, password string) error

Authenticate login to the filer with the provided credentials

func (*CteraClient) ConnectToPortal

func (c *CteraClient) ConnectToPortal(portalAddress, portalUser, portalPassword string, trust bool) (bool, error)

func (*CteraClient) CreateShare

func (c *CteraClient) CreateShare(name, path string, uuid *string, trustedNfsClients []ctera.NFSv3AccessControlEntry) (*ctera.Share, error)

CreateShare creates a share with the provided name and path and exports it to NFS

func (*CteraClient) DeleteShareSafe

func (c *CteraClient) DeleteShareSafe(name string) error

DeleteShareSafe deletes the share. Does not return an error if the share does not exists

func (*CteraClient) EnableCache

func (c *CteraClient) EnableCache() (bool, error)

func (*CteraClient) GetNfsConfiguration

func (c *CteraClient) GetNfsConfiguration() (*ctera.NfsConfiguration, error)

func (*CteraClient) GetShareSafe

func (c *CteraClient) GetShareSafe(name string) (*ctera.Share, error)

GetShareSafe returns the share by name. If the share does not exist returns nil without an error

func (*CteraClient) InitializeFiler

func (c *CteraClient) InitializeFiler(ctx context.Context, username, password string) (bool, error)

func (*CteraClient) RefreshFolders

func (c *CteraClient) RefreshFolders() error

func (*CteraClient) RemoveTrustedNfsClient

func (c *CteraClient) RemoveTrustedNfsClient(shareName, address, netmask string) error

RemoveTrustedNfsClient removes the trusted NFS client definition from the share

func (*CteraClient) SetLinuxAvoidUsingFanotify

func (c *CteraClient) SetLinuxAvoidUsingFanotify(newValue bool) (bool, error)

func (*CteraClient) SetNfsConfiguration

func (c *CteraClient) SetNfsConfiguration(configuration *ctera.NfsConfiguration) error

func (*CteraClient) UnsuspendSync

func (c *CteraClient) UnsuspendSync() (bool, error)

type Error

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

Error error type for Ctera Client errors

func (Error) Error

func (e Error) Error() string

Error returns non-empty string if there was an error.

type Logger

type Logger interface {
	Info(string, ...interface{})
	Error(error, string, ...interface{})
}

Logger interfaces are used to provide logging to the cteraclient package.

Jump to

Keyboard shortcuts

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