Skip to content

Commit 086698b

Browse files
Merge pull request #1 from SPOpenSource/development
0.13.0a3 - merge for PyPI fixes
2 parents 6eb54ef + ab6eb49 commit 086698b

4 files changed

Lines changed: 110 additions & 125 deletions

File tree

.gitignore

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,24 @@ __pycache__/
66
# Folder metadata
77
.DS_Store
88

9-
# Setup
10-
.eggs
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
1127

1228
# Tests & Documentation
1329
tests/
Lines changed: 84 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
======================
2-
Aruba Edge Connect Python SDK
3-
======================
1+
# Aruba Edge Connect Python SDK
2+
43

54
This package is a python wrapper for leveraging the API for Aruba
65
Orchestrator and Edge Connect SDWAN systems.
@@ -14,17 +13,12 @@ is underway to continue to add further functions.
1413
As of 0.13.0+ ~62% of non-deprecated Swagger functions are covered.
1514

1615

17-
Install
18-
----------
19-
16+
## Install
2017

21-
Python Version
22-
~~~~~~~~~~~~~~
2318

24-
.. note::
19+
### Python Version
2520

26-
Requires Python 3.9.0+ (due to PEP585 type-hinting e.g.
27-
``def my_func(var1 = list[str]``)
21+
> **Note:** Requires Python 3.9.0+ (due to PEP585 type-hinting e.g. ``def my_func(var1 = list[str]``)
2822
2923
Once Python 3.9 is installed on the system, it's recommended to use a
3024
virtual environment to install the package to.
@@ -34,16 +28,17 @@ virtual environment specifically with python3.9 and activate it. This
3428
is important if you have other versions of python installed on your
3529
system.
3630

37-
.. code:: bash
31+
```bash
3832

3933
:~$ python3.9 -m venv my_new_project
4034
:~$ source my_new_project/bin/activate
4135
(my_new_project) :~$ python3 --version
4236
Python 3.9.0+
37+
```
4338

4439
Now you can install the package and run your python code
4540

46-
.. code:: bash
41+
```bash
4742

4843
(my_new_project) :~$ pip install git+https://github.com/SPOpenSource/edgeconnect-python
4944
...
@@ -57,215 +52,191 @@ Now you can install the package and run your python code
5752
pkg-resources 0.0.0
5853
requests 2.25.1
5954
setuptools 44.0.0
60-
silverpeak-python-sdk 0.11.3a3.dev1+g45fd843.d20210428
55+
pyedgeconnect 0.13.0a2.dev1+g45fd843.d20210428
6156
urllib3 1.26.4
57+
```
6258

63-
Install from GitHub
64-
~~~~~~~~~~~~~~~~~~~
59+
### Install with pip
6560

66-
To install the most recent version of pyedgeconnect, open an
67-
interactive shell and run:
61+
```bash
62+
$ pip install pyedgeconnect
63+
```
6864

69-
.. note::
65+
### Install from GitHub
7066

71-
These commands assume you're within a Python 3.9 venv, or Python 3.9
72-
is the exclusive Python version installed in regard to referencing
73-
the use of ``pip``.
74-
75-
If that is not the case, you can specifically append
76-
``python3.9 -m`` ahead of the ``pip install ...``
67+
To install the most recent version of pyedgeconnect, open an
68+
interactive shell and run:
7769

78-
.. code:: python
70+
> **Note:** These commands assume you're within a Python 3.9 venv, or Python 3.9 is the exclusive Python version installed in regard to referencing the use of ``pip``. If that is not the case, you can specifically append ``python3.9 -m`` ahead of the ``pip install ...``
7971
80-
pip install git+https://github.com/SPOpenSource/edgeconnect-python
72+
```bash
73+
$ pip install git+https://github.com/SPOpenSource/edgeconnect-python
74+
```
8175

8276
To install a specific branch use the @branch syntax
8377

84-
.. code:: python
78+
```bash
79+
$ pip install git+https://github.com/SPOpenSource/edgeconnect-python@<branch_name>
80+
```
8581

86-
pip install git+https://github.com/SPOpenSource/edgeconnect-python@<branch_name>
82+
### Install dev options
8783

88-
For editing the code and general testing you can specify the [dev]
84+
For editing the code and general testing you can specify the ``[dev]``
8985
extras which will include ["black", "flake8", "flake8-rst-docstrings",
9086
"isort", "sphinx", "sphinx_rtd_theme"]
9187

92-
To install from the remote repo with the [dev] extras option use the
88+
To install from the remote repo with the ``[dev]`` extras option use the
9389
following syntax:
9490

95-
.. code:: python
91+
```bash
92+
$ pip install pyedgeconnect[dev]
93+
or
94+
$ pip install -e git+https://github.com/SPOpenSource/edgeconnect-python#egg=pyedgeconnect[dev]
95+
```
9696

97-
pip install -e git+https://github.com/SPOpenSource/edgeconnect-python#egg=pyedgeconnect[dev]
97+
## Docs
9898

99-
100-
Docs
101-
----------
102-
103-
To build the documentation, clone the repository, install with [dev] option
99+
To build the documentation, clone the repository, install with ``[dev]`` option
104100
to include sphinx and related packages, then in the docs directory run ``make html``
105101

106-
.. code:: bash
107-
102+
```bash
108103
$ git clone https://github.com/SPOpenSource/edgeconnect-python.git
109104
$ cd pyedgeconnect
110105
$ pip install .[dev]
111106
$ cd docs
112107
$ make html
108+
```
113109

110+
## Usage
114111

115-
Usage
116-
----------
117-
118-
Orchestrator Class
119-
~~~~~~~~~~~~~~~~~~
112+
### Orchestrator Class
120113

121114
Import the Orchestrator class to your script.
122115

123-
.. code:: python
124-
116+
```python
125117
from pyedgeconnect import Orchestrator
118+
```
126119

127120
To initialize an Orchestrator you must pass the url of the Orchestrator
128121
(IP or FQDN).
129122

130-
.. note::
131-
132-
If you're connecting to an Orchestrator without a valid certificate
133-
you'll want to set the ``verify_ssl`` paramter to ``False`` when
134-
instantiating Orchestrator to ignore certificate warnings/errors.
135-
136-
.. code:: python
123+
> **Note:** If you're connecting to an Orchestrator without a valid certificate you'll want to set the ``verify_ssl`` paramter to ``False`` when instantiating Orchestrator to ignore certificate warnings/errors.
137124
125+
```python
138126
orch_url = '10.1.1.100'
139127
orch_url = 'orchestrator.example.com'
140128
orch = Orchestrator(orch_url, verify_ssl=False)
129+
```
141130

142131
Now you can call the login function to connect to Orchestrator with a
143132
username and password:
144133

145-
.. code:: python
146-
134+
```python
147135
orch_user = 'admin'
148136
orch_pw = 'change_me'
149137
orch.login(orch_user, orch_pw)
150138
orch.logout()
139+
```
151140

152141
Another option is to pass an API Key on init to make authenticated calls
153142
without having to call login/logout functions
154143

155-
.. code:: python
156-
144+
```python
157145
orch_url = 'orchestrator.example.com'
158146
orch = Orchestrator(orch_url, api_key='xxx')
147+
```
159148

149+
### Edge Connect Class
160150

161-
Edge Connect Class
162-
~~~~~~~~~~~~~~~~~~
163-
164-
.. code:: python
165-
151+
```python
166152
from pyedgeconnect import EdgeConnect
153+
```
167154

168155
To initialize an Edge Connect you must pass the url of the Edge Connect
169156
(IP or FQDN).
170157

171-
.. note::
172-
173-
If you're connecting to an Edge Connect without a valid certificate
174-
you'll want to set the ``verify_ssl`` paramter to ``False`` when
175-
instantiating EdgeConnect to ignore certificate warnings/errors.
176-
177-
.. code:: python
158+
> **Note:** If you're connecting to an Edge Connect without a valid certificate you'll want to set the ``verify_ssl`` paramter to ``False`` when instantiating EdgeConnect to ignore certificate warnings/errors.
178159
160+
```python
179161
ecos_url = '10.2.30.50'
180162
ecos_url = 'edgeconnect.example.com'
181163
ec = EdgeConnect(ecos_url, verify_ssl=False)
182-
164+
```
183165

184166
Now you can call the login function to connect to Edge Connect with a
185167
username and password:
186168

187-
.. code:: python
188-
169+
```python
189170
ecos_user = 'admin'
190171
ecos_pw = 'admin'
191172
ec.login(ecos_user, ecos_pw)
192173
ec.logout()
174+
```
193175

194-
195-
Logging
196-
------------
176+
## Logging
197177

198178
By default, Orchestrator and EdgeConnect classes will not log calls
199-
and/or errors to file or console.
179+
and/or errors to file or console. When instantiating Orchestrator
180+
or EdgeConnect classes follow the below settings to enable logging
181+
options:
200182

201-
To enable logging to a local file, set the ``log_file`` parameter to
202-
``True`` when instantiating :class:`~pyedgeconnect.Orchestrator`
203-
or :class:`~pyedgeconnect.EdgeConnect`.
204-
This will create ./logging/sp_orch.log or ./logging/sp_ecos.log relative
205-
to where python is launched for calls that are performed.
183+
* Logging to a local file: set the ``log_file`` parameter to
184+
``True``. This will create ./logging/sp_orch.log or
185+
./logging/sp_ecos.log relative to where python is launched for calls
186+
that are performed.
206187

207-
To enable logging to the console, set the ``log_console`` parameter to
208-
``True`` when instantiating :class:`~pyedgeconnect.Orchestrator`
209-
or :class:`~pyedgeconnect.EdgeConnect`.
188+
* Logging to the console: set the ``log_console`` parameter to
189+
``True``
210190

211191
By default, successful API calls (e.g. returning HTTP 200/204 etc.) will
212192
not log response text to avoid logging sensitive data. To include
213193
response text in log messages, set the ``log_success`` parameter to
214194
``True``.
215195

216-
.. warning::
217-
If ``log_file`` and ``log_success`` are set to ``True``
218-
response text from successful API calls will be logged to
219-
the local log file. Some responses can include sensitive
220-
data that you may not wish to retain in the log files.
221-
222-
.. code:: python
196+
> **Warning:** If ``log_file`` and ``log_success`` are set to ``True`` response text from successful API calls will be logged to the local log file. Some responses can include sensitive data that you may not wish to retain in the log files.
223197
198+
```python
224199
orch_url = 'orchestrator.example.com'
225200
orch = Orchestrator(orch_url, log_file=True, log_console=True)
226201
# or
227202
ecos_url = '10.2.30.50'
228203
ec = EdgeConnect(ecos_url, log_success=True)
204+
```
229205

206+
## Example Code
230207

231-
Example Code
232-
---------------
233-
234-
In the ``/examples`` directory you can find scripts leveraging
208+
In the [Examples](/examples) directory you can find scripts leveraging
235209
the Orchestrator class demonstrating some uses
236210

237-
- *create_user.py*
238-
- creates a new read-only user on Orchestrator and returns the
211+
* [create_user.py](/examples/create_user.py)
212+
* creates a new read-only user on Orchestrator and returns the
239213
configured details
240-
- *print_appliance_info.py*
241-
- retrieves all appliances, retrieves detailed attributes of the
214+
* [print_appliance_info.py](/examples/print_appliance_info.py)
215+
* retrieves all appliances, retrieves detailed attributes of the
242216
appliances, and prints details in a table format
243-
- *run_packet_capture.py*
244-
- runs a tcpdump packet capture on a specified appliance, once
217+
* [run_packet_capture.py](/examples/run_packet_capture.py)
218+
* runs a tcpdump packet capture on a specified appliance, once
245219
completed, uploads to Orchestrator for user retrieval
246220

247221

248-
This is an alpha product
249-
---------------------------
222+
## This is an alpha product
250223

251224
This package is still very new. This is made explicit by the "Alpha"
252225
trove classifier, as well as by the "a" in the version number. **Until
253226
the package becomes stable, you should expect some formatting and/or
254227
syntax to change in the future**.
255228

256-
License
257-
---------
229+
## License
258230

259231
MIT
260232

261-
Contributing to pyedgeconnect
262-
------------------------------------------
233+
## Contributing to pyedgeconnect
263234

264235
Adding more modules and API functions are prioritized as needed for use.
265236
There is not currently support for reviewing external PR's as maintenance
266237
is best effort by the authors.
267238

268-
Open an issue <https://github.com/SPOpenSource/edgeconnect-python/issues>
239+
Open an [issue](issues)
269240
to track any/all suggestions/fixes/additions.
270241
Please don't file an issue to ask a question.
271242

@@ -274,18 +245,13 @@ discussed in regards to overall structure, error handling, logging, etc.
274245
Suggestions for these topics can be raised via issue or contacting the
275246
authors.
276247

277-
See contribution details at
278-
<https://github.com/SPOpenSource/edgeconnect-python/tree/main/CONTRIBUTING.md>
279-
280-
Release Notes
281-
---------------
248+
See contribution details at [Contributing](CONTRIBUTING.md)
282249

283-
Release notes are located in ``docs/source/release-notes`` directory:
250+
## Release Notes
284251

285-
<https://github.com/SPOpenSource/edgeconnect-python/tree/main/docs/source/release-notes>
252+
Release notes are located in ``docs/source/release-notes`` directory [here](docs/source/release-notes)
286253

287254

288-
Authors
289-
---------
255+
## Authors
290256

291257
Authored by Zach Camara, email at <zachary.camara@hpe.com>

_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.13.0-a1"
1+
version = "0.13.0a3.dev0"

0 commit comments

Comments
 (0)