aliyun-log-python-sdk 0.9.37__tar.gz → 0.9.39__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.
Files changed (148) hide show
  1. {aliyun_log_python_sdk-0.9.37/aliyun_log_python_sdk.egg-info → aliyun_log_python_sdk-0.9.39}/PKG-INFO +1 -1
  2. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/__init__.py +1 -1
  3. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/auth.py +23 -11
  4. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logclient.py +79 -4
  5. aliyun_log_python_sdk-0.9.39/aliyun/log/object_response.py +82 -0
  6. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/util.py +21 -2
  7. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/version.py +1 -1
  8. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39/aliyun_log_python_sdk.egg-info}/PKG-INFO +1 -1
  9. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun_log_python_sdk.egg-info/SOURCES.txt +1 -0
  10. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/LICENSE +0 -0
  11. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/README.md +0 -0
  12. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/__init__.py +0 -0
  13. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/_proto_py2/__init__.py +0 -0
  14. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/_proto_py2/log_logs_pb2.py +0 -0
  15. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/_proto_py2/log_logs_raw_pb2.py +0 -0
  16. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/acl_config.py +0 -0
  17. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/acl_response.py +0 -0
  18. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/async_sql_pb2.py +0 -0
  19. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/async_sql_response.py +0 -0
  20. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/common_response.py +0 -0
  21. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/compress.py +0 -0
  22. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/__init__.py +0 -0
  23. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/checkpoint_tracker.py +0 -0
  24. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/config.py +0 -0
  25. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/consumer_client.py +0 -0
  26. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/exceptions.py +0 -0
  27. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/fetched_log_group.py +0 -0
  28. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/heart_beat.py +0 -0
  29. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/preprocessor.py +0 -0
  30. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/shard_worker.py +0 -0
  31. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/tasks.py +0 -0
  32. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer/worker.py +0 -0
  33. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer_group_request.py +0 -0
  34. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/consumer_group_response.py +0 -0
  35. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/credentials.py +0 -0
  36. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/cursor_response.py +0 -0
  37. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/cursor_time_response.py +0 -0
  38. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/delete_async_sql_request.py +0 -0
  39. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/deletelogsrequest.py +0 -0
  40. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/deletelogssresponse.py +0 -0
  41. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/es_migration/__init__.py +0 -0
  42. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/es_migration/doc_logitem_converter.py +0 -0
  43. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/es_migration/index_logstore_mappings.py +0 -0
  44. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/es_migration/mapping_index_converter.py +0 -0
  45. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/es_migration/migration_log.py +0 -0
  46. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/es_migration/migration_manager.py +0 -0
  47. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/es_migration/migration_response.py +0 -0
  48. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/es_migration/migration_task.py +0 -0
  49. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/es_migration/util.py +0 -0
  50. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_config_response.py +0 -0
  51. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/__init__.py +0 -0
  52. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/config_parser.py +0 -0
  53. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/etl_util.py +0 -0
  54. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/exceptions.py +0 -0
  55. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/restrict_config_parser.py +0 -0
  56. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/runner.py +0 -0
  57. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/settings.py +0 -0
  58. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/trans_comp/__init__.py +0 -0
  59. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/trans_comp/trans_base.py +0 -0
  60. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/trans_comp/trans_csv.py +0 -0
  61. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/trans_comp/trans_json.py +0 -0
  62. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/trans_comp/trans_kv.py +0 -0
  63. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/trans_comp/trans_lookup.py +0 -0
  64. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/trans_comp/trans_mv.py +0 -0
  65. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/trans_comp/trans_regex.py +0 -0
  66. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/trans_comp/trans_set_field.py +0 -0
  67. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/transform/__init__.py +0 -0
  68. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/transform/condition_list.py +0 -0
  69. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/transform/condition_transform.py +0 -0
  70. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/transform/condition_util.py +0 -0
  71. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/transform/transform_base.py +0 -0
  72. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/transform/transform_list.py +0 -0
  73. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/etl_core/transform/transform_meta.py +0 -0
  74. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/export_response.py +0 -0
  75. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/ext/__init__.py +0 -0
  76. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/ext/jupyter_magic.py +0 -0
  77. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/ext/syslogclient.py +0 -0
  78. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/external_store_config.py +0 -0
  79. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/external_store_config_response.py +0 -0
  80. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/get_async_sql_request.py +0 -0
  81. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/getcontextlogsresponse.py +0 -0
  82. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/getdeletelogsstatusrequest.py +0 -0
  83. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/getdeletelogsstatusresponse.py +0 -0
  84. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/gethistogramsrequest.py +0 -0
  85. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/gethistogramsresponse.py +0 -0
  86. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/getlogsrequest.py +0 -0
  87. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/getlogsresponse.py +0 -0
  88. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/histogram.py +0 -0
  89. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/index_config.py +0 -0
  90. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/index_config_response.py +0 -0
  91. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/ingestion_response.py +0 -0
  92. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/job.py +0 -0
  93. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/listdeletelogsstasksrequest.py +0 -0
  94. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/listdeletelogsstasksresponse.py +0 -0
  95. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/listlogstoresrequest.py +0 -0
  96. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/listlogstoresresponse.py +0 -0
  97. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/listtopicsrequest.py +0 -0
  98. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/listtopicsresponse.py +0 -0
  99. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/log_logs_pb2.py +0 -0
  100. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/log_logs_raw_pb2.py +0 -0
  101. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logclient_core.py +0 -0
  102. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logclient_operator.py +0 -0
  103. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logexception.py +0 -0
  104. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logger_hanlder.py +0 -0
  105. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logitem.py +0 -0
  106. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logrequest.py +0 -0
  107. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logresponse.py +0 -0
  108. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logstore_config_response.py +0 -0
  109. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logtail_config_detail.py +0 -0
  110. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logtail_config_response.py +0 -0
  111. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logtail_pipeline_config_detail.py +0 -0
  112. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/logtail_pipeline_config_response.py +0 -0
  113. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/machine_group_detail.py +0 -0
  114. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/machinegroup_response.py +0 -0
  115. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/metering_mode_response.py +0 -0
  116. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/odps_sink.py +0 -0
  117. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/oss_sink.py +0 -0
  118. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/pluralize.py +0 -0
  119. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/project_response.py +0 -0
  120. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/proto.py +0 -0
  121. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/pulllog_response.py +0 -0
  122. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/putlogsrequest.py +0 -0
  123. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/putlogsresponse.py +0 -0
  124. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/queriedlog.py +0 -0
  125. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/rebuild_index_response.py +0 -0
  126. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/resource_params.py +0 -0
  127. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/resource_response.py +0 -0
  128. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/scheduled_sql.py +0 -0
  129. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/scheduled_sql_response.py +0 -0
  130. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/shard_response.py +0 -0
  131. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/shipper_config.py +0 -0
  132. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/shipper_response.py +0 -0
  133. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/sink.py +0 -0
  134. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/sql_instance_response.py +0 -0
  135. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/store_view.py +0 -0
  136. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/store_view_response.py +0 -0
  137. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/submit_async_sql_request.py +0 -0
  138. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/substore_config_response.py +0 -0
  139. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/tag_response.py +0 -0
  140. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/topostore_params.py +0 -0
  141. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun/log/topostore_response.py +0 -0
  142. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun_log_python_sdk.egg-info/dependency_links.txt +0 -0
  143. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun_log_python_sdk.egg-info/requires.txt +0 -0
  144. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/aliyun_log_python_sdk.egg-info/top_level.txt +0 -0
  145. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/setup.cfg +0 -0
  146. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/setup.py +0 -0
  147. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/tests/test_alert.py +0 -0
  148. {aliyun_log_python_sdk-0.9.37 → aliyun_log_python_sdk-0.9.39}/tests/test_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aliyun-log-python-sdk
