BlueCatAPIClient
Proteus_API_Guide_3.7.1
Making APIs Work for You
BlueCat Gateway
An API Client for BlueCat to be able to easily use the API in a more standard way.
How to install
$ pip install BlueCatAPIClient
Usage
The argument "method" must be specify every time.
Default arguments and attributes
import BlueCatAPIClient
client = BlueCatAPIClient.Client(verify=False, warnings=False, api_version='v1')
client.get(url=None, method='', data=None, auth = None)
# client.headers
# client.url_base
# client.token
# client.session
Getting entities
import BlueCatAPIClient
import json
client = BlueCatAPIClient.Client()
client.connect(url='https://BlueCat-server.local', username='admin', password='Admin123')
response = client.get(method='searchByCategory', keyword='MyIPV4Block', category='all', count=1)
print(json.dumps(response.json(), indent=4))
client.disconnect()
Paging
import BlueCatAPIClient
import json
client = BlueCatAPIClient.Client()
client.connect(url='https://BlueCat-server.local', username='admin', password='Admin123')
response = client.get(method='searchByCategory', keyword='MyIPV4Block', category='all', start=0, count=1)
print(json.dumps(response.json(), indent=4))
client.disconnect()
Filtering entities
import BlueCatAPIClient
import json
client = BlueCatAPIClient.Client()
client.connect(url='https://BlueCat-server.local', username='admin', password='Admin123')
response = client.get(method='getEntityById', id='12345')
print(json.dumps(response.json(), indent=4))
client.disconnect()
How to work with properties
import BlueCatAPIClient
import json
client = BlueCatAPIClient.Client()
client.connect(url='https://BlueCat-server.local', username='admin', password='Admin123')
response = client.get(method='searchByCategory', keyword='MyIPV4Block', category='all', start=0, count=1)
if response.status_code == 200:
properties = client.properties_to_json(response.json()[0].get('properties', ''))
print(properties)
print(client.json_to_properties(properties))
client.disconnect()
Creating entities
import BlueCatAPIClient
import json
client = BlueCatAPIClient.Client()
client.connect(url='https://BlueCat-server.local', username='admin', password='Admin123')
response = client.post(method='addIP4BlockByCIDR', parentId='12345', CIDR='10.0.0.1/24', properties='name=MyIPV4Block')
print(json.dumps(response.json(), indent=4))
client.disconnect()
Updating entities
import BlueCatAPIClient
import json
client = BlueCatAPIClient.Client()
client.connect(url='https://BlueCat-server.local', username='admin', password='Admin123')
response = client.get(method='searchByCategory', keyword='MyIPV4Block', category='all', start=0, count=1)
update_entity = response.json()[0]
update_entity['name'] = 'MyIPV4Block_TEST'
response = client.put(update_entity)
print(json.dumps(response.json(), indent=4))
client.disconnect()
Deleting entities
import BlueCatAPIClient
import json
client = BlueCatAPIClient.Client()
client.connect(url='https://BlueCat-server.local', username='admin', password='Admin123')
response = client.delete(ObjectId=12345)
print(json.dumps(response.json(), indent=4))
client.disconnect()
Metadata
Release files for BlueCatAPIClient 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| BlueCatAPIClient-0.0.1.tar.gz | 5.7 kB | Without provenance | Details for BlueCatAPIClient-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| BlueCatAPIClient-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for BlueCatAPIClient-0.0.1-py3-none-any.whl |
Total release size: 11.4 kB
Release files / BlueCatAPIClient-0.0.1.tar.gz
| Download URL | BlueCatAPIClient-0.0.1.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ebe0844b2c4c8a517894e0ece29ca195bf544c3432c11f15a27c63a918e8775e
|
|
BLAKE2b-256 checksum How to use checksums |
ef601df3b81595e0d65953bf62685f225f21f0d90a1b2d9afd7b166348e740c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Release files / BlueCatAPIClient-0.0.1-py3-none-any.whl
| Download URL | BlueCatAPIClient-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b1f396b941c36bd0c9624eefd70e20e8f550c767dee9f34b9a84d7ad1ca05f5
|
|
BLAKE2b-256 checksum How to use checksums |
5f7cb1e0e26e6141e37ba7ca1b6da062ea9c200b960ff75999fba195ab35dba1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Security for BlueCatAPIClient 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.