Skip to content

Commit

Permalink
Merge pull request #1 from glogiotatidis/list-monitors
Browse files Browse the repository at this point in the history
omw lots of commands
  • Loading branch information
glogiotatidis authored Apr 27, 2017
2 parents 899f498 + 2011bd7 commit df038e8
Show file tree
Hide file tree
Showing 15 changed files with 919 additions and 62 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst
include requirements.txt
include requirements_dev.txt

recursive-include tests *
recursive-exclude * __pycache__
Expand Down
165 changes: 141 additions & 24 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,40 +1,157 @@
===============================
neres
===============================
NewRelic Synthetics (unofficial) CLI (NeReS)
============================================

|image0| |image1| |image2|

.. image:: https://img.shields.io/pypi/v/neres.svg
:target: https://pypi.python.org/pypi/neres
NeReS is a cli tool to manage `NewRelic Synthetics
<https://synthetics.newrelic.com/>`__ monitors with a Synthetics Lite account
(Pro should work too). The tool emulates the actions of a user in the browser
and doesn't use the Synthetics API since that's only available to the Pro
accounts.

.. image:: https://img.shields.io/travis/glogiotatidis/neres.svg
:target: https://travis-ci.org/glogiotatidis/neres
Use the tools you can:

.. image:: https://readthedocs.org/projects/neres/badge/?version=latest
:target: https://neres.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
- List all your monitors, including their success rate, locations,
notifications etc.
- Create, update and delete monitors
- List available locations for monitor installation

.. image:: https://pyup.io/repos/github/glogiotatidis/neres/shield.svg
:target: https://pyup.io/repos/github/glogiotatidis/neres/
:alt: Updates
Everything you can do using the Web console is supported and provided to your
shell prompt.

Configuration
-------------

(unofficial) NewRelic Synthetics CLI
1. You will need a newrelic account
2. Start by using the `login` command
3. Read the docs or run `--help`


* Free software: GNU General Public License v3
* Documentation: https://neres.readthedocs.io.
Use
---

Login to NewRelic
~~~~~~~~~~~~~~~~~~

Features
--------
Login to NewRelic with the `login` command:

* TODO
.. code:: shell
Credits
---------
$ neres login
If you have multiple NewRelic accounts you can have different environments:

.. code:: shell
$ neres --environment work login
.. note::

Default environment is named `newrelic`. Remember to always pass `--environment`
to all neres commands to execute them in the correct environment. Alternatively
you can add `NERES_ENVIRONMENT` to your environment variables list.


List Accounts
~~~~~~~~~~~~~

You can list all the accounts connected to the email you used to connect using:

.. code:: shell
$ neres list-accounts
By default neres will act on the first account listed. This command will help
you select a different account by using the `ID` of the account in combination
with the `--account` option or by setting `NERES_ACCOUNT` in your environment.

List Locations
~~~~~~~~~~~~~~

Lists available monitor locations:

.. code:: shell
$ neres list-locations
List Monitors
~~~~~~~~~~~~~

Lists available monitors:

.. code:: shell
$ neres list-monitors
You can only list IDs of the monitors:

.. code:: shell
$ neres list-monitors --ids-only
Or get the raw JSON output from NewRelic:

.. code:: shell
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
$ neres list-monitors --raw
Add Monitor
~~~~~~~~~~~

Adds a Synthetics monitor:

.. code:: shell
$ neres add-monitor monitorName http://example.com
Use `--help` to get a full list of supported options for the command. All
options are optional.


Get Monitor
~~~~~~~~~~~

Get details on a monitor

.. code:: shell
$ neres get-monitor de310b69-3195-435e-b1ef-3a0af67499de
.. note::

You can use `list-monitors` to get a list of available monitors.

Update Monitor
~~~~~~~~~~~~~~

Update an existing monitor

.. code:: shell
$ neres update-monitor de310b69-3195-435e-b1ef-3a0af67499de --name "Foobar"
Use `--help` to get a full list of supported options for the command. All
options are optional.


Open Monitor
~~~~~~~~~~~~

Open monitor in the browser

.. code:: shell
$ neres open de310b69-3195-435e-b1ef-3a0af67499de
Credits
-------

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
This package was created with
`Cookiecutter <https://github.com/audreyr/cookiecutter>`__ and the
`audreyr/cookiecutter-pypackage <https://github.com/audreyr/cookiecutter-pypackage>`__
project template.

.. |image0| image:: https://img.shields.io/pypi/v/neres.svg
.. |image1| image:: https://travis-ci.org/glogiotatidis/neres.svg?branch=master
.. |image2| image:: https://pyup.io/repos/github/glogiotatidis/neres/shield.svg
4 changes: 4 additions & 0 deletions neres/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# -*- coding: utf-8 -*-

__author__ = """Giorgos Logiotatidis"""
__email__ = 'giorgos@sealabs.net'
__version__ = '0.1.0'
Loading

0 comments on commit df038e8

Please sign in to comment.