3
- Version: 0.9.37
3
+ Version: 0.9.39
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
@@ -48,7 +48,7 @@ from .logger_hanlder import SimpleLogHandler, QueuedLogHandler, LogFields, Uwsgi
48
48
  from .metering_mode_response import GetLogStoreMeteringModeResponse, \
49
49
  GetMetricStoreMeteringModeResponse, \
50
50
  UpdateLogStoreMeteringModeResponse, UpdateMetricStoreMeteringModeResponse
51
-
51
+ from .object_response import PutObjectResponse, GetObjectResponse
52
52
 
53
53
  from .store_view import StoreView, StoreViewStore
54
54
  from .store_view_response import CreateStoreViewResponse, UpdateStoreViewResponse, DeleteStoreViewResponse, ListStoreViewsResponse, GetStoreViewResponse
@@ -60,7 +60,7 @@ class AuthV1(AuthBase):
60
60
  logger.warning("failed to set locale time to C. skip it: {0}".format(ex))
61
61
  return datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')
62
62
 
63
- def sign_request(self, method, resource, params, headers, body):
63
+ def sign_request(self, method, resource, params, headers, body, compute_content_hash=True):
64
64
  credentials = self.credentials_provider.get_credentials()
65
65
  if credentials.get_security_token():
66
66
  headers['x-acs-security-token'] = credentials.get_security_token()
