Giter VIP home page Giter VIP logo

hpe3par_python_sdk's Introduction

HPE Alletra 9000 and HPE Primera and HPE 3PAR Software Development Kit for Python

This is a Client library that can talk to the HPE Alletra 9000 and Primera and 3PAR Storage array. The HPE Alletra 9000 and Primera and 3PAR storage array has a REST web service interface and a command line interface. This client library implements a simple interface for talking with either interface, as needed. The python Requests library is used to communicate with the REST interface. The python paramiko library is used to communicate with the command line interface over an SSH connection.

Requirements

  • 3PAR OS
    • 3.3.1 MU1, MU2, MU3, T05
    • 3.2.2 MU4, MU6
  • Primera OS
    • 4.3.1
  • Alletra 9000 OS
    • 9.3.0
  • WSAPI service should be enabled on the HPE Alletra 9000 and Primera and 3PAR storage array

Capabilities

  • Create Volume
  • Delete Volume
  • Get all Volumes
  • Get a Volume
  • Modify a Volume
  • Copy a Volume
  • Create a Volume Snapshot
  • Create CPG
  • Delete CPG
  • Get all CPGs
  • Get a CPG
  • Get a CPG's Available Space
  • Create a VLUN
  • Delete a VLUN
  • Get all VLUNs
  • Get a VLUN
  • Create a Host
  • Delete a Host
  • Get all Hosts
  • Get a Host
  • Get VLUNs for a Host
  • Find a Host
  • Find a Host Set for a Host
  • Get all Host Sets
  • Get a Host Set
  • Create a Host Set
  • Delete a Host Set
  • Modify a Host Set
  • Add Hosts to Host Set
  • Remove Hosts from Host Set
  • Get all Ports
  • Get iSCSI Ports
  • Get FC Ports
  • Get IP Ports
  • Set Volume Metadata
  • Get Volume Metadata
  • Get All Volume Metadata
  • Find Volume Metadata
  • Remove Volume Metadata
  • Create a Volume Set
  • Delete a Volume Set
  • Modify a Volume Set
  • Add Volumes to Volume Set
  • Remove Volumes from Volume Set
  • Get a Volume Set
  • Get all Volume Sets
  • Find one Volume Set containing a specified Volume
  • Find all Volume Sets containing a specified Volume
  • Create a QOS Rule
  • Modify a QOS Rule
  • Delete a QOS Rule
  • Set a QOS Rule
  • Query a QOS Rule
  • Query all QOS Rules
  • Get a Task
  • Get all Tasks
  • Get a Patch
  • Get all Patches
  • Get WSAPI Version
  • Get WSAPI Configuration Info
  • Get Storage System Info
  • Get Overall System Capacity
  • Stop Online Physical Copy
  • Query Online Physical Copy Status
  • Stop Offline Physical Copy
  • Query Remote Copy Info
  • Query a Remote Copy Group
  • Query all Remote Copy Groups
  • Create a Remote Copy Group
  • Delete a Remote Copy Group
  • Modify a Remote Copy Group
  • Add a Volume to a Remote Copy Group
  • Get Remote Copy Group Volumes
  • Get Remote Copy Group Volume
  • Remove a Volume from a Remote Copy Group
  • Start Remote Copy on a Remote Copy Group
  • Stop Remote Copy on a Remote Copy Group
  • Synchronize a Remote Copy Group
  • Recover a Remote Copy Group from a Disaster
  • Enable/Disable Config Mirroring on a Remote Copy Target
  • Promote Virtual Copy
  • Create Snapshot Schedule
  • Delete SnapShot Schedule
  • Modify Snapshot Schedule
  • Suspend Snapshot Schedule
  • Resume Snapshot Schedule
  • Get Snapshot Schedule
  • Admit Remote Copy Links
  • Dismiss Remote Copy Links
  • Start Remote Copy Service
  • Add Target to Remote Copy Group
  • Remove Target from Remote Copy Group
  • Remote Copy Group Status Check
  • Get Remote Copy Group Volumes
  • Get Remote Copy Group Volume

Installation

To install:

$ sudo pip install .

Unit Tests To run all unit tests:

$ tox -e py27

To run a specific test:

$ tox -e py27 -- test/file.py:class_name.test_method_name

To run all unit tests with code coverage:

$ tox -e cover

The output of the coverage tests will be placed into the coverage dir.

Folders

  • docs -- contains the documentation.
  • hpe3par_sdk -- the actual client.py library
  • test -- unit tests

Documentation

To build the documentation:

$ tox -e docs

To view the built documentation point your browser to:

docs/html/index.html

Running Simulators

The unit tests should automatically start/stop the simulators. To start them manually use the following commands. To stop them, use 'kill'. Starting them manually before running unit tests also allows you to watch the debug output.

WSAPI:

$ python test/HPE3ParMockServer_flask.py -port 5001 -user <USERNAME> -password <PASSWORD> -debug

SSH:

$ python test/HPE3ParMockServer_ssh.py [port]

hpe3par_python_sdk's People

Contributors

ansarars avatar farhan7500 avatar gautamphegde avatar jyotsnalothe avatar sneharai4 avatar wdurairaj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hpe3par_python_sdk's Issues

Please fix Requirements for primera

hi,

in your requierments you have:

Primera OS

4.0.0

Primera is currently on 4.2.2. After asking HPE support I got the answer:

I inform you that the 4.0.0 version was never a release customer version. The document refers to all 4.x.x version and you can use it with 4.2.2 version.

So please update to avoid any questions.

This does not do what it is supposed to do, or it is misused in the ansible module.

hosts = self.client.queryHost(iqns, wwns)['members']

This will return wwn's that exist on the storage, regardless of if they are already used in another host or not. Which means when you are trying to add WWNs to an existing host, ansible will complain that "they are already part of another host" when they are not. Add something like this:

