goisilon

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2016 License: Apache-2.0 Imports: 11 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) DisableFailureMapping added in v1.2.0

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

DisableFailureMapping disables the map_failure mapping for an Export.

func (*Client) DisableFailureMappingByID added in v1.2.0

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

DisableFailureMappingByID disables the map_failure mapping for an Export.

func (*Client) DisableNonRootMapping added in v1.2.0

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

DisableNonRootMapping disables the map_non_root mapping for an Export.

func (*Client) DisableNonRootMappingByID added in v1.2.0

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

DisableNonRootMappingByID disables the map_non_root mapping for an Export.

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) EnableFailureMapping added in v1.2.0

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

EnableFailureMapping enables the map_failure mapping for an Export.

func (*Client) EnableFailureMappingByID added in v1.2.0

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

EnableFailureMappingByID enables the map_failure mapping for an Export.

func (*Client) EnableNonRootMapping added in v1.2.0

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

EnableNonRootMapping enables the map_non_root mapping for an Export.

func (*Client) EnableNonRootMappingByID added in v1.2.0

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

EnableNonRootMappingByID enables the map_non_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) GetFailureMapping added in v1.2.0

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

GetFailureMapping returns the map_failure mapping for an Export.

func (*Client) GetFailureMappingByID added in v1.2.0

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

GetFailureMappingByID returns the map_failure mapping for an Export.

func (*Client) GetNonRootMapping added in v1.2.0

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

GetNonRootMapping returns the map_non_root mapping for an Export.

func (*Client) GetNonRootMappingByID added in v1.2.0

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

GetNonRootMappingByID returns the map_non_root mapping for an Export.

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) GetVolumeExportMap added in v1.2.0

func (c *Client) GetVolumeExportMap(
	ctx context.Context,
	includeRootClients bool) (map[Volume]Export, error)

GetVolumeExportMap returns a map that relates Volumes to their corresponding Exports. This function uses an Export's "clients" property to define the relationship. The flag "includeRootClients" can be set to "true" in order to also inspect the "root_clients" property of an Export when determining the Volume-to-Export relationship.

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

Directories

Path Synopsis
api
json
Package json implements encoding and decoding of JSON as defined in RFC 4627.
Package json implements encoding and decoding of JSON as defined in RFC 4627.
v1
v2

Jump to

Keyboard shortcuts

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