FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sysdig-sdk-python/examples/dashboard_basic_crud.py at master · sysdiglabs/sysdig-sdk-python · GitHub
This repository was archived by the owner on May 7, 2026. It is now read-only.
sysdiglabs
/
sysdig-sdk-python
Public archive
Notifications
You must be signed in to change notification settings
Fork
42
Star
69
Code
Issues
12
Pull requests
17
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
sysdig-sdk-python
/
examples
/
dashboard_basic_crud.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
78 lines (63 loc) · 1.23 KB
Breadcrumbs
sysdig-sdk-python
/
examples
/
dashboard_basic_crud.py
Copy path
File metadata and controls
executable file
·
78 lines (63 loc) · 1.23 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env python
#
# Simple example of dashboard creation, retrieval, updating, and deletion.
#
import
sys
import
uuid
from
sdcclient
import
SdMonitorClient
#
# Parse arguments
#
if
len
(
sys
.
argv
)
!=
2
:
print
((
'usage: %s <sysdig-token>'
%
sys
.
argv
[
0
]))
print
(
'You can find your token at https://app.sysdigcloud.com/#/settings/user'
)
sys
.
exit
(
1
)
sdc_token
=
sys
.
argv
[
1
]
#
# Instantiate the SDC client
#
sdclient
=
SdMonitorClient
(
sdc_token
)
#
# Create Dashboard.
#
ok
,
res
=
sdclient
.
create_dashboard
(
"Sample dashboard - "
+
uuid
.
uuid4
().
hex
)
#
# Check for successful creation
#
if
not
ok
:
print
(
res
)
sys
.
exit
(
1
)
dashboard
=
res
[
'dashboard'
]
#
# Get Dashboard.
#
ok
,
res
=
sdclient
.
get_dashboard
(
dashboard
[
'id'
])
#
# Check for successful retrieval
#
if
not
ok
:
print
(
res
)
sys
.
exit
(
1
)
dashboard
=
res
[
'dashboard'
]
#
# Update Dashboard.
#
dashboard
[
'name'
]
=
"Let's change the dashboard name. "
+
uuid
.
uuid4
().
hex
ok
,
res
=
sdclient
.
update_dashboard
(
dashboard
)
#
# Check for successful update
#
if
not
ok
:
print
(
res
)
sys
.
exit
(
1
)
dashboard
=
res
[
'dashboard'
]
#
# Delete Dashboard.
#
ok
,
res
=
sdclient
.
delete_dashboard
(
dashboard
)
#
# Check for successful delete
#
if
not
ok
:
print
(
res
)
sys
.
exit
(
1
)
Back
|
FazBrowse Home
|
New Git URL