Python client for Monasca REST API.
Go to file
Doug Hellmann d4541971c3 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I9c427d9186e3e27b74d790839b1eb623769f57ec
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-13 15:39:32 -04:00
doc/source Redistribute README to doc/source 2018-05-22 08:52:27 +02:00
monascaclient replace unicode with six.text_type 2018-06-13 15:39:32 -04:00
releasenotes Update reno for stable/queens 2018-01-22 17:16:39 +00:00
.gitignore Switch to using stestr 2018-06-02 21:18:55 -04:00
.gitreview Update .gitreview for new namespace 2015-10-17 22:37:23 +00:00
.stestr.conf Switch to using stestr 2018-06-02 21:18:55 -04:00
.testr.conf Migrate fully to ostestr 2017-02-20 11:07:46 +01:00
.zuul.yaml add lower-constraints job 2018-03-22 17:55:26 -04:00
CONTRIBUTING.rst Add CONTRIBUTING.rst 2016-11-18 11:44:37 +08:00
HACKING.rst Update the documentation link for doc migration 2017-08-02 16:52:12 +08:00
LICENSE Added HP copyright and Apache 2.0 license header. Added HACKING.rst and LICENSE file. 2014-05-01 16:59:50 -06:00
README.rst Redistribute README to doc/source 2018-05-22 08:52:27 +02:00
lower-constraints.txt add lower-constraints job 2018-03-22 17:55:26 -04:00
requirements.txt Switch to using stestr 2018-06-02 21:18:55 -04:00
setup.cfg Enable client documentation 2017-11-21 17:31:06 +01:00
setup.py Updated from global requirements 2017-03-02 11:54:51 +00:00
test-requirements.txt Switch to using stestr 2018-06-02 21:18:55 -04:00
tox.ini fix tox python3 overrides 2018-06-13 15:39:32 -04:00

README.rst

Team and repository tags

image

Python bindings to the Monasca API

This is a client library for Monasca built to interface with the Monasca API. It provides a Python API (the monascaclient module) and a command-line tool (monasca).

The Monasca Client was written using the OpenStack Heat Python client as a framework.

Contents:

Ubuntu Install

Requires:
  • pip - version >= 1.4. python get-pip.py
See versions on PYPI:

https://pypi.org/project/python-monascaclient/

Install It:
  • sudo pip install python-monascaclient
Alternative Manual Install Steps:
  • cd to your python-monascaclient repo
  • sudo pip install -r requirements.txt
  • python setup.py install

Building and Packaging

Install the tool dependencies

sudo apt-get install python-pip python-virtualenv

In the python-monascaclient source directory

virtualenv --no-site-packages .venv

source ./.venv/bin/activate

pip install wheel

python setup.py bdist_wheel

pip install $(ls -1rt dist/*.whl | tail -1) --upgrade

Command-line API

Installing this distribution gets you a shell command, monasca, that you can use to interact with the Monitoring API server.

Usage:

monasca

monasca help

monasca help <command>

This outputs the results in json format. Normally output is in table format.

The monascaclient CLI needs the Monasca API endpoint url and the OS_AUTH_TOKEN to pass to the Monasca API RESTful interface. This is provided through environment or CLI parameters.

Environmental Variables

Environmental variables can be sourced, or optionally passed in as CLI arguments. It is easiest to source them first and then use the CLI.

When token and endpoint are known:

export OS_AUTH_TOKEN=XXX
export MONASCA_API_URL=http://192.168.10.4:8070/v2.0/

When using Keystone to obtain the token and endpoint:

export OS_USERNAME=
export OS_PASSWORD=
export OS_USER_DOMAIN_NAME=
export OS_PROJECT_NAME=
export OS_AUTH_URL=
export OS_REGION_NAME=
# Optional(specific version added to OS_AUTH_URL if (v2.0 or v3) not present already)
export OS_AUTH_VERSION=

When OS_USER_DOMAIN_NAME is not set, then 'Default' is assumed. Alternatively IDs can be used instead of names. Although deprecated, but OS_TENANT_NAME and OS_TENANT_ID can be used for OS_PROEJCT_NAME and OS_PROJECT_ID respectively.

When using Vagrant Environment with middleware disabled:

export OS_AUTH_TOKEN=82510970543135
export OS_NO_CLIENT_AUTH=1
export MONASCA_API_URL=http://192.168.10.4:8070/v2.0/

The Monasca API will treat the auth token as the tenant ID when Keystone is not enabled.

License

(C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP Copyright 2017 Fujitsu LIMITED

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.