Skip to content

Commit e206a7a

Browse files
author
Gautham Hegde
committed
Initial Commit
0 parents  commit e206a7a

35 files changed

+15087
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/build
2+
/dist
3+
/hpe3par_python_sdk.egg-info

README.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# HPE 3PAR Software Development Kit for Python
2+
3+
This is a Client library that can talk to the HPE 3PAR Storage array. The 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.
4+
5+
### Requirements
6+
This branch requires 3.1.3 version MU1 or later of the 3PAR firmware.
7+
8+
### Capabilities
9+
* Create Volume
10+
* Delete Volume
11+
* Get all Volumes
12+
* Get a Volume
13+
* Modify a Volume
14+
* Copy a Volume
15+
* Create a Volume Snapshot
16+
* Create CPG
17+
* Delete CPG
18+
* Get all CPGs
19+
* Get a CPG
20+
* Get a CPG's Available Space
21+
* Create a VLUN
22+
* Delete a VLUN
23+
* Get all VLUNs
24+
* Get a VLUN
25+
* Create a Host
26+
* Delete a Host
27+
* Get all Hosts
28+
* Get a Host
29+
* Get VLUNs for a Host
30+
* Find a Host
31+
* Find a Host Set for a Host
32+
* Get all Host Sets
33+
* Get a Host Set
34+
* Create a Host Set
35+
* Delete a Host Set
36+
* Modify a Host Set
37+
* Get all Ports
38+
* Get iSCSI Ports
39+
* Get FC Ports
40+
* Get IP Ports
41+
* Set Volume Metadata
42+
* Get Volume Metadata
43+
* Get All Volume Metadata
44+
* Find Volume Metadata
45+
* Remove Volume Metadata
46+
* Create a Volume Set
47+
* Delete a Volume Set
48+
* Modify a Volume Set
49+
* Get a Volume Set
50+
* Get all Volume Sets
51+
* Find one Volume Set containing a specified Volume
52+
* Find all Volume Sets containing a specified Volume
53+
* Create a QOS Rule
54+
* Modify a QOS Rule
55+
* Delete a QOS Rule
56+
* Set a QOS Rule
57+
* Query a QOS Rule
58+
* Query all QOS Rules
59+
* Get a Task
60+
* Get all Tasks
61+
* Get a Patch
62+
* Get all Patches
63+
* Get WSAPI Version
64+
* Get WSAPI Configuration Info
65+
* Get Storage System Info
66+
* Get Overall System Capacity
67+
* Stop Online Physical Copy
68+
* Query Online Physical Copy Status
69+
* Stop Offline Physical Copy
70+
* Query Remote Copy Info
71+
* Query a Remote Copy Group
72+
* Query all Remote Copy Groups
73+
* Create a Remote Copy Group
74+
* Delete a Remote Copy Group
75+
* Modify a Remote Copy Group
76+
* Add a Volume to a Remote Copy Group
77+
* Remove a Volume from a Remote Copy Group
78+
* Start Remote Copy on a Remote Copy Group
79+
* Stop Remote Copy on a Remote Copy Group
80+
* Synchronize a Remote Copy Group
81+
* Recover a Remote Copy Group from a Disaster
82+
* Enable/Disable Config Mirroring on a Remote Copy Target
83+
* Promote Virtual Copy
84+
85+
### Installation
86+
To install:
87+
```bash
88+
$ sudo pip install .
89+
```
90+
Unit Tests
91+
To run all unit tests:
92+
```bash
93+
$ tox -e py27
94+
```
95+
To run a specific test:
96+
```bash
97+
$ tox -e py27 -- test/file.py:class_name.test_method_name
98+
```
99+
To run all unit tests with code coverage:
100+
```bash
101+
$ tox -e cover
102+
```
103+
The output of the coverage tests will be placed into the coverage dir.
104+
105+
### Folders
106+
* docs -- contains the documentation.
107+
* hpe3par_sdk -- the actual client.py library
108+
* test -- unit tests
109+
### Documentation
110+
To build the documentation:
111+
```bash
112+
$ tox -e docs
113+
```
114+
To view the built documentation point your browser to:
115+
116+
docs/html/index.html
117+
### Running Simulators
118+
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.
119+
120+
WSAPI:
121+
```bash
122+
$ python test/HPE3ParMockServer_flask.py -port 5001 -user <USERNAME> -password <PASSWORD> -debug
123+
```
124+
SSH:
125+
```bash
126+
$ python test/HPE3ParMockServer_ssh.py [port]
127+
```

config.ini

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[TEST]
2+
#flask_url=http://0.0.0.0:5001/api/v1
3+
flask_url=http://localhost:5001/api/v1
4+
user=USERNAME
5+
pass=PASSWORD
6+
unit=true
7+
debug=false
8+
3par_url=http://10.10.##.##:8008/api/v1
9+
cpg_ldlayout_ha=3
10+
disk_type=3
11+
domain=UNIT_TEST_DOMAIN
12+
missing_key_policy=AutoAddPolicy
13+
# skip_file_persona: Set to true when using an array without File Persona
14+
skip_file_persona=true
15+
# To speed up File Persona tests, specify an existing FPG to use.
16+
# fpg=unit_test_fpg
17+
# To run remote copy tests against live arrays, set this to true
18+
run_remote_copy=false
19+
20+
# If run_remote_copy is set to true, remote copy tests will be run. For this
21+
# to work as intended, a secondary array must be specified in the below
22+
# section. The URL, username, password, and the 3PAR target name are required
23+
# entries. The domain specified in the TEST config group must also be present
24+
# on the secondary array.
25+
[TEST_REMOTE_COPY]
26+
3par_url=http://10.10.##.##:8008/api/v1
27+
user=USERNAME
28+
pass=PASSWORD
29+
target_name=TARGET

hpe3par_sdk/__init__.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# (C) Copyright 2018 Hewlett Packard Enterprise Development LP
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
# not use this file except in compliance with the License. You may obtain
5+
# a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations
13+
# under the License.
14+
15+
version_tuple = (1, 0, 1)
16+
17+
18+
def get_version_string():
19+
"""Current version of HPE3PARClient."""
20+
if isinstance(version_tuple[-1], str):
21+
return '.'.join(map(str, version_tuple[:-1])) + version_tuple[-1]
22+
return '.'.join(map(str, version_tuple))
23+
24+
25+
version = get_version_string()

0 commit comments

Comments
 (0)