@@ -68,13 +68,17 @@ class AuthV1(AuthBase):
68
68
  headers['x-log-signaturemethod'] = 'hmac-sha1'
69
69
  headers['Date'] = self._getGMT()
70
70
 
71
- if body:
72
- headers['Content-MD5'] = Util.cal_md5(body)
71
+ content_md5 = None
72
+ # we don't need content-md5 in signature if compute_content_hash is False
73
+ if body and compute_content_hash:
74
+ content_md5 = Util.cal_md5(body)
75
+ headers['Content-MD5'] = content_md5
76
+
73
77
  if not credentials.get_access_key_secret():
74
78
  return six.b('')
75
79
  content = method + '\n'
76
- if 'Content-MD5' in headers:
77
- content += headers['Content-MD5']
80
+ if content_md5 is not None:
81
+ content += content_md5
78
82
  content += '\n'
79
83
  if 'Content-Type' in headers:
80
84
  content += headers['Content-Type']
@@ -87,23 +91,27 @@ class AuthV1(AuthBase):
87
91
  headers['x-log-date'] = headers['Date'] # bypass some proxy doesn't allow "Date" in header issue.
88
92
 
89
93
 
94
+ _EMPTY_CONTENT_SHA256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
95
+
90
96
  class AuthV4(AuthBase):
91
97
  def __init__(self, credentials_provider, region):
92
98
  AuthBase.__init__(self, credentials_provider)
93
99
  self._region = region
94
100
 
95
- def sign_request(self, method, resource, params, headers, body):
101
+ def sign_request(self, method, resource, params, headers, body, compute_content_hash=True):
96
102
  current_time = datetime.utcnow().strftime("%Y%m%dT%H%M%SZ")
97
- headers['Authorization'] = self._do_sign_request(method, resource, params, headers, body, current_time)
103
+ headers['Authorization'] = self._do_sign_request(method, resource, params, headers, body, current_time, compute_content_hash=compute_content_hash)
98
104
 
99
- def _do_sign_request(self, method, resource, params, headers, body, current_time):
105
+ def _do_sign_request(self, method, resource, params, headers, body, current_time, compute_content_hash=True):
100
106
  credentials = self.credentials_provider.get_credentials()
101
107
 
102
108
  if credentials.get_security_token():
103
109
  headers['x-acs-security-token'] = credentials.get_security_token()
104
110
 
105
- content_sha256 = sha256(body).hexdigest() \
106
- if body else 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
111
+ content_sha256 = _EMPTY_CONTENT_SHA256
112
+ if compute_content_hash and body:
113
+ content_sha256 = sha256(body).hexdigest()
114
+
107
115
  headers['x-log-content-sha256'] = content_sha256
108
116
  headers['x-log-date'] = current_time
109
117
  current_date = current_time[:8]
@@ -111,7 +119,11 @@ class AuthV4(AuthBase):
111
119
  signed_headers = ''
112
120
  for original_key, value in headers.items():
113
121
  key = original_key.lower()
114
- if key == 'content-type' or key == 'host' or key.startswith('x-log-') or key.startswith('x-acs-'):
122
+ if (
123
+ key == "content-type"
124
+ or key == "host"
125
+ or Util._is_extra_sign_header(key)
126
+ ):
115
127
  canonical_headers[key] = value
116
128
  headers_to_string = ''
117
129
  for key, value in sorted(canonical_headers.items()):
@@ -10,9 +10,9 @@ import json
10
10
  import requests
11
11
  import six
12
12
  import time
13
- import zlib
14
13
  from datetime import datetime
15
14
  import logging
15
+ import re
16
16
 
17
17
  from .store_view_response import ListStoreViewsResponse, CreateStoreViewResponse, UpdateStoreViewResponse, DeleteStoreViewResponse, GetStoreViewResponse
18
18
  from .credentials import StaticCredentialsProvider
@@ -76,7 +76,8 @@ from .compress import CompressType, Compressor
76
76
  from .metering_mode_response import GetLogStoreMeteringModeResponse, \
77
77
  GetMetricStoreMeteringModeResponse, UpdateLogStoreMeteringModeResponse, \
78
78
  UpdateMetricStoreMeteringModeResponse
79
- from .util import require_python3
79
+ from .object_response import PutObjectResponse, GetObjectResponse
80
+ from .util import require_python3, object_name_encode
80
81
 
81
82
  logger = logging.getLogger(__name__)
82
83
 
@@ -310,7 +311,7 @@ class LogClient(object):
310
311
  'Request is failed. Http code is ' + str(resp_status) + exJson, requestId,
311
312
  resp_status, resp_header, resp_body)
312
313
 