hosts = self.client.queryHost(iqns, wwns)['members']
        for host in [x for x in hosts if x.get('name',None)]:
            host_list.append(Host(host))
        return host_list

Or fix the ansible module:
https://github.com/HewlettPackard/hpe3par_ansible_module/blob/master/Modules/hpe3par_host.py#L622-L627

This should become:

host_list = client_obj.queryHost(wwns=wwn_list)
for host_obj in host_list:
    host_name_3par = host_obj.name
    if host_name_3par:
        if host_name == host_name_3par:
            wwn_same_host.append(wwn)
        else:
            wwn_other_host.append(wwn)

Storage System Info returns a dictionary instead of an object

the method getStorageSystemInfo returns a dictionary rather than the expected object

{u'clusterNodes': [0, 1, 2, 3], u'onlineNodes': [0, 1, 2, 3], u'name': u'CB2515_2000K_252', u'licenseInfo': {u'WWNBASE': 103353, u'issueTimeSec': 1530167972, u'diskCount': 34, u'licenseState': {u'onlineImport': True, u'storageFederation': True, u'systemReporter': True, u'dynamicOptimization': True, u'qos': True, u'smartSAN': True, u'thinProvisioing': True, u'rmcApplicationSuite': True, u'peerVirtualization': True, u'thinPersistence': True, u'thinProvisioning': True, u'remoteCopy': True, u'adaptiveOptimization': True, u'darEncryption': True, u'virtualLock': True, u'domains': True, u'thinConversion': True, u'fileServices': True, u'virtualCopy': True}, u'issueTime8601': u'2018-06-28T12:09:32+05:30', u'licenses': [{u'name': u'3PAR OS Suite'}, {u'name': u'Adaptive Flash Cache'}, {u'name': u'Adaptive Optimization'}, {u'name': u'Autonomic Rebalance'}, {u'name': u'Cluster Extension'}, {u'name': u'Cluster Extension (102400G)'}, {u'name': u'Compression'}, {u'name': u'Data Encryption'}, {u'name': u'Dynamic Optimization'}, {u'name': u'File Persona (102400G)'}, {u'name': u'File Persona Basic'}, {u'name': u'Management Plug-In for VMware vCenter'}, {u'name': u'Online Import'}, {u'name': u'Peer Motion'}, {u'name': u'Priority Optimization'}, {u'name': u'Recovery Manager Central'}, {u'name': u'Recovery Manager for Exchange'}, {u'name': u'Recovery Manager for Microsoft Hyper-V'}, {u'name': u'Recovery Manager for Oracle'}, {u'name': u'Recovery Manager for SQL'}, {u'name': u'Recovery Manager for VMware vSphere'}, {u'name': u'Remote Copy'}, {u'name': u'Remote Copy (102400G)'}, {u'name': u'RMC Application Suite'}, {u'name': u'Smart SAN'}, {u'name': u'Storage Federation'}, {u'name': u'System Reporter'}, {u'name': u'Thin Conversion'}, {u'name': u'Thin Copy Reclamation'}, {u'name': u'Thin Deduplication'}, {u'name': u'Thin Persistence'}, {u'name': u'Thin Provisioning (102400G)'}, {u'name': u'Virtual Copy'}, {u'name': u'Virtual Copy (102400G)'}, {u'name': u'Virtual Domains'}, {u'name': u'Virtual Lock'}, {u'name': u'VSS Provider for Microsoft Windows'}]}, u'freeCapacityMiB': 21050368.0, u'chunkletSizeMiB': 1024, u'totalCapacityMiB': 38260736.0, u'serialNumber': u'SGH549W49T', u'IPv4Addr': u'15.212.192.252', u'id': 103353, u'parameters': {u'rawSpaceAlertFC': 0, u'hostDIFTemplate': 2, u'thermalShutdown': True, u'remoteCopyHostThrottling': False, u'remoteSyslogSecurityHost': u'0.0.0.0', u'allowR0': True, u'overProvRatioLimit': 0.0, u'allowR5OnNLDrives': False, u'failoverMatchedSet': True, u'upgradeNote': u'', u'disableDedup': False, u'portFailoverEnabled': True, u'allowWrtbackUpgrade': False, u'eventLogNum': 1, u'autoExportAfterReboot': True, u'sessionTimeout': 3600, u'sparingAlgorithm': u'Default', u'eventLogsize': 4194304, u'rawSpaceAlertSSD': 0, u'remoteSyslog': False, u'disableChunkletInitUNMAP': False, u'hostDIF': True, u'allowWrtbackSingleNode': False, u'disableCompr': False, u'complianceOfficerApproval': False, u'allowR5OnFCDrives': True, u'VVRetentionTimeMax': 1209600, u'personaProfile': 1, u'remoteSyslogHost': u'0.0.0.0', u'rawSpaceAlertNL': 0, u'overProvRatioWarning': 0.0}, u'systemVersion': u'3.3.1.457', u'allocatedCapacityMiB': 14423040.0, u'failedCapacityMiB': 0.0, u'readOnlyParameters': {u'maxCompressedVolumeSizeMiB': 16777216, u'maxDedupVolumeSizeMiB': 16777216, u'maxVolumeSizeMiB': 67108864}, u'timeZone': u'Asia/Kolkata', u'IPv6Addr': u'2620:0:a17:e033::12', u'totalNodes': 4, u'masterNode': 1, u'model': u'HPE_3PAR 20800'}

Fix GrowthParams and PrivateSpace objects for not None in models

Currently, class GrowthParams and PrivateSpace objects do not get initialized when they are not None. This needs to be corrected in models.py like below.

class GrowthParams(object):

def __init__(self, object_hash):
    if object_hash is None:
        return

Please check the same in other places.

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.