goscaleio

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

README

Goscaleio

The Goscaleio project represents API bindings that can be used to provide ScaleIO functionality into other Go applications.

Use Cases

Any application written in Go can take advantage of these bindings. Specifically, things that are involved in monitoring, management, and more specifically infrastructrue as code would find these bindings relevant.

Current State

Early build-out and pre-documentation stages. The basics around authentication and object models are there.

Usage

Logging in
client, err := goscaleio.NewClient()
if err != nil {
  log.Fatalf("err: %v", err)
}

_, err = client.Authenticate(&goscaleio.ConfigConnect{endpoint, username, password})
if err != nil {
  log.Fatalf("error authenticating: %v", err)
}

fmt.Println("Successfuly logged in to ScaleIO Gateway at", client.SIOEndpoint.String())
Reusing the authentication token

Once a client struct is created via the NewClient() function, you can replace the Token with the saved token.

client, err := goscaleio.NewClient()
if err != nil {
  log.Fatalf("error with NewClient: %s", err)
}

client.Token = oldToken
Get Systems

Retrieving systems is the first step after authentication which enables you to work with other necessary methods.

All Systems
systems, err := client.GetInstance()
if err != nil {
  log.Fatalf("err: problem getting instance %v", err)
}
Find a System
system, err := client.FindSystem(systemid,"","")
if err != nil {
  log.Fatalf("err: problem getting instance %v", err)
}
Get Protection Domains

Once you have a System struct you can then get other things like Protection Domains.

protectiondomains, err := system.GetProtectionDomain()
if err != nil {
  log.Fatalf("error getting protection domains: %v", err)
}

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 on the Github issues page for this project. This is to help keep track and document everything related to this repo. For general discussions and further support you can join the EMC {code} Community slack channel. Lastly, for questions asked on Stackoverflow.com please tag them with EMC. 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

func DuplicateRequest

func DuplicateRequest(request *http.Request) (request1 *http.Request, request2 *http.Request)
func GetLink(links []*types.Link, rel string) (*types.Link, error)

func GetSdcLocalGUID

func GetSdcLocalGUID() (sdcGUID string, err error)

Types

type Client