313
- def _send(self, method, project, body, resource, params, headers, respons_body_type='json'):
314
+ def _send(self, method, project, body, resource, params, headers, respons_body_type='json', compute_content_hash=True):
314
315
  if body:
315
316
  headers['Content-Length'] = str(len(body))
316
317
  else:
@@ -337,7 +338,7 @@ class LogClient(object):
337
338
  params2 = copy(params)
338
339
  if self._securityToken:
339
340
  headers2["x-acs-security-token"] = self._securityToken
340
- self._auth.sign_request(method, resource, params2, headers2, body)
341
+ self._auth.sign_request(method, resource, params2, headers2, body, compute_content_hash=compute_content_hash)
341
342
  return self._sendRequest(method, url, params2, body, headers2, respons_body_type)
342
343
  except LogException as ex:
343
344
  last_err = ex
@@ -6511,3 +6512,77 @@ class LogClient(object):
6511
6512
  resource = "/storeviews/" + store_view_name
6512
6513
  (resp, header) = self._send("DELETE", project_name, None, resource, params, {})
6513
6514
  return DeleteStoreViewResponse(header, resp)
6515
+
6516
+ def put_object(
6517
+ self, project_name, logstore_name, object_name, content, headers=None
6518
+ ):
6519
+ """Put an object to the specified logstore.
6520
+ Unsuccessful operation will cause an LogException.
6521
+
6522
+ :type project_name: string
6523
+ :param project_name: the project name
6524
+
6525
+ :type logstore_name: string
6526
+ :param logstore_name: the logstore name
6527
+
6528
+ :type object_name: string
6529
+ :param object_name: the object name (only allow a-z A-Z 0-9 _ -)
6530
+
6531
+ :type content: bytes/string
6532
+ :param content: the object content (can be empty)
6533
+
6534
+ :type headers: dict
6535
+ :param headers: optional headers to send with the request.
6536
+ - x-log-meta-* headers will be attached to the object as metadata, and returned in the response when getting the object
6537
+ - Content-Type will be attached to the object as metadata, and returned in the response when getting the object
6538
+ - Content-MD5 will be attached to the object as metadata, and returned in the response when getting the object
6539
+
6540
+ :return: PutObjectResponse
6541
+
6542
+ :raise: LogException
6543
+ """
6544
+ encoded_object_name = object_name_encode(object_name)
6545
+ if headers is None:
6546
+ headers = {}
6547
+ else:
6548
+ headers = dict(headers)
6549
+
6550
+ if isinstance(content, six.text_type):
6551
+ body = content.encode("utf-8")
6552
+ elif isinstance(content, six.binary_type):
6553
+ body = content
6554
+ else:
6555
+ raise LogException("InvalidParameter", "content must be bytes or string")
6556
+
6557
+ headers["x-log-bodyrawsize"] = str(len(body))
6558
+ resource = "/logstores/" + logstore_name + "/objects/" + encoded_object_name
6559
+
6560
+ (resp, resp_header) = self._send(
6561
+ "PUT", project_name, body, resource, {}, headers, compute_content_hash=False
6562
+ )
6563
+ return PutObjectResponse(resp_header, resp)
6564
+
6565
+ def get_object(self, project_name, logstore_name, object_name):
6566
+ """Get an object from the specified logstore.
6567
+ Unsuccessful operation will cause an LogException.
6568
+
6569
+ :type project_name: string
6570
+ :param project_name: the project name
6571
+
6572
+ :type logstore_name: string
6573
+ :param logstore_name: the logstore name
6574
+
6575
+ :type object_name: string
6576
+ :param object_name: the object name
6577
+
6578
+ :return: GetObjectResponse
6579
+
6580
+ :raise: LogException
6581
+ """
6582
+ encoded_object_name = object_name_encode(object_name)
6583
+ resource = "/logstores/" + logstore_name + "/objects/" + encoded_object_name
6584
+
6585
+ (resp, resp_header) = self._send(
6586
+ "GET", project_name, None, resource, {}, {}, respons_body_type="raw"
6587
+ )
6588
+ return GetObjectResponse(resp_header, resp)
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env python
2
+ # encoding: utf-8
3
+
4
+ # Copyright (C) Alibaba Cloud Computing
5
+ # All rights reserved.
6
+
7
+ from .logresponse import LogResponse
8
+ from .util import Util
9
+
10
+ __all__ = ['PutObjectResponse', 'GetObjectResponse']
11
+
12
+
13
+ class PutObjectResponse(LogResponse):
14
+ """ The response of the put_object API from log.
15
+
16
+ :type header: dict
17
+ :param header: PutObjectResponse HTTP response header
18
+
19
+ :type resp: string
20
+ :param resp: PutObjectResponse HTTP response body
21
+ """
22
+
23
+ def __init__(self, header, resp=''):
24
+ LogResponse.__init__(self, header, resp)
25
+
26
+ def get_etag(self):
27
+ """ Get the ETag of the uploaded object.
28
+
29
+ :return: string, ETag value
30
+ """
31
+ return Util.h_v_td(self.headers, 'ETag', None)
32
+
33
+ def log_print(self):
34
+ print('PutObjectResponse:')
35
+ print('headers:', self.get_all_headers())
36
+
37
+
38
+ class GetObjectResponse(LogResponse):
39
+ """ The response of the get_object API from log.
40
+
41
+ :type header: dict
42
+ :param header: GetObjectResponse HTTP response header
43
+
44
+ :type resp: bytes
45
+ :param resp: GetObjectResponse HTTP response body (object content)
46
+ """
47
+
48
+ def __init__(self, header, resp):
49
+ LogResponse.__init__(self, header, resp)
50
+
51
+ def get_etag(self):
52
+ """ Get the ETag of the object.
53
+
54
+ :return: string, ETag value, may be None if not set
55
+ """
56
+ return Util.h_v_td(self.headers, 'ETag', None)
57
+
58
+ def get_content_type(self):
59
+ """ Get the content type of the object.
60
+
61
+ :return: string, content type
62
+ """
63
+ return Util.h_v_td(self.headers, 'Content-Type', '')
64
+
65
+ def get_headers(self):
66
+ """ Get all headers of the response.
67
+
68
+ :return: dict, all response headers
69
+ """
70
+ return self.headers
71
+
72
+ def get_body(self):
73
+ """ Get the object content.
74
+
75
+ :return: bytes, object content
76
+ """
77
+ return self.body
78
+
79
+ def log_print(self):
80
+ print('GetObjectResponse:')
81
+ print('headers:', self.get_all_headers())
82
+
@@ -40,6 +40,7 @@ def base64_decodestring(s):
40
40
  s = s.encode('utf8')
