client

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package client provides an http client for interacting with the Hammerspace API

Index

Constants

View Source
const (
	BasePath = "/mgmt/v1.2/rest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HammerspaceClient

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

func NewHammerspaceClient

func NewHammerspaceClient(endpoint, username, password string, tlsVerify bool) (*HammerspaceClient, error)

func (*HammerspaceClient) CheckIfShareCreateTaskIsRunning

func (client *HammerspaceClient) CheckIfShareCreateTaskIsRunning(shareName string) (bool, error)

func (*HammerspaceClient) CreateShare

func (client *HammerspaceClient) CreateShare(name string,
	exportPath string,
	size int64,
	objectives []string,
	exportOptions []common.ShareExportOptions,
	deleteDelay int64,
	comment string) error

func (*HammerspaceClient) CreateShareFromSnapshot

func (client *HammerspaceClient) CreateShareFromSnapshot(name string,
	exportPath string,
	size int64,
	objectives []string,
	exportOptions []common.ShareExportOptions,
	deleteDelay int64,
	comment string,
	snapshotPath string) error

func (*HammerspaceClient) DeleteFileSnapshot

func (client *HammerspaceClient) DeleteFileSnapshot(filePath, snapshotName string) error

func (*HammerspaceClient) DeleteShare

func (client *HammerspaceClient) DeleteShare(name string, deleteDelay int64) error

func (*HammerspaceClient) DeleteShareSnapshot

func (client *HammerspaceClient) DeleteShareSnapshot(shareName, snapshotName string) error

func (*HammerspaceClient) DoesFileExist

func (client *HammerspaceClient) DoesFileExist(path string) (bool, error)

func (*HammerspaceClient) EnsureLogin

func (client *HammerspaceClient) EnsureLogin() error

Logs into Hammerspace Anvil Server

func (*HammerspaceClient) GetAnvilPortal

func (client *HammerspaceClient) GetAnvilPortal() (string, error)

GetAnvilPortal returns the hostname of the configured Hammerspace API gateway

func (*HammerspaceClient) GetClusterAvailableCapacity

func (client *HammerspaceClient) GetClusterAvailableCapacity() (int64, error)

func (*HammerspaceClient) GetDataPortals

func (client *HammerspaceClient) GetDataPortals(nodeID string) ([]common.DataPortal, error)

GetDataPortals returns a list of operational data-portals those with a matching nodeID are put at the top of the list

func (*HammerspaceClient) GetFile

func (client *HammerspaceClient) GetFile(path string) (*common.File, error)

func (*HammerspaceClient) GetFileSnapshots

func (client *HammerspaceClient) GetFileSnapshots(filePath string) ([]common.FileSnapshot, error)

func (*HammerspaceClient) GetPortalFloatingIp

func (client *HammerspaceClient) GetPortalFloatingIp() (string, error)

Return a string with a floating data portal IP

func (*HammerspaceClient) GetShare

func (client *HammerspaceClient) GetShare(name string) (*common.ShareResponse, error)

func (*HammerspaceClient) GetShareRawFields

func (client *HammerspaceClient) GetShareRawFields(name string) (map[string]interface{}, error)

func (*HammerspaceClient) GetShareSnapshots

func (client *HammerspaceClient) GetShareSnapshots(shareName string) ([]string, error)

func (*HammerspaceClient) ListObjectiveNames

func (client *HammerspaceClient) ListObjectiveNames() ([]string, error)

func (*HammerspaceClient) ListObjectives

func (client *HammerspaceClient) ListObjectives() ([]common.ClusterObjectiveResponse, error)

func (*HammerspaceClient) ListShares

func (client *HammerspaceClient) ListShares() ([]common.ShareResponse, error)

func (*HammerspaceClient) ListSnapshots

func (client *HammerspaceClient) ListSnapshots() ([]common.SnapshotResponse, error)

func (*HammerspaceClient) ListVolumes

func (client *HammerspaceClient) ListVolumes() ([]common.VolumeResponse, error)

func (*HammerspaceClient) RestoreFileSnapToDestination

func (client *HammerspaceClient) RestoreFileSnapToDestination(snapshotPath, filePath string) error

func (*HammerspaceClient) SetObjectives

func (client *HammerspaceClient) SetObjectives(shareName string,
	path string,
	objectives []string,
	replaceExisting bool) error

Set objectives on a share, at the specified path, optionally clearing previously-set objectives at the path The path must start with a slash

func (*HammerspaceClient) SnapshotFile

func (client *HammerspaceClient) SnapshotFile(filepath string) (string, error)

func (*HammerspaceClient) SnapshotShare

func (client *HammerspaceClient) SnapshotShare(shareName string) (string, error)

func (*HammerspaceClient) UpdateShareSize

func (client *HammerspaceClient) UpdateShareSize(name string,
	size int64,
) error

func (*HammerspaceClient) WaitForTaskCompletion

func (client *HammerspaceClient) WaitForTaskCompletion(taskLocation string) (bool, error)

Jump to

Keyboard shortcuts

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