{ "info": { "author": "Quentin Rousseau", "author_email": "contact@quent.in", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development", "Topic :: System :: Logging", "Topic :: System :: Monitoring" ], "description": "pypertrail\n==========\n\n|pypi| |travis| |doc| |pyup|\n\nPython wrapper library and CLI for papertrail API.\n\nInstallation\n------------\n\nInstall using pip:\n\n.. code:: bash\n\n $ pip install pypertrail\n\nRequirements\n------------\n\n- Python 2.6, 2.7, 3.3, 3.4, or 3.5\n- A Papertrail account\n\nLibrary\n-------\n\nAccounts\n~~~~~~~~\n\n.. code:: python\n\n import os\n from pypertrail.accounts import Account\n\n accounts = Account(os.environ['PAPERTRAIL_API_TOKEN'])\n\n # List account usage\n accounts.list()\n\nArchives\n~~~~~~~~\n\n.. code:: python\n\n import os\n from pypertrail.archives import Archive\n\n archives = Archive(os.environ['PAPERTRAIL_API_TOKEN'])\n\n # List archive information\n archives.list()\n\nGroups\n~~~~~~\n\n.. code:: python\n\n import os\n from pypertrail.groups import Group\n\n groups = Group(os.environ['PAPERTRAIL_API_TOKEN'])\n\n # List groups\n groups.list()\n\n # Show a group\n groups.show(group_id)\n\n # Update a group\n groups.update(group_id)\n\n # Delete a group\n groups.delete(group_id)\n\nSaved searches\n~~~~~~~~~~~~~~\n\n.. code:: python\n\n import os\n from pypertrail.saved_searches import SavedSearch\n\n saved_searches = SavedSearch(os.environ['PAPERTRAIL_API_TOKEN'])\n\n # List saved_searches\n saved_searches.list()\n\n # Show a saved search\n saved_searches.show(saved_search_id)\n\n # Create a saved search\n payload = {'name':'my_query', 'query':'sshd'}\n saved_searches.create(payload)\n\n # Update a saved search\n payload = {'search[query]':'another_query'}\n saved_searches.update(payload)\n\n # Delete a saved search\n saved_searches.delete(saved_search_id)\n\nSearch\n~~~~~~~~~~~~~~\n\n.. code:: python\n\n import os\n from pypertrail.search import Search\n\n search = Search(os.environ['PAPERTRAIL_API_TOKEN'])\n\n # Search events\n search.events(\"sshd\")\n\nSystems\n~~~~~~\n\n.. code:: python\n\n import os\n from pypertrail.systems import System\n\n systems = Search(os.environ['PAPERTRAIL_API_TOKEN'])\n\n # List systems\n systems.list()\n\n # Show a system\n systems.show(system_id)\n\n # Create a system\n payload = {'system[name]':'foo', 'system[hostname]':'bar', 'destination_port':46865}\n systems.create(payload)\n\n # Update a system\n payload = {'system[name]':'another_name'}\n systems.update(system_id, payload)\n\n # Delete a system\n systems.delete(system_id)\n\n # Join a group\n payload = {'group_id':10}\n systems.join_group(system_id, payload)\n\n # Leave a group\n payload = {'group_id':10}\n systems.leave_group(system_id, payload)\n\nUsers\n~~~~~\n\n.. code:: python\n\n import os\n from pypertrail.users import User\n\n users = User(os.environ['PAPERTRAIL_API_TOKEN'])\n\n # List users\n users.list()\n\n # Invite a user\n payload = {'email':'contact@quent.in', 'read_only':'true'}\n users.invite(payload)\n\n # Delete a user\n users.delete(user_id)\n\nCLI\n---\n\nCLI Authentication\n~~~~~~~~~~~~~~~~~~\n\nVia environment variables:\n\n.. code:: bash\n\n $ export PAPERTRAIL_API_TOKEN=my_token\n $ pypertrail users list\n\nVia implicit ~/.pypertrail.yml:\n\n.. code:: bash\n\n $ echo \"token: my_token\" > ~/.pypertrail.yml\n $ pypertrail users list\n\nVia (--conf/-c) option:\n\n.. code:: bash\n\n $ echo \"token: my_token\" > /path/to/config\n $ pypertrail --conf /path/to/config users list\n\nVia (--token/-t) option:\n\n.. code:: bash\n\n $ pypertrail --token my_token users list\n\nSubcommands\n~~~~~~~~~~~\n\n.. code:: plain\n\n Usage: pypertrail.py [OPTIONS] COMMAND [ARGS]...\n\n Options:\n -d, --debug Debug mode.\n -p, --pretty Prettify JSON output.\n -t, --token TEXT Papertrail API token.\n -c, --conf TEXT Path to config (~/.pypertrail.yml).\n --version Show the version and exit.\n -h, --help Show this message and exit.\n\n Commands:\n accounts\n archives\n groups\n saved_searches\n search\n systems\n users\n\nAccounts\n~~~~~~~~\n\n.. code:: plain\n\n Usage: papertrail.py accounts [OPTIONS] COMMAND [ARGS]...\n\n Options:\n -h, --help Show this message and exit.\n\n Commands:\n list List account usage\n\nExamples:\n\n.. code:: bash\n\n $ pypertrail --pretty accounts list\n\n\nArchives\n~~~~~~~~\n\n.. code:: plain\n\n Usage: papertrail.py archives [OPTIONS] COMMAND [ARGS]...\n\n Options:\n -h, --help Show this message and exit.\n\n Commands:\n list List archive information\n\nExamples:\n\n.. code:: bash\n\n $ pypertrail --pretty archives list\n\nSaved searches\n~~~~~~~~~~~~~~\n\n.. code:: plain\n\n Usage: cli.py saved_searches [OPTIONS] COMMAND [ARGS]...\n\n Options:\n -h, --help Show this message and exit.\n\n Commands:\n create Create a saved search\n delete Delete a saved search\n list List saved_searches\n show Show a saved search\n update Update a saved search\n\nExamples:\n\n.. code:: bash\n\n $ pypertrail saved_searches create --payload '{\"search[name]\":\"foo\", \"search[query]\":\"bar\"}'\n $ pypertrail saved_searches delete 1\n $ pypertrail saved_searches list\n $ pypertrail saved_searches show 1\n $ pypertrail saved_searches update 1 --payload '{\"search[query]\":\"another_query\"}'\n\n\nGroups\n~~~~~~\n\n.. code:: plain\n\n Usage: papertrail.py groups [OPTIONS] COMMAND [ARGS]...\n\n Options:\n -h, --help Show this message and exit.\n\n Commands:\n delete Delete a group\n list List groups\n show Show a group\n update Update a group\n\nExamples:\n\n.. code:: bash\n\n $ pypertrail groups delete 1\n $ pypertrail groups list\n $ pypertrail groups show 1\n $ pypertrail groups update 1 --payload '{\"group[name]\":\"another_name\"}'\n\n\nSearch\n~~~~~~\n\n.. code:: plain\n\n Usage: papertrail.py search events [OPTIONS]\n\n Search events\n\n Options:\n -q, --query TEXT Terms to query.\n -s, --system INTEGER System to search.\n -g, --group INTEGER Group to search.\n -e, --min-time INTEGER Earliest time to search from.\n -l, --max-time INTEGER Latest time to search from.\n -f, --follow Continue running and printing new events\n (off).\n -d, --delay INTEGER Delay between refresh (5).\n -j, --json Output raw JSON data (off).\n -c, --color [program|system|all|off]\n Attribute(s) to colorize based on (program).\n -h, --help Show this message and exit.\n\nExamples:\n\n.. code:: bash\n\n $ pypertrail search events\n $ pypertrail search events --follow\n $ pypertrail search events --follow --color program\n $ pypertrail search events --follow --query sshd\n $ pypertrail search events --follow --json\n\nSystems\n~~~~~~~\n\n.. code:: plain\n\n Usage: papertrail.py systems [OPTIONS] COMMAND [ARGS]...\n\n Options:\n -h, --help Show this message and exit.\n\n Commands:\n create Create a saved search\n delete Delete a system\n join_group Join a group\n leave_group Leave a group\n list List systems\n show Show a system\n update Update a system\n\nExamples:\n\n.. code:: bash\n\n $ pypertrail systems create --payload '{\"system[name]\":\"foo\", \"system[hostname]\":\"bar\", \"destination_port\":46865}'\n $ pypertrail systems delete 1\n $ pypertrail systems join_group 1 --payload '{\"group_id\":10}'\n $ pypertrail systems leave_group 1 --payload '{\"group_id\":10}'\n $ pypertrail systems list\n $ pypertrail systems show 1\n $ pypertrail systems update 1 --payload '{\"system[name]\":\"another_name\"}'\n\nUsers\n~~~~~\n\n.. code:: plain\n\n Usage: papertrail.py users [OPTIONS] COMMAND [ARGS]...\n\n Options:\n -h, --help Show this message and exit.\n\n Commands:\n delete Delete a user\n invite Invite a user\n list List users\n\nExamples:\n\n.. code:: bash\n\n $ pypertrail users delete 1\n $ pypertrail users invite --payload '{\"email\":\"contact@quent.in\", \"read_only\":true}'\n $ pypertrail users list\n\nDocumentation\n=============\n\n- https://pypertrail.readthedocs.io\n- http://help.papertrailapp.com/kb/how-it-works/http-api\n\nHistory\n=======\n\nView the `changelog`_\n\nAuthors\n=======\n\n- `Quentin Rousseau`_\n\nLicense\n=======\n\n.. code:: plain\n\n Copyright (c) 2016 Quentin Rousseau \n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation\n files (the \"Software\"), to deal in the Software without\n restriction, including without limitation the rights to use,\n copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the\n Software is furnished to do so, subject to the following\n conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n\n.. _changelog: https://github.com/kwent/pypertrail/blob/master/HISTORY.rst\n.. _Quentin Rousseau: https://github.com/kwent\n\n.. |pypi| image:: https://img.shields.io/pypi/v/pypertrail.svg\n :target: https://pypi.python.org/pypi/pypertrail\n.. |travis| image:: https://img.shields.io/travis/kwent/pypertrail.svg\n :target: https://travis-ci.org/kwent/pypertrail\n.. |doc| image:: https://readthedocs.org/projects/pypertrail/badge/?version=latest\n :target: https://pypertrail.readthedocs.io/en/latest/?badge=latest\n.. |pyup| image:: https://pyup.io/repos/github/kwent/pypertrail/shield.svg\n :target: https://pyup.io/repos/github/kwent/pypertrail/\n\n\n=======\nHistory\n=======\n\n1.0.0 (2016-10-06)\n------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": "https://pythonhosted.org/pypertrail/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kwent/pypertrail", "keywords": "pypertrail", "license": "MIT license", "maintainer": null, "maintainer_email": null, "name": "pypertrail", "package_url": "https://pypi.org/project/pypertrail/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pypertrail/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kwent/pypertrail" }, "release_url": "https://pypi.org/project/pypertrail/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Python wrapper library and CLI for papertrail API.", "version": "1.0.0" }, "last_serial": 2385535, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "56e5155d28227d27bb52d01dc298ee1e", "sha256": "e7ea36b2d6a54aa8b2fa37fe67fac79b478e1eb317f2177774701dbaf5bc302e" }, "downloads": -1, "filename": "pypertrail-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "56e5155d28227d27bb52d01dc298ee1e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16261, "upload_time": "2016-10-06T21:58:50", "url": "https://files.pythonhosted.org/packages/07/a2/0df56f8982a34147df07548da8080372109d2f626d0dc55e0c9b5569ae7b/pypertrail-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "351baa6830ab41b3430ab8fea60c72c3", "sha256": "3f98883f179b1b4f74d07b0aae714689d3b9829295dc4d84d18847517c62b9f1" }, "downloads": -1, "filename": "pypertrail-1.0.0.tar.gz", "has_sig": false, "md5_digest": "351baa6830ab41b3430ab8fea60c72c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29748, "upload_time": "2016-10-06T21:58:48", "url": "https://files.pythonhosted.org/packages/d4/a4/baba9e426875c20b49b29901092afab4d2f7fd2bd973893cb03918a7f50e/pypertrail-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "56e5155d28227d27bb52d01dc298ee1e", "sha256": "e7ea36b2d6a54aa8b2fa37fe67fac79b478e1eb317f2177774701dbaf5bc302e" }, "downloads": -1, "filename": "pypertrail-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "56e5155d28227d27bb52d01dc298ee1e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16261, "upload_time": "2016-10-06T21:58:50", "url": "https://files.pythonhosted.org/packages/07/a2/0df56f8982a34147df07548da8080372109d2f626d0dc55e0c9b5569ae7b/pypertrail-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "351baa6830ab41b3430ab8fea60c72c3", "sha256": "3f98883f179b1b4f74d07b0aae714689d3b9829295dc4d84d18847517c62b9f1" }, "downloads": -1, "filename": "pypertrail-1.0.0.tar.gz", "has_sig": false, "md5_digest": "351baa6830ab41b3430ab8fea60c72c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29748, "upload_time": "2016-10-06T21:58:48", "url": "https://files.pythonhosted.org/packages/d4/a4/baba9e426875c20b49b29901092afab4d2f7fd2bd973893cb03918a7f50e/pypertrail-1.0.0.tar.gz" } ] }