4.6.3. Product metadata

API for working with product metadata.

class axonius_api_client.api.system.meta.Meta(auth, **kwargs)[source]

Bases: axonius_api_client.api.mixins.ModelMixins

API for working with product metadata.

Examples

Parameters

auth (axonius_api_client.auth.models.Model) –

about()[source]

Get about page metadata.

Examples

Create a client using axonius_api_client.connect.Connect

>>> data = meta.about()
>>> j(data)
{
  "Build Date": "Fri Oct 2 00:18:27 UTC 2020",
  "Customer ID": "e1d48d82f50a4d2085658fea1a59b979",
  "api_client_version": "4.0",
  "Version": "3.10"
}
Return type

dict

historical_sizes()[source]

Get disk usage metadata.

Examples

Create a client using axonius_api_client.connect.Connect

>>> data = meta.historical_sizes()
>>> data['disk_free_mb']
70.93
>>> data['disk_used_mb']
122.87
>>> list(data)
['disk_free_mb', 'disk_used_mb', 'historical_sizes_devices', 'historical_sizes_users']
Return type

dict

property version

Get the version of Axonius.

Examples

Create a client using axonius_api_client.connect.Connect

>>> meta.version
'3.10'
Return type

str

_get_version(about)[source]

Ensure we have a Version key.

Parameters

about (dict) – raw about data from _about()

Return type

str

_about()[source]

Direct API method to get the About page.

Return type

dict

_historical_sizes()[source]

Direct API method to get the metadata about disk usage.

Return type

dict

property router

Router for this API model.

Return type

axonius_api_client.api.routers.Router

__init__(auth, **kwargs)

Mixins for API Models.

Parameters
__repr__()

Show info for this model object.

Return type

str

__str__()

Show info for this model object.

Return type

str

_build_err_msg(response, error=None, exc=None)

Build an error message from a response.

Parameters
Return type

str

_check_response_code(response, error_status=True)

Check the status code of a response.

Parameters
  • responserequests.Response object to check

  • error_status (bool) – throw exc if response status code is bad

Raises

ResponseNotOk – if response has a status code that is an error and error_status is True

_check_response_json(response, error_json_bad_status=True, error_json_invalid=True, uses_api_response=False)

Check the text body of a response is JSON.

Parameters
Raises
  • JsonInvalid – if error_json_invalid is True and response has invalid json

  • JsonError – if error_json_bad_status is True and response is a json dict that has a non-empty error key or a status key that == error

Return type

typing.Any

_init(**kwargs)

Post init method for subclasses to use for extra setup.

request(path, method='get', raw=False, is_json=True, empty_ok=False, error_status=True, error_json_bad_status=True, error_json_invalid=True, **kwargs)

Send a REST API request.

Parameters
  • path (str) – path to use in request

  • method (str) – method to use in request

  • raw (bool) – return the raw response object

  • is_json (bool) – return the response as deserialized json or just return the text body

  • error_status (bool) – throw error if response has a bad status code

  • error_json_bad_status (bool) – throw error if json response has non-empty error key

  • error_json_invalid (bool) – throw error if response can not be deserialized into json

  • **kwargs – Passed to axonius_api_client.http.Http.__call__()

  • empty_ok (bool) –

Return type

typing.Any

Returns

requests.Response or str or dict or int or list