Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aliyun/log/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
from .metering_mode_response import GetLogStoreMeteringModeResponse, \
GetMetricStoreMeteringModeResponse, \
UpdateLogStoreMeteringModeResponse, UpdateMetricStoreMeteringModeResponse
from .multimodal_config_response import GetLogStoreMultimodalConfigurationResponse, \
PutLogStoreMultimodalConfigurationResponse
from .object_response import PutObjectResponse, GetObjectResponse

from .store_view import StoreView, StoreViewStore
Expand Down
57 changes: 57 additions & 0 deletions aliyun/log/logclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
from .metering_mode_response import GetLogStoreMeteringModeResponse, \
GetMetricStoreMeteringModeResponse, UpdateLogStoreMeteringModeResponse, \
UpdateMetricStoreMeteringModeResponse
from .multimodal_config_response import GetLogStoreMultimodalConfigurationResponse, \
PutLogStoreMultimodalConfigurationResponse
from .object_response import PutObjectResponse, GetObjectResponse
from .util import require_python3, object_name_encode

Expand Down Expand Up @@ -1833,6 +1835,61 @@ def update_logstore_metering_mode(self, project_name, logstore_name, metering_mo
(resp, header) = self._send("PUT", project_name, body_str, resource, params, headers)
return UpdateLogStoreMeteringModeResponse(header, resp)

def get_logstore_multimodal_configuration(self, project_name, logstore_name):
""" Get the multimodal configuration of the logstore
Unsuccessful operation will cause an LogException.

:type project_name: string
:param project_name: the Project name

:type logstore_name: string
:param logstore_name: the logstore name

:return: GetLogStoreMultimodalConfigurationResponse

:raise: LogException
"""
params = {}
resource = "/logstores/" + logstore_name + "/multimodalconfiguration"
headers = {}

(resp, header) = self._send("GET", project_name, None, resource, params, headers)
return GetLogStoreMultimodalConfigurationResponse(resp, header)

def put_logstore_multimodal_configuration(self, project_name, logstore_name, status, anonymous_write=None):
""" Put the multimodal configuration of the logstore
Unsuccessful operation will cause an LogException.

:type project_name: string
:param project_name: the Project name

:type logstore_name: string
:param logstore_name: the logstore name

:type status: string
:param status: the status of multimodal configuration, required (e.g., "Enabled" or "Disabled")

:type anonymous_write: string
:param anonymous_write: the anonymous write setting, optional (e.g., "Enabled" or "Disabled")

:return: PutLogStoreMultimodalConfigurationResponse

:raise: LogException
"""
params = {}
resource = "/logstores/" + logstore_name + "/multimodalconfiguration"
headers = {"x-log-bodyrawsize": '0', "Content-Type": "application/json"}
body = {
"status": status
}
if anonymous_write is not None:
body["anonymousWrite"] = anonymous_write

body_str = six.b(json.dumps(body))

(resp, header) = self._send("PUT", project_name, body_str, resource, params, headers)
return PutLogStoreMultimodalConfigurationResponse(header, resp)

def get_metric_store_metering_mode(self, project_name, metric_store_name):
""" Get the metering mode of the metric store
Unsuccessful operation will cause an LogException.
Expand Down
61 changes: 61 additions & 0 deletions aliyun/log/multimodal_config_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env python
# encoding: utf-8

# Copyright (C) Alibaba Cloud Computing
# All rights reserved.

from .util import Util
from .logresponse import LogResponse


class GetLogStoreMultimodalConfigurationResponse(LogResponse):
""" The response of the get_logstore_multimodal_configuration API from log.

:type header: dict
:param header: GetLogStoreMultimodalConfigurationResponse HTTP response header

:type resp: dict
:param resp: the HTTP response body
"""

def __init__(self, resp, header):
LogResponse.__init__(self, header, resp)
self.status = Util.convert_unicode_to_str(resp["status"])
self.anonymous_write = None
if "anonymousWrite" in resp:
self.anonymous_write = Util.convert_unicode_to_str(resp["anonymousWrite"])

def get_status(self):
"""
:return: string, the status of the multimodal configuration
"""
return self.status

def get_anonymous_write(self):
"""
:return: string, the anonymous write setting, or None if not set
"""
return self.anonymous_write

def log_print(self):
print('GetLogStoreMultimodalConfigurationResponse')
print('headers:', self.get_all_headers())
print('status:', self.status)
if self.anonymous_write is not None:
print('anonymousWrite:', self.anonymous_write)


class PutLogStoreMultimodalConfigurationResponse(LogResponse):
""" The response of the put_logstore_multimodal_configuration API from log.

:type header: dict
:param header: PutLogStoreMultimodalConfigurationResponse HTTP response header
"""

def __init__(self, header, resp=''):
LogResponse.__init__(self, header, resp)

def log_print(self):
print('PutLogStoreMultimodalConfigurationResponse:')
print('headers:', self.get_all_headers())

2 changes: 1 addition & 1 deletion aliyun/log/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.9.39'
__version__ = '0.9.40'

import sys
OS_VERSION = str(sys.platform)
Expand Down
Loading