-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathStatisticsAPI.py
More file actions
25 lines (20 loc) · 955 Bytes
/
Copy pathStatisticsAPI.py
File metadata and controls
25 lines (20 loc) · 955 Bytes
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
"""
"""
from BasicAPI import *
from RequestData import *
class StatisticsAPI(BasicAPI):
def __init__(self, format):
BasicAPI.__init__(self, format, app='statistics')
def retrieve_all_statistics(self, elementType, container):
self.uri = '/' + self.app + '/' + container + '/' + elementType
self.method = 'GET'
self.data = None
self.headers = {'Accept': 'application/' + self.format}
return RequestData(uri=self.uri, method=self.method, data=self.data, headers=self.headers)
def retrieve_node_statistics(self, nodeId, nodeType, elementType, container):
self.uri = '/' + self.app + '/' + container + '/' + \
elementType + '/node/' + nodeType + '/' + nodeId
self.method = 'GET'
self.data = None
self.headers = {'Accept': 'application/' + self.format}
return RequestData(uri=self.uri, method=self.method, data=self.data, headers=self.headers)