report_configs¶
The following methods allow for interaction with the ZBI Report Configurations API endpoints.
Methods are accessible via zbi.report_configs
Copyright (c) 2023, Zscaler Inc.
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- class ReportConfigsAPI¶
Bases:
APIClientA Client object for the Business Insights Report Configurations resource.
Provides CRUD operations for managing report configurations associated with custom applications.
- create_report_config(report_type='customapps', **kwargs)¶
Creates a report configuration associated with custom apps.
- Parameters:
report_type (str) – The report type path segment. Currently only
customappsis supported.name (str) – Report name.
sub_type (str) – Report subtype. One of: OVERVIEW, USERS.
enabled (bool) – Whether the report is enabled.
delivery_information (list[dict]) – Delivery settings with
delivery_methodandemails.schedule_params (dict, optional) – Schedule settings with
timezone,frequency, and optionalweekday.backfill_params (dict, optional) – Backfill settings with
timezone,stime, andetime.
- Returns:
(ReportConfig instance, Response, error).
- Return type:
Examples
Create a scheduled report configuration:
>>> cfg, _, err = client.zbi.report_configs.create_report_config( ... name="Daily report", ... sub_type="USERS", ... enabled=True, ... custom_ids=[1234], ... delivery_information=[{ ... "delivery_method": "EMAIL", ... "emails": ["admin@example.com"] ... }], ... schedule_params={ ... "timezone": "UTC", ... "frequency": "DAILY" ... } ... )
- delete_report_config(config_id, report_type='customapps')¶
Deletes a report configuration by ID.
- Parameters:
- Returns:
(status_code, Response, error).
- Return type:
Examples
Delete a report configuration:
>>> _, _, err = client.zbi.report_configs.delete_report_config(1) >>> if err: ... print(f"Error: {err}")
- get_report_config(config_id, report_type='customapps')¶
Retrieves a specific report configuration by ID.
- Parameters:
- Returns:
(ReportConfig instance, Response, error).
- Return type:
Examples
Get a report configuration by ID:
>>> cfg, _, err = client.zbi.report_configs.get_report_config(1) >>> if err: ... print(f"Error: {err}") >>> print(cfg.as_dict())
- list_report_configs(report_type='customapps', query_params=None)¶
Retrieves report configurations along with their associated custom apps.
- Parameters:
- Returns:
(list of ReportConfig instances, Response, error).
- Return type:
Examples
List all report configurations:
>>> configs, _, err = client.zbi.report_configs.list_report_configs() >>> if err: ... print(f"Error: {err}") >>> for cfg in configs: ... print(cfg.as_dict())
- update_report_config(config_id, report_type='customapps', **kwargs)¶
Updates a report configuration by ID.
- Parameters:
config_id (int) – The unique identifier of the report configuration to update.
report_type (str) – The report type path segment. Currently only
customappsis supported.name (str) – Updated report name.
sub_type (str) – Updated subtype.
enabled (bool) – Whether the report is enabled.
delivery_information (list[dict]) – Updated delivery settings.
schedule_params (dict, optional) – Updated schedule.
- Returns:
(ReportConfig instance, Response, error).
- Return type:
Examples
Update a report configuration:
>>> cfg, _, err = client.zbi.report_configs.update_report_config( ... 1, ... name="Weekly report", ... sub_type="USERS", ... enabled=True, ... custom_ids=[1234], ... delivery_information=[{ ... "delivery_method": "EMAIL", ... "emails": ["admin@example.com"] ... }], ... schedule_params={ ... "timezone": "UTC", ... "frequency": "WEEKLY", ... "weekday": "MON" ... } ... )