apiv1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Note: The bulk of this was taken from the goextremio package.

Index

Constants

This section is empty.

Variables

View Source
var (
	NamespacePath       = "namespace"
	VolumesPath         = "/ifs/volumes"
	ExportsPath         = "platform/1/protocols/nfs/exports"
	QuotaPath           = "platform/1/quota/quotas"
	SnapshotsPath       = "platform/1/snapshot/snapshots"
	VolumeSnapshotsPath = "/ifs/.snapshot"
)

Functions

This section is empty.

Types

type AclRequest

type AclRequest struct {
	Authoritative string     `json:"authoritative"`
	Action        string     `json:"action"`
	Owner         *Ownership `json:"owner"`
	Group         *Ownership `json:"group,omitempty"`
}

type Error

type Error struct {
	StatusCode int
	Err        []PapiError `json:"errors"`
}

func (*Error) Error

func (err *Error) Error() string

Extract the error string from a received error message

type ExportClientList

type ExportClientList struct {
	Clients []string `json:"clients"`
}

Isi PAPI export clients JSON struct

type ExportPathList

type ExportPathList struct {
	Paths  []string `json:"paths"`
	MapAll struct {
		User   string   `json:"user"`
		Groups []string `json:"groups,omitempty"`
	} `json:"map_all"`
}

Isi PAPI export path JSON struct

type IsiExport

type IsiExport struct {
	Id      int      `json:"id"`
	Paths   []string `json:"paths"`
	Clients []string `json:"clients"`
}

Isi PAPI export attributes JSON structs

type IsiQuota

type IsiQuota struct {
	Container                 bool          `json:"container"`
	Enforced                  bool          `json:"enforced"`
	Id                        string        `json:"id"`
	IncludeSnapshots          bool          `json:"include_snapshots"`
	Linked                    interface{}   `json:"linked"`
	Notifications             string        `json:"notifications"`
	Path                      string        `json:"path"`
	Persona                   interface{}   `json:"persona"`
	Ready                     bool          `json:"ready"`
	Thresholds                isiThresholds `json:"thresholds"`
	ThresholdsIncludeOverhead bool          `json:"thresholds_include_overhead"`
	Type                      string        `json:"type"`
	Usage                     struct {
		Inodes   int64 `json:"inodes"`
		Logical  int64 `json:"logical"`
		Physical int64 `json:"physical"`
	} `json:"usage"`
}

type IsiQuotaReq

type IsiQuotaReq struct {
	Enforced                  bool             `json:"enforced"`
	IncludeSnapshots          bool             `json:"include_snapshots"`
	Path                      string           `json:"path"`
	Thresholds                isiThresholdsReq `json:"thresholds"`
	ThresholdsIncludeOverhead bool             `json:"thresholds_include_overhead"`
	Type                      string           `json:"type"`
}

type IsiSnapshot

type IsiSnapshot struct {
	Created       int64   `json:"created"`
	Expires       int64   `json:"expires"`
	HasLocks      bool    `json:"has_locks"`
	Id            int64   `json:"id"`
	Name          string  `json:"name"`
	Path          string  `json:"path"`
	PctFilesystem float64 `json:"pct_filesystem"`
	PctReserve    float64 `json:"pct_reserve"`
	Schedule      string  `json:"schedule"`
	ShadowBytes   int64   `json:"shadow_bytes"`
	Size          int64   `json:"size"`
	State         string  `json:"state"`
	TargetId      int64   `json:"target_it"`
	TargetName    string  `json:"target_name"`
}

Isi PAPI snapshot JSON struct

type IsiUpdateQuotaReq

type IsiUpdateQuotaReq struct {
	Enforced                  bool             `json:"enforced"`
	Thresholds                isiThresholdsReq `json:"thresholds"`
	ThresholdsIncludeOverhead bool             `json:"thresholds_include_overhead"`
}

type IsiVolume

type IsiVolume struct {
	Name         string `json:"name"`
	AttributeMap []struct {
		Name  string      `json:"name"`
		Value interface{} `json:"value"`
	} `json:"attrs"`
}

type Ownership

type Ownership struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

Isi PAPI Volume ACL JSON structs

type PapiConnection

type PapiConnection struct {
	VolumePath string
	// contains filtered or unexported fields
}

func New

func New(endpoint string, insecure bool, username, group, password, volumePath string) (*PapiConnection, error)

Create a new HTTP connection

