Skip to content

Commit 46fa282

Browse files
Adityashankar KiniAdityashankar Kini
authored andcommitted
Set default explore group configuration for a user
1 parent a087dd2 commit 46fa282

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env python
2+
#
3+
# Set the group configuration in explore.
4+
#
5+
6+
import os
7+
import sys
8+
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))
9+
from sdcclient import SdcClient
10+
11+
#
12+
# Parse arguments
13+
#
14+
if len(sys.argv) != 2:
15+
print 'usage: %s <sysdig-token>' % sys.argv[0]
16+
print 'You can find your token at https://app.sysdigcloud.com/#/settings/user'
17+
sys.exit(1)
18+
19+
sdc_token = sys.argv[1]
20+
21+
#
22+
# Instantiate the SDC client
23+
#
24+
sdclient = SdcClient(sdc_token)
25+
26+
#
27+
# Fire the request, set the group configuration you need in the example below
28+
#
29+
groupConfig = ['agent.tag.role', 'host.mac']
30+
res = sdclient.set_explore_grouping_hierarchy(groupConfig)
31+
32+
#
33+
# Show the error if there was one
34+
#
35+
if res[0] == False:
36+
print res[1]
37+
38+

0 commit comments

Comments
 (0)