goxtremio

package module
v0.0.0-...-dd0daf3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

README

GoXtremIO

Overview

GoXtremIO represents API bindings for Go that allow you to manage XtremIO storage 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.

API Compatibility

Currently only tested with XMS v3.

Functions

Name Description
GetEvents get a list or filtered list of events
GetInitiator get a specific initiator by name or ID
GetInitiators get a non-detailed list of initiators
GetInitiatorGroup get a specific initiator group by name or ID
GetInitiatorGroups get a non-detailed list of initiator groups
GetIGFolder get a specific initiator group folder by name or ID
GetIGFolders get a non-detailed list of initiator folders
GetISCSIPortal get a specific ISCSI portal by name or ID
GetISCSIPortals get a non-detailed list of ISCSI portals
GetLunMap get a specific LUN map by name or ID
GetLunMaps get a non-detailed list of LUN maps
NewLunMap create a new LUN map
DeleteLunMap delete a LUN map
GetSnapshot get a specific snapshot by name or ID
GetSnapshots get a non-detailed list of snapshots
NewSnapshot create a new snapshot of a volume
DeleteSnapshot delete a snapshot
GetVolume get a specific volume by name or ID
GetVolumes get a non-detailed list of volumes
NewVolume create a new volume
DeleteVolume delete a volume
GetVolumeFolder get a specific volume folder by name or ID
GetVolumeFolders get a non-detailed list of volume folders

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)
if err != nil {
	panic(err)
}

Get an Initiator Group by Name

initiator, err := c.GetInitiatorGroup("", "VPLEX-ee20")
if err != nil {
  panic(err)
}

Create a Volume

opts := &NewVolumeOptions{
  VolName: "testing1",
  VolSize: 1073741824,
}

result, err := c.NewVolume(opts)
if err != nil {
  panic(err)
}

Map a Volume

opts := &NewLunMapOptions{
  VolID: 24,
  IgID:  4,
}

result, err := c.NewLunMap(opts)
if err != nil {
  panic(err)
}

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

Environment Variables

Name Description
GOXTREMIO_ENDPOINT the API endpoint, ie. https://10.5.132.140/api/json
GOXTREMIO_USERNAME the username
GOXTREMIO_PASSWORD the password
GOXTREMIO_INSECURE whether to skip SSL validation
GOXTREMIO_DEBUG enables debug logging

Contributions

Please contribute! The API bindings are not 100% complete based on the v3 API, so there is some work left to implement all features.

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

Please file bugs and issues at the Github issues page. For more general discussions you can contact the EMC Code team at Google Groups or tagged with EMC on Stackoverflow.com. 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 Client3

func NewClient

func NewClient() (*Client, error)

func NewClientWithArgs

func NewClientWithArgs(
	endpoint string,
	insecure bool,
	username, password string) (*Client, error)

func (*Client) DeleteInitiator

func (c *Client) DeleteInitiator(id string, name string) error

DeleteInitiator deletes a volume

func (*Client) DeleteLunMap

func (c *Client) DeleteLunMap(id string, name string) error

DeleteLunMap deletes a volume

func (*Client) DeleteSnapshot

func (c *Client) DeleteSnapshot(id string, name string) error

DeleteSnapshot deletes a volume

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(id string, name string) error

DeleteVolume deletes a volume

func (*Client) GetEvents

func (c *Client) GetEvents(
	severity, eventCode, descRxPatt string) ([]Event, error)

GetEvents returns a list or a specific events filtered by severity, eventCode, or description

func (*Client) GetIGFolder

func (c *Client) GetIGFolder(id string, name string) (InitiatorGroupFolder, error)

GetIGFolder returns a specific initiator by name or ID

func (*Client) GetIGFolders

func (c *Client) GetIGFolders() (Refs, error)

GetIGFolders returns a list of initiators

func (*Client) GetISCSIPortal

func (c *Client) GetISCSIPortal(id string, name string) (ISCSIPortal, error)

GetISCSIPortal returns a specific iSCSI portal by name or ID

func (*Client) GetISCSIPortals

func (c *Client) GetISCSIPortals() (Refs, error)

GetISCSIPortals returns a list of iSCSI portals

func (*Client) GetInitiator

func (c *Client) GetInitiator(id string, name string) (Initiator, error)

GetInitiator returns a specific initiator by name or ID

func (*Client) GetInitiatorGroup

