Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8cb1766
fix: :bug: correct _post to _get method for get_all_users function - …
zachcamara-hpe May 26, 2022
b974735
fix: :bug: Correct typo in endpoint query parameters `tunnel_name` wi…
zachcamara-hpe May 26, 2022
726011b
Change appliance_groups and appliance_regions parameters to mandatory…
zachcamara-hpe May 26, 2022
e52c049
Merge branch 'may22bugfixes' into development
zachcamara-hpe May 31, 2022
cfc799d
feat: :wheelchair: Add backwards compatability to python3.7 via `from…
zachcamara-hpe May 31, 2022
90a96f5
docs: :memo: Update docs and setup.py for 3.7+ compatability
zachcamara-hpe Jun 7, 2022
3685747
Merge branch 'python-backport-37' into development
zachcamara-hpe Jun 7, 2022
119cfea
feat: :sparkles: add 2 ecos statistics functions
zachcamara-hpe Jun 13, 2022
2f87ad6
Merge branch 'feature/ecos-stats' into development
zachcamara-hpe Jun 13, 2022
84b1b51
feat: :sparkles: add ecos _memory submodule
zachcamara-hpe Jun 22, 2022
c0bf272
fix: :memo: fix docstring typo for get_appliance_stats_minute_file
zachcamara-hpe Jun 22, 2022
203b0eb
feat: :sparkles: add ecos _dns submodule
zachcamara-hpe Jun 22, 2022
3090ffd
docs: :memo: fix typos in docstrings for _dns, _memory, and _statistics
zachcamara-hpe Jun 22, 2022
3499347
feat: :sparkles: add ecos _time submodule
zachcamara-hpe Jun 22, 2022
331b484
feat: :sparkles: add ecos _disk_usage submodule
zachcamara-hpe Jun 22, 2022
a3ddf9c
Merge branch 'feature/ecos-w25-augment' into development
zachcamara-hpe Jun 23, 2022
88b8daa
docs: :memo: version update and release notes for 0.15.1
zachcamara-hpe Jun 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,65 +15,65 @@ is underway to continue to add further functions.

### Python Version

> **Note:** Requires Python 3.9.0+ (due to PEP585 type-hinting e.g. ``def my_func(var1 = list[str]``)
> **Note:** Requires Python 3.7+

Once Python 3.9 is installed on the system, it's recommended to use a
Once Python 3.7+ is installed on the system, it's recommended to use a
virtual environment to install the package to.

In the directory you'd like to write your project/script, setup a python
virtual environment specifically with python3.9 and activate it. This
virtual environment with the desired python version and activate it. This
is important if you have other versions of python installed on your
system.

```bash

:~$ python3.9 -m venv my_new_project
:~$ source my_new_project/bin/activate
(my_new_project) :~$ python3 --version
Python 3.9.0+
(my_new_project) :~$ python --version
Python 3.9.13
```

Now you can install the package and run your python code
Now you are ready to install the package and run your python code.

```bash

