goisilon

package module
v1.1.0 Latest Latest
Warning

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

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

README

GoIsilon

Overview

GoIsilon represents API bindings for Go that allow you to manage Isilon NAS platforms. In the true nature of API bindings, it is intended that the functions available are basically a direct implementation of what is available through the API. There is however, an abstraction called object which can be used by things like Docker, Mesos, and REX-Ray to integrate Isilon.

API Compatibility

Currently only tested with v7+.

Examples

The package was written using test files, so these can be looked at for a more comprehensive view of how to implement the different functions.

Intialize a new client

c, err := NewClient() // or NewClientWithArgs(endpoint, insecure, userName,
password,volumePath)
if err != nil {
	panic(err)
}

Create a Volume

volume, err := c.CreateVolume("testing")

Export a Volume

err := c.ExportVolume("testing")

Delete a Volume

_, err := c.DeleteVolume(name)

For example usage you can see the REX-Ray repo. There, the goisilon package is used to implement a Volume Manager across multiple storage platforms. This includes managing multipathing, mounts, and filesystems.

Environment Variables

Name Description
GOISILON_ENDPOINT the API endpoint, https://172.17.177.230:8080
GOISILON_USERNAME the username
GOISILON_GROUP the user's group
GOISILON_PASSWORD the password
GOISILON_INSECURE whether to skip SSL validation
GOISILON_VOLUMEPATH which base path to use when looking for volume directories

Contributions

Please contribute!

Licensing

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Support

If you have questions relating to the project, please either post Github Issues, join our Slack channel available by signup through community.emc.com and post questions into #projects, or reach out to the maintainers directly. The code and documentation are released with no warranties or SLAs and are intended to be supported through a community driven process.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// API is the underlying OneFS API client.
	API api.Client
}

Client is an Isilon client.

func NewClient

func NewClient(ctx context.Context) (*Client, error)

func NewClientWithArgs

func NewClientWithArgs(
	ctx context.Context,
	endpoint string,
	insecure bool,
	user, group, pass, volumesPath string) (*Client, error)

func (*Client) AddExportClients added in v1.1.0

func (c *Client) AddExportClients(
	ctx context.Context, name string, clients ...string) error

AddExportClients adds to the Export's clients property.

func (*Client) AddExportClientsByID added in v1.1.0

func (c *Client) AddExportClientsByID(
	ctx context.Context, id int, clients ...string) error

AddExportClientsByID adds to the Export's clients property.

func (*Client) AddExportRootClients added in v1.1.0

func (c *Client) AddExportRootClients(
	ctx context.Context, name string, clients ...string) error

AddExportRootClients adds to the Export's root_clients property.

func (*Client) AddExportRootClientsByID added in v1.1.0

func (c *Client) AddExportRootClientsByID(
	ctx context.Context, id int, clients ...string) error

AddExportRootClientsByID adds to the Export's root_clients property.

func (*Client) ClearExportClients

func (c *Client) ClearExportClients(
	ctx context.Context, name string) error

ClearExportClients sets the Export's clients property to nil.

func (*Client) ClearExportClientsByID added in v1.1.0

func (c *Client) ClearExportClientsByID(
	ctx context.Context, id int) error

ClearExportClientsByID sets the Export's clients property to nil.

func (*Client) ClearExportRootClients added in v1.1.0

func (c *Client) ClearExportRootClients(
	ctx context.Context, name string) error

ClearExportRootClients sets the Export's root_clients property to nil.

func (*Client) ClearExportRootClientsByID added in v1.1.0

func (c *Client) ClearExportRootClientsByID(
	ctx context.Context, id int) error

ClearExportRootClientsByID sets the Export's clients property to nil.

func (*Client) ClearQuota

func (c *Client) ClearQuota(ctx context.Context, name string) error

ClearQuota removes the quota from a volume

func (*Client) CopySnapshot

func (c *Client) CopySnapshot(
	ctx context.Context,
	sourceId int64, sourceName, destinationName string) (Volume, error)

func (*Client) CopyVolume

func (c *Client) CopyVolume(
	ctx context.Context, src, dest string) (Volume, error)

CopyVolume creates a volume based on an existing volume

func (*Client) CreateSnapshot

func (c *Client) CreateSnapshot(
	ctx context.Context, path, name string) (Snapshot, error)

func (*Client) CreateVolume

func (c *Client) CreateVolume(
	ctx context.Context, name string) (Volume, error)

CreateVolume creates a volume

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(
	ctx context.Context, name string) error

DeleteVolume deletes a volume

func (*Client) DisableRootMapping added in v1.1.0

func (c *Client) DisableRootMapping(
	ctx context.Context, name string) error

DisableRootMapping disables the root mapping for an Export.

func (*Client) DisableRootMappingByID added in v1.1.0

func (c *Client) DisableRootMappingByID(
	ctx context.Context, id int) error

DisableRootMappingbyID disables the root mapping for an Export.

func (*Client) EnableRootMapping added in v1.1.0

func (c *Client) EnableRootMapping(
	ctx context.Context, name, user string) error

EnableRootMapping enables the root mapping for an Export.

func (*Client) EnableRootMappingByID added in v1.1.0

func (c *Client) EnableRootMappingByID(
	ctx context.Context, id int, user string) error

EnableRootMappingByID enables the root mapping for an Export.

func (*Client) Export

func (c *Client) Export(ctx context.Context, name string) (int, error)

Export the volume with a given name on the cluster

func (*Client) ExportVolume

