Skip to main content

Armorblox SDK for Python

Project description

Armorblox logo

Armorblox Python SDK (Alpha)

PyPI version Apache-2 License

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 details)

Uploaded Source

Built Distribution

armorblox_sdk-0.1.4-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file armorblox-sdk-0.1.4.tar.gz.

File metadata

  • Download URL: armorblox-sdk-0.1.4.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.5 Darwin/22.3.0

File hashes

Hashes for armorblox-sdk-0.1.4.tar.gz
Algorithm Hash digest
SHA256 dba441ff2e18841f2c229db88c81d3f5510ccec86daa2c824812e4bd2bd0ded2
MD5 cfb39d4041d7029583521dfe51c5cb73
BLAKE2b-256 72afbc80e3f846b54303927d41b59559ebe8a7989854d91d72938b62a2f7fab9

See more details on using hashes here.

File details

Details for the file armorblox_sdk-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: armorblox_sdk-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.5 Darwin/22.3.0

File hashes

Hashes for armorblox_sdk-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ca8f9d72cb0adc7d106ae5e21281c289a90c3c36ed42f69d9ae85f56365cb86a
MD5 f933e7847bee46f063da3b7d3638187d
BLAKE2b-256 7438c7cbafc8211a0a5f0cf0e1cb5f161212f81ae5eab527ac4261fdbd4be5be

See more details on using hashes here.

Supported by

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