## updownio project
[](https://pypi.org/project/updownio/)
[](https://pypi.org/project/updownio/)
[](https://updownio.readthedocs.io/)
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 | <span/> |
| `UPDOWN_ENDPOINT` | API Endpoint | https://updown.io |
| `UPDOWN_TIMEOUT ` | Request timeout in seconds | 60 |
## Usage
### Import library
```python
import updownio
```
### Initialize service with arguments
```python
updown_checks = updownio.service('checks',
api_key = 'xxxxxxxxxxx',
endpoint = 'https://example.org/api',
timeout = 3600)
```
### Endpoints
#### Checks
##### List all your checks
```python
checks = updownio.service('checks').list()
```
##### Show a single check
Select check by token
```python
check = updownio.service('checks').show(token = 'xxxx')
```
or by URL
```python
check = updownio.service('checks').show(url = 'https://example.org')
```
##### Get all the downtimes of a check
Select downtimes by token
```python
check = updownio.service('checks').downtimes(token = 'xxxx'
params = {'page': 1,
'results': False})
```
or by URL
```python
check = updownio.service('checks').downtimes(url = 'https://example.org')
```
##### Get detailed metrics about the check
Select metrics by token
```python
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
```python
check = updownio.service('checks').metrics(url = 'https://example.org')
```
##### Add a new check
```python
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
```python
check = updownio.service('checks').update(token = 'xxxx',
data = {'apdex_t': 1.0,
'disabled_locations': ['fra', 'syd'],
'recipients': ['email:xxxxxxxx', 'slack:xxxxxxxx']})
```
or by URL
```python
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
```python
updownio.service('checks').delete(token = 'xxxx')
```
or by URL
```python
updownio.service('checks').delete(url = 'https://example.org')
```
#### Nodes
##### List all updown.io monitoring nodes
```python
nodes = updownio.service('nodes').list()
```
##### List all updown.io monitoring nodes IPv4 addresses
```python
nodes = updownio.service('nodes').ipv4()
```
##### List all updown.io monitoring nodes IPv6 addresses
```python
nodes = updownio.service('nodes').ipv6()
```
#### Recipients
##### List all the possible alert recipients/channels on your account
```python
recipients = updownio.service('recipients').list()
```
##### Add a new recipient
```python
recipients = updownio.service('recipients').add(xtype = 'email',
value = 'xxxxxxxx',
data = {'selected': True})
```
##### Delete a recipient
```python
updownio.service('recipients').delete(xid = 'email:xxxxxxxx')
```
#### Status pages
##### List all your status pages
```python
status_pages = updownio.service('status_pages').list()
```
##### Add a new status page
```python
status_page = updownio.service('status_pages').add(['xxxx', 'yyyy', 'zzzz'],
data = {'name': 'foo',
'description': 'bar'})
```
##### Update a status page
```python
status_page = updownio.service('status_pages').update(token = 'xxxx',
data = {'checks': ['xxxx', 'zzzz'],
'name': 'spam',
'description': 'ham'})
```
##### Delete a status page
```python
updownio.service('status_pages').delete(token = 'xxxx')
```
Raw data
{
"_id": null,
"home_page": "https://github.com/decryptus/updownio",
"name": "updownio",
"maintainer": "",
"docs_url": null,
"requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.7.*, !=3.9.*",
"maintainer_email": "",
"keywords": "",
"author": "Adrien Delle Cave",
"author_email": "pypi@doowan.net",
"download_url": "",
"platform": null,
"description": "## updownio project\n\n[](https://pypi.org/project/updownio/)\n[](https://pypi.org/project/updownio/)\n[](https://updownio.readthedocs.io/)\n\nupdownio is a free and open-source, it's a python wrapper for the updown.io API.\n\n## Installation\n\n`pip install updownio`\n\n## Environment variables\n\n| Variable | Description | Default |\n|:-------------------------|:----------------------------|:--------|\n| `UPDOWN_ACCEPT` | HTTP Accept request-header | application/json |\n| `UPDOWN_ACCEPT_ENCODING` | HTTP Accept-Encoding request-header | gzip |\n| `UPDOWN_API_KEY` | API key for authentication | <span/> |\n| `UPDOWN_ENDPOINT` | API Endpoint | https://updown.io |\n| `UPDOWN_TIMEOUT ` | Request timeout in seconds | 60 |\n\n## Usage\n\n### Import library\n\n```python\nimport updownio\n```\n\n### Initialize service with arguments\n\n```python\nupdown_checks = updownio.service('checks',\n api_key = 'xxxxxxxxxxx',\n endpoint = 'https://example.org/api',\n timeout = 3600)\n```\n\n### Endpoints\n\n#### Checks\n\n##### List all your checks\n\n```python\nchecks = updownio.service('checks').list()\n```\n\n##### Show a single check\n\nSelect check by token\n\n```python\ncheck = updownio.service('checks').show(token = 'xxxx')\n```\nor by URL\n\n```python\ncheck = updownio.service('checks').show(url = 'https://example.org')\n```\n\n##### Get all the downtimes of a check\n\nSelect downtimes by token\n\n```python\ncheck = updownio.service('checks').downtimes(token = 'xxxx'\n params = {'page': 1,\n 'results': False})\n```\nor by URL\n\n```python\ncheck = updownio.service('checks').downtimes(url = 'https://example.org')\n```\n\n##### Get detailed metrics about the check\n\nSelect metrics by token\n\n```python\ncheck = updownio.service('checks').metrics(token = 'xxxx',\n params = {'from': '2022-12-16 15:11:17 +0100',\n 'to': '2023-01-16 15:11:17 +0100',\n 'group': 'host'})\n```\nor by URL\n\n```python\ncheck = updownio.service('checks').metrics(url = 'https://example.org')\n```\n\n##### Add a new check\n\n```python\ncheck = updownio.service('checks').add('https://example.org',\n data = {'apdex_t': 2.0,\n 'disabled_locations': ['fra', 'syd'],\n 'period': 3600,\n 'recipients': ['email:xxxxxxxx', 'slack:xxxxxxxx']})\n```\n\n##### Update a check\n\nSelect check by token\n\n```python\ncheck = updownio.service('checks').update(token = 'xxxx',\n data = {'apdex_t': 1.0,\n 'disabled_locations': ['fra', 'syd'],\n 'recipients': ['email:xxxxxxxx', 'slack:xxxxxxxx']})\n```\nor by URL\n\n```python\ncheck = updownio.service('checks').update(url = 'https://example.org',\n data = {'apdex_t': 1.0,\n 'disabled_locations': ['fra', 'syd'],\n 'recipients': ['email:xxxxxxxx', 'slack:xxxxxxxx']})\n```\n\n##### Delete a check\n\nSelect check by token\n\n```python\nupdownio.service('checks').delete(token = 'xxxx')\n```\nor by URL\n\n```python\nupdownio.service('checks').delete(url = 'https://example.org')\n```\n\n#### Nodes\n\n##### List all updown.io monitoring nodes\n\n```python\nnodes = updownio.service('nodes').list()\n```\n\n##### List all updown.io monitoring nodes IPv4 addresses\n\n```python\nnodes = updownio.service('nodes').ipv4()\n```\n\n##### List all updown.io monitoring nodes IPv6 addresses\n\n```python\nnodes = updownio.service('nodes').ipv6()\n```\n\n#### Recipients\n\n##### List all the possible alert recipients/channels on your account\n\n```python\nrecipients = updownio.service('recipients').list()\n```\n\n##### Add a new recipient\n\n```python\nrecipients = updownio.service('recipients').add(xtype = 'email',\n value = 'xxxxxxxx',\n data = {'selected': True})\n```\n\n##### Delete a recipient\n\n```python\nupdownio.service('recipients').delete(xid = 'email:xxxxxxxx')\n```\n\n#### Status pages\n\n##### List all your status pages\n\n```python\nstatus_pages = updownio.service('status_pages').list()\n```\n\n##### Add a new status page\n\n```python\nstatus_page = updownio.service('status_pages').add(['xxxx', 'yyyy', 'zzzz'],\n data = {'name': 'foo',\n 'description': 'bar'})\n```\n\n##### Update a status page\n\n```python\nstatus_page = updownio.service('status_pages').update(token = 'xxxx',\n data = {'checks': ['xxxx', 'zzzz'],\n 'name': 'spam',\n 'description': 'ham'})\n```\n\n##### Delete a status page\n\n```python\nupdownio.service('status_pages').delete(token = 'xxxx')\n```\n\n\n",
"bugtrack_url": null,
"license": "License GPL-3",
"summary": "Client library for updown.io API.",
"version": "0.0.9",
"project_urls": {
"Homepage": "https://github.com/decryptus/updownio"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "487214b8c474d763e6a5ada4cd0b6f06fd9ab65ac560c17134e375295e876d2d",
"md5": "38a870e88a4e0c15e7f17c642a745f91",
"sha256": "71c84fdca7057a9140d342005ba64d3c3617670de43139c7f20bd393c5702844"
},
"downloads": -1,
"filename": "updownio-0.0.9-py2-none-any.whl",
"has_sig": false,
"md5_digest": "38a870e88a4e0c15e7f17c642a745f91",
"packagetype": "bdist_wheel",
"python_version": "py2",
"requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.7.*, !=3.9.*",
"size": 20789,
"upload_time": "2024-01-24T09:35:02",
"upload_time_iso_8601": "2024-01-24T09:35:02.852886Z",
"url": "https://files.pythonhosted.org/packages/48/72/14b8c474d763e6a5ada4cd0b6f06fd9ab65ac560c17134e375295e876d2d/updownio-0.0.9-py2-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "45f469dd3c548890b0857538f650b79e0334f65f938a6e2da2fac766c7b562c8",
"md5": "b50f0662f8854a9996b9d10b9688c420",
"sha256": "fa26bfbd99adce484251d3eaf4a4bd02a94bd8f1f40956e9346da3d5542785b9"
},
"downloads": -1,
"filename": "updownio-0.0.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b50f0662f8854a9996b9d10b9688c420",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.7.*, !=3.9.*",
"size": 20788,
"upload_time": "2024-01-24T09:35:06",
"upload_time_iso_8601": "2024-01-24T09:35:06.248326Z",
"url": "https://files.pythonhosted.org/packages/45/f4/69dd3c548890b0857538f650b79e0334f65f938a6e2da2fac766c7b562c8/updownio-0.0.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-24 09:35:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "decryptus",
"github_project": "updownio",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "updownio"
}