41
41
  return base64.decodebytes(s).decode('utf8')
42
42
 
43
+ _EXCLUDE_SIGN_HEADER_PREFIX = 'x-log-meta-'
43
44
 
44
45
  class Util(object):
45
46
  @staticmethod
@@ -90,10 +91,18 @@ class Util(object):
90
91
  def canonicalized_log_headers(headers):
91
92
  content = ''
92
93
  for key in sorted(six.iterkeys(headers)):
93
- if key[:6].lower() in ('x-log-', 'x-acs-'): # x-log- header
94
+ if Util._is_extra_sign_header(key):
94
95
  content += key + ':' + str(headers[key]) + "\n"
95
96
  return content
96
97
 
98
+ @staticmethod
99
+ def _is_extra_sign_header(key):
100
+ lower_key = key.lower()
101
+ return lower_key.startswith("x-acs-") or (
102
+ lower_key.startswith("x-log-")
103
+ and not lower_key.startswith(_EXCLUDE_SIGN_HEADER_PREFIX)
104
+ )
105
+
97
106
  @staticmethod
98
107
  def url_encode(params):
99
108
  for key, value in params.items(): # urllib.urlencode accept 8-bit str
@@ -322,4 +331,14 @@ def require_python3(func):
322
331
  if not six.PY3:
323
332
  raise RuntimeError("Function '{func_name}' requires Python 3 to run.".format(func_name=func.__name__))
324
333
  return func(*args, **kwargs)
325
- return wrapper
334
+ return wrapper
335
+
336
+
337
+ if six.PY2:
338
+ from urllib import quote as urlquote
339
+ else:
340
+ from urllib.parse import quote as urlquote
341
+ urlquote
342
+
343
+ def object_name_encode(object_name):
344
+ return urlquote(object_name)
@@ -1,4 +1,4 @@
1
- __version__ = '0.9.37'
1
+ __version__ = '0.9.39'
2
2
 
3
3
  import sys
4
4
  OS_VERSION = str(sys.platform)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aliyun-log-python-sdk
3
- Version: 0.9.37
3
+ Version: 0.9.39
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
@@ -59,6 +59,7 @@ aliyun/log/logtail_pipeline_config_response.py
59
59
  aliyun/log/machine_group_detail.py
60
60
  aliyun/log/machinegroup_response.py
61
61
  aliyun/log/metering_mode_response.py
62
+ aliyun/log/object_response.py
62
63
  aliyun/log/odps_sink.py
63
64
  aliyun/log/oss_sink.py
64
65
  aliyun/log/pluralize.py