Skip to main content

Panopta API Client

Project description

Panopta API Python Package
==========================
The Panopta API (previously `panopta_rest_api`) provides full access to all configuration, status and outage
management functionality of the Panopta monitoring service, including the
ability to create and modify monitoring checks that are being performed, manage
notification configuration, respond to active outages and to pull availability
statistics for monitored servers. This package makes it simple to interact with
the Panopta API.

# API Documentation
Full documentation for the API is available at
[https://api2.panopta.com/v2/api-docs/](https://api2.panopta.com/v2/api-docs/).
By entering your API token you can view full details on all of the API methods
and issue API requests from the documentation page.

# Installation
```bash
pip install panopta_api
```

# Usage
The library provides a wrapper around the Panopta API, making it easy to issue
GET, POST, PUT and DELETE operations to the API. The `Client` is an adapter
built on top of [Requests](http://python-requests.org), so anything you can do
with a `requests.Session`, you can with `panopta_api.Client`.

## Instantiate the Panopta API client
```python
from panopta_api import Client
client = Client('your-api-key',
host='http://api2.panopta.com',
version='2',
log_level=Client.LOG_INFO,
log_path='logs/')
```

## Generate API urls
```python
resource = 'server'
id = '123'
collection = 'network_service'
server_network_services = client.url(resource, id, collection)
```

## GET
```python
five_contacts = client.get(client.url('contact'), params={'limit': 5});

servers_with_a_certain_fully_qualified_domain_name = client.get(
client.url('server'),
params={'fqdn': 'panopta.com'}
)

server_forty_two = client.get(client.url('server', '42'))
```

## POST
```python
new_notification_schedule = client.post(
client.url('notification_schedule'),
json={'name': 'New Notification Schedule',
'targets': [server_forty_two['url']]}
)
```

## PUT
```python
updated_server_group = client.put(
client.url('server_group'),
json={'name': 'Updated Server Group',
'notification_schedule': new_notification_schedule['url']}
)
```

## DELETE
```python
client.delete(client.url('contact', '1'))
```

Project details


Download files

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

Source Distribution

panopta_api-2.0.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

panopta_api-2.0.0-py2.py3-none-any.whl (5.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file panopta_api-2.0.0.tar.gz.

File metadata

  • Download URL: panopta_api-2.0.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for panopta_api-2.0.0.tar.gz
Algorithm Hash digest
SHA256 1a2406f34d9fb53bef99b283015b679c927ad2213f95ba11b5d101d4a22d39a9
MD5 a05b1c7ae229b11448e20763bcf7d3fc
BLAKE2b-256 c715843a6b940ea08ea21d50ab33c74709df78291e4c1ab915e53869c4b6ad9f

See more details on using hashes here.

File details

Details for the file panopta_api-2.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for panopta_api-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 944dfefdb656af298ec306460c297ba5fa50c06f47c24e4fdf216e4acfebba84
MD5 1c87d1bdaef003d233bd2c116304b290
BLAKE2b-256 d29f035d4dd0fd91e7bfa6b5ae5f51d4aa48a6a6e692c78eb3d17a86f49ffb5a

See more details on using hashes here.

Supported by

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