bloxone.b1 Class

class bloxone.b1(cfg_file='config.ini')[source]

Parent Class to simplify access to the BloxOne APIs for subclasses Can also be used to genericallly access the API

Raises
create(url, body='')[source]

Generic create object wrapper

Parameters
  • url (str) – Full URL

  • body (str) – JSON formatted data payload

Returns

Requests response object

Return type

response object

delete(url, id='')[source]

Generic delete object wrapper

Parameters
  • url (str) – Full URL

  • id (str) – Object id to delete

Returns

Requests response object

Return type

response object

get(url, id='', action='', **params)[source]

Generic get object wrapper

Parameters
  • url (str) – Full URL

  • id (str) – Optional Object ID

  • action (str) – Optional object action, e.g. “nextavailableip”

Returns

Requests response object

Return type

response object

replace(url, id='', body='')[source]

Generic create object wrapper

Parameters
  • url (str) – Full URL

  • body (str) – JSON formatted data payload

Returns

Requests response object

Return type

response object

update(url, id='', body='')[source]

Generic create object wrapper

Parameters
  • url (str) – Full URL

  • body (str) – JSON formatted data payload

Returns

Requests response object

Return type

response object

class bloxone.IniFileSectionError[source]

Exception for missing section in ini file

class bloxone.IniFileKeyError[source]

Exception for missing key in ini file

class bloxone.APIKeyFormatError[source]

Exception for API key format mismatch

class bloxone.b1platform(cfg_file='config.ini')[source]

Class now reused for BloxOne Platform Methods, e.g. Audit Log Management of BloxOne On Prem Hosts is via the b1oph Class b1oph class is inherited here for compatibility

audit_users(domains=[])[source]

Audit User Data for non compliant email domains

Parameters

domain (list) – List of valid email domains

Returns

List of User Data (json)

auditlog(**params)[source]

Get the audit log

Parameters

**params (dict) – Generic API parameters

Returns

audit_log (list); list of dict

get_current_tenant(**params)[source]

Get name of current tenant

Parameters

**params (dict) – Generic API parameters

Returns

string containing name of tenant or ‘’ on failure

get_current_user(**params)[source]

Get Current User Data

Parameters

**params (dict) – Generic API parameters

Returns

Requests response object

Return type

response object

get_current_user_accounts(**params)[source]

Get Current Users Accounts Data

Parameters

**params (dict) – Generic API parameters

Returns

Requests response object

Return type

response object

get_full_auditlog(**params)[source]
get_users(**params)[source]

Get User Data

Parameters

**params (dict) – Generic API parameters

Returns

Requests response object

Return type

response object