========================
Landscape API (Python 3)
.. image:: https://img.shields.io/pypi/v/landscape_api_py3.svg
:target: https://pypi.python.org/pypi/landscape_api_py3
.. image:: https://img.shields.io/travis/jurya/landscape_api_py3.svg
:target: https://travis-ci.org/jurya/landscape_api_py3
.. image:: https://github.com/JuryA/landscape_api_py3/workflows/Build%20tests/badge.svg
:target: https://github.com/JuryA/landscape_api_py3
.. image:: https://readthedocs.org/projects/landscape-api-py3/badge/?version=latest
:target: https://landscape-api-py3.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://app.fossa.com/api/projects/git%2Bgithub.com%2FJuryA%2Flandscape_api_py3.svg?type=shield
:target: https://app.fossa.com/projects/git%2Bgithub.com%2FJuryA%2Flandscape_api_py3?ref=badge_shield
:alt: FOSSA Status
Client for the Landscape API (Python 3)
Features
- easy installation from PyPI (you can use pipenv, pip, pipex, Chocolatey, ...)
- working on Windows (pipx create landscape-api.exe shim)
- working with Python>=v3.5 (easily from landscape_api_py3.base import API)
- for quick use can be installed with pipx install landscape_api_py3
Quick start
Check if you have installed Python v3.5 and above.
To install Landscape API (Python 3), run this command in your terminal:
On Linux:
.. code-block:: console
$ pip install landscape-api-py3
$ python -m landscape-api --uri https://your-uri-to-ls-api/api --key <your API key> --secret <your API secret> --json get-computers --limit 1
On Windows:
.. code-block:: console
C:\> pip install landscape-api-py3
C:\> python -m landscape-api --uri https://your-uri-to-ls-api/api --key <your API key> --secret <your API secret> --json get-computers --limit 1
or you can use pipx (virtual environment will be created automatically):
On Linux:
.. code-block:: console
$ pip install --user pipx
$ pipx ensurepath
$ exec $SHELL # Restart your shell to reload PATH
$ pipx install landscape-api-py3
$ landscape-api --uri https://your-uri-to-ls-api/api --key <your API key> --secret <your API secret> --json get-computers --limit 1
On Windows:
.. code-block:: console
C:\> pip install --user pipx
C:\> pipx ensurepath
C:\> REM Restart console window to reload PATH
C:\> pipx install landscape-api-py3
C:\> landscape-api --uri https://your-uri-to-ls-api/api --key <your API key> --secret <your API secret> --json get-computers --limit 1
Known issues
- none (issues with dependencies resolved in v0.3.0)
Credits
Based on package landscape-api_ from Canonical Ltd.
_
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage
_ project template.
License
.. image:: https://app.fossa.com/api/projects/git%2Bgithub.com%2FJuryA%2Flandscape_api_py3.svg?type=large
:target: https://app.fossa.com/projects/git%2Bgithub.com%2FJuryA%2Flandscape_api_py3?ref=badge_large
:alt: FOSSA Status
.. _landscape-api: https://landscape.canonical.com/static/doc/api/python-api.html
.. _Canonical Ltd.
: https://canonical.com
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage
: https://github.com/audreyr/cookiecutter-pypackage
=======
History
v0.7.1 (2021-01-27)
v0.7.0 (2021-01-27)
- fix #245: CreateScript endpoint raises exception (solution suggested and tested)
- fix #246: CreateScriptAttachment endpoint raises exception (solution suggested and tested)
- minor format change
- add pyproject.toml
v0.6.1 (2020-06-17)
v0.5.0 (2020-06-11)
- added support for Python 3.5, 3.6, 3.7, 3.8 and above
- fixed minor bugs
- updated documentation (Installation, Usage, Quick start)
v0.4.2 (2020-06-10)
- fixed documentation import bug
- fixed default CA cert bug
v0.4.1 (2020-06-10)
- fixed bug with imports - now it's compatible with Canonical landscape-api
v0.3.5 (2020-06-10)
v0.3.4 (2020-06-09)
- replaced pycurl --> requests
v0.2.0alpha (2020-06-08) - First pre-release of landscape-api package
- 🎉 first ALPHA non-production version release of landscape-api ported to Python v3.8
Known issues (v0.2.0alpha):
* on **Windows** download CA certificate file from `<https://curl.haxx.se/ca/cacert.pem>`_ and use **--ssl-ca-file** or **LANDSCAPE_API_SSL_CA_FILE** (see Landscape API documentation `here <https://landscape.canonical.com/static/doc/api/api-client-package.html>`_)
* on **Linux** depends on **gnutls** and **libssl** (require **pycurl** package for installation)
Before installation of the package (v0.2.0alpha):
- on Ubuntu 16.04 (Xenial Xerus) use sudo apt-get install -y libgnutls-dev
- on Ubuntu 20.04 (Focal Fossa) use sudo apt-get install -y libgnutls28-dev libcurl4-openssl-dev libssl-dev
- on Windows 10 simply use pipx install landscape_api_py3
0.1.3 (2020-06-07)