|
27 | 27 | sdclient = SdcClient(sdc_token) |
28 | 28 |
|
29 | 29 | # |
30 | | -# Create the new dashboard, apllying to cassandra in production |
| 30 | +# Create the new dashboard, applying to cassandra in production |
31 | 31 | # |
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) |
38 | 45 | # |
39 | 46 | # Check the result |
40 | 47 | # |
|
45 | 52 | sys.exit(1) |
46 | 53 |
|
47 | 54 | # |
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 |
49 | 57 | # |
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) |
53 | 67 |
|
54 | 68 | # |
55 | 69 | # Check the result |
|
0 commit comments