type Client struct {
	Token       string
	SIOEndpoint url.URL
	Http        http.Client
	Insecure    string
	ShowBody    bool
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (client *Client, err error)

func NewClientWithArgs

func NewClientWithArgs(
	endpoint string,
	version string,
	insecure,
	useCerts bool) (client *Client, err error)

func (*Client) Authenticate

func (client *Client) Authenticate(configConnect *ConfigConnect) (Cluster, error)

func (*Client) CreateVolume

func (client *Client) CreateVolume(volume *types.VolumeParam, storagePoolName string) (volumeResp *types.VolumeResp, err error)

func (*Client) FindStoragePool

func (client *Client) FindStoragePool(id, name, href string) (storagePool *types.StoragePool, err error)

func (*Client) FindSystem

func (client *Client) FindSystem(instanceID, name, href string) (*System, error)

func (*Client) FindVolumeID

func (client *Client) FindVolumeID(volumename string) (volumeID string, err error)

func (*Client) GetInstance

func (client *Client) GetInstance(systemhref string) (systems []*types.System, err error)

func (*Client) GetStoragePool

func (client *Client) GetStoragePool(storagepoolhref string) (storagePools []*types.StoragePool, err error)

func (*Client) GetVolume

func (client *Client) GetVolume(volumehref, volumeid, ancestorvolumeid, volumename string, getSnapshots bool) (volumes []*types.Volume, err error)

func (*Client) NewRequest

func (c *Client) NewRequest(params map[string]string, method string, u url.URL, body io.Reader) *http.Request

type ClientPersistent

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

type Cluster

type Cluster struct {
}

type ConfigConnect

type ConfigConnect struct {
	Endpoint string
	Version  string
	Username string
	Password string
}

type Device

type Device struct {
	Device *types.Device
	// contains filtered or unexported fields
}

func NewDevice

func NewDevice(client *Client) *Device

func NewDeviceEx

func NewDeviceEx(client *Client, device *types.Device) *Device

type ProtectionDomain

type ProtectionDomain struct {
	ProtectionDomain *types.ProtectionDomain
	// contains filtered or unexported fields
}

func NewProtectionDomain

func NewProtectionDomain(client *Client) *ProtectionDomain

func NewProtectionDomainEx

func NewProtectionDomainEx(client *Client, pd *types.ProtectionDomain) *ProtectionDomain

func (*ProtectionDomain) CreateSds

func (protectionDomain *ProtectionDomain) CreateSds(name string, ipList []string) (string, error)

func (*ProtectionDomain) CreateStoragePool

func (protectionDomain *ProtectionDomain) CreateStoragePool(name string) (string, error)

func (*ProtectionDomain) FindSds

func (protectionDomain *ProtectionDomain) FindSds(field, value string) (sds *types.Sds, err error)

func (*ProtectionDomain) FindStoragePool

func (protectionDomain *ProtectionDomain) FindStoragePool(id, name, href string) (storagePool *types.StoragePool, err error)

func (*ProtectionDomain) GetSds

func (protectionDomain *ProtectionDomain) GetSds() (sdss []types.Sds, err error)

func (*ProtectionDomain) GetStoragePool

func (protectionDomain *ProtectionDomain) GetStoragePool(storagepoolhref string) (storagePools []*types.StoragePool, err error)

type Sdc

type Sdc struct {
	Sdc *types.Sdc
	// contains filtered or unexported fields
}

func NewSdc

func NewSdc(client *Client, sdc *types.Sdc) *Sdc

func (*Sdc) GetStatistics

func (sdc *Sdc) GetStatistics() (statistics *types.Statistics, err error)

func (*Sdc) GetVolume

func (sdc *Sdc) GetVolume() (volumes []*types.Volume, err error)

type SdcMappedVolume

type SdcMappedVolume struct {
	MdmID     string
	VolumeID  string
	SdcDevice string
}

func GetLocalVolumeMap

func GetLocalVolumeMap() (mappedVolumes []*SdcMappedVolume, err error)

type Sds

type Sds struct {
	Sds *types.Sds
	// contains filtered or unexported fields
}

func NewSds

func NewSds(client *Client) *Sds

func NewSdsEx

func NewSdsEx(client *Client, sds *types.Sds) *Sds

type StoragePool

type StoragePool struct {
	StoragePool *types.StoragePool
	// contains filtered or unexported fields
}

func NewStoragePool

func NewStoragePool(client *Client) *StoragePool

func NewStoragePoolEx

func NewStoragePoolEx(client *Client, pool *types.StoragePool) *StoragePool

func (*StoragePool) AttachDevice

func (storagePool *StoragePool) AttachDevice(path string, sdsID string) (string, error)

func (*StoragePool) CreateVolume

func (storagePool *StoragePool) CreateVolume(volume *types.VolumeParam) (volumeResp *types.VolumeResp, err error)

func (*StoragePool) FindDevice

func (storagePool *StoragePool) FindDevice(field, value string) (device *types.Device, err error)

func (*StoragePool) FindVolumeID

func (storagePool *StoragePool) FindVolumeID(volumename string) (volumeID string, err error)

func (*StoragePool) GetDevice

func (storagePool *StoragePool) GetDevice() (devices []types.Device, err error)

func (*StoragePool) GetStatistics

func (storagePool *StoragePool) GetStatistics() (statistics *types.Statistics, err error)

func (*StoragePool) GetVolume

func (storagePool *StoragePool) GetVolume(volumehref, volumeid, ancestorvolumeid, volumename string, getSnapshots bool) (volumes []*types.Volume, err error)

type System

type System struct {
	System *types.System
	// contains filtered or unexported fields
}

func NewSystem

func NewSystem(client *Client) *System

func (*System) CreateProtectionDomain

func (system *System) CreateProtectionDomain(name string) (string, error)

func (*System) CreateSnapshotConsistencyGroup

func (system *System) CreateSnapshotConsistencyGroup(snapshotVolumesParam *types.SnapshotVolumesParam) (snapshotVolumesResp *types.SnapshotVolumesResp, err error)

func (*System) FindProtectionDomain

func (system *System) FindProtectionDomain(id, name, href string) (protectionDomain *types.ProtectionDomain, err error)

func (*System) FindSdc

func (system *System) FindSdc(field, value string) (sdc *Sdc, err error)

func (*System) GetProtectionDomain

func (system *System) GetProtectionDomain(protectiondomainhref string) (protectionDomains []*types.ProtectionDomain, err error)

func (*System) GetScsiInitiator

func (system *System) GetScsiInitiator() (scsiInitiators []types.ScsiInitiator, err error)

func (*System) GetSdc

func (system *System) GetSdc() (sdcs []types.Sdc, err error)

func (*System) GetStatistics

func (system *System) GetStatistics() (statistics *types.Statistics, err error)

func (*System) GetUser

func (system *System) GetUser() (user []types.User, err error)

type Volume

type Volume struct {
	Volume *types.Volume
	// contains filtered or unexported fields
}

func NewVolume

func NewVolume(client *Client) *Volume

func (*Volume) GetVTree

func (volume *Volume) GetVTree() (vtree *types.VTree, err error)

func (*Volume) MapVolumeSdc

func (volume *Volume) MapVolumeSdc(mapVolumeSdcParam *types.MapVolumeSdcParam) (err error)

func (*Volume) RemoveVolume

func (volume *Volume) RemoveVolume(removeMode string) (err error)

func (*Volume) UnmapVolumeSdc

func (volume *Volume) UnmapVolumeSdc(unmapVolumeSdcParam *types.UnmapVolumeSdcParam) (err error)

Directories

Path Synopsis
types
v1

Jump to

Keyboard shortcuts

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