Giter VIP home page Giter VIP logo

gopowerscale's Introduction

GoIsilon

Overview

GoIsilon is a Go package that provides a client for the EMC Isilon OneFS HTTP API. The package provides both direct implementations of the API bindings as well as abstract, helper functionality. In addition, services such as Docker, Mesos, and REX-Ray use the GoIsilon package to integrate with the NAS storage platform.

OneFS API Support Matrix

The GoIsilon package is tested with and supports OneFS 8.1+.

Examples

The tests provide working examples for how to use the package, but here are a few code snippets to further illustrate the basic ideas:

Initialize a new client

This example shows how to initialize a new client.

client, err := NewClient(context.Background())
if err != nil {
	panic(err)
}

Please note that there is no attempt to provide a host, credentials, or any other options. The NewClient() function relies on the following environment variables to configure the GoIsilon client:

Environment Variables

Name Description
GOISILON_ENDPOINT the API endpoint, ex. 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
GOISILON_VOLUMEPATH_PERMISSIONS permissions for new volume directory
GOISILON_AUTHTYPE what should be the auth type, session-based or basic

Initialize a new client with options

The following example demonstrates how to explicitly specify options when creating a client:

client, err := NewClientWithArgs(
	context.Background(),
	"https://172.17.177.230:8080",
	true,
	1,
	"userName",
	"groupName",
	"password",
	"/ifs/volumes",
	"0777",
	0)
if err != nil {
	panic(err)
}

Create a Volume

This snippet creates a new volume named "testing" at "/ifs/volumes/testing". The volume path is generated by concatenating the client's volume path and the name of the volume.

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

Export a Volume

Enabling a volume for NFS access is fairly straight-forward.

if err := c.ExportVolume(context.Background(), "testing"); err != nil {
	panic(err)
}

Delete a Volume

When a volume is no longer needed, this is how it may be removed.

if err := c.DeleteVolume(context.Background(), "testing"); err != nil {
	panic(err)
}

More Examples

Several, very detailed examples of the GoIsilon package in use can be found in the package's *_test.go files as well as in the libStorage Isilon storage driver.

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

For any issues, questions or feedback, please follow our support process

gopowerscale's People

Contributors

bpjain2004 avatar shefali-malhotra avatar sakshi-dell avatar chimanjain avatar randeepdell avatar nitesh3108 avatar maxan98 avatar harishh-dell avatar walker2 avatar iliarn avatar forrestxia avatar taohe1012 avatar dependabot[bot] avatar p-cao avatar santhoshatdell avatar astripei70 avatar navisj avatar shanduur-dell avatar adamginna-dell avatar mtrajfacki-dell avatar shekhar-j avatar

Stargazers

George Kontridze avatar  avatar Elie Koivunen avatar  avatar  avatar  avatar Paul Verrall avatar Puneet Katyal avatar Prasanna M avatar  avatar

Watchers

Trevor Dawe avatar James Cloos avatar Ryan Wallner avatar  avatar Aaron Tye avatar John A. Hull avatar  avatar Fernando Alfaro Campos avatar jai kumar avatar Luna Xu avatar Luis Liu avatar yifei jin avatar Jooseppi Luna avatar Harish P avatar Michael Edegware avatar  avatar  avatar Prasanna M avatar Meghana GM avatar

gopowerscale's Issues

Possibly missing *ByID and *ByIDWithZone versions for some APIs

If I understand the API design for goisilon correctly, it serves as a complete DAL to the Isilon API.
It's not intended that applications work with Export objects directly, so they must use one of the opaque DAL functions (such as AddExportClients or RemoveExportClientsByIDWithZone).

There is one problem with this approach: It requires separate functions for every combination of [export identifier type, API]. As there are (at least) three different kinds of export identifiers (ByName, ByID, ByIDWithZone), this will require at least three functions per API.
However: The way goisilon is written at the moment, not all combinations of all APIs are supported. I'm not sure how important that is (perhaps some APIs don't require the full identifier?), but it seems incomplete.

I wonder if it wouldn't make sense to separate the DAL into lookup functions that return DAOs instead (for example: GetExportByName, GetExportByID, GetExportByIDWithZone), and attach all the operations to the DAOs. So, instead of calling RemoveExportClientsByIDWithZone, one would do this:

export, err := isi.GetExportByIDWithZone(id, accessZone)
if err != nil {
    // report "export not found"
} else {
    export.RemoveExportClients(clients)
}

Alternatively, perhaps the [export identifier type, API] tuples could be autogenerated, so all combinations are available.

For the particular problem I'm trying to solve at the moment, I need the functions DisableRootMappingByIDWithZone and EnableRootMappingByIDWithZone, which aren't available in goisilon. I submitted a pull request to add them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.