4.6.4. System Settings -> Global Settings

API for working with System Settings -> Global Settings.

class axonius_api_client.api.system.settings_global.SettingsGlobal(auth, **kwargs)[source]

Bases: axonius_api_client.api.system.settings_mixins.SettingsMixins

API for working with System Settings -> Global Settings.

Parameters

auth (axonius_api_client.auth.models.Model) –

TITLE: str = 'Global Settings'
PATH: str = 'settings_global'
__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

_get()

Direct API method to get the current system settings.

Return type

dict

_init(**kwargs)

Post init method for subclasses to use for extra setup.

_update(new_config)

Direct API method to update the system settings.

Parameters

new_config (dict) – new system settings to update

Return type

dict

get()

Get the current system settings.

Return type

dict

get_section(section, full_config=False)

Get the current settings for a section of system settings.

Parameters
  • section (str) – name of section

  • full_config (bool) – return the full configuration

Return type

dict

get_sub_section(section, sub_section, full_config=False)

Get the current settings for a sub-section of a section of system settings.

Parameters
  • section (str) – name of section

  • sub_section (str) – name of sub section of section

  • full_config (bool) – return the full configuration

Return type

dict

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

property router

Router for this API model.

Return type

axonius_api_client.api.routers.Router

property router_path

Get the path from the router for this setting object.

Return type

str

update_section(section, **kwargs)

Update the current settings for a section of system settings.

Parameters
  • section (str) – name of section

  • **kwargs – settings to update

Return type

dict

update_sub_section(section, sub_section, **kwargs)

Update the current settings for a sub-section of a section of system settings.

Parameters
  • section (str) – name of section

  • sub_section (str) – name of sub section of section

  • **kwargs – settings to update

Return type

dict