Widget¶
Methods described in this section relate to the widget API.
These methods can be accessed at TenableIE.widgets
.
- class WidgetsAPI(api: APISession)[source]¶
- create(dashboard_id: int, pos_x: int, pos_y: int, width: int, height: int, title: str) → List[Dict][source]¶
Creates a new widget.
- Parameters:
- Returns:
The created widget object.
- Return type:
Examples
>>> tie.widgets.create( ... dashboard_id=1, ... pos_x=1, ... pos_y=1, ... width=2, ... height=2, ... title='ExampleWidget', ... )
- define_widget_options(dashboard_id: int, widget_id: int, chart_type: str, series: List[Dict]) → None[source]¶
Defines the widget option.
- Parameters:
dashboard_id (int) – The dashboard instance identifier.
widget_id (int) – The dashboard instance identifier.
chart_type (str) –
- The type of chart for widget. possible options
are
BigNumber
,LineChart
,BarChart
,SecurityCompliance
andStepChart
.
series (list) – Additional keywords passed will be added to the series list of dicts within the API call.
- Return type:
None
Examples
>>> tie.widgets.define_widget_options( ... dashboard_id=1, ... widget_id=1, ... chart_type='BigNumber' ... series=[ ... { ... 'dataOptions': { ... 'type': 'User', ... 'duration': 1, ... 'directoryIds': [1, 2, 3], ... 'active': True ... }, ... 'displayOptions': { ... 'label': 'label' ... } ... } ... ] ... )
- delete(dashboard_id: int, widget_id: int) → None[source]¶
Deletes an existing widget.
- Parameters:
- Return type:
None
Examples
>>> tie.widgets.delete( ... dashboard_id=1, ... widget_id=1 ... )
- details(dashboard_id: int, widget_id: int) → Dict[source]¶
Retrieves the details for a specific widget.
- Parameters:
- Returns:
The widget object.
- Return type:
Examples
>>> tie.widget.details(dashboard_id=1, widget_id=1)
- list(dashboard_id: int) → List[Dict][source]¶
Retrieves all the widgets.
- Parameters:
dashboard_id (int) – The dashboard instance identifier.
- Returns:
The list of widget objects.
- Return type:
Examples
>>> tie.widgets.list(dashboard_id=13)
- update(dashboard_id: int, widget_id: int, **kwargs) → Dict[source]¶
Updates an existing widget.
- Parameters:
dashboard_id (int) – The dashboard instance identifier.
widget_id (int) – The dashboard instance identifier.
pos_x (optional, int) – x-axis position for widget.
pos_y (optional, int) – y-axis position for widget.
width (optional, int) – width of widget.
height (optional, int) – height of widget.
title (optional, str) – title for widget.
- Returns:
The updated widget object.
- Return type:
Examples
>>> tie.widgets.update( ... dashboard_id=1, ... widget_id=1, ... pos_x=1, ... pos_y=1, ... width=3, ... height=3, ... title='EditedWidget' ... )