Skip to content

Commit 816699a

Browse files
committed
Merge branch 'master' into teams-api
# Conflicts: # sdcclient/_client.py
2 parents 29bcc7e + cd3bb18 commit 816699a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

examples/get_data_simple.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
# You just need to specify the ID for keys, and ID with aggregation for values.
3030
#
3131
metrics = [
32-
# { "id": "agent.tag.team" },
33-
# { "id": "kubernetes.pod.label.name" },
32+
# { "id": "container.id" },
3433
# { "id": "agent.tag.env", "aggregations": { "time": "concat", "group": "concat" } },
3534
{ "id": "cpu.used.percent", "aggregations": { "time": "timeAvg", "group": "avg" } }
3635
]
@@ -55,10 +54,15 @@
5554
#
5655
sampling = 60
5756

57+
#
58+
# Paging (from and to included; by default you get from=0 to=9)
59+
#
60+
paging = { "from": 0, "to": 9 }
61+
5862
#
5963
# Load data
6064
#
61-
res = sdclient.get_data(metrics, start, end, sampling, filter = filter)
65+
res = sdclient.get_data(metrics, start, end, sampling, filter = filter, paging = paging)
6266

6367
#
6468
# Show the result

sdcclient/_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ def add_dashboard_panel(self, dashboard, name, panel_type, metrics, scope=None,
663663
v_count = 0
664664
for i, metric in enumerate(metrics):
665665
property_name = 'v' if 'aggregations' in metric else 'k'
666+
666667
if property_name == 'k':
667668
i = k_count
668669
k_count += 1
@@ -1596,8 +1597,8 @@ def get_agents_config(self):
15961597

15971598
def set_agents_config(self, config):
15981599
res = requests.put(self.url + '/api/agents/config', headers=self.hdrs, data=json.dumps(config))
1599-
if not self.__checkResponse(res):
1600-
return [False, self.lasterr]
1600+
if not self.__checkResponse(res):
1601+
return [False, self.lasterr]
16011602
return [True, res.json()]
16021603

16031604
def clear_agents_config(self):

0 commit comments

Comments
 (0)