Armorblox SDK for Python
Project description
Armorblox Python SDK (Alpha)
This is an alpha version of the SDK with limited documentation and no support.
Requirements
Python 3.5+
Installation
pip install armorblox-sdk
Usage
from armorblox import client
# Create an API client for your tenant
c = client.Client(api_key='your-api-key-here', instance_name='yourtenantname')
# Fetch information about an incident's analysis data
incident_analysis = c.incidents.analysis(78143)
# Fetch information about an incident's sender data
incident_senders = c.incidents.senders(78143)
# Fetch information about an object associated with an incident (usually mail).
# Get the object ID from Get Incident by Id's response, under .events[].object_id
incident_object = c.incidents.mail('d72c07bc789c30cb4d63d78ee2861f94add695f9c812e30cfb081b20d3e7e5e7')
# Updates the action to be taken for an incident's objects
update_details = c.incidents.update(78143, body = {
"policyActionType": "DELETE",
"addSenderToException": False,
"actionProfileId": ""
})
# Fetch a list of threats
threat_incidents, next_page_token, total_incident_count = c.threats.list()
# Fetch a specific threat
incident = c.threats.get(44006)
# Fetch a list of abuse incidents
abuse_incidents, next_page_token, total_incident_count = c.abuse_incidents.list()
# Fetch a specific abuse incident
abuse_incident = c.abuse_incidents.get(44200)
# Fetch a list of DLP incidents
dlp_incidents, next_page_token, total_incident_count = c.dlp_incidents.list()
# Fetch a specific DLP incident
dlp_incident = c.dlp_incidents.get(44010)
# Fetch a list of EAC incidents
eac_incidents, next_page_token, total_incident_count = c.eac_incidents.list()
# Fetch a specific EAC incident
eac_incident = c.eac_incidents.get(67)
# Fetch a list of Graymail incidents
graymail_incidents, next_page_token, total_incident_count = c.graymail_incidents.list()
# Fetch a specific EAC incident
graymail_incident = c.graymail_incidents.get(2627)
# Example to fetch all threats using next_page_token
next_page_token = None
incidents = []
while True:
threats, next_page_token, total_incident_count = c.threats.list(page_token=next_page_token)
incidents.extend(threats)
if not next_page_token:
break
Contributing
- Install Poetry
- Clone the SDK repo &
cd
into it
git clone https://github.com/armorblox/armorblox-python-sdk
cd armorblox-python-sdk
- Run
poetry install
to install the dependencies - Run
tox
to run the tests
Publishing
TestPyPI
One-time setup
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi <your-TestPyPI-token>
Publishing
poetry publish --build -r test-pypi
Use
pip install --index-url https://test.pypi.org/simple/ --no-deps armorblox-sdk
to make sure the installation works correctly.
PyPI
One-time setup
poetry config pypi-token.pypi <your-PyPI-token>
Publishing
poetry publish --build
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
armorblox-sdk-0.1.4.tar.gz
(9.9 kB
view hashes)
Built Distribution
Close
Hashes for armorblox_sdk-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca8f9d72cb0adc7d106ae5e21281c289a90c3c36ed42f69d9ae85f56365cb86a |
|
MD5 | f933e7847bee46f063da3b7d3638187d |
|
BLAKE2b-256 | 7438c7cbafc8211a0a5f0cf0e1cb5f161212f81ae5eab527ac4261fdbd4be5be |