pyedgeconnect


Namepyedgeconnect JSON
Version 0.16.0a1 PyPI version JSON
download
home_pagehttps://github.com/aruba/pyedgeconnect
SummaryA Python wrapper for Aruba Orchestrator and Edge Connect API
upload_time2024-03-07 00:36:32
maintainer
docs_urlNone
authorZach Camara
requires_python>=3.7, <4
licenseMIT
keywords silverpeak silverpeak python aruba edgeconnect edgeconnect
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Aruba Edge Connect Python SDK

[![Downloads](https://static.pepy.tech/personalized-badge/pyedgeconnect?period=total&units=none&left_color=grey&right_color=orange&left_text=PyPI%20Downloads)](https://pepy.tech/project/pyedgeconnect)

This package is a python wrapper for leveraging the API for Aruba
Orchestrator and Edge Connect SDWAN systems.

API's are documented via Swagger directly on Orchestrator and
Edge Connect web interfaces under "Support > Rest API"

Many, but not all API functions have been implemented yet. Development
is underway to continue to add further functions.

**THERE IS NOW PRELIMINARY SUPPORT FOR API CHANGES INTRODUCED IN
ORCHESTRATOR 9.3+**

## Install

### Python Version

> **Note:** Requires Python 3.7+

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 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) :~$ python --version
    Python 3.9.13
```

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

> **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 list
    Package                       Version
    ----------------------------- --------------------------------
    ...                           ...
    pyedgeconnect                 x.y.z
    ...                           ...
```

### Install from GitHub

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

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

To install a specific branch use the @branch syntax

```bash
    $ pip install git+https://github.com/aruba/pyedgeconnect@<branch_name>
    ...
    # Install the Development branch
    $ pip install git+https://github.com/aruba/pyedgeconnect@development
    ...
```

### Install dev options

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

To install from the remote repo with the ``[dev]`` extras option use the
following syntax:

```bash
    $ pip install pyedgeconnect[dev]
    or
    $ pip install git+https://github.com/aruba/pyedgeconnect#egg=pyedgeconnect[dev]
```

## Docs

[![Documentation Status](https://readthedocs.org/projects/pyedgeconnect/badge/?version=latest)](https://pyedgeconnect.readthedocs.io/en/latest/?badge=latest)

Docs are viewable on [Read the Docs](https://pyedgeconnect.readthedocs.io)

To build the documentation locally, clone the repository, install with ``[dev]`` option
to include sphinx and related packages, then in the docs directory run ``make html``

```bash
    git clone https://github.com/aruba/pyedgeconnect.git
    cd edgeconnect-python
    pip install .[dev]
    cd docs
    make html
```

## Usage

### Orchestrator Class

Import the Orchestrator class to your script.

```python
    from pyedgeconnect import Orchestrator
```

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

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

```python
    orch_url = '10.1.1.100'
    orch_url = 'orchestrator.example.com'
    orch = Orchestrator(orch_url, verify_ssl=False)
```

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

```python
    orch_user = 'admin'
    orch_pw = 'change_me'
    orch.login(orch_user, orch_pw)
    orch.logout()
```

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

```python
    orch_url = 'orchestrator.example.com'
    orch = Orchestrator(orch_url, api_key='xxx')
```

### Edge Connect Class

```python
    from pyedgeconnect import EdgeConnect
```

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

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

```python
    ecos_url = '10.2.30.50'
    ecos_url = 'edgeconnect.example.com'
    ec = EdgeConnect(ecos_url, verify_ssl=False)
```

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

```python
    ecos_user = 'admin'
    ecos_pw = 'admin'
    ec.login(ecos_user, ecos_pw)
    ec.logout()
```

## Logging

By default, Orchestrator and EdgeConnect classes will not log calls
and/or errors to file or console. When instantiating Orchestrator
or EdgeConnect classes follow the below settings to enable logging
options:

* Logging to a local file: set the ``log_file`` parameter to
``True``. This will create ./logging/sp_orch.log or
./logging/sp_ecos.log relative to where python is launched for calls
that are performed.

* Logging to the console: set the ``log_console`` parameter to
``True``

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

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

```python
    orch_url = 'orchestrator.example.com'
    orch = Orchestrator(orch_url, log_file=True, log_console=True)
    # or
    ecos_url = '10.2.30.50'
    ec = EdgeConnect(ecos_url, log_success=True)
```

## Example Code

In the [Examples](/examples) directory you can find scripts leveraging
the Orchestrator class demonstrating some uses

* [create_user.py](/examples/create_user.py)
  * creates a new read-only user on Orchestrator and returns the
      configured details
* [print_appliance_info.py](/examples/print_appliance_info.py)
  * retrieves all appliances, retrieves detailed attributes of the
      appliances, and prints details in a table format
* [run_packet_capture.py](/examples/run_packet_capture.py)
  * runs a tcpdump packet capture on a specified appliance, once
      completed, uploads to Orchestrator for user retrieval
* [preconfig.py](/examples/generate_preconfig/preconfig.py)
  * uses a CSV file as source data to generate Edge Connect YAML
      preconfig from a Jinja template

## This is an alpha product

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

## License

MIT

## Contributing to pyedgeconnect

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

Open an [issue](issues)
to track any/all suggestions/fixes/additions.
Please don't file an issue to ask a question.

As this code is in early stages there are larger changes that may be
discussed in regards to overall structure, error handling, logging, etc.
Suggestions for these topics can be raised via issue or contacting the
authors.

See contribution details at [Contributing](CONTRIBUTING.md)

## Release Notes

Release notes are located in ``docs/source/release-notes`` directory [here](docs/source/release-notes)

## Authors

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aruba/pyedgeconnect",
    "name": "pyedgeconnect",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7, <4",
    "maintainer_email": "",
    "keywords": "silverpeak,silverpeak python,aruba edgeconnect,edgeconnect",
    "author": "Zach Camara",
    "author_email": "zachary.camara@hpe.com",
    "download_url": "https://files.pythonhosted.org/packages/71/b9/5678afb46e9ad8c78da799d72d76ec6dfa419768bf2e12bc4b3f7f2f1fc0/pyedgeconnect-0.16.0a1.tar.gz",
    "platform": null,
    "description": "# Aruba Edge Connect Python SDK\n\n[![Downloads](https://static.pepy.tech/personalized-badge/pyedgeconnect?period=total&units=none&left_color=grey&right_color=orange&left_text=PyPI%20Downloads)](https://pepy.tech/project/pyedgeconnect)\n\nThis package is a python wrapper for leveraging the API for Aruba\nOrchestrator and Edge Connect SDWAN systems.\n\nAPI's are documented via Swagger directly on Orchestrator and\nEdge Connect web interfaces under \"Support > Rest API\"\n\nMany, but not all API functions have been implemented yet. Development\nis underway to continue to add further functions.\n\n**THERE IS NOW PRELIMINARY SUPPORT FOR API CHANGES INTRODUCED IN\nORCHESTRATOR 9.3+**\n\n## Install\n\n### Python Version\n\n> **Note:** Requires Python 3.7+\n\nOnce Python 3.7+ is installed on the system, it's recommended to use a\nvirtual environment to install the package to.\n\nIn the directory you'd like to write your project/script, setup a python\nvirtual environment with the desired python version and activate it. This\nis important if you have other versions of python installed on your\nsystem.\n\n```bash\n\n    :~$ python3.9 -m venv my_new_project\n    :~$ source my_new_project/bin/activate\n    (my_new_project) :~$ python --version\n    Python 3.9.13\n```\n\nNow you are ready to install the package and run your python code.\n\n> **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 ...``\n\n### Install from PyPI\n\n```bash\n    $ pip install pyedgeconnect\n    ...\n    $ pip list\n    Package                       Version\n    ----------------------------- --------------------------------\n    ...                           ...\n    pyedgeconnect                 x.y.z\n    ...                           ...\n```\n\n### Install from GitHub\n\nTo install the most recent version of pyedgeconnect, open an\ninteractive shell and run:\n\n```bash\n    $ pip install git+https://github.com/aruba/pyedgeconnect\n    ...\n    $ pip list\n    Package                       Version\n    ----------------------------- --------------------------------\n    ...                           ...\n    pyedgeconnect                 x.y.z\n    ...                           ...\n```\n\nTo install a specific branch use the @branch syntax\n\n```bash\n    $ pip install git+https://github.com/aruba/pyedgeconnect@<branch_name>\n    ...\n    # Install the Development branch\n    $ pip install git+https://github.com/aruba/pyedgeconnect@development\n    ...\n```\n\n### Install dev options\n\nFor editing the code and general testing you can specify the ``[dev]``\nextras which will include [\"black\", \"flake8\", \"flake8-rst-docstrings\",\n\"isort\", \"sphinx\", \"sphinx_rtd_theme\"]\n\nTo install from the remote repo with the ``[dev]`` extras option use the\nfollowing syntax:\n\n```bash\n    $ pip install pyedgeconnect[dev]\n    or\n    $ pip install git+https://github.com/aruba/pyedgeconnect#egg=pyedgeconnect[dev]\n```\n\n## Docs\n\n[![Documentation Status](https://readthedocs.org/projects/pyedgeconnect/badge/?version=latest)](https://pyedgeconnect.readthedocs.io/en/latest/?badge=latest)\n\nDocs are viewable on [Read the Docs](https://pyedgeconnect.readthedocs.io)\n\nTo build the documentation locally, clone the repository, install with ``[dev]`` option\nto include sphinx and related packages, then in the docs directory run ``make html``\n\n```bash\n    git clone https://github.com/aruba/pyedgeconnect.git\n    cd edgeconnect-python\n    pip install .[dev]\n    cd docs\n    make html\n```\n\n## Usage\n\n### Orchestrator Class\n\nImport the Orchestrator class to your script.\n\n```python\n    from pyedgeconnect import Orchestrator\n```\n\nTo initialize an Orchestrator you must pass the url of the Orchestrator\n(IP or FQDN).\n\n> **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.\n\n```python\n    orch_url = '10.1.1.100'\n    orch_url = 'orchestrator.example.com'\n    orch = Orchestrator(orch_url, verify_ssl=False)\n```\n\nNow you can call the login function to connect to Orchestrator with a\nusername and password:\n\n```python\n    orch_user = 'admin'\n    orch_pw = 'change_me'\n    orch.login(orch_user, orch_pw)\n    orch.logout()\n```\n\nAnother option is to pass an API Key on init to make authenticated calls\nwithout having to call login/logout functions\n\n```python\n    orch_url = 'orchestrator.example.com'\n    orch = Orchestrator(orch_url, api_key='xxx')\n```\n\n### Edge Connect Class\n\n```python\n    from pyedgeconnect import EdgeConnect\n```\n\nTo initialize an Edge Connect you must pass the url of the Edge Connect\n(IP or FQDN).\n\n> **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.\n\n```python\n    ecos_url = '10.2.30.50'\n    ecos_url = 'edgeconnect.example.com'\n    ec = EdgeConnect(ecos_url, verify_ssl=False)\n```\n\nNow you can call the login function to connect to Edge Connect with a\nusername and password:\n\n```python\n    ecos_user = 'admin'\n    ecos_pw = 'admin'\n    ec.login(ecos_user, ecos_pw)\n    ec.logout()\n```\n\n## Logging\n\nBy default, Orchestrator and EdgeConnect classes will not log calls\nand/or errors to file or console. When instantiating Orchestrator\nor EdgeConnect classes follow the below settings to enable logging\noptions:\n\n* Logging to a local file: set the ``log_file`` parameter to\n``True``. This will create ./logging/sp_orch.log or\n./logging/sp_ecos.log relative to where python is launched for calls\nthat are performed.\n\n* Logging to the console: set the ``log_console`` parameter to\n``True``\n\nBy default, successful API calls (e.g. returning HTTP 200/204 etc.) will\nnot log response text to avoid logging sensitive data. To include\nresponse text in log messages, set the ``log_success`` parameter to\n``True``.\n\n> **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.\n\n```python\n    orch_url = 'orchestrator.example.com'\n    orch = Orchestrator(orch_url, log_file=True, log_console=True)\n    # or\n    ecos_url = '10.2.30.50'\n    ec = EdgeConnect(ecos_url, log_success=True)\n```\n\n## Example Code\n\nIn the [Examples](/examples) directory you can find scripts leveraging\nthe Orchestrator class demonstrating some uses\n\n* [create_user.py](/examples/create_user.py)\n  * creates a new read-only user on Orchestrator and returns the\n      configured details\n* [print_appliance_info.py](/examples/print_appliance_info.py)\n  * retrieves all appliances, retrieves detailed attributes of the\n      appliances, and prints details in a table format\n* [run_packet_capture.py](/examples/run_packet_capture.py)\n  * runs a tcpdump packet capture on a specified appliance, once\n      completed, uploads to Orchestrator for user retrieval\n* [preconfig.py](/examples/generate_preconfig/preconfig.py)\n  * uses a CSV file as source data to generate Edge Connect YAML\n      preconfig from a Jinja template\n\n## This is an alpha product\n\nThis package is still very new. This is made explicit by the \"Alpha\"\ntrove classifier, as well as by the \"a\" in the version number. **Until\nthe package becomes stable, you should expect some formatting and/or\nsyntax to change in the future**.\n\n## License\n\nMIT\n\n## Contributing to pyedgeconnect\n\nAdding more modules and API functions are prioritized as needed for use.\nThere is not currently support for reviewing external PR's as maintenance\nis best effort by the authors.\n\nOpen an [issue](issues)\nto track any/all suggestions/fixes/additions.\nPlease don't file an issue to ask a question.\n\nAs this code is in early stages there are larger changes that may be\ndiscussed in regards to overall structure, error handling, logging, etc.\nSuggestions for these topics can be raised via issue or contacting the\nauthors.\n\nSee contribution details at [Contributing](CONTRIBUTING.md)\n\n## Release Notes\n\nRelease notes are located in ``docs/source/release-notes`` directory [here](docs/source/release-notes)\n\n## Authors\n\nAuthored by Zach Camara, email at <zachary.camara@hpe.com>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python wrapper for Aruba Orchestrator and Edge Connect API",
    "version": "0.16.0a1",
    "project_urls": {
        "Bug Reports": "https://github.com/aruba/pyedgeconnect/issues",
        "Homepage": "https://github.com/aruba/pyedgeconnect",
        "Source": "https://github.com/aruba/pyedgeconnect/"
    },
    "split_keywords": [
        "silverpeak",
        "silverpeak python",
        "aruba edgeconnect",
        "edgeconnect"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2934289b187a67d2b1cf66089dffd583753a41ebb5763320ec44bc50ead7d0b4",
                "md5": "806b472a224408147b7ea12c93d073bc",
                "sha256": "58a0c8a6e4b72529d22800aebd3bb5680eec30ff26962069625be93074e2e1dc"
            },
            "downloads": -1,
            "filename": "pyedgeconnect-0.16.0a1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "806b472a224408147b7ea12c93d073bc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7, <4",
            "size": 272671,
            "upload_time": "2024-03-07T00:36:21",
            "upload_time_iso_8601": "2024-03-07T00:36:21.116625Z",
            "url": "https://files.pythonhosted.org/packages/29/34/289b187a67d2b1cf66089dffd583753a41ebb5763320ec44bc50ead7d0b4/pyedgeconnect-0.16.0a1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "71b95678afb46e9ad8c78da799d72d76ec6dfa419768bf2e12bc4b3f7f2f1fc0",
                "md5": "8793d31f75057994dd228f511fba8d1f",
                "sha256": "8bb9ccbfb1ea46a7e0309377f70674db327c9db31c3913b542592a2aa1874917"
            },
            "downloads": -1,
            "filename": "pyedgeconnect-0.16.0a1.tar.gz",
            "has_sig": false,
            "md5_digest": "8793d31f75057994dd228f511fba8d1f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7, <4",
            "size": 2673304,
            "upload_time": "2024-03-07T00:36:32",
            "upload_time_iso_8601": "2024-03-07T00:36:32.269796Z",
            "url": "https://files.pythonhosted.org/packages/71/b9/5678afb46e9ad8c78da799d72d76ec6dfa419768bf2e12bc4b3f7f2f1fc0/pyedgeconnect-0.16.0a1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-07 00:36:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aruba",
    "github_project": "pyedgeconnect",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pyedgeconnect"
}
        
Elapsed time: 0.22028s