FiremonAPIClient
An API Client for Firemon to be able to easily use the API in a more standard way.
How to install
$ pip install FiremonAPIClient
Usage
the argument "method" must be specify everytime. Look at authentication validation for an example.
Default arguments and attributes
import FiremonAPIClient
client = FiremonAPIClient.Client(verify=False, warnings=False, api_version='v1')
client.get(url=None, method='', data=None, auth = None)
# client.headers
# client.url_base
# client.token
Import and instantiate the class
import FiremonAPIClient
client = FiremonAPIClient.Client()
Connect, Validate authentication and Disconnect
import FiremonAPIClient
import json
client = FiremonAPIClient.Client()
client.connect(url='https://firemon-server.local', username='admin', password='Admin123')
response = client.post(method='/authentication/validate', data={'username': 'admin', 'password': 'Admin123'})
print(json.dumps(response.json(), indent=4), response.status_code, response.reason)
client.disconnect()
How to get an object
import FiremonAPIClient
import json
client = FiremonAPIClient.Client()
client.connect(url='https://firemon-server.local', username='admin', password='Admin123')
domain_id = 1
group_name = 'mytestgroup'
response = client.get(method=f'/domain/{domain_id}/usergroup/name/{group_name}')
print(json.dumps(response.json(), indent=4), response.status_code, response.reason)
client.disconnect()
How to create an object
import FiremonAPIClient
import json
client = FiremonAPIClient.Client()
client.connect(url='https://firemon-server.local', username='admin', password='Admin123')
domain_id = 1
group_name = 'mytestgroup'
response = client.post(method=f'/domain/{domain_id}/usergroup', domainId=domain_id, data={
"name": group_name, "description": "This group is a test and can be deleted"})
print(json.dumps(response.json(), indent=4), response.status_code, response.reason)
client.disconnect()
How to update an object
import FiremonAPIClient
client = FiremonAPIClient.Client()
client.connect(url='https://firemon-server.local', username='admin', password='Admin123')
domain_id = 1
group_id = 123
group_name = 'mytestgroup'
response = client.put(method=f'/domain/{domain_id}/usergroup/{group_id}', domainId=domain_id, id=group_id,
data={"id": group_id, "domainId": domain_id, "name": group_name,
"description": "This group is a test and it has been updated and can be deleted"})
print(response.status_code, response.reason)
client.disconnect()
How to delete an object
import FiremonAPIClient
client = FiremonAPIClient.Client()
client.connect(url='https://firemon-server.local', username='admin', password='Admin123')
domain_id = 1
group_id = 123
response = client.delete(method=f'/domain/{domain_id}/usergroup/{group_id}', domainId=domain_id, id=group_id)
print(response.status_code, response.reason)
client.disconnect()
Metadata
Release files for FiremonAPIClient 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 |
|---|---|---|---|---|
| FiremonAPIClient-0.0.1.tar.gz | 5.7 kB | Without provenance | Details for FiremonAPIClient-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| FiremonAPIClient-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for FiremonAPIClient-0.0.1-py3-none-any.whl |
Total release size: 10.8 kB
Release files / FiremonAPIClient-0.0.1.tar.gz
| Download URL | FiremonAPIClient-0.0.1.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59035111646343a8c4a8a3be5626ba2f7286cfd9e3d482199c7af68f827139c7
|
|
BLAKE2b-256 checksum How to use checksums |
2e990f33bb24d0065a409286728ba35f1aebb07fa1d9aa8da981c14e66c58e02
|
| 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 / FiremonAPIClient-0.0.1-py3-none-any.whl
| Download URL | FiremonAPIClient-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8543c7814ff1593c7850c202c24dd2c18f4d1698cd549c22ee0a9b44c9e9b551
|
|
BLAKE2b-256 checksum How to use checksums |
6a768f906f87273a07badf5a1f4f13279e1995e5c4af94ccfa4ed860548bbd4e
|
| 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 FiremonAPIClient 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.