goisilon/Open Source Project

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 7.2+ with support for APIv2 and APIv3 (introduced in OneFS 8.0).

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

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",
    "groupName",
    "userName",
    "password",
    true,
    "/ifs/volumes")
if err != nil {
    panic(err)
}

Create a Volume

This snippet creates a new volume named "testing" at "/ifs/volumes/loremipsum". The volume path is generated by concatenating the client's volume path and the name of the volume.
volume, err := c.CreateVolume(context.Background(), "loremipsum")

Export a Volume

Enabling a volume for NFS access is fairly straight-forward.
if err := c.ExportVolume(context.Background(), "loremipsum"); 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(), "loremipsum"); 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 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.

Information

  • 7 Stars
  • 6 Forks
  • 4 Contributors
  • Go
  • API Binding
  • go / Isilon / SDK
  • From the {code} Blog

    • Go: A Highly Performant, Case-Insensitive String Sort

      While the Go standard library makes sorting slices of strings in a case-sensitive manner a trivial operation, what does a developer do when case-insensitivity is required? This blog post outlines why the common approach ...
      October 24, 2017
    • Golang Dependency Tool and Line Endings

      The Golang dependency tool dep is awesome, but it has this habit of marking files as changed when the only difference is related to line-endings. This blog post highlights the issue and provides a ...
      October 10, 2017
    • Say Hello to Goodbye

      Ask a developer to discuss one of Go’s many features and there are no shortages from which to choose. Yet the catalyst for some of the most in depth discussions is often not what ...
      October 2, 2017
    More related posts on the {code} Blog

    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 7.2+ with support for APIv2 and APIv3 (introduced in OneFS 8.0).

    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

    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",
        "groupName",
        "userName",
        "password",
        true,
        "/ifs/volumes")
    if err != nil {
        panic(err)
    }
    

    Create a Volume

    This snippet creates a new volume named "testing" at "/ifs/volumes/loremipsum". The volume path is generated by concatenating the client's volume path and the name of the volume.
    volume, err := c.CreateVolume(context.Background(), "loremipsum")
    

    Export a Volume

    Enabling a volume for NFS access is fairly straight-forward.
    if err := c.ExportVolume(context.Background(), "loremipsum"); 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(), "loremipsum"); 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 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.

    From the {code} Blog

    • Go: A Highly Performant, Case-Insensitive String Sort

      While the Go standard library makes sorting slices of strings in a case-sensitive manner a trivial operation, what does a developer do when case-insensitivity is required? This blog post outlines why the common approach ...
      October 24, 2017
    • Golang Dependency Tool and Line Endings

      The Golang dependency tool dep is awesome, but it has this habit of marking files as changed when the only difference is related to line-endings. This blog post highlights the issue and provides a ...
      October 10, 2017
    • Say Hello to Goodbye

      Ask a developer to discuss one of Go’s many features and there are no shortages from which to choose. Yet the catalyst for some of the most in depth discussions is often not what ...
      October 2, 2017
    More related posts on the {code} Blog

    From the {code} Blog

    • Go: A Highly Performant, Case-Insensitive String Sort

      While the Go standard library makes sorting slices of strings in a case-sensitive manner a trivial operation, what does a developer do when case-insensitivity is required? This blog post outlines why the common approach ...
      October 24, 2017
    • Golang Dependency Tool and Line Endings

      The Golang dependency tool dep is awesome, but it has this habit of marking files as changed when the only difference is related to line-endings. This blog post highlights the issue and provides a ...
      October 10, 2017
    • Say Hello to Goodbye

      Ask a developer to discuss one of Go’s many features and there are no shortages from which to choose. Yet the catalyst for some of the most in depth discussions is often not what ...
      October 2, 2017
    More related posts on the {code} Blog