Package: vmemclient
Violin Memory Client APIWelcome 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 VersionsThe following products are supported by this library:v7000 Concerto GatewaySupport for this product is accomplished using the JSON REST API:7.50v6000 Memory GatewaySupport for this product is accomplished using the XML REST API:V6.xV6.x / G6.x  and priorv6000 Memory ArraySupport for this product is accomplished using the XML REST API:Generic support for all versionsGetting StartedGetting a connection to your Violin Memory appliance is as simple as this:import vmemclient
con = vmemclient.open(hostname, username, password)Theopen()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 overhttpspreferably, but it can also fallback tohttpfor the session
authentication ifhttpsisn’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 theopen()function can
return.  Please refer to theopen()documentation for more info on the
specifics of using each object type, and the various functions available
for your product / version.ExamplesBelow are a few examples of how to use the core VXG python library:Example 1:  Get the system uptimeThis 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 LUNsThis 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 LUNEach object returned fromvmemclient.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()ChangelogVersion 1.1.9Ensure port 443 is used if https protocol is specifiedVersion 1.1.8Added support for EncryptionVersion 1.1.7Added support for ReplicationVersion 1.1.5 / 1.1.6Added support for iSCSI operationsMinor bug fixesVersion 1.1.4Added support for snapgroup operationsAdded function to remap thin clonesMinor bug fixesVersion 1.1.3vmemclient.open() raises AuthenticationError on auth errorMinor bug fixesVersion 1.1.2Moving .snapshot.get_snapshot_copy_status() to .lun.get_lun_copy_status()Adding .snapshot.get_snapshot_copy_status()Version 1.1.1Minor bug fixesVersion 1.1.0Added support for Concerto 7.5.2Version 1.0.1Updated licensingVersion 1.0.0Initial version of this packageSupport for VShare 5.x / 6.xSupport for ACM (generic)Support for Concerto 7.50