pytbox 0.2.3__tar.gz → 0.2.5__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.
Potentially problematic release.
This version of pytbox might be problematic. Click here for more details.
- {pytbox-0.2.3/src/pytbox.egg-info → pytbox-0.2.5}/PKG-INFO +1 -1
- {pytbox-0.2.3 → pytbox-0.2.5}/pyproject.toml +1 -1
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/base.py +8 -1
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/database/victoriametrics.py +29 -29
- pytbox-0.2.5/src/pytbox/mingdao.py +163 -0
- pytbox-0.2.5/src/pytbox/notion.py +731 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/pyjira.py +14 -7
- {pytbox-0.2.3 → pytbox-0.2.5/src/pytbox.egg-info}/PKG-INFO +1 -1
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox.egg-info/SOURCES.txt +5 -0
- pytbox-0.2.5/tests/test_jira_connection.py +55 -0
- pytbox-0.2.5/tests/test_mingdao.py +37 -0
- pytbox-0.2.5/tests/test_notion.py +279 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/tests/test_victoriametrics.py +11 -5
- {pytbox-0.2.3 → pytbox-0.2.5}/MANIFEST.in +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/README.md +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/setup.cfg +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/alert/alert_handler.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/alert/ping.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/alicloud/sls.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/build_config.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/instances.toml +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/__init__.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.cpu/cpu.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.disk/disk.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.diskio/diskio.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.dns_query/dns_query.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.http_response/http_response.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.mem/mem.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.net/net.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.net_response/net_response.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.ping/ping.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.prometheus/prometheus.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.snmp/cisco_interface.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.snmp/cisco_system.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.snmp/h3c_interface.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.snmp/h3c_system.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.snmp/huawei_interface.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.snmp/huawei_system.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.snmp/ruijie_interface.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.snmp/ruijie_system.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/categraf/jinja2/input.vsphere/vsphere.toml.j2 +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli/__init__.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli/categraf/__init__.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli/categraf/commands.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli/commands/vm.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli/common/__init__.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli/common/options.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli/common/utils.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli/formatters/__init__.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli/formatters/output.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli/main.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/cli.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/common/__init__.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/database/mongo.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/dida365.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/excel.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/feishu/client.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/feishu/endpoints.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/feishu/errors.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/feishu/helpers.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/feishu/typing.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/log/logger.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/log/victorialog.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/mail/alimail.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/mail/client.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/mail/mail_detail.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/network/meraki.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/onepassword_connect.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/onepassword_sa.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/utils/cronjob.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/utils/env.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/utils/load_config.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/utils/load_vm_devfile.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/utils/response.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/utils/richutils.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/utils/timeutils.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/vmware.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox/win/ad.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox.egg-info/dependency_links.txt +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox.egg-info/entry_points.txt +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox.egg-info/requires.txt +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/src/pytbox.egg-info/top_level.txt +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/tests/test_base.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/tests/test_feishu.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/tests/test_load_jsonfile.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/tests/test_logger.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/tests/test_onepassword_connect.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/tests/test_onepassword_sa.py +0 -0
- {pytbox-0.2.3 → pytbox-0.2.5}/tests/test_vmware.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pytbox"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.5"
|
|
8
8
|
description = "A collection of Python integrations and utilities (Feishu, Dida365, VictoriaMetrics, ...)"
|
|
9
9
|
authors = [{ name = "mingming hou", email = "houm01@foxmail.com" }]
|
|
10
10
|
license = "MIT"
|
|
@@ -16,6 +16,8 @@ from pytbox.mail.client import MailClient
|
|
|
16
16
|
from pytbox.mail.alimail import AliMail
|
|
17
17
|
from pytbox.alicloud.sls import AliCloudSls
|
|
18
18
|
from pytbox.utils.cronjob import cronjob_counter
|
|
19
|
+
from pytbox.notion import Notion
|
|
20
|
+
from pytbox.mingdao import Mingdao
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
config = load_config_by_file(path='/workspaces/pytbox/tests/alert/config_dev.toml', oc_vault_id=os.environ.get('oc_vault_id'))
|
|
@@ -96,6 +98,7 @@ vmware_test = VMwareClient(
|
|
|
96
98
|
|
|
97
99
|
pyjira = PyJira(
|
|
98
100
|
base_url=config['jira']['base_url'],
|
|
101
|
+
username=config['jira']['username'],
|
|
99
102
|
token=config['jira']['token']
|
|
100
103
|
)
|
|
101
104
|
|
|
@@ -111,4 +114,8 @@ sls = AliCloudSls(
|
|
|
111
114
|
)
|
|
112
115
|
|
|
113
116
|
def get_cronjob_counter(app_type='', app='', comment=None, schedule_interval=None, schedule_cron=None):
|
|
114
|
-
return cronjob_counter(vm=vm, log=get_logger('cronjob_counter'), app_type=app_type, app=app, comment=comment, schedule_interval=schedule_interval, schedule_cron=schedule_cron)
|
|
117
|
+
return cronjob_counter(vm=vm, log=get_logger('cronjob_counter'), app_type=app_type, app=app, comment=comment, schedule_interval=schedule_interval, schedule_cron=schedule_cron)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
notion = Notion(token=config['notion']['api_secrets'], proxy=config['notion']['proxy'])
|
|
121
|
+
mingdao = Mingdao(app_key=config['mingdao']['app_key'], sign=config['mingdao']['sign'])
|
|
@@ -168,41 +168,41 @@ class VictoriaMetrics:
|
|
|
168
168
|
ReturnResponse:
|
|
169
169
|
code = 0 正常, code = 1 异常, code = 2 没有查询到数据, 建议将其判断为正常
|
|
170
170
|
'''
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
query = f"ping_result_code{{target='{target}'}}"
|
|
174
|
-
else:
|
|
175
|
-
query = "ping_result_code"
|
|
176
|
-
|
|
177
|
-
if last_minute:
|
|
178
|
-
query = query + f"[{last_minute}m]"
|
|
179
|
-
|
|
180
|
-
if env == 'dev':
|
|
171
|
+
query = f'avg_over_time((ping_result_code{{target="{target}"}})[{last_minute}m])'
|
|
172
|
+
if self.env == 'dev':
|
|
181
173
|
r = load_dev_file(dev_file)
|
|
182
174
|
else:
|
|
183
175
|
r = self.query(query=query)
|
|
184
|
-
|
|
185
176
|
if r.code == 0:
|
|
186
|
-
|
|
187
|
-
if
|
|
188
|
-
code =
|
|
189
|
-
msg = f"已检查 {target} 最近 {last_minute} 分钟是正常的!"
|
|
177
|
+
value = r.data[0]['value'][1]
|
|
178
|
+
if value == '0':
|
|
179
|
+
return ReturnResponse(code=0, msg=f"已检查 {target} 最近 {last_minute} 分钟是正常的!", data=r.data)
|
|
190
180
|
else:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
181
|
+
return ReturnResponse(code=1, msg=f"已检查 {target} 最近 {last_minute} 分钟是异常的!", data=r.data)
|
|
182
|
+
else:
|
|
183
|
+
return r
|
|
184
|
+
|
|
185
|
+
def check_unreachable_ping_result(self, dev_file: str='') -> ReturnResponse:
|
|
186
|
+
'''
|
|
187
|
+
检查ping结果
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
target (str): 目标地址
|
|
191
|
+
last_minute (int, optional): 最近多少分钟. Defaults to 10.
|
|
192
|
+
env (str, optional): 环境. Defaults to 'prod'.
|
|
193
|
+
dev_file (str, optional): 开发文件. Defaults to ''.
|
|
194
|
+
|
|
195
|
+
Returns:
|
|
196
|
+
ReturnResponse:
|
|
197
|
+
code = 0 正常, code = 1 异常, code = 2 没有查询到数据, 建议将其判断为正常
|
|
198
|
+
'''
|
|
199
|
+
query = "ping_result_code == 1"
|
|
204
200
|
|
|
205
|
-
|
|
201
|
+
if self.env == 'dev':
|
|
202
|
+
r = load_dev_file(dev_file)
|
|
203
|
+
else:
|
|
204
|
+
r = self.query(query=query)
|
|
205
|
+
return r
|
|
206
206
|
|
|
207
207
|
def check_interface_rate(self,
|
|
208
208
|
direction: Literal['in', 'out'],
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
from typing import Literal, Type
|
|
4
|
+
|
|
5
|
+
import requests
|
|
6
|
+
|
|
7
|
+
from .utils.response import ReturnResponse
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Mingdao:
|
|
11
|
+
'''
|
|
12
|
+
_summary_
|
|
13
|
+
'''
|
|
14
|
+
def __init__(self, app_key: str=None, sign: str=None, timeout: int=5):
|
|
15
|
+
self.base_url = "https://api.mingdao.com/"
|
|
16
|
+
self.headers = {
|
|
17
|
+
'Content-Type': 'application/json;charset=UTF-8',
|
|
18
|
+
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36'
|
|
19
|
+
}
|
|
20
|
+
self.timeout = timeout
|
|
21
|
+
self.app_key = app_key
|
|
22
|
+
self.sign = sign
|
|
23
|
+
|
|
24
|
+
def _build_api_request(self, api_url: str, method: Literal['GET', 'POST'], params: dict=None, body: dict=None, api_version: Literal['v1', 'v2']='v2'):
|
|
25
|
+
body['appKey'] = self.app_key
|
|
26
|
+
body['sign'] = self.sign
|
|
27
|
+
if not api_url.startswith('/'):
|
|
28
|
+
url = f'{self.base_url}/{api_version}/{api_url}'
|
|
29
|
+
else:
|
|
30
|
+
url = f'{self.base_url}/{api_version}{api_url}'
|
|
31
|
+
params = {
|
|
32
|
+
"appKey": self.app_key,
|
|
33
|
+
"sign": self.sign,
|
|
34
|
+
}
|
|
35
|
+
return requests.request(method, url, params=params, headers=self.headers, json=body, timeout=self.timeout)
|
|
36
|
+
|
|
37
|
+
def get_app_info(self) -> ReturnResponse:
|
|
38
|
+
'''
|
|
39
|
+
_summary_
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
ReturnResponse: _description_
|
|
43
|
+
'''
|
|
44
|
+
r = self._build_api_request(api_url='/open/app/get', method='GET', body={}, api_version='v1')
|
|
45
|
+
return ReturnResponse(code=0, msg='获取应用信息成功', data=r.json())
|
|
46
|
+
|
|
47
|
+
def get_work_sheet_info(self, worksheet_id: str=None, table_name: str=None, worksheet_name: str=None):
|
|
48
|
+
if worksheet_name:
|
|
49
|
+
worksheet_id = self.get_work_sheet_id_by_name(table_name=table_name, worksheet_name=worksheet_name)
|
|
50
|
+
|
|
51
|
+
r = self._build_api_request(
|
|
52
|
+
api_url='open/worksheet/getWorksheetInfo',
|
|
53
|
+
method='POST',
|
|
54
|
+
body={
|
|
55
|
+
"worksheetId": worksheet_id,
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
return r.json()
|
|
59
|
+
|
|
60
|
+
def get_project_info(self, worksheet_id: str, keywords: str):
|
|
61
|
+
r = self._build_api_request(
|
|
62
|
+
api_url='open/worksheet/getFilterRows',
|
|
63
|
+
method='POST',
|
|
64
|
+
body={
|
|
65
|
+
"pageIndex": 1,
|
|
66
|
+
"pageSize": 100,
|
|
67
|
+
"worksheetId": worksheet_id,
|
|
68
|
+
"keyWords": keywords,
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
return r.json()
|
|
72
|
+
|
|
73
|
+
def get_work_sheet_id_by_name(self, table_name: str, worksheet_name: str, child_section: bool=False):
|
|
74
|
+
r = self.get_app_info()
|
|
75
|
+
for i in r.data['data']['sections']:
|
|
76
|
+
if table_name == i['name']:
|
|
77
|
+
if child_section:
|
|
78
|
+
for child in i['childSections'][0]['items']:
|
|
79
|
+
if child['name'] == worksheet_name:
|
|
80
|
+
return child['id']
|
|
81
|
+
else:
|
|
82
|
+
for item in i['items']:
|
|
83
|
+
if item['name'] == worksheet_name:
|
|
84
|
+
return item['id']
|
|
85
|
+
|
|
86
|
+
def get_control_id(self, table_name: str=None, worksheet_name: str=None, control_name: str=None):
|
|
87
|
+
r = self.get_work_sheet_info(table_name=table_name, worksheet_name=worksheet_name)
|
|
88
|
+
for control in r['data']['controls']:
|
|
89
|
+
if control['controlName'] == control_name:
|
|
90
|
+
return control['controlId']
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
def get_value(self, table_name: str=None, worksheet_name: str=None, control_name: str=None, value_name: str=None):
|
|
94
|
+
control_id = self.get_control_id(table_name=table_name, worksheet_name=worksheet_name, control_name=control_name)
|
|
95
|
+
|
|
96
|
+
r = self._build_api_request(
|
|
97
|
+
api_url='open/worksheet/getFilterRows',
|
|
98
|
+
method='POST',
|
|
99
|
+
body={
|
|
100
|
+
"pageIndex": 1,
|
|
101
|
+
"pageSize": 100,
|
|
102
|
+
"worksheetId": self.get_work_sheet_id_by_name(table_name=table_name, worksheet_name=worksheet_name),
|
|
103
|
+
# "filters": filters
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
for row in r.json()['data']['rows']:
|
|
107
|
+
if row[control_id] == value_name:
|
|
108
|
+
return row['rowid']
|
|
109
|
+
|
|
110
|
+
def get_work_record(self,
|
|
111
|
+
worksheet_id: str=None,
|
|
112
|
+
project_control_id: str=None,
|
|
113
|
+
project_value: str=None,
|
|
114
|
+
complete_date_control_id: str=None,
|
|
115
|
+
complete_date: Literal['Today', '上个月', 'Last7Day', 'Last30Day']=None,
|
|
116
|
+
parse_control_id: bool=False,
|
|
117
|
+
page_size: int=100,
|
|
118
|
+
):
|
|
119
|
+
filters = []
|
|
120
|
+
if project_value:
|
|
121
|
+
filters.append({
|
|
122
|
+
"controlId": project_control_id,
|
|
123
|
+
"dataType": 29,
|
|
124
|
+
"spliceType": 1,
|
|
125
|
+
"filterType": 24,
|
|
126
|
+
"dateRange": 0,
|
|
127
|
+
"dateRangeType": 0,
|
|
128
|
+
"value": "",
|
|
129
|
+
"values": [
|
|
130
|
+
project_value
|
|
131
|
+
],
|
|
132
|
+
"minValue": "",
|
|
133
|
+
"maxValue": ""
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
if complete_date:
|
|
137
|
+
if complete_date == '上个月':
|
|
138
|
+
data_range = 8
|
|
139
|
+
elif complete_date == 'Today':
|
|
140
|
+
data_range = 1
|
|
141
|
+
elif complete_date == 'Last7Day':
|
|
142
|
+
data_range = 21
|
|
143
|
+
else:
|
|
144
|
+
data_range = 1
|
|
145
|
+
|
|
146
|
+
filters.append({
|
|
147
|
+
"controlId": complete_date_control_id,
|
|
148
|
+
"dataType": 15,
|
|
149
|
+
"spliceType": 1,
|
|
150
|
+
"filterType": 17,
|
|
151
|
+
"dateRange": data_range,
|
|
152
|
+
})
|
|
153
|
+
r = self._build_api_request(
|
|
154
|
+
api_url='open/worksheet/getFilterRows',
|
|
155
|
+
method='POST',
|
|
156
|
+
body={
|
|
157
|
+
"pageIndex": 1,
|
|
158
|
+
"pageSize": page_size,
|
|
159
|
+
"worksheetId": worksheet_id,
|
|
160
|
+
"filters": filters
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
return r.json()
|