aliyun-log-python-sdk 0.9.11__tar.gz → 0.9.13__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.11/aliyun_log_python_sdk.egg-info → aliyun_log_python_sdk-0.9.13}/PKG-INFO +6 -6
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/README.md +2 -9
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/__init__.py +1 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logclient.py +96 -3
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logclient_operator.py +8 -3
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logitem.py +9 -3
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/project_response.py +12 -1
- aliyun_log_python_sdk-0.9.13/aliyun/log/rebuild_index_response.py +60 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/util.py +359 -358
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/version.py +1 -1
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13/aliyun_log_python_sdk.egg-info}/PKG-INFO +6 -6
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun_log_python_sdk.egg-info/SOURCES.txt +1 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/setup.py +5 -5
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/LICENSE +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/_proto_py2/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/_proto_py2/log_logs_pb2.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/_proto_py2/log_logs_raw_pb2.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/acl_config.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/acl_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/auth.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/common_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer/checkpoint_tracker.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer/config.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer/consumer_client.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer/exceptions.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer/fetched_log_group.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer/heart_beat.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer/shard_worker.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer/tasks.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer/worker.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer_group_request.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/consumer_group_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/credentials.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/cursor_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/cursor_time_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/es_migration/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/es_migration/doc_logitem_converter.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/es_migration/index_logstore_mappings.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/es_migration/mapping_index_converter.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/es_migration/migration_log.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/es_migration/migration_manager.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/es_migration/migration_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/es_migration/migration_task.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/es_migration/util.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/config_parser.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/etl_util.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/exceptions.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/restrict_config_parser.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/runner.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/settings.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/trans_comp/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/trans_comp/trans_base.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/trans_comp/trans_csv.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/trans_comp/trans_json.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/trans_comp/trans_kv.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/trans_comp/trans_lookup.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/trans_comp/trans_mv.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/trans_comp/trans_regex.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/trans_comp/trans_set_field.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/transform/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/transform/condition_list.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/transform/condition_transform.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/transform/condition_util.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/transform/transform_base.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/transform/transform_list.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/etl_core/transform/transform_meta.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/export_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/ext/__init__.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/ext/jupyter_magic.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/ext/syslogclient.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/external_store_config.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/external_store_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/getcontextlogsresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/gethistogramsrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/gethistogramsresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/getlogsrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/getlogsresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/histogram.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/index_config.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/index_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/ingestion_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/job.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/listlogstoresrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/listlogstoresresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/listtopicsrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/listtopicsresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/log_logs_pb2.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/log_logs_raw_pb2.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logclient_core.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logexception.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logger_hanlder.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logstore_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logtail_config_detail.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logtail_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/machine_group_detail.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/machinegroup_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/odps_sink.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/oss_sink.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/pluralize.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/proto.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/pulllog_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/putlogsrequest.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/putlogsresponse.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/queriedlog.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/resource_params.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/resource_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/scheduled_sql.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/scheduled_sql_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/shard_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/shipper_config.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/shipper_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/sink.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/sql_instance_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/substore_config_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/tag_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/topostore_params.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/topostore_response.py +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun_log_python_sdk.egg-info/dependency_links.txt +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun_log_python_sdk.egg-info/requires.txt +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun_log_python_sdk.egg-info/top_level.txt +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/setup.cfg +0 -0
- {aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/tests/test_alert.py +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: aliyun-log-python-sdk
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.13
|
|
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
|
|
7
7
|
Classifier: Development Status :: 5 - Production/Stable
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
9
|
Classifier: Operating System :: OS Independent
|
|
10
|
-
Classifier: Programming Language :: Python :: 2.6
|
|
11
10
|
Classifier: Programming Language :: Python :: 2.7
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.4
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.5
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
16
11
|
Classifier: Programming Language :: Python :: 3.7
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: six
|
|
@@ -30,15 +30,8 @@ Don't want to write code? Try the [CLI](http://aliyun-log-cli.readthedocs.io/en/
|
|
|
30
30
|
|
|
31
31
|
### Supported Python:
|
|
32
32
|
|
|
33
|
-
1. Python 2.
|
|
34
|
-
2. Python
|
|
35
|
-
3. Python 3.3
|
|
36
|
-
4. Python 3.4
|
|
37
|
-
5. Python 3.5
|
|
38
|
-
6. Python 3.6
|
|
39
|
-
7. Python 3.7
|
|
40
|
-
8. Pypy2
|
|
41
|
-
9. Pypy3
|
|
33
|
+
1. Python 2 with version >= 2.7
|
|
34
|
+
2. Python 3 with version >= 3.7
|
|
42
35
|
|
|
43
36
|
### Supported Log Service API
|
|
44
37
|
1. Log Service API 0.6
|
|
@@ -34,6 +34,7 @@ from .shipper_response import *
|
|
|
34
34
|
from .common_response import *
|
|
35
35
|
from .external_store_config_response import *
|
|
36
36
|
from .proto import LogGroupRaw as LogGroup
|
|
37
|
+
from .rebuild_index_response import *
|
|
37
38
|
|
|
38
39
|
# logging handler
|
|
39
40
|
from .logger_hanlder import SimpleLogHandler, QueuedLogHandler, LogFields, UwsgiQueuedLogHandler
|
|
@@ -37,6 +37,7 @@ from .logstore_config_response import *
|
|
|
37
37
|
from .substore_config_response import *
|
|
38
38
|
from .logtail_config_response import *
|
|
39
39
|
from .machinegroup_response import *
|
|
40
|
+
from .rebuild_index_response import *
|
|
40
41
|
from .project_response import *
|
|
41
42
|
from .pulllog_response import PullLogResponse
|
|
42
43
|
from .putlogsresponse import PutLogsResponse
|
|
@@ -855,7 +856,7 @@ class LogClient(object):
|
|
|
855
856
|
:raise: LogException
|
|
856
857
|
"""
|
|
857
858
|
if not is_stats_query(sql):
|
|
858
|
-
raise LogException("parameter sql invalid, please follow 'Search|Analysis' syntax, refer to "
|
|
859
|
+
raise LogException("InvalidParameter", "parameter sql invalid, please follow 'Search|Analysis' syntax, refer to "
|
|
859
860
|
"https://help.aliyun.com/document_detail/43772.html")
|
|
860
861
|
return self.get_log(project, logstore, from_time, to_time, topic=None,
|
|
861
862
|
query=sql, reverse=False, offset=0, size=100, power_sql=power_sql)
|
|
@@ -2560,6 +2561,31 @@ class LogClient(object):
|
|
|
2560
2561
|
|
|
2561
2562
|
(resp, header) = self._send("POST", project_name, body, resource, params, headers)
|
|
2562
2563
|
return CreateProjectResponse(header, resp)
|
|
2564
|
+
|
|
2565
|
+
def update_project(self, project_name, project_des):
|
|
2566
|
+
""" Update a project
|
|
2567
|
+
Unsuccessful operation will cause an LogException.
|
|
2568
|
+
|
|
2569
|
+
:type project_name: string
|
|
2570
|
+
:param project_name: the Project name
|
|
2571
|
+
|
|
2572
|
+
:type project_des: string
|
|
2573
|
+
:param project_des: the description of a project
|
|
2574
|
+
|
|
2575
|
+
:return: UpdateProjectResponse
|
|
2576
|
+
|
|
2577
|
+
:raise: LogException
|
|
2578
|
+
"""
|
|
2579
|
+
|
|
2580
|
+
params = {}
|
|
2581
|
+
body = {"description": project_des}
|
|
2582
|
+
|
|
2583
|
+
body = six.b(json.dumps(body))
|
|
2584
|
+
headers = {'Content-Type': 'application/json', 'x-log-bodyrawsize': str(len(body))}
|
|
2585
|
+
resource = "/"
|
|
2586
|
+
|
|
2587
|
+
(resp, header) = self._send("PUT", project_name, body, resource, params, headers)
|
|
2588
|
+
return UpdateProjectResponse(header, resp)
|
|
2563
2589
|
|
|
2564
2590
|
def get_project(self, project_name):
|
|
2565
2591
|
""" get project
|
|
@@ -3052,7 +3078,7 @@ class LogClient(object):
|
|
|
3052
3078
|
to_client = self
|
|
3053
3079
|
return copy_project(self, to_client, from_project, to_project, copy_machine_group)
|
|
3054
3080
|
|
|
3055
|
-
def copy_logstore(self, from_project, from_logstore, to_logstore, to_project=None, to_client=None, to_region_endpoint=None):
|
|
3081
|
+
def copy_logstore(self, from_project, from_logstore, to_logstore, to_project=None, to_client=None, to_region_endpoint=None, keep_config_name=False):
|
|
3056
3082
|
"""
|
|
3057
3083
|
copy logstore, index, logtail config to target logstore, machine group are not included yet.
|
|
3058
3084
|
the target logstore will be crated if not existing
|
|
@@ -3077,7 +3103,7 @@ class LogClient(object):
|
|
|
3077
3103
|
|
|
3078
3104
|
:return:
|
|
3079
3105
|
"""
|
|
3080
|
-
return copy_logstore(self, from_project, from_logstore, to_logstore, to_project=to_project, to_client=to_client, to_region_endpoint=to_region_endpoint)
|
|
3106
|
+
return copy_logstore(self, from_project, from_logstore, to_logstore, to_project=to_project, to_client=to_client, to_region_endpoint=to_region_endpoint, keep_config_name=keep_config_name)
|
|
3081
3107
|
|
|
3082
3108
|
def list_project(self, offset=0, size=100, project_name_pattern=None, resource_group_id=''):
|
|
3083
3109
|
""" list the project
|
|
@@ -5772,6 +5798,73 @@ class LogClient(object):
|
|
|
5772
5798
|
(resp, header) = self._send("POST", project, body_str, resource, params, headers)
|
|
5773
5799
|
return CreateEntityResponse(header, resp)
|
|
5774
5800
|
|
|
5801
|
+
def create_rebuild_index(self, project, logstore, job_name, display_name, from_time, to_time):
|
|
5802
|
+
"""Create a job that rebuild index for a logstore
|
|
5803
|
+
type: (string, string, string, string, int, int) -> CreateRebuildIndexResponse
|
|
5804
|
+
|
|
5805
|
+
:type project: string
|
|
5806
|
+
:param project: the project name
|
|
5807
|
+
|
|
5808
|
+
:type logstore: string
|
|
5809
|
+
:param logstore: the logstore name
|
|
5810
|
+
|
|
5811
|
+
:type job_name: string
|
|
5812
|
+
:param job_name: job name
|
|
5813
|
+
|
|
5814
|
+
:type display_name: string
|
|
5815
|
+
:param display_name: display name for the job
|
|
5816
|
+
|
|
5817
|
+
:type from_time: int
|
|
5818
|
+
:param from_time: from time, in unix timestamp format, eg 1736156803
|
|
5819
|
+
|
|
5820
|
+
|
|
5821
|
+
:type to_time: int
|
|
5822
|
+
:param to_time: to time, in unix timestamp format, eg 1736156803, to_time should not large than the unix_timestamp before 900 seconds ago
|
|
5823
|
+
|
|
5824
|
+
:return: CreateRebuildIndexResponse
|
|
5825
|
+
|
|
5826
|
+
:raise: LogException
|
|
5827
|
+
"""
|
|
5828
|
+
|
|
5829
|
+
params = {}
|
|
5830
|
+
headers = {"Content-Type": "application/json"}
|
|
5831
|
+
body = {
|
|
5832
|
+
"configuration":
|
|
5833
|
+
{
|
|
5834
|
+
"fromTime": from_time,
|
|
5835
|
+
"toTime": to_time,
|
|
5836
|
+
"logstore": logstore,
|
|
5837
|
+
},
|
|
5838
|
+
"displayName": display_name,
|
|
5839
|
+
"name": job_name,
|
|
5840
|
+
"recyclable": False,
|
|
5841
|
+
"type": "RebuildIndex"
|
|
5842
|
+
}
|
|
5843
|
+
data = six.b(json.dumps(body))
|
|
5844
|
+
|
|
5845
|
+
resource = "/jobs"
|
|
5846
|
+
(resp, header) = self._send("POST", project, data, resource, params, headers)
|
|
5847
|
+
return CreateRebuildIndexResponse(header, resp)
|
|
5848
|
+
|
|
5849
|
+
def get_rebuild_index(self, project, job_name):
|
|
5850
|
+
"""get rebuild index by the given job_name
|
|
5851
|
+
|
|
5852
|
+
:type project: string
|
|
5853
|
+
:param project: the project name
|
|
5854
|
+
|
|
5855
|
+
:type job_name: string
|
|
5856
|
+
:param job_name: the job name
|
|
5857
|
+
|
|
5858
|
+
:return: GetRebuildIndexResponse
|
|
5859
|
+
|
|
5860
|
+
:raise: LogException
|
|
5861
|
+
"""
|
|
5862
|
+
headers = {}
|
|
5863
|
+
params = {}
|
|
5864
|
+
resource = "/jobs/" + job_name
|
|
5865
|
+
(resp, header) = self._send("GET", project, None, resource, params, headers)
|
|
5866
|
+
return GetRebuildIndexResponse(header, resp)
|
|
5867
|
+
|
|
5775
5868
|
# make_lcrud_methods(LogClient, 'job', name_field='name', root_resource='/jobs', entities_key='results')
|
|
5776
5869
|
# make_lcrud_methods(LogClient, 'dashboard', name_field='dashboardName')
|
|
5777
5870
|
# make_lcrud_methods(LogClient, 'alert', name_field='name', root_resource='/jobs', entities_key='results', job_type="Alert")
|
{aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/logclient_operator.py
RENAMED
|
@@ -186,7 +186,7 @@ def copy_project(from_client, to_client, from_project, to_project, copy_machine_
|
|
|
186
186
|
break
|
|
187
187
|
|
|
188
188
|
|
|
189
|
-
def copy_logstore(from_client, from_project, from_logstore, to_logstore, to_project=None, to_client=None, to_region_endpoint=None):
|
|
189
|
+
def copy_logstore(from_client, from_project, from_logstore, to_logstore, to_project=None, to_client=None, to_region_endpoint=None, keep_config_name=False):
|
|
190
190
|
"""
|
|
191
191
|
copy logstore, index, logtail config to target logstore, machine group are not included yet.
|
|
192
192
|
the target logstore will be crated if not existing
|
|
@@ -211,6 +211,9 @@ def copy_logstore(from_client, from_project, from_logstore, to_logstore, to_proj
|
|
|
211
211
|
|
|
212
212
|
:type to_region_endpoint: string
|
|
213
213
|
:param to_region_endpoint: target region, use it to operate on the "to_project" while "to_client" not be specified
|
|
214
|
+
|
|
215
|
+
:type keep_config_name: bool
|
|
216
|
+
:param keep_config_name: use the same logtail config name as the source one, note that the config name must be unique in the same project
|
|
214
217
|
|
|
215
218
|
:return:
|
|
216
219
|
"""
|
|
@@ -299,8 +302,10 @@ def copy_logstore(from_client, from_project, from_logstore, to_logstore, to_proj
|
|
|
299
302
|
config = ret.logtail_config
|
|
300
303
|
if config.logstore_name != from_logstore:
|
|
301
304
|
continue
|
|
302
|
-
|
|
303
|
-
|
|
305
|
+
if keep_config_name:
|
|
306
|
+
config.config_name = config_name
|
|
307
|
+
else:
|
|
308
|
+
config.config_name = to_logstore + '_' + config_name
|
|
304
309
|
config.logstore_name = to_logstore
|
|
305
310
|
ret = to_client.create_logtail_config(to_project, config)
|
|
306
311
|
|
|
@@ -12,7 +12,7 @@ class LogItem(object):
|
|
|
12
12
|
""" LogItem used to present a log, it contains log time and multiple
|
|
13
13
|
key/value pairs to present the log contents.
|
|
14
14
|
|
|
15
|
-
:type timestamp: int
|
|
15
|
+
:type timestamp: int with seconds as unit
|
|
16
16
|
:param timestamp: time of the log item, the default time is the now time.
|
|
17
17
|
|
|
18
18
|
:type contents: tuple(key-value) list
|
|
@@ -20,9 +20,12 @@ class LogItem(object):
|
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
22
|
def __init__(self, timestamp=None, time_nano_part=None, contents=None):
|
|
23
|
-
nano_time = int(time.time()* 10**9)
|
|
23
|
+
nano_time = int(time.time() * 10**9)
|
|
24
24
|
self.timestamp = int(timestamp) if timestamp else int(nano_time / 1000000000)
|
|
25
|
-
|
|
25
|
+
# milliseconds
|
|
26
|
+
if self.timestamp > 1e10:
|
|
27
|
+
self.timestamp = int(self.timestamp / 1000.0)
|
|
28
|
+
self.time_nano_part = int(time_nano_part) if time_nano_part else int(nano_time % 1000000000)
|
|
26
29
|
self.contents = copy.deepcopy(contents) if contents else []
|
|
27
30
|
|
|
28
31
|
def push_back(self, key, value):
|
|
@@ -70,6 +73,9 @@ class LogItem(object):
|
|
|
70
73
|
:type timestamp: int
|
|
71
74
|
:param timestamp: log time
|
|
72
75
|
"""
|
|
76
|
+
# milliseconds
|
|
77
|
+
if timestamp > 1e10:
|
|
78
|
+
timestamp = timestamp / 1000.0
|
|
73
79
|
self.timestamp = int(timestamp)
|
|
74
80
|
|
|
75
81
|
def set_time_nano_part(self, time_nano_part):
|
{aliyun-log-python-sdk-0.9.11 → aliyun_log_python_sdk-0.9.13}/aliyun/log/project_response.py
RENAMED
|
@@ -9,7 +9,7 @@ from .logresponse import LogResponse
|
|
|
9
9
|
from .util import Util
|
|
10
10
|
|
|
11
11
|
__all__ = [
|
|
12
|
-
'CreateProjectResponse', 'DeleteProjectResponse',
|
|
12
|
+
'CreateProjectResponse', 'UpdateProjectResponse', 'DeleteProjectResponse',
|
|
13
13
|
'GetProjectResponse', 'ListProjectResponse',
|
|
14
14
|
'GetProjectTagsResponse',
|
|
15
15
|
]
|
|
@@ -26,6 +26,17 @@ class CreateProjectResponse(LogResponse):
|
|
|
26
26
|
print('CreateProjectResponse:')
|
|
27
27
|
print('headers:', self.get_all_headers())
|
|
28
28
|
|
|
29
|
+
class UpdateProjectResponse(LogResponse):
|
|
30
|
+
"""
|
|
31
|
+
Response of update_project
|
|
32
|
+
"""
|
|
33
|
+
def __init__(self, header, resp=''):
|
|
34
|
+
LogResponse.__init__(self, header, resp)
|
|
35
|
+
|
|
36
|
+
def log_print(self):
|
|
37
|
+
print('UpdateProjectResponse:')
|
|
38
|
+
print('headers:', self.get_all_headers())
|
|
39
|
+
|
|
29
40
|
|
|
30
41
|
class DeleteProjectResponse(LogResponse):
|
|
31
42
|
def __init__(self, header, resp=''):
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from .logresponse import LogResponse
|
|
2
|
+
|
|
3
|
+
__all__ = ['CreateRebuildIndexResponse', 'GetRebuildIndexResponse']
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CreateRebuildIndexResponse(LogResponse):
|
|
7
|
+
""" Response of create_rebuild_index
|
|
8
|
+
|
|
9
|
+
:type resp: dict
|
|
10
|
+
:param resp: CreateRebuildIndexResponse HTTP response body
|
|
11
|
+
|
|
12
|
+
:type header: dict
|
|
13
|
+
:param header: CreateRebuildIndexResponse HTTP response header
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(self, header, resp):
|
|
17
|
+
LogResponse.__init__(self, header, resp)
|
|
18
|
+
|
|
19
|
+
def log_print(self):
|
|
20
|
+
print('CreateRebuildIndexResponse:')
|
|
21
|
+
print('headers:', self.get_all_headers())
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class GetRebuildIndexResponse(LogResponse):
|
|
25
|
+
""" The response of the get_rebuild_index.
|
|
26
|
+
|
|
27
|
+
:type resp: dict
|
|
28
|
+
:param resp: GetRebuildIndexResponse HTTP response body
|
|
29
|
+
|
|
30
|
+
:type header: dict
|
|
31
|
+
:param header: GetRebuildIndexResponse HTTP response header
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def __init__(self, header, resp):
|
|
35
|
+
LogResponse.__init__(self, header, resp)
|
|
36
|
+
self._status = resp['status']
|
|
37
|
+
self._execution_details = resp.get('executionDetails')
|
|
38
|
+
self._configuration = resp['configuration']
|
|
39
|
+
|
|
40
|
+
def get_status(self):
|
|
41
|
+
"""job status
|
|
42
|
+
"""
|
|
43
|
+
return self._status
|
|
44
|
+
|
|
45
|
+
def get_execution_details(self):
|
|
46
|
+
"""job execution details
|
|
47
|
+
"""
|
|
48
|
+
return self._execution_details
|
|
49
|
+
|
|
50
|
+
def get_configuration(self):
|
|
51
|
+
"""job configuration
|
|
52
|
+
"""
|
|
53
|
+
return self._configuration
|
|
54
|
+
|
|
55
|
+
def log_print(self):
|
|
56
|
+
print('GetRebuildIndexResponse:')
|
|
57
|
+
print('headers:', self.get_all_headers())
|
|
58
|
+
print('status: ', self.get_status())
|
|
59
|
+
print('execution_details: ', self.get_execution_details())
|
|
60
|
+
print('configuration: ', self.get_configuration())
|