(my_new_project) :~$ pip install git+https://github.com/SPOpenSource/edgeconnect-python
...
(my_new_project) :~$ pip list
Package Version
--------------------- --------------------------------
certifi 2020.12.5
chardet 4.0.0
idna 2.10
pip 20.0.2
pkg-resources 0.0.0
requests 2.25.1
setuptools 44.0.0
pyedgeconnect 0.13.0a2.dev1+g45fd843.d20210428
urllib3 1.26.4
```
> **Note:** Going forward, these commands assume you're within a Python 3.7+ venv, or Python 3.7+ 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.x -m`` ahead of the ``pip install ...``

### Install from PyPI

```bash
pip install pyedgeconnect
$ pip install pyedgeconnect
...
$ pip list
Package Version
----------------------------- --------------------------------
... ...
pyedgeconnect x.y.z
... ...
```

### Install from GitHub

To install the most recent version of pyedgeconnect, open an
interactive shell and run:

> **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 ...``

```bash
pip install git+https://github.com/SPOpenSource/edgeconnect-python
$ pip install git+https://github.com/SPOpenSource/edgeconnect-python
...
$ pip list
Package Version
----------------------------- --------------------------------
... ...
pyedgeconnect x.y.z
... ...
```

To install a specific branch use the @branch syntax

```bash
pip install git+https://github.com/SPOpenSource/edgeconnect-python@<branch_name>
$ pip install git+https://github.com/SPOpenSource/edgeconnect-python@<branch_name>
...
# Install the Development branch
$ pip install git+https://github.com/SPOpenSource/edgeconnect-python@development
...
```

### Install dev options
Expand All @@ -88,7 +88,7 @@ following syntax:
```bash
$ pip install pyedgeconnect[dev]
or
$ pip install -e git+https://github.com/SPOpenSource/edgeconnect-python#egg=pyedgeconnect[dev]
$ pip install git+https://github.com/SPOpenSource/edgeconnect-python#egg=pyedgeconnect[dev]
```

## Docs
Expand Down
2 changes: 1 addition & 1 deletion _version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.15.0a2.dev0"
version = "0.15.1a1.dev0"
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Main version number
version = "0.15"
# The full version, including alpha/beta/rc tags
release = "0.15.0-a1"
release = "0.15.1-a1"


# -- General configuration ---------------------------------------------------
Expand Down
79 changes: 37 additions & 42 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ Python Version

.. note::

Requires Python 3.9.0+ (due to PEP585 type-hinting e.g.
``def my_func(var1 = list[str]``)
Requires Python 3.7+

Once Python 3.9 is installed on the system, it's recommended to use a
Once Python 3.7+ is installed on the system, it's recommended to use a
virtual environment to install the package to.

In the directory you'd like to write your project/script, setup a python
virtual environment specifically with python3.9 and activate it. This
virtual environment with the desired python version and activate it. This
is important if you have other versions of python installed on your
system.

Expand All @@ -23,61 +22,57 @@ system.
:~$ python3.9 -m venv my_new_project
:~$ source my_new_project/bin/activate
(my_new_project) :~$ python3 --version
Python 3.9.0+
Python 3.9.13

Now you can install the package and run your python code
Now you are ready to install the package and run your python code.

.. code:: bash
.. note::

(my_new_project) :~$ pip install git+https://github.com/SPOpenSource/edgeconnect-python
...
(my_new_project) :~$ pip list
Package Version
--------------------- --------------------------------
certifi 2020.12.5
chardet 4.0.0
idna 2.10
pip 20.0.2
pkg-resources 0.0.0
requests 2.25.1
setuptools 44.0.0
pyedgeconnect 0.13.0a1.dev1+g45fd843.d20210428
urllib3 1.26.4
Going forward, these commands assume you're within a Python 3.7+ venv, or Python 3.7+
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.x -m`` ahead of the ``pip install ...``

Install from PyPI
-------------------

.. code:: bash

$ pip install pyedgeconnect

...
$ pip list
Package Version
----------------------------- --------------------------------
... ...
pyedgeconnect x.y.z
... ...

Install from GitHub
-------------------

To install the most recent version of pyedgeconnect, open an
interactive shell and run:

.. 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 ...``

.. code:: python
.. code:: bash

pip install git+https://github.com/SPOpenSource/edgeconnect-python
$ pip install git+https://github.com/SPOpenSource/edgeconnect-python
...
$ pip list
Package Version
----------------------------- --------------------------------
... ...
pyedgeconnect x.y.z
... ...

To install a specific branch use the @branch syntax

.. code:: python

pip install git+https://github.com/SPOpenSource/edgeconnect-python@<branch_name>

.. code:: bash

$ pip install git+https://github.com/SPOpenSource/edgeconnect-python@<branch_name>
# Install the Development branch
$ pip install git+https://github.com/SPOpenSource/edgeconnect-python@Development

Build Documentation Locally
---------------------------
Expand All @@ -87,8 +82,8 @@ to include sphinx and related packages, then in the docs directory run ``make ht

.. code:: bash

git clone https://github.com/SPOpenSource/edgeconnect-python.git
cd edgeconnect-python
pip install .[dev]
cd docs
make html
$ git clone https://github.com/SPOpenSource/edgeconnect-python.git
$ cd edgeconnect-python
$ pip install .[dev]
$ cd docs
$ make html
54 changes: 54 additions & 0 deletions docs/source/release-notes/0.15.1-a1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
0.15.1-a1 -- 2022-06-23
-----------------------


🚀 Features
~~~~~~~~~~~~~

**Backwards compatability**: Introduced support back to Python 3.7


Added the following EdgeConnect functions from Swagger:

from .ecos._disk_usage
- :func:`~pyedgeconnect.EdgeConnect.get_appliance_disk_usage`

from .ecos._dns
- :func:`~pyedgeconnect.EdgeConnect.get_appliance_dns_config`
- :func:`~pyedgeconnect.EdgeConnect.set_appliance_dns_config`

from .ecos._memory
- :func:`~pyedgeconnect.EdgeConnect.get_appliance_memory`

from .ecos._statistics
- :func:`~pyedgeconnect.EdgeConnect.get_appliance_stats_minute_range`
- :func:`~pyedgeconnect.EdgeConnect.get_appliance_stats_minute_file`

from .ecos._time
- :func:`~pyedgeconnect.EdgeConnect.get_appliance_time`


🐛 Bug Fixes
~~~~~~~~~~~~~~

- `#4 <https://github.com/SPOpenSource/edgeconnect-python/issues/4>`_ -
:func:`~pyedgeconnect.Orchestrator.get_all_users` was using POST
instead of GET
- `#6 <https://github.com/SPOpenSource/edgeconnect-python/issues/6>`_ -
:func:`~pyedgeconnect.Orchestrator.update_appliance_access_group`
remove default values for appliance_groups and appliance_regions
- `#7 <https://github.com/SPOpenSource/edgeconnect-python/issues/7>`_ -
:func:`~pyedgeconnect.Orchestrator.get_timeseries_stats_tunnel_single_appliance`
update tunnel_name query in URL to tunnelName


