ga-api-client 0.6.2__tar.gz → 0.6.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ga_api_client-0.6.2/ga_api_client.egg-info → ga_api_client-0.6.4}/PKG-INFO +1 -1
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api/average.py +0 -11
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api/capture.py +1 -47
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api/ga_api_client.py +59 -75
- {ga_api_client-0.6.2 → ga_api_client-0.6.4/ga_api_client.egg-info}/PKG-INFO +1 -1
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/setup.cfg +1 -1
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/LICENSE +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/README.md +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api/__init__.py +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api/field_tree.py +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api/hyper_log_log.py +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api/rate.py +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api/std.py +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api/tdigest.py +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api_client.egg-info/SOURCES.txt +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api_client.egg-info/dependency_links.txt +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api_client.egg-info/requires.txt +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/ga_api_client.egg-info/top_level.txt +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/pyproject.toml +0 -0
- {ga_api_client-0.6.2 → ga_api_client-0.6.4}/setup.py +0 -0
|
@@ -6,11 +6,9 @@ class Average:
|
|
|
6
6
|
self._count = arg[1]
|
|
7
7
|
def __add__(self, other):
|
|
8
8
|
return Average([self._sum + other._sum, self._count + other._count])
|
|
9
|
-
# return HyperLogLog(bytearray(max(a,b) for a, b in zip(self._rmem, other._rmem)))
|
|
10
9
|
|
|
11
10
|
def __radd__(self, other):
|
|
12
11
|
return Average([self._sum + other._sum, self._count + other._count])
|
|
13
|
-
# return HyperLogLog(bytearray(max(a,b) for a, b in zip(self._rmem, other._rmem)))
|
|
14
12
|
|
|
15
13
|
def __iadd__(self, other):
|
|
16
14
|
self._sum += other._sum
|
|
@@ -27,12 +25,3 @@ class Average:
|
|
|
27
25
|
if self._count == 0:
|
|
28
26
|
return math.nan
|
|
29
27
|
return self._sum / self._count
|
|
30
|
-
|
|
31
|
-
if __name__ == '__main__':
|
|
32
|
-
x = Average([10, 2])
|
|
33
|
-
y = Average([10, 5])
|
|
34
|
-
print('x = ', x)
|
|
35
|
-
print('y = ', y)
|
|
36
|
-
print('x + y = ', x + y)
|
|
37
|
-
print('repr(x) = ', repr(x))
|
|
38
|
-
print('repr(y) = ', repr(y))
|
|
@@ -96,50 +96,4 @@ class CaptureMax(CaptureBase):
|
|
|
96
96
|
return self.__class__([other._t, other._v ])
|
|
97
97
|
elif other._v is None:
|
|
98
98
|
return self.__class__([self._t, self._v])
|
|
99
|
-
return self.__class__([self._t, max(self._v, other._v)])
|
|
100
|
-
|
|
101
|
-
if __name__ == '__main__':
|
|
102
|
-
# Test CaptureAnyMin
|
|
103
|
-
print('CaptureAnyMin')
|
|
104
|
-
a = CaptureAnyMin([5, 'd:2024-12-01T00:00:00'])
|
|
105
|
-
b = CaptureAnyMin([10, 'd:2024-12-02T00:00:00'])
|
|
106
|
-
|
|
107
|
-
print(a + b) # CaptureAnyMin(v=5, t=datetime.datetime(2024, 12, 1, 0, 0))
|
|
108
|
-
|
|
109
|
-
a += b
|
|
110
|
-
print(a) # CaptureAnyMin(v=5, t=datetime.datetime(2024, 12, 1, 0, 0))
|
|
111
|
-
print('CaptureAnyMax')
|
|
112
|
-
# Test CaptureAnyMax
|
|
113
|
-
c = CaptureAnyMax([5, 'd:2024-12-01T00:00:00'])
|
|
114
|
-
d = CaptureAnyMax([10, 'd:2024-12-02T00:00:00'])
|
|
115
|
-
|
|
116
|
-
print(c + d) # CaptureAnyMax(v=10, t=datetime.datetime(2024, 12, 2, 0, 0))
|
|
117
|
-
|
|
118
|
-
c += d
|
|
119
|
-
print(c) # CaptureAnyMax(v=10, t=datetime.datetime(2024, 12, 2, 0, 0))
|
|
120
|
-
print('CaptureMin')
|
|
121
|
-
# Test CaptureMin
|
|
122
|
-
e = CaptureMin(10)
|
|
123
|
-
f = CaptureMin(5)
|
|
124
|
-
print(e + f) # CaptureMin(v=5, t=None)
|
|
125
|
-
e += f
|
|
126
|
-
print(e) # CaptureMin(v=5, t=None)
|
|
127
|
-
|
|
128
|
-
e = CaptureMin('d:2024-12-01T00:00:00')
|
|
129
|
-
f = CaptureMin('d:2024-12-02T00:00:00')
|
|
130
|
-
print(e + f) # CaptureMin(v=5, t=None)
|
|
131
|
-
e += f
|
|
132
|
-
print(e) # CaptureMin(v=5, t=None)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
e = CaptureMax(5)
|
|
136
|
-
f = CaptureMax(10)
|
|
137
|
-
print(e + f) # CaptureMin(v=5, t=None)
|
|
138
|
-
e += f
|
|
139
|
-
print(e) # CaptureMin(v=5, t=None)
|
|
140
|
-
|
|
141
|
-
e = CaptureMax('d:2024-12-01T00:00:00')
|
|
142
|
-
f = CaptureMax('d:2024-12-02T00:00:00')
|
|
143
|
-
print(e + f) # CaptureMin(v=5, t=None)
|
|
144
|
-
e += f
|
|
145
|
-
print(e) # CaptureMin(v=5, t=None)
|
|
99
|
+
return self.__class__([self._t, max(self._v, other._v)])
|
|
@@ -8,7 +8,6 @@ import getpass
|
|
|
8
8
|
import json
|
|
9
9
|
import logging
|
|
10
10
|
import math
|
|
11
|
-
# from async_timeout import timeout
|
|
12
11
|
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes # 36.0.0
|
|
13
12
|
import aiohttp # 3.8.1
|
|
14
13
|
import pandas as pd # 1.4.2
|
|
@@ -24,7 +23,7 @@ def _logtime(ts):
|
|
|
24
23
|
return time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(ts))
|
|
25
24
|
|
|
26
25
|
TZINFO = datetime.datetime.now().astimezone().tzinfo
|
|
27
|
-
|
|
26
|
+
APPLICATION_JSON = 'application/json'
|
|
28
27
|
def _get_utc_timestamp(ts):
|
|
29
28
|
if ts.tz is None:
|
|
30
29
|
ts = ts.tz_localize(tz=TZINFO)
|
|
@@ -56,10 +55,10 @@ def pprint(value, indent=4, depth=0):
|
|
|
56
55
|
return
|
|
57
56
|
# non-empty list, check if expression
|
|
58
57
|
any_complex = False
|
|
59
|
-
if
|
|
58
|
+
if not isinstance(value[0], str) or not value[0].startswith('$'):
|
|
60
59
|
for e in value:
|
|
61
|
-
if (
|
|
62
|
-
(
|
|
60
|
+
if (isinstance(e, dict) and len(e) > 0) or \
|
|
61
|
+
(isinstance(e, list) and len(e) > 0):
|
|
63
62
|
any_complex = True
|
|
64
63
|
break
|
|
65
64
|
if any_complex:
|
|
@@ -109,20 +108,19 @@ class Client:
|
|
|
109
108
|
self.burst = burst
|
|
110
109
|
self._sem = asyncio.Semaphore(burst) # semaphone to throttle concurrent burst
|
|
111
110
|
self._headers = {
|
|
112
|
-
'Content-Type':
|
|
111
|
+
'Content-Type': APPLICATION_JSON
|
|
113
112
|
}
|
|
114
113
|
if self.strategy not in Client.SUPPORT_STRATEGIES:
|
|
115
|
-
raise
|
|
114
|
+
raise ValueError(f"unsupported strategy {self.strategy}, supported strategies are {Client.SUPPORT_STRATEGIES}")
|
|
116
115
|
if self.strategy == 'controller' and self.controller is None:
|
|
117
|
-
raise
|
|
116
|
+
raise TypeError('controller strategy requires "controller" argument')
|
|
118
117
|
|
|
119
118
|
self._last_auth = 0 # timestamp of last authenticate in seconds since Eopch
|
|
120
119
|
self._session = aiohttp.ClientSession(trust_env=True)
|
|
121
|
-
# self._session = aiohttp.ClientSession(trust_env=True, connector=aiohttp.TCPConnector(force_close=True))
|
|
122
120
|
self.timeout = aiohttp.ClientTimeout(total=None, connect=None, sock_connect=conn_timeout, sock_read=read_timeout)
|
|
123
121
|
|
|
124
122
|
async def _authenticate(self):
|
|
125
|
-
|
|
123
|
+
auth_data = {
|
|
126
124
|
'strategy': 'custom',
|
|
127
125
|
'account': f'{self.user}@{self.tenant}', # user account '<user>@<tenant>'
|
|
128
126
|
'password': self.password # user password
|
|
@@ -134,11 +132,10 @@ class Client:
|
|
|
134
132
|
if resp.status != 200:
|
|
135
133
|
text = await resp.text()
|
|
136
134
|
raise UnexpectedStatus(resp.status, text)
|
|
137
|
-
# TODO: if url is wrong, the result might not be JSON
|
|
138
135
|
bringup = await resp.json()
|
|
139
136
|
# do captcha when enabled
|
|
140
137
|
if bringup.get('tenantID') is not None:
|
|
141
|
-
self.
|
|
138
|
+
self.tenant_id = bringup['tenantID']
|
|
142
139
|
if bringup['captchaEnabled']:
|
|
143
140
|
logging.info('captcha')
|
|
144
141
|
key = os.urandom(24)
|
|
@@ -157,32 +154,32 @@ class Client:
|
|
|
157
154
|
decryptor = Cipher(algorithms.AES(key), modes.CBC(iv)).decryptor()
|
|
158
155
|
answer_b = decryptor.update(ct) + decryptor.finalize()
|
|
159
156
|
answer_s = answer_b.decode('utf8')
|
|
160
|
-
|
|
157
|
+
auth_data['captcha'] = {
|
|
161
158
|
'_id': captcha['_id'],
|
|
162
159
|
'answer': answer_s
|
|
163
160
|
}
|
|
164
161
|
# do authenticate
|
|
165
162
|
if 'allowLogin' in bringup:
|
|
166
163
|
if (self.strategy == 'custom' or self.strategy == 'local') and bringup['allowLogin']['local'] is False:
|
|
167
|
-
raise
|
|
164
|
+
raise ValueError('local login is not allowed')
|
|
168
165
|
elif self.strategy == 'remote' and bringup['allowLogin']['remote'] is False:
|
|
169
|
-
raise
|
|
166
|
+
raise ValueError('remote login is not allowed')
|
|
170
167
|
elif self.strategy == 'controller':
|
|
171
168
|
if bringup['allowLogin']['controller'] is False:
|
|
172
|
-
raise
|
|
169
|
+
raise ValueError('controller login is not allowed')
|
|
173
170
|
elif len([x for x in bringup['allowLogin']['controller'] if x['_id'] == self.controller]) == 0:
|
|
174
|
-
raise
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
raise ValueError(f'controller is not found, available controllers are:{bringup["allowLogin"]["controller"]}')
|
|
172
|
+
auth_data['controller'] = self.controller
|
|
173
|
+
auth_data['strategy'] = self.strategy
|
|
177
174
|
|
|
178
175
|
url = self.url+'/authentication'
|
|
179
|
-
async with self._session.post(url, json=
|
|
176
|
+
async with self._session.post(url, json=auth_data, headers=self._headers, ssl=self.ssl) as resp:
|
|
180
177
|
if resp.status != 201:
|
|
181
178
|
text = await resp.text()
|
|
182
179
|
raise UnexpectedStatus(resp.status, text)
|
|
183
180
|
body = await resp.json()
|
|
184
181
|
self._headers = {
|
|
185
|
-
'Content-Type':
|
|
182
|
+
'Content-Type': APPLICATION_JSON,
|
|
186
183
|
'Authorization': body['accessToken']
|
|
187
184
|
}
|
|
188
185
|
self._last_auth = time.time()
|
|
@@ -205,7 +202,7 @@ class Client:
|
|
|
205
202
|
raise e
|
|
206
203
|
# send the request
|
|
207
204
|
retry_count = 0
|
|
208
|
-
meta =
|
|
205
|
+
meta = {}
|
|
209
206
|
async with self._sem:
|
|
210
207
|
# test_fn is a function to check if the request should be sent
|
|
211
208
|
if test_fn is not None and test_fn() is False:
|
|
@@ -217,15 +214,15 @@ class Client:
|
|
|
217
214
|
async with self._session.request(method, self.url+path, json=data, headers=self._headers, ssl=self.ssl, timeout=self.timeout) as resp:
|
|
218
215
|
if resp.status in code: # expected status code
|
|
219
216
|
rlt = None
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
ts_head = datetime.datetime.now()
|
|
218
|
+
if resp.content_type == APPLICATION_JSON:
|
|
222
219
|
data = await resp.json()
|
|
223
|
-
ts_done = datetime.datetime.now()
|
|
224
220
|
if 'rlt' in data:
|
|
225
221
|
rlt = data['rlt']
|
|
226
222
|
logging.debug(f'transfer req={ts_send.strftime("%Y/%m/%d %H:%M:%S")} head={ts_head.strftime("%Y/%m/%d %H:%M:%S")} data={ts_done.strftime("%Y/%m/%d %H:%M:%S")}')
|
|
227
223
|
if 'status' in data:
|
|
228
224
|
meta = data['status']
|
|
225
|
+
ts_done = datetime.datetime.now()
|
|
229
226
|
wrk_total = 0
|
|
230
227
|
if "wrk_wait" in meta:
|
|
231
228
|
wrk_total += meta["wrk_wait"]
|
|
@@ -421,6 +418,7 @@ class Reader:
|
|
|
421
418
|
self.pipeline = pipeline
|
|
422
419
|
self.count = 0
|
|
423
420
|
self.size = 0
|
|
421
|
+
self.sub_size = 0
|
|
424
422
|
self.meta = None
|
|
425
423
|
|
|
426
424
|
def test_fn(self):
|
|
@@ -434,7 +432,7 @@ class Reader:
|
|
|
434
432
|
pipeline['config'] = {}
|
|
435
433
|
pipeline['config']['start'] = start
|
|
436
434
|
pipeline['config']['end'] = end
|
|
437
|
-
pipeline['config']['size'] = self.
|
|
435
|
+
pipeline['config']['size'] = self.sub_size
|
|
438
436
|
pipeline['config']['series'] = self.series
|
|
439
437
|
if self.fields is not None:
|
|
440
438
|
pipeline['config']['fields'] = self.fields
|
|
@@ -452,16 +450,20 @@ class Reader:
|
|
|
452
450
|
return pd.DataFrame()
|
|
453
451
|
return pd.DataFrame.from_dict(self.meta)
|
|
454
452
|
|
|
455
|
-
async def read_data(self, dts, series='full', size=100, fields=None):
|
|
453
|
+
async def read_data(self, dts, series='full', size=100, fields=None, sub_size=None):
|
|
456
454
|
"""Execute adhoc request and read its data
|
|
457
455
|
Args:
|
|
458
456
|
dts: pd.DatetimeIndex, using pd.date_range to generate.
|
|
459
457
|
series: 'full', 'hour', 'day' or 'log
|
|
460
458
|
size: number of rows to read
|
|
461
459
|
fields: list of field names
|
|
460
|
+
sub_size: size of each dts query, default is size
|
|
462
461
|
Returns:
|
|
463
462
|
The record of dataframe.
|
|
464
463
|
"""
|
|
464
|
+
if sub_size is None:
|
|
465
|
+
sub_size = size
|
|
466
|
+
self.sub_size = sub_size
|
|
465
467
|
self.size = size
|
|
466
468
|
self.count = 0
|
|
467
469
|
self.series = f"%{series}" # present in literal
|
|
@@ -714,7 +716,7 @@ def _compute_kcol_mcol(pipeline):
|
|
|
714
716
|
else:
|
|
715
717
|
moper.append('$capAnyMin')
|
|
716
718
|
else:
|
|
717
|
-
raise
|
|
719
|
+
raise ValueError(f"unknown metric operation {m[0]}")
|
|
718
720
|
return kcol, mcol, moper
|
|
719
721
|
|
|
720
722
|
|
|
@@ -735,7 +737,7 @@ class _translate_table:
|
|
|
735
737
|
output_row = [] if self.ts is None else [self.ts]
|
|
736
738
|
for idx, elem in enumerate(input_row):
|
|
737
739
|
if idx < self.kcol:
|
|
738
|
-
if
|
|
740
|
+
if isinstance(elem, list):
|
|
739
741
|
output_row.append(tuple(elem))
|
|
740
742
|
else:
|
|
741
743
|
output_row.append(elem)
|
|
@@ -818,8 +820,8 @@ class Adhoc:
|
|
|
818
820
|
task.cancel()
|
|
819
821
|
raise e
|
|
820
822
|
kcol, mcol, moper = _compute_kcol_mcol(self.pipeline)
|
|
821
|
-
|
|
822
|
-
return pd.DataFrame(
|
|
823
|
+
iters = itertools.chain.from_iterable(_translate_rlts(tsidx, rlts, kcol, mcol, moper))
|
|
824
|
+
return pd.DataFrame(iters, columns=columns), metas
|
|
823
825
|
|
|
824
826
|
async def read_data(self, dts, *args, **kwargs):
|
|
825
827
|
"""Execute adhoc request and read its data
|
|
@@ -835,7 +837,7 @@ class Adhoc:
|
|
|
835
837
|
"""
|
|
836
838
|
try:
|
|
837
839
|
ts = pd.Timestamp(dts)
|
|
838
|
-
except:
|
|
840
|
+
except Exception:
|
|
839
841
|
ts = None
|
|
840
842
|
if ts is None:
|
|
841
843
|
rlt, meta = await self._read_range(dts, *args, **kwargs)
|
|
@@ -891,8 +893,8 @@ class Pipeline:
|
|
|
891
893
|
task.cancel()
|
|
892
894
|
raise e
|
|
893
895
|
kcol, mcol, moper = _compute_kcol_mcol(self.conf['pipeline'])
|
|
894
|
-
|
|
895
|
-
return pd.DataFrame(
|
|
896
|
+
iters = itertools.chain.from_iterable(_translate_rlts(tsidx, rlts, kcol, mcol, moper))
|
|
897
|
+
return pd.DataFrame(iters, columns=columns)
|
|
896
898
|
|
|
897
899
|
async def read_data(self, dts, *args, **kwargs):
|
|
898
900
|
"""Read pipeline data on API server.
|
|
@@ -906,7 +908,7 @@ class Pipeline:
|
|
|
906
908
|
"""
|
|
907
909
|
try:
|
|
908
910
|
ts = pd.Timestamp(dts)
|
|
909
|
-
except:
|
|
911
|
+
except Exception:
|
|
910
912
|
ts = None
|
|
911
913
|
if ts is None:
|
|
912
914
|
return await self._read_range(dts, *args, **kwargs)
|
|
@@ -1029,7 +1031,6 @@ class Dataset:
|
|
|
1029
1031
|
continue
|
|
1030
1032
|
await coro(next_ts, *args)
|
|
1031
1033
|
add_delta = True
|
|
1032
|
-
# TODO: support cancel task
|
|
1033
1034
|
except Exception as e:
|
|
1034
1035
|
logging.exception(e)
|
|
1035
1036
|
finally:
|
|
@@ -1043,15 +1044,15 @@ class Controller:
|
|
|
1043
1044
|
self._tenant = tenant
|
|
1044
1045
|
|
|
1045
1046
|
def desc_resource(self, rlt):
|
|
1046
|
-
|
|
1047
|
+
tmp_dict = {}
|
|
1047
1048
|
for i in rlt:
|
|
1048
1049
|
item = i.copy()
|
|
1049
1050
|
item.pop('tenant', None)
|
|
1050
1051
|
item.pop('rawConfig', None)
|
|
1051
1052
|
item.pop('devices', None)
|
|
1052
|
-
|
|
1053
|
+
tmp_dict[item["_id"]] = item
|
|
1053
1054
|
# item.pop('_id', group.None)
|
|
1054
|
-
return pd.DataFrame.from_dict(
|
|
1055
|
+
return pd.DataFrame.from_dict(tmp_dict, orient='index')
|
|
1055
1056
|
|
|
1056
1057
|
def desc_resource_group(self, rlt):
|
|
1057
1058
|
lst = []
|
|
@@ -1067,8 +1068,7 @@ class Controller:
|
|
|
1067
1068
|
Returns:
|
|
1068
1069
|
pandas.DataFrane: interface indexed by tag
|
|
1069
1070
|
"""
|
|
1070
|
-
|
|
1071
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.interface'
|
|
1071
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.interface'
|
|
1072
1072
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1073
1073
|
return self.desc_resource(rlt)
|
|
1074
1074
|
|
|
@@ -1078,8 +1078,7 @@ class Controller:
|
|
|
1078
1078
|
Returns:
|
|
1079
1079
|
pandas.DataFrane: home indexed by tag
|
|
1080
1080
|
"""
|
|
1081
|
-
|
|
1082
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.home'
|
|
1081
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.home'
|
|
1083
1082
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1084
1083
|
return self.desc_resource(rlt)
|
|
1085
1084
|
|
|
@@ -1089,8 +1088,7 @@ class Controller:
|
|
|
1089
1088
|
Returns:
|
|
1090
1089
|
pandas.DataFrane: router indexed by tag
|
|
1091
1090
|
"""
|
|
1092
|
-
|
|
1093
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.router'
|
|
1091
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.router'
|
|
1094
1092
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1095
1093
|
return self.desc_resource(rlt)
|
|
1096
1094
|
|
|
@@ -1100,8 +1098,7 @@ class Controller:
|
|
|
1100
1098
|
Returns:
|
|
1101
1099
|
pandas.DataFrane: boundary indexed by tag
|
|
1102
1100
|
"""
|
|
1103
|
-
|
|
1104
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.boundary'
|
|
1101
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.boundary'
|
|
1105
1102
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1106
1103
|
return self.desc_resource(rlt)
|
|
1107
1104
|
|
|
@@ -1111,8 +1108,7 @@ class Controller:
|
|
|
1111
1108
|
Returns:
|
|
1112
1109
|
pandas.DataFrane: neighbor indexed by tag
|
|
1113
1110
|
"""
|
|
1114
|
-
|
|
1115
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.neighbor'
|
|
1111
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.neighbor'
|
|
1116
1112
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1117
1113
|
return self.desc_resource(rlt)
|
|
1118
1114
|
|
|
@@ -1122,8 +1118,7 @@ class Controller:
|
|
|
1122
1118
|
Returns:
|
|
1123
1119
|
pandas.DataFrane: subnetwork indexed by tag
|
|
1124
1120
|
"""
|
|
1125
|
-
|
|
1126
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.subnetwork'
|
|
1121
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.subnetwork'
|
|
1127
1122
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1128
1123
|
return self.desc_resource(rlt)
|
|
1129
1124
|
|
|
@@ -1133,8 +1128,7 @@ class Controller:
|
|
|
1133
1128
|
Returns:
|
|
1134
1129
|
pandas.DataFrane: serverfarm indexed by tag
|
|
1135
1130
|
"""
|
|
1136
|
-
|
|
1137
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.serverfarm'
|
|
1131
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.serverfarm'
|
|
1138
1132
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1139
1133
|
return self.desc_resource(rlt)
|
|
1140
1134
|
|
|
@@ -1144,8 +1138,7 @@ class Controller:
|
|
|
1144
1138
|
Returns:
|
|
1145
1139
|
pandas.DataFrane: vpn indexed by tag
|
|
1146
1140
|
"""
|
|
1147
|
-
|
|
1148
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.vpnCustomer'
|
|
1141
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.vpnCustomer'
|
|
1149
1142
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1150
1143
|
return self.desc_resource(rlt)
|
|
1151
1144
|
|
|
@@ -1155,8 +1148,7 @@ class Controller:
|
|
|
1155
1148
|
Returns:
|
|
1156
1149
|
pandas.DataFrane: pop indexed by tag
|
|
1157
1150
|
"""
|
|
1158
|
-
|
|
1159
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.pop'
|
|
1151
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.pop'
|
|
1160
1152
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1161
1153
|
return self.desc_resource(rlt)
|
|
1162
1154
|
|
|
@@ -1166,8 +1158,7 @@ class Controller:
|
|
|
1166
1158
|
Returns:
|
|
1167
1159
|
pandas.DataFrane: interface groups indexed by group ID
|
|
1168
1160
|
"""
|
|
1169
|
-
|
|
1170
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.group.interface'
|
|
1161
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.group.interface'
|
|
1171
1162
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1172
1163
|
return self.desc_resource_group(rlt)
|
|
1173
1164
|
|
|
@@ -1177,8 +1168,7 @@ class Controller:
|
|
|
1177
1168
|
Returns:
|
|
1178
1169
|
pandas.DataFrane: router groups indexed by group ID
|
|
1179
1170
|
"""
|
|
1180
|
-
|
|
1181
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.group.router'
|
|
1171
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.group.router'
|
|
1182
1172
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1183
1173
|
return self.desc_resource_group(rlt)
|
|
1184
1174
|
|
|
@@ -1188,8 +1178,7 @@ class Controller:
|
|
|
1188
1178
|
Returns:
|
|
1189
1179
|
pandas.DataFrane: boundary groups indexed by group ID
|
|
1190
1180
|
"""
|
|
1191
|
-
|
|
1192
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.group.boundary'
|
|
1181
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.group.boundary'
|
|
1193
1182
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1194
1183
|
return self.desc_resource_group(rlt)
|
|
1195
1184
|
|
|
@@ -1199,8 +1188,7 @@ class Controller:
|
|
|
1199
1188
|
Returns:
|
|
1200
1189
|
pandas.DataFrane: neighbor groups indexed by group ID
|
|
1201
1190
|
"""
|
|
1202
|
-
|
|
1203
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.group.neighbor'
|
|
1191
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.group.neighbor'
|
|
1204
1192
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1205
1193
|
return self.desc_resource_group(rlt)
|
|
1206
1194
|
|
|
@@ -1210,8 +1198,7 @@ class Controller:
|
|
|
1210
1198
|
Returns:
|
|
1211
1199
|
pandas.DataFrane: subnetwork groups indexed by group ID
|
|
1212
1200
|
"""
|
|
1213
|
-
|
|
1214
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.group.subnetwork'
|
|
1201
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.group.subnetwork'
|
|
1215
1202
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1216
1203
|
return self.desc_resource_group(rlt)
|
|
1217
1204
|
|
|
@@ -1221,8 +1208,7 @@ class Controller:
|
|
|
1221
1208
|
Returns:
|
|
1222
1209
|
pandas.DataFrane: serverfarm groups indexed by group ID
|
|
1223
1210
|
"""
|
|
1224
|
-
|
|
1225
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.group.serverfarm'
|
|
1211
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.group.serverfarm'
|
|
1226
1212
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1227
1213
|
return self.desc_resource_group(rlt)
|
|
1228
1214
|
|
|
@@ -1232,8 +1218,7 @@ class Controller:
|
|
|
1232
1218
|
Returns:
|
|
1233
1219
|
pandas.DataFrane: vpn groups indexed by group ID
|
|
1234
1220
|
"""
|
|
1235
|
-
|
|
1236
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.group.vpnCustomer'
|
|
1221
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.group.vpnCustomer'
|
|
1237
1222
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1238
1223
|
return self.desc_resource_group(rlt)
|
|
1239
1224
|
|
|
@@ -1243,8 +1228,7 @@ class Controller:
|
|
|
1243
1228
|
Returns:
|
|
1244
1229
|
pandas.DataFrane: pop groups indexed by group ID
|
|
1245
1230
|
"""
|
|
1246
|
-
|
|
1247
|
-
req = f'tenant.{self._tenant.tenantID}.intern.atmC.{self.cid}.sync.group.pop'
|
|
1231
|
+
req = f'tenant.{self._tenant.tenant_id}.intern.atmC.{self.cid}.sync.group.pop'
|
|
1248
1232
|
rlt = await self._tenant.get_mgr_config(req)
|
|
1249
1233
|
return self.desc_resource_group(rlt)
|
|
1250
1234
|
|
|
@@ -1280,7 +1264,7 @@ class Repository:
|
|
|
1280
1264
|
pandas.DataFrame: Dataset configurations indexed by id.
|
|
1281
1265
|
"""
|
|
1282
1266
|
now = datetime.datetime.now().timestamp()
|
|
1283
|
-
req_path = f'tenant.{self._tenant.
|
|
1267
|
+
req_path = f'tenant.{self._tenant.tenant_id}.intern.atmC?ts={now}'
|
|
1284
1268
|
controller_list = await self._tenant.get_mgr_config(req_path)
|
|
1285
1269
|
controller_dict = {}
|
|
1286
1270
|
for controller in controller_list:
|
|
@@ -1302,7 +1286,7 @@ class Repository:
|
|
|
1302
1286
|
Returns:
|
|
1303
1287
|
Controller object with the specified id.
|
|
1304
1288
|
"""
|
|
1305
|
-
return Controller(cid, self._tenant)
|
|
1289
|
+
return await Controller(cid, self._tenant)
|
|
1306
1290
|
|
|
1307
1291
|
async def list(self):
|
|
1308
1292
|
"""List all datasets
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|