SolidFire Host Integrations delivers products that assist developers in integrating with SolidFire. One of those products is a fully functional software development kit (SDK) in three languages. The SDKs are going to be presented at the NetApp Insight 2016 conference in Las Vegas and Berlin. As a preview, and to whet your appetite, here are a few snippets of code using all three languages of the SDK.

Create Account and Volume (Java)

// Connect to SF Cluster /////
SolidFireElement sf = ElementFactory.create("cluster_mvip", "username", "password");

 // Create an account ///////////////////
AddAccountRequest addAccountRequest =
        AddAccountRequest.builder()
                .username("insight-demo")
                .build();
AddAccountResult addAccountResult = sf.addAccount(addAccountRequest);
Long accountId = addAccountResult.getAccountID();

// Create a volume /////////////////////
CreateVolumeRequest createVolumeRequest =
        CreateVolumeRequest.builder()
                .name("insight-demo")
                .accountID(accountId)
                .totalSize(1000000000l)
                .enable512e(false)
                .build();
sf.createVolume(createVolumeRequest);

Modify Volume QoS (Python)

from solidfire.factory import ElementFactory
from solidfire.models import *

# Create connection to SF Cluster
sf = ElementFactory.create("cluster_mvip", "username", "password")

# Create a new QoS object
qos = QoS(burst_iops=20000, max_iops=18000, min_iops=8000)

# Modify the volume with the new QoS
sf.modify_volume([your_volume_id], qos=qos)

Initialize a Schedule for automatically creating snapshots  (C#)

var sf = ElementFactory.Create("cluster_mvip", "username", "password");

// Schedule a recurring Snapshot /////
var schedule = new Schedule()
{
    Name = "MWFat0100Hours",
    Frequency = new DaysOfWeekFrequency()
    {
        Hours = 1,
        Weekdays = new Weekday[] { Weekday.Monday, Weekday.Wednesday, Weekday.Friday }
    },
    ScheduleInfo = new ScheduleInfo() { VolumeIDs = demoVolumesResult.Volumes.Select(v => v.VolumeID).ToArray() }
};

sf.CreateSchedule(schedule);

Want to learn more? Attend our NetApp Insight 2016 conference and make sure you’re in the audience for my session titled “Integrating your app with SolidFire”. I’m going to walk through each SDK language and help you get it plugged into your app.

If you’re a code monkey and are ready to jump in without any help, head over to our SolidFire GitHub page where you can download the SDKs and start playing with them today.

Stay tuned to ThePub for more examples of how to leverage the SolidFire SDKs. Also join us on Slack by clicking on the Slack navigation button at the top of the site.

 

Adam Haid
Adam Haid is a Sr. Engineer on the SolidFire Host Integrations team. His passion is APIs. He creates, consumes, and curses APIs on a daily basis. Adam has been working on integrations and back-end systems for over 20 years. He specializes in Microsoft technologies but has built many Java-based applications as well. Contact Adam at adam.haid@netapp.com