client

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 27 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(ctx context.Context, shareName string) (bool, error)

func (*HammerspaceClient) CreateShare

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

func (*HammerspaceClient) CreateShareFromSnapshot

func (client *HammerspaceClient) CreateShareFromSnapshot(ctx context.Context, 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(ctx context.Context, filePath, snapshotName string) error

func (*HammerspaceClient) DeleteShare

func (client *HammerspaceClient) DeleteShare(ctx context.Context, name string, deleteDelay int64) error

func (*HammerspaceClient) DeleteShareSnapshot

func (client *HammerspaceClient) DeleteShareSnapshot(ctx context.Context, shareName, snapshotName string) error

func (*HammerspaceClient) DoesFileExist

func (client *HammerspaceClient) DoesFileExist(ctx context.Context, 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(ctx context.Context) (int64, error)

func (*HammerspaceClient) GetDataPortals

func (client *HammerspaceClient) GetDataPortals(ctx context.Context, 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(ctx context.Context, path string) (*common.File, error)

func (*HammerspaceClient) GetFileSnapshots

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

func (*HammerspaceClient) GetPortalFloatingIp

func (client *HammerspaceClient) GetPortalFloatingIp(ctx context.Context) (string, error)

Return a string with a floating data portal IP

func (*HammerspaceClient) GetShare

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

func (*HammerspaceClient) GetShareRawFields

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

func (*HammerspaceClient) GetShareSnapshots

func (client *HammerspaceClient) GetShareSnapshots(ctx context.Context, shareName string) ([]string, error)

func (*HammerspaceClient) ListObjectiveNames

func (client *HammerspaceClient) ListObjectiveNames(ctx context.Context) ([]string, error)

func (*HammerspaceClient) ListObjectives

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

func (*HammerspaceClient) ListShares

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

func (*HammerspaceClient) ListSnapshots

func (client *HammerspaceClient) ListSnapshots(ctx context.Context, snapshot_id, volume_id string) ([]common.SnapshotResponse, error)

func (*HammerspaceClient) ListVolumes

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

func (*HammerspaceClient) RestoreFileSnapToDestination

func (client *HammerspaceClient) RestoreFileSnapToDestination(ctx context.Context, snapshotPath, filePath string) error

func (*HammerspaceClient) SetObjectives

func (client *HammerspaceClient) SetObjectives(ctx context.Context, 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(ctx context.Context, filepath string) (string, error)

func (*HammerspaceClient) SnapshotShare

func (client *HammerspaceClient) SnapshotShare(ctx context.Context, shareName string) (string, error)

func (*HammerspaceClient) UpdateShareSize

func (client *HammerspaceClient) UpdateShareSize(ctx context.Context, name string, size int64) error

size in bytes

func (*HammerspaceClient) WaitForTaskCompletion

func (client *HammerspaceClient) WaitForTaskCompletion(ctx context.Context, taskLocation string) (bool, error)

Jump to

Keyboard shortcuts

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