You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a panel to the dashboard. A panel can be a time series, or a top chart (i.e. bar chart), or a number panel.
60
-
61
-
**Arguments**
62
-
-**dashboard**: dashboard to edit
63
-
-**name**: name of the new panel
64
-
-**panel_type**: type of the new panel. Valid values are: `timeSeries`, `top`, `number`
65
-
-**metrics**: a list of dictionaries, specifying the metrics to show in the panel, and optionally, if there is only one metric, a grouping key to segment that metric by. A metric is any of the entries that can be found in the _Metrics_ section of the Explore page in Sysdig Cloud. Metric entries require an _aggregations_ section specifying how to aggregate the metric across time and groups of containers/hosts. A grouping key is any of the entries that can be found in the _Show_ or _Segment By_ sections of the Explore page in Sysdig Cloud. Refer to the examples section below for ready to use code snippets. Note, certain panels allow certain combinations of metrics and grouping keys:
66
-
-`timeSeries`: 1 or more metrics OR 1 metric + 1 grouping key
67
-
-`top`: 1 or more metrics OR 1 metric + 1 grouping key
68
-
-`number`: 1 metric only
69
-
-**scope**: filter to apply to the panel; must be based on metadata available in Sysdig Cloud; Example: _kubernetes.namespace.name='production' and container.image='nginx'_.
70
-
-**sort_by**: Data sorting; The parameter is optional and it's a dictionary of `metric` and `mode` (it can be `desc` or `asc`)
71
-
-**limit**: This parameter sets the limit on the number of lines/bars shown in a `timeSeries` or `top` panel. In the case of more entities being available than the limit, the top entities according to the sort will be shown. The default value is 10 for `top` panels (for `timeSeries` the default is defined by Sysdig Cloud itself). Note that increasing the limit above 10 is not officially supported and may cause performance and rendering issues
72
-
-**layout**: Size and position of the panel. The dashboard layout is defined by a grid of 12 columns, each row height is equal to the column height. For example, say you want to show 2 panels at the top: one panel might be 6 x 3 (half the width, 3 rows height) located in row 1 and column 1 (top-left corner of the viewport), the second panel might be 6 x 3 located in row 1 and position 7. The location is specified by a dictionary of `row` (row position), `col` (column position), `size_x` (width), `size_y` (height).
73
-
74
-
**Success Return Value**
75
-
A dictionary showing the details of the edited dashboard.
76
-
77
-
**Example**
78
-
[examples/dashboard.py](examples/dashboard.py).
79
-
80
-
#### `add_email_notification_recipient`
81
-
**`(self, email)`**
82
-
83
-
**Description**
84
-
Add a new recipient for email alert notifications.
85
-
**Arguments**
86
-
-**email**: the email target to add.
87
-
88
-
**Success Return Value**
89
-
A dictionary showing the updated user notifications configuration.
-**name**: the alert name. This will appear in the Sysdig Cloud UI and in notification emails.
100
-
-**description**: the alert description. This will appear in the Sysdig Cloud UI and in notification emails.
101
-
-**severity**: syslog-encoded alert severity. This is a number from 0 to 7 where 0 means 'emergency' and 7 is 'debug'.
102
-
-**for_atleast_s**: the number of consecutive seconds the condition must be satisfied for the alert to fire.
103
-
-**condition**: the alert condition, as described here https://app.sysdigcloud.com/apidocs/#!/Alerts/post_api_alerts
104
-
-**segmentby**: a list of Sysdig Cloud segmentation criteria that can be used to apply the alert to multiple entities. For example, segmenting a CPU alert by ['host.mac', 'proc.name'] allows to apply it to any process in any machine.
105
-
-**segment_condition**: When _segmentby_ is specified (and therefore the alert will cover multiple entities) this field is used to determine when it will fire. In particular, you have two options for _segment_condition_: **ANY** (the alert will fire when at least one of the monitored entities satisfies the condition) and **ALL** (the alert will fire when all of the monitored entities satisfy the condition).
106
-
-**user_filter**: a boolean expression combining Sysdig Cloud segmentation criteria that makes it possible to reduce the scope of the alert. For example: _kubernetes.namespace.name='production' and container.image='nginx'_.
107
-
-**notify**: the type of notification you want this alert to generate. Options are _EMAIL_, _SNS_, _PAGER_DUTY_, _SYSDIG_DUMP_.
108
-
-**enabled**: if True, the alert will be enabled when created.
109
-
-**annotations**: an optional dictionary of custom properties that you can associate to this alert for automation or management resons
110
-
111
-
**Success Return Value**
112
-
A dictionary describing the just created alert, with the format described at [this link](https://app.sysdigcloud.com/apidocs/#!/Alerts/post_api_alerts).
Creates an empty dashboard. You can then add panels by using `add_dashboard_panel`.
121
-
122
-
**Arguments**
123
-
-**name**: the name of the dashboard that will be created.
124
-
125
-
**Success Return Value**
126
-
A dictionary showing the details of the new dashboard.
127
-
128
-
**Example**
129
-
[examples/dashboard.py](examples/dashboard.py).
130
-
131
-
#### `create_dashboard_from_dashboard`
132
-
**`(self, newdashname, templatename, filter)`**
133
-
134
-
**Description**
135
-
Create a new dasboard using one of the existing dashboards as a template. You will be able to define the scope of the new dasboard.
136
-
**Arguments**
137
-
-**newdashname**: the name of the dashboard that will be created.
138
-
-**viewname**: the name of the dasboard to use as the template, as it appears in the Sysdig Cloud dashboard page.
139
-
-**filter**: a boolean expression combining Sysdig Cloud segmentation criteria defines what the new dasboard will be applied to. For example: _kubernetes.namespace.name='production' and container.image='nginx'_.
140
-
141
-
**Success Return Value**
142
-
A dictionary showing the details of the new dashboard.
Create a new dasboard using one of the Sysdig Cloud views as a template. You will be able to define the scope of the new dasboard.
151
-
**Arguments**
152
-
-**newdashname**: the name of the dashboard that will be created.
153
-
-**viewname**: the name of the view to use as the template for the new dashboard. Thia corresponds to the name that the view has in the explore page.
154
-
-**filter**: a boolean expression combining Sysdig Cloud segmentation criteria defines what the new dasboard will be applied to. For example: _kubernetes.namespace.name='production' and container.image='nginx'_.
155
-
156
-
**Success Return Value**
157
-
A dictionary showing the details of the new dashboard.
This is the method you use to export metric data. It's flexible enough to offer both time-series and table-based data export.
240
-
**Arguments**
241
-
-**metrics**: a list of dictionaries, specifying the metrics and grouping keys that the query will return. A metric is any of the entries that can be found in the _Metrics_ section of the Explore page in sysdig cloud. Metric entries require an _aggregations_ section specifying how to aggregate the metric across time and containers/host. A grouping key is any of the entries that can be found in the _Show_ or _Segment By_ sections of the Explore page in sysdig cloud. These entries are used to apply single or hierarchical segmentation to the returned data and don't require the aggregations section. Refer to the examples section below for ready to use code snippets.
242
-
-**start_ts**: the UTC time (in seconds) of the beginning of the data window. A negative value can be optionally used to indicate a relative time in the past from now. For example, -3600 means "one hour ago".
243
-
-**end_ts**: the UTC time (in seconds) of the end of the data window, or 0 to indicate "now". A negative value can also be optionally used to indicate a relative time in the past from now. For example, -3600 means "one hour ago".
244
-
-**sampling_s**: the duration of the samples that will be returned. 0 Means that the whole data will be returned as a single sample.
245
-
-**filter**: a boolean expression combining Sysdig Cloud segmentation criteria defines what the query will be applied to. For example: _kubernetes.namespace.name='production' and container.image='nginx'_.
246
-
-**datasource_type**: specify the metric source for the request, can be `container` or `host`. Most metrics, for example `cpu.used.percent` or `memory.bytes.used`, are reported by both hosts and containers. By default, host metrics are used, but if the request contains a container-specific grouping key in the metric list/filter (e.g. `container.name`), then the container source is used. In cases where grouping keys are missing or apply to both hosts and containers (e.g. `tag.Name`), datasource_type can be explicitly set to avoid any ambiguity and allow the user to select precisely what kind of data should be used for the request. [examples/get_data_datasource.py](examples/get_data_datasource.py) contains a few examples that should clarify the use of this argument.
247
-
248
-
**Success Return Value**
249
-
A dictionary with the requested data. Data is organized in a list of time samples, each of which includes a UTC timestamp and a list of values, whose content and order reflect what was specified in the _metrics_ argument.
Return the list of dashboards available under the given user account. This includes the dashboards created by the user and the ones shared with her by other users.
258
-
**Success Return Value**
259
-
A dictionary containing the list of available sampling intervals.
Return the list of data retention intervals, with beginning and end UTC time for each of them. Sysdig Cloud performs rollups of the data it stores. This means that data is stored at different time granularities depending on how far in time it is. This call can be used to know what precision you can expect before you make a call to `get_data()`.
268
-
**Success Return Value**
269
-
A dictionary containing the list of available sampling intervals.
Finds dashboards with the specified name. You can then delete the dashboard (with `delete_dashboard`) or edit panels (with `add_dashboard_panel` and `remove_dashboard_panel`)
358
-
359
-
**Arguments**
360
-
-**name**: the name of the dashboards to find.
361
-
362
-
**Success Return Value**
363
-
A list of dictionaries of dashboards matching the specified name.
364
-
365
-
**Example**
366
-
[examples/dashboard.py](examples/dashboard.py).
367
-
368
-
#### `poll_sysdig_capture`
369
-
**`(self, capture)`**
370
-
371
-
**Description**
372
-
Fetch the updated state of a sysdig capture. Can be used to poll the status of a capture that has been previously created and started with `create_sysdig_capture`.
373
-
**Arguments**
374
-
-**capture**: the capture object as returned by `get_sysdig_captures()` or `create_sysdig_capture()`.
375
-
376
-
**Success Return Value**
377
-
A dictionary showing the updated details of the capture. Use the `status` field to check the progress of a capture.
You can use this method you use to send an event to Sysdig Cloud. The events you post are available in the Events tab in the Sysdig Cloud UI and can be overlied to charts.
386
-
**Arguments**
387
-
-**name**: the name of the new event.
388
-
-**description**: a longer description offering detailed information about the event.
389
-
-**severity**: syslog style from 0 (high) to 7 (low).
390
-
-**event_filter**: metadata, in Sysdig Cloud format, of nodes to associate with the event, e.g. `host.hostName = 'ip-10-1-1-1' and container.name = 'foo'`.
391
-
-**tags**: a list of key-value dictionaries that can be used to tag the event. Can be used for filtering/segmenting purposes in Sysdig Cloud.
Please Refer to the [Python Script Library documentation page](https://sysdig.gitbooks.io/sysdig-cloud-api/content/python_script_library.html) for a more complete documentation of the library.
0 commit comments