API & command-line client for BelugaCDN's API.
Project description
## beluga_py
Command line interface and python module for the BelugaCDN API. Python2 and Python3 compatible.
### Installation
```
pip install beluga_py
```
### API Usage
```
from beluga_py.api import BelugaAPI
api = BelugaAPI(token_id=<BELUGACDN_TOKEN_ID>, token_secret=<BELUGACDN_TOKEN_SECRET>)
# or
api = BelugaAPI(username=<BELUGACDN_USERNAME>, password=<BELUGACDN_PASSWORD>)
# get a list of all site configurations
r = api.get('api/cdn/v2/sites')
# create an authentication token
r = api.post('api/token/token', json={'description': 'test from api'})
data = r.json()
```
### Command Line
```
# get a list of all site configurations
beluga --username <your username> --password <your password> --service api/cdn/v2 --path sites
# create an authentication token
beluga --username <your username> --password <your password> --method POST --service api/token --path token --body '{"description": "my new token"}'
```
Refer BelugaCDN's API documentation at https://docs.belugacdn.com/ for more information.
#### Notes
* based on [`python-beluga`](https://github.com/belugacdn/python-beluga) by Adam Jacob Muller ([@AdamJacobMuller](https://github.com/AdamJacobMuller))
Command line interface and python module for the BelugaCDN API. Python2 and Python3 compatible.
### Installation
```
pip install beluga_py
```
### API Usage
```
from beluga_py.api import BelugaAPI
api = BelugaAPI(token_id=<BELUGACDN_TOKEN_ID>, token_secret=<BELUGACDN_TOKEN_SECRET>)
# or
api = BelugaAPI(username=<BELUGACDN_USERNAME>, password=<BELUGACDN_PASSWORD>)
# get a list of all site configurations
r = api.get('api/cdn/v2/sites')
# create an authentication token
r = api.post('api/token/token', json={'description': 'test from api'})
data = r.json()
```
### Command Line
```
# get a list of all site configurations
beluga --username <your username> --password <your password> --service api/cdn/v2 --path sites
# create an authentication token
beluga --username <your username> --password <your password> --method POST --service api/token --path token --body '{"description": "my new token"}'
```
Refer BelugaCDN's API documentation at https://docs.belugacdn.com/ for more information.
#### Notes
* based on [`python-beluga`](https://github.com/belugacdn/python-beluga) by Adam Jacob Muller ([@AdamJacobMuller](https://github.com/AdamJacobMuller))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
beluga_py-1.0.0.tar.gz
(4.9 kB
view details)
Built Distribution
File details
Details for the file beluga_py-1.0.0.tar.gz
.
File metadata
- Download URL: beluga_py-1.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce9f63c018f0e7085cf17022c04509aeaba95f2cfd7d3273640b881aafbe7431 |
|
MD5 | ebb152edebb3c11629a005d1fdcfe210 |
|
BLAKE2b-256 | 52151275d927cf4acbd7eaea31734f5f499c44fc791a09a6ab341317fa806ab5 |
File details
Details for the file beluga_py-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: beluga_py-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bd83ee837ffb7d5dedfadddb32df9a529ced0ecf3f94950a5af024f094389aa |
|
MD5 | c20d46378536598e8c9ab73b198a8941 |
|
BLAKE2b-256 | bfac6650a7b385f6021fb847932b2dfa5107a129b20d88b7750bbaa40350b5ab |