aliyun-log-python-sdk 0.9.5__tar.gz → 0.9.7__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.
- {aliyun-log-python-sdk-0.9.5/aliyun_log_python_sdk.egg-info → aliyun-log-python-sdk-0.9.7}/PKG-INFO +1 -8
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/mapping_index_converter.py +6 -2
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/migration_task.py +26 -9
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/export_response.py +10 -1
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/getlogsresponse.py +127 -134
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/index_config.py +5 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logclient.py +23 -1
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/version.py +1 -1
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7/aliyun_log_python_sdk.egg-info}/PKG-INFO +1 -8
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/LICENSE +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/README.md +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/acl_config.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/acl_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/auth.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/common_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/checkpoint_tracker.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/config.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/consumer_client.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/exceptions.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/fetched_log_group.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/heart_beat.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/shard_worker.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/tasks.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/worker.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer_group_request.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer_group_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/credentials.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/cursor_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/cursor_time_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/doc_logitem_converter.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/index_logstore_mappings.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/migration_log.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/migration_manager.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/migration_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/util.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/config_parser.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/etl_util.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/exceptions.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/restrict_config_parser.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/runner.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/settings.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/trans_comp/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/trans_comp/trans_base.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/trans_comp/trans_csv.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/trans_comp/trans_json.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/trans_comp/trans_kv.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/trans_comp/trans_lookup.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/trans_comp/trans_mv.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/trans_comp/trans_regex.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/trans_comp/trans_set_field.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/transform/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/transform/condition_list.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/transform/condition_transform.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/transform/condition_util.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/transform/transform_base.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/transform/transform_list.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/transform/transform_meta.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/ext/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/ext/jupyter_magic.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/ext/syslogclient.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/external_store_config.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/external_store_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/getcontextlogsresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/gethistogramsrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/gethistogramsresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/getlogsrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/histogram.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/index_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/ingestion_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/job.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/listlogstoresrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/listlogstoresresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/listtopicsrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/listtopicsresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/log_logs_pb2.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/log_logs_raw_pb2.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logclient_core.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logclient_operator.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logexception.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logger_hanlder.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logitem.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logstore_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logtail_config_detail.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logtail_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/machine_group_detail.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/machinegroup_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/odps_sink.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/oss_sink.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/pluralize.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/project_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/pulllog_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/putlogsrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/putlogsresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/queriedlog.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/resource_params.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/resource_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/scheduled_sql.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/scheduled_sql_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/shard_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/shipper_config.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/shipper_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/sink.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/sql_instance_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/substore_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/tag_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/topostore_params.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/topostore_response.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/util.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun_log_python_sdk.egg-info/SOURCES.txt +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun_log_python_sdk.egg-info/dependency_links.txt +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun_log_python_sdk.egg-info/requires.txt +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun_log_python_sdk.egg-info/top_level.txt +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/setup.cfg +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/setup.py +0 -0
- {aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/tests/test_alert.py +0 -0
{aliyun-log-python-sdk-0.9.5/aliyun_log_python_sdk.egg-info → aliyun-log-python-sdk-0.9.7}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: aliyun-log-python-sdk
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.7
|
|
4
4
|
Summary: Aliyun log service Python client SDK
|
|
5
5
|
Home-page: https://github.com/aliyun/aliyun-log-python-sdk
|
|
6
6
|
Author: Aliyun
|
|
@@ -16,13 +16,6 @@ Classifier: Programming Language :: Python :: 3.6
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.7
|
|
17
17
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
18
18
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: six
|
|
20
|
-
Requires-Dist: requests
|
|
21
|
-
Requires-Dist: python-dateutil
|
|
22
|
-
Requires-Dist: elasticsearch
|
|
23
|
-
Requires-Dist: jmespath
|
|
24
|
-
Requires-Dist: dateparser
|
|
25
|
-
Requires-Dist: protobuf<4.0.0,>3.4.0
|
|
26
19
|
|
|
27
20
|
|
|
28
21
|
Python SDK for Alicloud Log Service
|
|
@@ -34,6 +34,7 @@ class MappingIndexConverter(object):
|
|
|
34
34
|
line_config = IndexLineConfig(token_list=cls.DEFAULT_TOKEN_LIST, chinese=True)
|
|
35
35
|
key_config_list = cls.to_key_config_list(properties=mapping["properties"])
|
|
36
36
|
index_config = IndexConfig(line_config=line_config, key_config_list=key_config_list)
|
|
37
|
+
index_config.docvalue_max_text_len = 16384
|
|
37
38
|
return index_config
|
|
38
39
|
|
|
39
40
|
@classmethod
|
|
@@ -43,6 +44,8 @@ class MappingIndexConverter(object):
|
|
|
43
44
|
return key_config_list
|
|
44
45
|
fields = set()
|
|
45
46
|
for field_name, field_desc in properties.items():
|
|
47
|
+
if len(fields) >= 16:
|
|
48
|
+
break
|
|
46
49
|
if field_name.lower() in fields:
|
|
47
50
|
continue
|
|
48
51
|
fields.add(field_name.lower())
|
|
@@ -250,11 +253,12 @@ class MappingIndexConverter(object):
|
|
|
250
253
|
key_configs = cls.parse_properties(None, properties)
|
|
251
254
|
for key_name, key_config in key_configs.items():
|
|
252
255
|
json_key_config.add_key(key_name=key_name, key_type=key_config.index_type, doc_value=key_config.doc_value)
|
|
253
|
-
if len(json_key_config.json_keys) >=
|
|
256
|
+
if len(json_key_config.json_keys) >= 8:
|
|
254
257
|
break
|
|
255
258
|
return IndexKeyConfig(
|
|
256
259
|
index_type=AliyunLogFieldType.JSON,
|
|
257
|
-
json_key_config=json_key_config
|
|
260
|
+
json_key_config=json_key_config,
|
|
261
|
+
doc_value=True,
|
|
258
262
|
)
|
|
259
263
|
|
|
260
264
|
@classmethod
|
|
@@ -11,7 +11,7 @@ import json
|
|
|
11
11
|
import traceback
|
|
12
12
|
from datetime import datetime
|
|
13
13
|
from elasticsearch.exceptions import NotFoundError
|
|
14
|
-
from aliyun.log import LogClient
|
|
14
|
+
from aliyun.log import LogClient, LogException
|
|
15
15
|
from aliyun.log.putlogsrequest import PutLogsRequest
|
|
16
16
|
from aliyun.log.es_migration.doc_logitem_converter import DocLogItemConverter
|
|
17
17
|
|
|
@@ -251,12 +251,29 @@ class MigrationLogstore(object):
|
|
|
251
251
|
return self._logstore_name
|
|
252
252
|
|
|
253
253
|
def put_logs(self, logitems):
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
254
|
+
try:
|
|
255
|
+
self._log_client.put_logs(
|
|
256
|
+
PutLogsRequest(
|
|
257
|
+
project=self._project_name,
|
|
258
|
+
logstore=self._logstore_name,
|
|
259
|
+
topic=self._topic,
|
|
260
|
+
source=self._source,
|
|
261
|
+
logitems=logitems,
|
|
262
|
+
)
|
|
263
|
+
)
|
|
264
|
+
except LogException as exc:
|
|
265
|
+
if exc.get_error_code() != "InvalidLogSize":
|
|
266
|
+
raise
|
|
267
|
+
else: # putting succeeds
|
|
268
|
+
return
|
|
269
|
+
|
|
270
|
+
for item in logitems:
|
|
271
|
+
self._log_client.put_logs(
|
|
272
|
+
PutLogsRequest(
|
|
273
|
+
project=self._project_name,
|
|
274
|
+
logstore=self._logstore_name,
|
|
275
|
+
topic=self._topic,
|
|
276
|
+
source=self._source,
|
|
277
|
+
logitems=[item],
|
|
278
|
+
)
|
|
261
279
|
)
|
|
262
|
-
)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
from .logresponse import LogResponse
|
|
9
9
|
from .util import Util
|
|
10
10
|
|
|
11
|
-
__all__ = ['CreateExportResponse', 'DeleteExportResponse', 'GetExportResponse', 'ListExportResponse']
|
|
11
|
+
__all__ = ['CreateExportResponse', 'DeleteExportResponse', 'GetExportResponse', 'ListExportResponse', 'UpdateExportResponse']
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class CreateExportResponse(LogResponse):
|
|
@@ -32,6 +32,15 @@ class DeleteExportResponse(LogResponse):
|
|
|
32
32
|
print('headers:', self.get_all_headers())
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
class UpdateExportResponse(LogResponse):
|
|
36
|
+
def __init__(self, header, resp=''):
|
|
37
|
+
LogResponse.__init__(self, header, resp)
|
|
38
|
+
|
|
39
|
+
def log_print(self):
|
|
40
|
+
print('UpdateExportResponse:')
|
|
41
|
+
print('headers:', self.get_all_headers())
|
|
42
|
+
|
|
43
|
+
|
|
35
44
|
class GetExportResponse(LogResponse):
|
|
36
45
|
""" The response of the get_export API from log.
|
|
37
46
|
|
|
@@ -248,20 +248,19 @@ class GetLogsResponse(LogResponse):
|
|
|
248
248
|
self._phrase_query_info = GetLogsResponse.PhraseQueryInfo(
|
|
249
249
|
phrase_query_info) if phrase_query_info else None
|
|
250
250
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
# self._terms.append(GetLogsResponse.Term._from_dict(term))
|
|
251
|
+
self._limited = meta.get("limited")
|
|
252
|
+
self._processed_bytes = meta.get("processedBytes")
|
|
253
|
+
self._telemetry_type = meta.get("telementryType") or meta.get("telemetryType") # not typo
|
|
254
|
+
self._power_sql = Util.v_or_d(meta.get("powerSql"), False)
|
|
255
|
+
self._inserted_sql = meta.get("insertedSQL")
|
|
256
|
+
self._keys = meta.get("keys")
|
|
257
|
+
self._marker = meta.get("marker")
|
|
258
|
+
self._is_accurate = meta.get("isAccurate")
|
|
259
|
+
self._column_types = meta.get("columnTypes")
|
|
260
|
+
self._highlights = meta.get("highlights")
|
|
261
|
+
self._terms = []
|
|
262
|
+
for term in meta.get("terms", []):
|
|
263
|
+
self._terms.append(GetLogsResponse.Term._from_dict(term))
|
|
265
264
|
|
|
266
265
|
def is_completed(self):
|
|
267
266
|
""" Check if the get logs query is completed
|
|
@@ -305,18 +304,17 @@ class GetLogsResponse(LogResponse):
|
|
|
305
304
|
'mode': self.get_mode(),
|
|
306
305
|
'scanBytes': self.get_scan_bytes(),
|
|
307
306
|
'phraseQueryInfo': phrase_query_info_dict,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
# 'terms': [term.to_dict() for term in self._terms],
|
|
307
|
+
'limited': self.get_limited(),
|
|
308
|
+
'processedBytes': self.get_processed_bytes(),
|
|
309
|
+
'telementryType': self.get_telemetry_type(), # not typo
|
|
310
|
+
'powerSql': self.get_power_sql(),
|
|
311
|
+
'insertedSQL': self.get_inserted_sql(),
|
|
312
|
+
'keys': self.get_keys(),
|
|
313
|
+
'marker': self.get_marker(),
|
|
314
|
+
'isAccurate': self.get_is_accurate(),
|
|
315
|
+
'columnTypes': self.get_column_types(),
|
|
316
|
+
'highlights': self.get_highlights(),
|
|
317
|
+
'terms': [term._to_dict() for term in self.get_terms()],
|
|
320
318
|
}
|
|
321
319
|
|
|
322
320
|
def log_print(self):
|
|
@@ -400,77 +398,72 @@ class GetLogsResponse(LogResponse):
|
|
|
400
398
|
"""
|
|
401
399
|
return self._phrase_query_info
|
|
402
400
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
# def get_highlights(self):
|
|
464
|
-
# """
|
|
465
|
-
# :return: highlights, List[Dict]
|
|
466
|
-
# """
|
|
467
|
-
# return self._highlights
|
|
401
|
+
def get_limited(self):
|
|
402
|
+
"""
|
|
403
|
+
:return: limited, int
|
|
404
|
+
"""
|
|
405
|
+
return self._limited
|
|
406
|
+
|
|
407
|
+
def get_processed_bytes(self):
|
|
408
|
+
"""
|
|
409
|
+
:return: processed_bytes, int
|
|
410
|
+
"""
|
|
411
|
+
return self._processed_bytes
|
|
412
|
+
|
|
413
|
+
def get_telemetry_type(self):
|
|
414
|
+
"""
|
|
415
|
+
:return: telemetry_type, str
|
|
416
|
+
"""
|
|
417
|
+
return self._telemetry_type
|
|
418
|
+
|
|
419
|
+
def get_power_sql(self):
|
|
420
|
+
"""
|
|
421
|
+
:return: power_sql, bool
|
|
422
|
+
"""
|
|
423
|
+
return self._power_sql
|
|
424
|
+
|
|
425
|
+
def get_inserted_sql(self):
|
|
426
|
+
"""
|
|
427
|
+
:return: inserted_sql, str
|
|
428
|
+
"""
|
|
429
|
+
return self._inserted_sql
|
|
430
|
+
|
|
431
|
+
def get_keys(self):
|
|
432
|
+
"""
|
|
433
|
+
:return: keys, List[str]
|
|
434
|
+
"""
|
|
435
|
+
return self._keys
|
|
436
|
+
|
|
437
|
+
def get_marker(self):
|
|
438
|
+
"""
|
|
439
|
+
:return: marker, str
|
|
440
|
+
"""
|
|
441
|
+
return self._marker
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
def get_is_accurate(self):
|
|
445
|
+
"""
|
|
446
|
+
:return: is_accurate, bool
|
|
447
|
+
"""
|
|
448
|
+
return self._is_accurate
|
|
449
|
+
|
|
450
|
+
def get_column_types(self):
|
|
451
|
+
"""
|
|
452
|
+
:return: column_types, List[str]
|
|
453
|
+
"""
|
|
454
|
+
return self._column_types
|
|
455
|
+
|
|
456
|
+
def get_highlights(self):
|
|
457
|
+
"""
|
|
458
|
+
:return: highlights, List[Dict]
|
|
459
|
+
"""
|
|
460
|
+
return self._highlights
|
|
468
461
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
462
|
+
def get_terms(self):
|
|
463
|
+
"""
|
|
464
|
+
:return: terms, List[Term]
|
|
465
|
+
"""
|
|
466
|
+
return self._terms
|
|
474
467
|
|
|
475
468
|
class PhraseQueryInfo():
|
|
476
469
|
""" query info of phrase, includes beginOffset/endOffset/scanAll/endTime
|
|
@@ -528,41 +521,41 @@ class GetLogsResponse(LogResponse):
|
|
|
528
521
|
print(self._to_dict())
|
|
529
522
|
|
|
530
523
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
524
|
+
class Term():
|
|
525
|
+
""" terms of query, field key/term
|
|
526
|
+
"""
|
|
527
|
+
|
|
528
|
+
def __init__(self, key, term):
|
|
529
|
+
self._key = key
|
|
530
|
+
self._term = term
|
|
531
|
+
|
|
532
|
+
@classmethod
|
|
533
|
+
def _from_dict(cls, data):
|
|
534
|
+
""" Initialize from a dict
|
|
535
|
+
"""
|
|
536
|
+
key = data.get("key")
|
|
537
|
+
term = data.get("term")
|
|
538
|
+
return cls(key, term)
|
|
539
|
+
|
|
540
|
+
def get_key(self):
|
|
541
|
+
""" field key of term
|
|
542
|
+
"""
|
|
543
|
+
return self._key
|
|
544
|
+
|
|
545
|
+
def get_term(self):
|
|
546
|
+
""" field term of term
|
|
547
|
+
"""
|
|
548
|
+
return self._term
|
|
549
|
+
|
|
550
|
+
def _to_dict(self):
|
|
551
|
+
""" to Dict
|
|
552
|
+
"""
|
|
553
|
+
return {
|
|
554
|
+
"key": self.get_key(),
|
|
555
|
+
"term": self.get_term()
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
def log_print(self):
|
|
559
|
+
""" print info
|
|
560
|
+
"""
|
|
561
|
+
print(self._to_dict())
|
|
@@ -25,6 +25,7 @@ class IndexJsonKeyConfig(object):
|
|
|
25
25
|
self.max_depth = max_depth
|
|
26
26
|
self.alias = alias
|
|
27
27
|
self.json_keys = {}
|
|
28
|
+
self.keys_set = set()
|
|
28
29
|
|
|
29
30
|
"""
|
|
30
31
|
Inner key config in json, if the json value is :
|
|
@@ -52,6 +53,10 @@ class IndexJsonKeyConfig(object):
|
|
|
52
53
|
def add_key(self, key_name, key_type, doc_value=False, alias=None):
|
|
53
54
|
if key_type != 'text' and key_type != 'long' and key_type != 'double':
|
|
54
55
|
return
|
|
56
|
+
if key_name.lower() in self.keys_set:
|
|
57
|
+
return
|
|
58
|
+
self.keys_set.add(key_name.lower())
|
|
59
|
+
|
|
55
60
|
self.json_keys[key_name] = {}
|
|
56
61
|
self.json_keys[key_name]["type"] = key_type
|
|
57
62
|
self.json_keys[key_name]["doc_value"] = doc_value
|
|
@@ -5075,7 +5075,7 @@ class LogClient(object):
|
|
|
5075
5075
|
:type project_name: string
|
|
5076
5076
|
:param project_name: the Project name
|
|
5077
5077
|
|
|
5078
|
-
:type export:
|
|
5078
|
+
:type export: Export
|
|
5079
5079
|
:param export: the export job configuration
|
|
5080
5080
|
"""
|
|
5081
5081
|
params = {}
|
|
@@ -5110,6 +5110,28 @@ class LogClient(object):
|
|
|
5110
5110
|
(resp, header) = self._send("DELETE", project_name, None, resource, params, headers)
|
|
5111
5111
|
return DeleteExportResponse(header, resp)
|
|
5112
5112
|
|
|
5113
|
+
def update_export(self, project_name, job_name, export):
|
|
5114
|
+
""" Update and Restart an export job
|
|
5115
|
+
Unsuccessful opertaion will cause an LogException.
|
|
5116
|
+
|
|
5117
|
+
:type project_name: string
|
|
5118
|
+
:param project_name: the Project name
|
|
5119
|
+
|
|
5120
|
+
:type job_name: string
|
|
5121
|
+
:param job_name: the job name of export job
|
|
5122
|
+
|
|
5123
|
+
:type export: string
|
|
5124
|
+
:param export: the export job configuration
|
|
5125
|
+
"""
|
|
5126
|
+
if not isinstance(export, str):
|
|
5127
|
+
raise TypeError("export type must be string")
|
|
5128
|
+
params = {"action": "RESTART"}
|
|
5129
|
+
body = six.b(export)
|
|
5130
|
+
headers = {'Content-Type': 'application/json', 'x-log-bodyrawsize': str(len(body))}
|
|
5131
|
+
resource = "/jobs/" + job_name
|
|
5132
|
+
(resp, header) = self._send("PUT", project_name, body, resource, params, headers)
|
|
5133
|
+
return UpdateExportResponse(header, resp)
|
|
5134
|
+
|
|
5113
5135
|
def get_export(self, project_name, job_name):
|
|
5114
5136
|
""" get export
|
|
5115
5137
|
Unsuccessful operation will cause an LogException.
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7/aliyun_log_python_sdk.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: aliyun-log-python-sdk
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.7
|
|
4
4
|
Summary: Aliyun log service Python client SDK
|
|
5
5
|
Home-page: https://github.com/aliyun/aliyun-log-python-sdk
|
|
6
6
|
Author: Aliyun
|
|
@@ -16,13 +16,6 @@ Classifier: Programming Language :: Python :: 3.6
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.7
|
|
17
17
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
18
18
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: six
|
|
20
|
-
Requires-Dist: requests
|
|
21
|
-
Requires-Dist: python-dateutil
|
|
22
|
-
Requires-Dist: elasticsearch
|
|
23
|
-
Requires-Dist: jmespath
|
|
24
|
-
Requires-Dist: dateparser
|
|
25
|
-
Requires-Dist: protobuf<4.0.0,>3.4.0
|
|
26
19
|
|
|
27
20
|
|
|
28
21
|
Python SDK for Alicloud Log Service
|
|
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
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/consumer_client.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/exceptions.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/fetched_log_group.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/heart_beat.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer/shard_worker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer_group_request.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/consumer_group_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/cursor_time_response.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/es_migration/migration_log.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_config_response.py
RENAMED
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/config_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/etl_core/exceptions.py
RENAMED
|
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
|
|
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
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/external_store_config.py
RENAMED
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/getcontextlogsresponse.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/gethistogramsrequest.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/gethistogramsresponse.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/index_config_response.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/ingestion_response.py
RENAMED
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/listlogstoresrequest.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/listlogstoresresponse.py
RENAMED
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/listtopicsresponse.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logclient_operator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logstore_config_response.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logtail_config_detail.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/logtail_config_response.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/machine_group_detail.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/machinegroup_response.py
RENAMED
|
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
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/scheduled_sql_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/sql_instance_response.py
RENAMED
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/substore_config_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aliyun-log-python-sdk-0.9.5 → aliyun-log-python-sdk-0.9.7}/aliyun/log/topostore_response.py
RENAMED
|
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
|