🐛 Known Issues
~~~~~~~~~~~~~~~

.. warning::

The following two functions for the _ip_objects submodule exprience
errors at this time. These function do work in the Orchestrator UI:

- :func:`~pyedgeconnect.Orchestrator.bulk_upload_address_group`
- :func:`~pyedgeconnect.Orchestrator.bulk_upload_service_group`
1 change: 1 addition & 0 deletions docs/source/release-notes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All of the release notes for pyedgeconnect are organized below
==================

.. toctree::
0.15.1-a1
0.15.0-a1
0.14.0-a2
0.14.0-a1
Expand Down
8 changes: 8 additions & 0 deletions pyedgeconnect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,14 +1328,22 @@ def __init__(
self.logger.addHandler(self.console_handler)

# Imported methods
from .ecos._disk_usage import get_appliance_disk_usage
from .ecos._dns import get_appliance_dns_config, set_appliance_dns_config
from .ecos._gms import assign_orchestrator, get_orchestrator
from .ecos._interfaces import get_appliance_interfaces
from .ecos._license import is_reboot_required
from .ecos._login import login, logout
from .ecos._memory import get_appliance_memory
from .ecos._network_interfaces import (
get_appliance_network_interfaces,
modify_network_interfaces,
)
from .ecos._reboot import request_reboot
from .ecos._save_changes import save_changes
from .ecos._sp_portal import register_sp_portal, register_sp_portal_status
from .ecos._statistics import (
get_appliance_stats_minute_file,
get_appliance_stats_minute_range,
)
from .ecos._time import get_appliance_time
32 changes: 32 additions & 0 deletions pyedgeconnect/ecos/_disk_usage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# MIT License
# (C) Copyright 2022 Hewlett Packard Enterprise Development LP.
#
# diskUsage : Available disk space


def get_appliance_disk_usage(
self,
) -> dict:
"""Get the disk usage of the appliance

.. list-table::
:header-rows: 1

* - Swagger Section
- Method
- Endpoint
* - diskUsage
- GET
- /diskUsage

:return: Returns dictionary of current appliance disk usage \n
* keyword **<directory name>** (`dict`): Directory disk
utilization, e.g. ``/`` or ``/dev`` etc. \n
* keyword **1k-blocks** (`int`): The number of 1k-blocks
* keyword **used** (`int`): Size of used space, KB
* keyword **available** (`int`): Size of available space, KB
* keyword **usedpercent** (`int`): Percent of used space
* keyword **filesystem** (`str`): Name of the filesystem
:rtype: dict
"""
return self._get("/diskUsage")
Loading