Skip to main content

Violin Memory Client Interface Library

Project description

Violin Memory Client API

Welcome to the Violin Memory Client Interface Library. This API provides an additional management interface to many Violin Memory products through a REST-like interface.

Supported Products and Versions

The following products are supported by this library:

v7000 Concerto Gateway

Support for this product is accomplished using the JSON REST API:

  • 7.50

v6000 Memory Gateway

Support for this product is accomplished using the XML REST API:

  • V6.x

  • V6.x / G6.x and prior

v6000 Memory Array

Support for this product is accomplished using the XML REST API:

  • Generic support for all versions

Getting Started

Getting a connection to your Violin Memory appliance is as simple as this:

import vmemclient
con = vmemclient.open(hostname, username, password)

The open() function automatically determines what kind of Violin Memory appliance it sees, and returns a version specific object that you can use to query and manage your array. It makes this connection over https preferably, but it can also fallback to http for the session authentication if https isn’t working.

When finished interacting with the Violin Memory array, close the connection like so:

con.close()

There are a few different object types that the open() function can return. Please refer to the open() documentation for more info on the specifics of using each object type, and the various functions available for your product / version.

Examples

Below are a few examples of how to use the core VXG python library:

Example 1: Get the system uptime

This example works on all MGs running 6.x and lower, and all ACMs.:

# Get the connection object
con = vmemclient.open(hostname, username, password)
if con is not None:
    node = '/system/uptime'
    answer = con.basic.get_node_values(node)
    uptime = datetime.timedelta(int(milliseconds=answer[node]))
    print '{0} uptime: {1}'.format(hostname, uptime)
    con.close()

Example 2: List all LUNs

This example works on all MGs running 6.x and lower.:

con = vmemclient.open(hostname, username, password)
if con is not None:
    base_node = '/vshare/state/local/container/*'
    containers = con.basic.get_node_values(base_node)
    for container in containers.values():
        print '[LUNs in container: {0}]'.format(container)
        luns_node = base_node[:-1] + container + '/lun/*'
        luns = con.basic.get_node_values(luns_node)
        for lun in luns.values():
            print ' - {0}'.format(lun)
        print
    con.close()

Example 3: Create a LUN

Each object returned from vmemclient.open() has a number of namespaces, and each namespace will have a collection of functions. This example will demonstrate how to do LUN creation on a MG running 6.x. Pairing these functions with the version specific REST API documentation will tell what types of input are expected, and any acceptible values.:

# Create the object connection like normal
con = vmemclient.open(hostname, username, password)
if con is not None:
    answer = con.basic.get_node_values('/vshare/state/local/container/*')
    if not answer:
        print 'No container present'
    else:
        # Use the first container on this MG
        container = answer.values()[0]

        # Create a single, read-only, thick LUN of size 10G
        result = con.lun.create_lun(container, 'MyNewLun', size='10',
                                    quantity=1, nozero='nozero',
                                    thin='0', readonly='r',
                                    startnum=1)

        # Actions return a dict with two keys: 'code' and 'message'
        if result['code'] == 0:
            print 'Created LUN OK: {0}'.format(result['message'])
        else:
            print 'Failed ({code}): {message}'.format(**result)

    # Done
    con.close()

Changelog

Version 1.1.7

  • Added support for Replication

Version 1.1.5 / 1.1.6

  • Added support for iSCSI operations

  • Minor bug fixes

Version 1.1.4

  • Added support for snapgroup operations

  • Added function to remap thin clones

  • Minor bug fixes

Version 1.1.3

  • vmemclient.open() raises AuthenticationError on auth error

  • Minor bug fixes

Version 1.1.2

  • Moving .snapshot.get_snapshot_copy_status() to .lun.get_lun_copy_status()

  • Adding .snapshot.get_snapshot_copy_status()

Version 1.1.1

  • Minor bug fixes

Version 1.1.0

  • Added support for Concerto 7.5.2

Version 1.0.1

  • Updated licensing

Version 1.0.0

  • Initial version of this package

  • Support for VShare 5.x / 6.x

  • Support for ACM (generic)

  • Support for Concerto 7.50

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vmemclient-1.1.7.tar.gz (58.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page