func (c *Client) ExportVolume(
	ctx context.Context, name string) (int, error)

ExportVolume exports a volume

func (*Client) GetExportByID added in v1.1.0

func (c *Client) GetExportByID(ctx context.Context, id int) (Export, error)

GetExportByID returns an export with the provided ID.

func (*Client) GetExportByName added in v1.1.0

func (c *Client) GetExportByName(
	ctx context.Context, name string) (Export, error)

GetExportByName returns the first export with a path for the provided volume name.

func (*Client) GetExportClients

func (c *Client) GetExportClients(
	ctx context.Context, name string) ([]string, error)

GetExportClients returns an Export's clients property.

func (*Client) GetExportClientsByID added in v1.1.0

func (c *Client) GetExportClientsByID(
	ctx context.Context, id int) ([]string, error)

GetExportClientsByID returns an Export's clients property.

func (*Client) GetExportRootClients added in v1.1.0

func (c *Client) GetExportRootClients(
	ctx context.Context, name string) ([]string, error)

GetExportRootClients returns an Export's root_clients property.

func (*Client) GetExportRootClientsByID added in v1.1.0

func (c *Client) GetExportRootClientsByID(
	ctx context.Context, id int) ([]string, error)

GetExportRootClientsByID returns an Export's clients property.

func (*Client) GetExports added in v1.1.0

func (c *Client) GetExports(ctx context.Context) (ExportList, error)

GetExports returns a list of all exports on the cluster

func (*Client) GetQuota

func (c *Client) GetQuota(ctx context.Context, name string) (Quota, error)

GetQuota returns a specific quota by path

func (*Client) GetRootMapping added in v1.1.0

func (c *Client) GetRootMapping(
	ctx context.Context, name string) (UserMapping, error)

GetRootMapping returns the root mapping for an Export.

func (*Client) GetRootMappingByID added in v1.1.0

func (c *Client) GetRootMappingByID(
	ctx context.Context, id int) (UserMapping, error)

GetRootMappingByID returns the root mapping for an Export.

func (*Client) GetSnapshot

func (c *Client) GetSnapshot(
	ctx context.Context, id int64, name string) (Snapshot, error)

func (*Client) GetSnapshots

func (c *Client) GetSnapshots(ctx context.Context) (SnapshotList, error)

func (*Client) GetSnapshotsByPath

func (c *Client) GetSnapshotsByPath(
	ctx context.Context, path string) (SnapshotList, error)

func (*Client) GetVolume

func (c *Client) GetVolume(
	ctx context.Context, id, name string) (Volume, error)

GetVolume returns a specific volume by name or ID

func (*Client) GetVolumeExports

func (c *Client) GetVolumeExports(
	ctx context.Context) ([]*VolumeExport, error)

GetVolumeExports return a list of volume exports

func (*Client) GetVolumes

func (c *Client) GetVolumes(ctx context.Context) ([]Volume, error)

GetVolumes returns a list of volumes

func (*Client) IsExported added in v1.1.0

func (c *Client) IsExported(
	ctx context.Context, name string) (bool, int, error)

IsExported returns a flag and export ID if the provided volume name is already exported.

func (*Client) RemoveSnapshot

func (c *Client) RemoveSnapshot(
	ctx context.Context, id int64, name string) error

func (*Client) SetExportClients

func (c *Client) SetExportClients(
	ctx context.Context, name string, clients ...string) error

SetExportClients sets the Export's clients property.

func (*Client) SetExportClientsByID added in v1.1.0

func (c *Client) SetExportClientsByID(
	ctx context.Context, id int, clients ...string) error

SetExportClientsByID sets the Export's clients property.

func (*Client) SetExportRootClients added in v1.1.0

func (c *Client) SetExportRootClients(
	ctx context.Context, name string, clients ...string) error

SetExportRootClients sets the Export's root_clients property.

func (*Client) SetExportRootClientsByID added in v1.1.0

func (c *Client) SetExportRootClientsByID(
	ctx context.Context, id int, clients ...string) error

SetExportRootClientsByID sets the Export's clients property.

func (*Client) SetQuotaSize

func (c *Client) SetQuotaSize(
	ctx context.Context, name string, size int64) error

SetQuota sets the max size (hard threshold) of a quota for a volume

func (*Client) Unexport

func (c *Client) Unexport(
	ctx context.Context, name string) error

Stop exporting a given volume from the cluster

func (*Client) UnexportByID added in v1.1.0

func (c *Client) UnexportByID(
	ctx context.Context, id int) error

UnexportByID unexports an Export by its ID.

func (*Client) UnexportVolume

func (c *Client) UnexportVolume(
	ctx context.Context, name string) error

UnexportVolume stops exporting a volume

func (*Client) UpdateQuotaSize

func (c *Client) UpdateQuotaSize(
	ctx context.Context, name string, size int64) error

UpdateQuota modifies the max size (hard threshold) of a quota for a volume

type Export

type Export *api.Export

type ExportList

type ExportList []*api.Export

type Quota

type Quota *api.IsiQuota

type Snapshot

type Snapshot *api.IsiSnapshot

type SnapshotList

type SnapshotList []*api.IsiSnapshot

type UserMapping added in v1.1.0

type UserMapping *api.UserMapping

type Volume

type Volume *api.IsiVolume

type VolumeExport

type VolumeExport struct {
	Volume     Volume
	ExportPath string
	Clients    []string
}

Directories

Path Synopsis
api
v1
v2

Jump to

Keyboard shortcuts

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