Skip to main content

Client library for updown.io API.

Project description

updownio project

PyPI pyversions PyPI version shields.io Documentation Status

updownio is a free and open-source, it's a python wrapper for the updown.io API.

Installation

pip install updownio

Environment variables

Variable Description Default
UPDOWN_ACCEPT HTTP Accept request-header application/json
UPDOWN_ACCEPT_ENCODING HTTP Accept-Encoding request-header gzip
UPDOWN_API_KEY API key for authentication
UPDOWN_ENDPOINT API Endpoint https://updown.io
UPDOWN_TIMEOUT Request timeout in seconds 60

Usage

Import library

import updownio

Initialize service with arguments

updown_checks = updownio.service('checks',
                                 api_key  = 'xxxxxxxxxxx',
                                 endpoint = 'https://example.org/api',
                                 timeout  = 3600)

Endpoints

Checks

List all your checks
checks = updownio.service('checks').list()
Show a single check

Select check by token

check = updownio.service('checks').show(token = 'xxxx')

or by URL

check = updownio.service('checks').show(url = 'https://example.org')
Get all the downtimes of a check

Select downtimes by token

check = updownio.service('checks').downtimes(token = 'xxxx'
                                             params = {'page': 1,
                                                       'results': False})

or by URL

check = updownio.service('checks').downtimes(url = 'https://example.org')
Get detailed metrics about the check

Select metrics by token

check = updownio.service('checks').metrics(token = 'xxxx',
                                           params = {'from': '2022-12-16 15:11:17 +0100',
                                                     'to': '2023-01-16 15:11:17 +0100',
                                                     'group': 'host'})

or by URL

check = updownio.service('checks').metrics(url = 'https://example.org')
Add a new check
check = updownio.service('checks').add('https://example.org',
                                       data = {'apdex_t': 2.0,
                                               'disabled_locations': ['fra', 'syd'],
                                               'period': 3600,
                                               'recipients': ['email:xxxxxxxx', 'slack:xxxxxxxx']})
Update a check

Select check by token

check = updownio.service('checks').update(token = 'xxxx',
                                          data = {'apdex_t': 1.0,
                                                  'disabled_locations': ['fra', 'syd'],
                                                  'recipients': ['email:xxxxxxxx', 'slack:xxxxxxxx']})

or by URL

check = updownio.service('checks').update(url = 'https://example.org',
                                          data = {'apdex_t': 1.0,
                                                  'disabled_locations': ['fra', 'syd'],
                                                  'recipients': ['email:xxxxxxxx', 'slack:xxxxxxxx']})
Delete a check

Select check by token

updownio.service('checks').delete(token = 'xxxx')

or by URL

updownio.service('checks').delete(url = 'https://example.org')

Nodes

List all updown.io monitoring nodes
nodes = updownio.service('nodes').list()
List all updown.io monitoring nodes IPv4 addresses
nodes = updownio.service('nodes').ipv4()
List all updown.io monitoring nodes IPv6 addresses
nodes = updownio.service('nodes').ipv6()

Recipients

List all the possible alert recipients/channels on your account
recipients = updownio.service('recipients').list()
Add a new recipient
recipients = updownio.service('recipients').add(xtype = 'email',
                                                value = 'xxxxxxxx',
                                                data = {'selected': True})
Delete a recipient
updownio.service('recipients').delete(xid = 'email:xxxxxxxx')

Status pages

List all your status pages
status_pages = updownio.service('status_pages').list()
Add a new status page
status_page = updownio.service('status_pages').add(['xxxx', 'yyyy', 'zzzz'],
                                                   data = {'name': 'foo',
                                                           'description': 'bar'})
Update a status page
status_page = updownio.service('status_pages').update(token = 'xxxx',
                                                      data = {'checks': ['xxxx', 'zzzz'],
                                                              'name': 'spam',
                                                              'description': 'ham'})
Delete a status page
updownio.service('status_pages').delete(token = 'xxxx')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

updownio-0.0.10-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

updownio-0.0.10-py2-none-any.whl (20.8 kB view details)

Uploaded Python 2

File details

Details for the file updownio-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: updownio-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.26.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/2.7.18

File hashes

Hashes for updownio-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 c38608312aee4fb88f79d7b530efb1cd1c5cef70236068152d76716586007f4f
MD5 73bcb60e0e99c39c1d24b791c8c75494
BLAKE2b-256 12fbc0d346232793b2b50579515f243fd29dabcc06a863a92663f612a19bd4d6

See more details on using hashes here.

File details

Details for the file updownio-0.0.10-py2-none-any.whl.

File metadata

  • Download URL: updownio-0.0.10-py2-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.26.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/2.7.18

File hashes

Hashes for updownio-0.0.10-py2-none-any.whl
Algorithm Hash digest
SHA256 8472c7f562de4a56b15cc200c6a8e8bf1371b67b568cb6a4f52c5aab3b4029d4
MD5 69b749fee3559e9e756fcf72f5d4d9f5
BLAKE2b-256 439aeb8649f5daf95dc7b9ba784827788f6f698ce9348df403208309b25b0f64

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page