func (c *Client) GetInitiatorGroup(
	id string, name string) (*InitiatorGroup, error)

GetInitiatorGroup returns a specific initiator by name or ID

func (*Client) GetInitiatorGroups

func (c *Client) GetInitiatorGroups() (Refs, error)

GetInitiatorGroups returns a list of initiators

func (*Client) GetInitiators

func (c *Client) GetInitiators() (Refs, error)

GetInitiators returns a list of initiators

func (*Client) GetLunMap

func (c *Client) GetLunMap(id string, name string) (LunMap, error)

GetLunMap returns a specific lunMap by name or ID

func (*Client) GetLunMaps

func (c *Client) GetLunMaps() (Refs, error)

GetLunMaps returns a list of lunMaps

func (*Client) GetSnapshot

func (c *Client) GetSnapshot(id string, name string) (Snapshot, error)

GetSnapshot returns a specific snapshot by name or ID

func (*Client) GetSnapshots

func (c *Client) GetSnapshots() (Refs, error)

GetSnapshots returns a list of snapshots

func (*Client) GetVolume

func (c *Client) GetVolume(id string, name string) (Volume, error)

GetVolume returns a specific volume by name or ID

func (*Client) GetVolumeFolder

func (c *Client) GetVolumeFolder(id string, name string) (VolumeFolder, error)

GetVolumeFolder returns a specific initiator by name or ID

func (*Client) GetVolumeFolders

func (c *Client) GetVolumeFolders() (Refs, error)

GetVolumeFolders returns a list of initiators

func (*Client) GetVolumes

func (c *Client) GetVolumes() (Refs, error)

GetVolumes returns a list of volumes

func (*Client) NewInitiator

func (c *Client) NewInitiator(opts *NewInitiatorOptions) (NewInitiatorResult, error)

NewInitiator creates a volume

func (*Client) NewLunMap

func (c *Client) NewLunMap(opts *NewLunMapOptions) (NewLunMapResult, error)

NewLunMap creates a volume

func (*Client) NewSnapshot

func (c *Client) NewSnapshot(opts *NewSnapshotOptions) (NewSnapshotResult, error)

NewSnapshot creates a volume

func (*Client) NewVolume

func (c *Client) NewVolume(opts *NewVolumeOptions) (NewVolumeResult, error)

NewVolume creates a volume

type Client3

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

type Event

type Event *xms.Event

type ISCSIPortal

type ISCSIPortal *xms.ISCSIPortal

type Initiator

type Initiator *xms.Initiator

type InitiatorGroup

type InitiatorGroup xms.InitiatorGroup

type InitiatorGroupFolder

type InitiatorGroupFolder *xms.IGFolder

type LunMap

type LunMap *xms.LunMap

type NewInitiatorOptions

type NewInitiatorOptions xms.PostInitiatorsReq

type NewInitiatorResult

type NewInitiatorResult *xms.PostInitiatorsResp

type NewLunMapOptions

type NewLunMapOptions xms.PostLunMapsReq

type NewLunMapResult

type NewLunMapResult *xms.PostLunMapsResp

type NewSnapshotOptions

type NewSnapshotOptions xms.PostSnapshotsReq

type NewSnapshotResult

type NewSnapshotResult *xms.PostSnapshotsResp

type NewVolumeOptions

type NewVolumeOptions xms.PostVolumesReq

type NewVolumeResult

type NewVolumeResult *xms.PostVolumesResp

type Refs

type Refs []*xms.Ref

type SnapListItems

type SnapListItems []*xms.SnapListItem

func NewSnapListItems

func NewSnapListItems(ancestorIdsAndNames ...string) SnapListItems

type Snapshot

type Snapshot *xms.Snapshot

func SnapshotCtor

func SnapshotCtor() Snapshot

Constructs a new Snapshot instance

func SnapshotCtorNameIndex

func SnapshotCtorNameIndex(name string, index int) Snapshot

Constructs a new Snapshot instance

type Volume

type Volume *xms.Volume

func VolumeCtor

func VolumeCtor() Volume

Constructs a new Volume instance

func VolumeCtorNameIndex

func VolumeCtorNameIndex(name string, index int) Volume

Constructs a new Volume instance

type VolumeFolder

type VolumeFolder *xms.VolumeFolder

Directories

Path Synopsis
api
v3

Jump to

Keyboard shortcuts

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