func (*PapiConnection) CopyIsiSnapshot

func (papi *PapiConnection) CopyIsiSnapshot(sourceSnapshotName, sourceVolume, destinationName string) (resp *IsiVolume, err error)

CopyIsiSnaphost copies all files/directories in a snapshot to a new directory

func (*PapiConnection) CopyIsiVolume

func (papi *PapiConnection) CopyIsiVolume(sourceName, destinationName string) (resp *getIsiVolumesResp, err error)

CopyIsiVolume creates a new volume on the cluster based on an existing volume

func (*PapiConnection) CreateIsiSnapshot

func (papi *PapiConnection) CreateIsiSnapshot(path, name string) (resp *IsiSnapshot, err error)

CreateIsiSnapshot makes a new snapshot on the cluster

func (*PapiConnection) CreateIsiVolume

func (papi *PapiConnection) CreateIsiVolume(name string) (resp *getIsiVolumesResp, err error)

CreateIsiVolume makes a new volume on the cluster

func (*PapiConnection) DeleteIsiQuota

func (papi *PapiConnection) DeleteIsiQuota(path string) (err error)

DeleteIsiQuota removes the quota for a directory

func (*PapiConnection) DeleteIsiVolume

func (papi *PapiConnection) DeleteIsiVolume(name string) (resp *getIsiVolumesResp, err error)

DeleteIsiVolume removes a volume from the cluster

func (*PapiConnection) Export

func (papi *PapiConnection) Export(path string) (err error)

Export enables an NFS export on the cluster to access the volumes. Return the path to the export so other processes can mount the volume directory

func (*PapiConnection) GetIsiExports

func (papi *PapiConnection) GetIsiExports() (resp *getIsiExportsResp, err error)

GetIsiExports queries a list of all exports on the cluster

func (*PapiConnection) GetIsiQuota

func (papi *PapiConnection) GetIsiQuota(path string) (quota *IsiQuota, err error)

GetIsiQuota queries the quota for a directory

func (*PapiConnection) GetIsiSnapshot

func (papi *PapiConnection) GetIsiSnapshot(id int64) (*IsiSnapshot, error)

GetIsiSnapshot queries an individual snapshot on the cluster

func (*PapiConnection) GetIsiSnapshots

func (papi *PapiConnection) GetIsiSnapshots() (resp *getIsiSnapshotsResp, err error)

GetIsiSnapshots queries a list of all snapshots on the cluster

func (*PapiConnection) GetIsiVolume

func (papi *PapiConnection) GetIsiVolume(name string) (resp *getIsiVolumeAttributesResp, err error)

GetIsiVolume queries the attributes of a volume on the cluster

func (*PapiConnection) GetIsiVolumes

func (papi *PapiConnection) GetIsiVolumes() (resp *getIsiVolumesResp, err error)

GetIsiVolumes queries a list of all volumes on the cluster

func (*PapiConnection) RemoveIsiSnapshot

func (papi *PapiConnection) RemoveIsiSnapshot(id int64) error

RemoveIsiSnapshot deletes a snapshot from the cluster

func (*PapiConnection) SetExportClients

func (papi *PapiConnection) SetExportClients(Id int, clients []string) (err error)

SetExportClients limits access to an NFS export on the cluster to a specific client address.

func (*PapiConnection) SetIsiQuotaHardThreshold

func (papi *PapiConnection) SetIsiQuotaHardThreshold(path string, size int64) (err error)

SetIsiQuotaHardThreshold sets the hard threshold of a quota for a directory

func (*PapiConnection) Unexport

func (papi *PapiConnection) Unexport(Id int) (err error)

Unexport disables the NFS export on the cluster that points to the volumes directory.

func (*PapiConnection) UpdateIsiQuotaHardThreshold

func (papi *PapiConnection) UpdateIsiQuotaHardThreshold(path string, size int64) (err error)

UpdateIsiQuotaHardThreshold modifies the hard threshold of a quota for a directory

type PapiError

type PapiError struct {
	Code    string `json:"code"`
	Field   string `json:"field"`
	Message string `json:"message"`
}

Isi PAPI error JSON structs

type SnapshotPath

type SnapshotPath struct {
	Path string `json:"path"`
	Name string `json:"name,omitempty"`
}

Isi PAPI snapshot path JSON struct

type VolumeName

type VolumeName struct {
	Name string `json:"name"`
}

Isi PAPI volume JSON structs

Jump to

Keyboard shortcuts

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