Skip to content

Commit a746cd4

Browse files
author
Davide Schiera
committed
Improved parameters documentation.
1 parent d6c452b commit a746cd4

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

examples/create_dashboard.py

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,21 @@
2727
sdclient = SdcClient(sdc_token)
2828

2929
#
30-
# Create the new dashboard, apllying to cassandra in production
30+
# Create the new dashboard, applying to cassandra in production
3131
#
32-
res = sdclient.create_dashboard_from_view("API test - cassandra in prod", # The name we're giving to the new dashboard.
33-
"Overview by Process", # The view we're copying.
34-
"kubernetes.namespace.name=prod and proc.name = cassandra") # the filter specifying what this dasboard appies to.
35-
# Remember that here you can use combinations of any
36-
# segmentation criteria that you find in the Sysdig
37-
# Cloud explore page.
32+
33+
# Name for the dashboard to create
34+
dashboardName = "API test - cassandra in prod"
35+
# Name of the view to copy
36+
viewName = "Overview by Process"
37+
# Filter to apply to the new dashboard.
38+
# Remember that you can use combinations of any segmentation criteria you find
39+
# in Sysdig Cloud Explore page.
40+
# You can also refer to AWS tags by using "cloudProvider.tag.*" metadata or
41+
# agent tags by using "agent.tag.*" metadata
42+
dashboardFilter = "kubernetes.namespace.name = prod and proc.name = cassandra"
43+
44+
res = sdclient.create_dashboard_from_view(dashboardName, viewName, dashboardFilter)
3845
#
3946
# Check the result
4047
#
@@ -45,11 +52,18 @@
4552
sys.exit(1)
4653

4754
#
48-
# Make a Copy the just created dasboard, this time applying it to cassandra in the dev namespace
55+
# Make a Copy the just created dasboard, this time applying it to cassandra in
56+
# the dev namespace
4957
#
50-
res = sdclient.create_dashboard_from_dashboard("API test - cassandra in dev", # The name we're giving to the new dashboard.
51-
"API test - cassandra in prod", # The view we're copying.
52-
"kubernetes.namespace.name=dev and proc.name = cassandra") # the filter specifying what this dasboard appies to.
58+
59+
# Name for the dashboard to create
60+
dashboardName = "API test - cassandra in dev"
61+
# Name of the dashboard to copy
62+
dashboardToCopy = "API test - cassandra in prod"
63+
# Filter to apply to the new dashboard. Same as above.
64+
dashboardFilter = "kubernetes.namespace.name = dev and proc.name = cassandra"
65+
66+
res = sdclient.create_dashboard_from_dashboard(dashboardName, dashboardToCopy, dashboardFilter)
5367

5468
#
5569
# Check the result

0 commit comments

Comments
 (0)