2251 lines
69 KiB
Python
2251 lines
69 KiB
Python
# coding: utf-8
|
||
|
||
from __future__ import absolute_import
|
||
|
||
import datetime
|
||
import re
|
||
import importlib
|
||
|
||
import six
|
||
|
||
from huaweicloudsdkcore.client import Client, ClientBuilder
|
||
from huaweicloudsdkcore.exceptions import exceptions
|
||
from huaweicloudsdkcore.utils import http_utils
|
||
from huaweicloudsdkcore.sdk_stream_request import SdkStreamRequest
|
||
|
||
|
||
class LtsClient(Client):
|
||
"""
|
||
:param configuration: .Configuration object for this client
|
||
:param pool_threads: The number of threads to use for async requests
|
||
to the API. More threads means more concurrent API requests.
|
||
"""
|
||
|
||
PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
|
||
NATIVE_TYPES_MAPPING = {
|
||
'int': int,
|
||
'long': int if six.PY3 else long,
|
||
'float': float,
|
||
'str': str,
|
||
'bool': bool,
|
||
'date': datetime.date,
|
||
'datetime': datetime.datetime,
|
||
'object': object,
|
||
}
|
||
|
||
def __init__(self):
|
||
super(LtsClient, self).__init__()
|
||
self.model_package = importlib.import_module("huaweicloudsdklts.v2.model")
|
||
self.preset_headers = {'User-Agent': 'HuaweiCloud-SDK-Python'}
|
||
|
||
@classmethod
|
||
def new_builder(cls, clazz=None):
|
||
if clazz is None:
|
||
return ClientBuilder(cls)
|
||
|
||
if clazz.__name__ != "LtsClient":
|
||
raise TypeError("client type error, support client type is LtsClient")
|
||
|
||
return ClientBuilder(clazz)
|
||
|
||
def create_keywords_alarm_rule(self, request):
|
||
"""创建关键词告警规则
|
||
|
||
该接口用于创建关键词告警,目前每个帐户最多可以创建共200个关键词告警与SQL告警。
|
||
|
||
:param CreateKeywordsAlarmRuleRequest request
|
||
:return: CreateKeywordsAlarmRuleResponse
|
||
"""
|
||
return self.create_keywords_alarm_rule_with_http_info(request)
|
||
|
||
def create_keywords_alarm_rule_with_http_info(self, request):
|
||
"""创建关键词告警规则
|
||
|
||
该接口用于创建关键词告警,目前每个帐户最多可以创建共200个关键词告警与SQL告警。
|
||
|
||
:param CreateKeywordsAlarmRuleRequest request
|
||
:return: CreateKeywordsAlarmRuleResponse
|
||
"""
|
||
|
||
all_params = ['create_keywords_alarm_rule_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json;charset=UTF-8'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/alarms/keywords-alarm-rule',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='CreateKeywordsAlarmRuleResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def create_log_dump_obs(self, request):
|
||
"""日志转储
|
||
|
||
该接口用于将指定的一个或多个日志流的日志转储到OBS服务。
|
||
|
||
:param CreateLogDumpObsRequest request
|
||
:return: CreateLogDumpObsResponse
|
||
"""
|
||
return self.create_log_dump_obs_with_http_info(request)
|
||
|
||
def create_log_dump_obs_with_http_info(self, request):
|
||
"""日志转储
|
||
|
||
该接口用于将指定的一个或多个日志流的日志转储到OBS服务。
|
||
|
||
:param CreateLogDumpObsRequest request
|
||
:return: CreateLogDumpObsResponse
|
||
"""
|
||
|
||
all_params = ['create_log_dump_obs_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/log-dump/obs',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='CreateLogDumpObsResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def create_log_group(self, request):
|
||
"""创建日志组
|
||
|
||
该接口用于创建一个日志组
|
||
|
||
:param CreateLogGroupRequest request
|
||
:return: CreateLogGroupResponse
|
||
"""
|
||
return self.create_log_group_with_http_info(request)
|
||
|
||
def create_log_group_with_http_info(self, request):
|
||
"""创建日志组
|
||
|
||
该接口用于创建一个日志组
|
||
|
||
:param CreateLogGroupRequest request
|
||
:return: CreateLogGroupResponse
|
||
"""
|
||
|
||
all_params = ['create_log_group_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/groups',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='CreateLogGroupResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def create_log_stream(self, request):
|
||
"""创建日志流
|
||
|
||
该接口用于创建某个指定日志组下的日志流
|
||
|
||
:param CreateLogStreamRequest request
|
||
:return: CreateLogStreamResponse
|
||
"""
|
||
return self.create_log_stream_with_http_info(request)
|
||
|
||
def create_log_stream_with_http_info(self, request):
|
||
"""创建日志流
|
||
|
||
该接口用于创建某个指定日志组下的日志流
|
||
|
||
:param CreateLogStreamRequest request
|
||
:return: CreateLogStreamResponse
|
||
"""
|
||
|
||
all_params = ['log_group_id', 'create_log_stream_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'log_group_id' in local_var_params:
|
||
path_params['log_group_id'] = local_var_params['log_group_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/groups/{log_group_id}/streams',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='CreateLogStreamResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def create_struct_template(self, request):
|
||
"""创建结构化配置
|
||
|
||
该接口用于创建指定日志流下的结构化配置。
|
||
|
||
:param CreateStructTemplateRequest request
|
||
:return: CreateStructTemplateResponse
|
||
"""
|
||
return self.create_struct_template_with_http_info(request)
|
||
|
||
def create_struct_template_with_http_info(self, request):
|
||
"""创建结构化配置
|
||
|
||
该接口用于创建指定日志流下的结构化配置。
|
||
|
||
:param CreateStructTemplateRequest request
|
||
:return: CreateStructTemplateResponse
|
||
"""
|
||
|
||
all_params = ['create_struct_template_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/struct/template',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='CreateStructTemplateResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def delete_active_alarms(self, request):
|
||
"""删除活动告警
|
||
|
||
该接口用于删除活动告警
|
||
|
||
:param DeleteActiveAlarmsRequest request
|
||
:return: DeleteActiveAlarmsResponse
|
||
"""
|
||
return self.delete_active_alarms_with_http_info(request)
|
||
|
||
def delete_active_alarms_with_http_info(self, request):
|
||
"""删除活动告警
|
||
|
||
该接口用于删除活动告警
|
||
|
||
:param DeleteActiveAlarmsRequest request
|
||
:return: DeleteActiveAlarmsResponse
|
||
"""
|
||
|
||
all_params = ['domain_id', 'delete_active_alarms_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'domain_id' in local_var_params:
|
||
path_params['domain_id'] = local_var_params['domain_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json;charset=UTF-8'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/{domain_id}/lts/alarms/sql-alarm/clear',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='DeleteActiveAlarmsResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def delete_keywords_alarm_rule(self, request):
|
||
"""删除关键词告警规则
|
||
|
||
该接口用于删除关键词告警。
|
||
|
||
:param DeleteKeywordsAlarmRuleRequest request
|
||
:return: DeleteKeywordsAlarmRuleResponse
|
||
"""
|
||
return self.delete_keywords_alarm_rule_with_http_info(request)
|
||
|
||
def delete_keywords_alarm_rule_with_http_info(self, request):
|
||
"""删除关键词告警规则
|
||
|
||
该接口用于删除关键词告警。
|
||
|
||
:param DeleteKeywordsAlarmRuleRequest request
|
||
:return: DeleteKeywordsAlarmRuleResponse
|
||
"""
|
||
|
||
all_params = ['keywords_alarm_rule_id']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'keywords_alarm_rule_id' in local_var_params:
|
||
path_params['keywords_alarm_rule_id'] = local_var_params['keywords_alarm_rule_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/alarms/keywords-alarm-rule/{keywords_alarm_rule_id}',
|
||
method='DELETE',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='DeleteKeywordsAlarmRuleResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def delete_log_group(self, request):
|
||
"""删除日志组
|
||
|
||
该接口用于删除指定日志组。当日志组中的日志流配置了日志转储,需要取消日志转储后才可删除。
|
||
|
||
:param DeleteLogGroupRequest request
|
||
:return: DeleteLogGroupResponse
|
||
"""
|
||
return self.delete_log_group_with_http_info(request)
|
||
|
||
def delete_log_group_with_http_info(self, request):
|
||
"""删除日志组
|
||
|
||
该接口用于删除指定日志组。当日志组中的日志流配置了日志转储,需要取消日志转储后才可删除。
|
||
|
||
:param DeleteLogGroupRequest request
|
||
:return: DeleteLogGroupResponse
|
||
"""
|
||
|
||
all_params = ['log_group_id']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'log_group_id' in local_var_params:
|
||
path_params['log_group_id'] = local_var_params['log_group_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/groups/{log_group_id}',
|
||
method='DELETE',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='DeleteLogGroupResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def delete_log_stream(self, request):
|
||
"""删除日志流
|
||
|
||
该接口用于删除指定日志组下的指定日志流。当该日志流配置了日志转储,需要取消日志转储后才可删除。
|
||
|
||
:param DeleteLogStreamRequest request
|
||
:return: DeleteLogStreamResponse
|
||
"""
|
||
return self.delete_log_stream_with_http_info(request)
|
||
|
||
def delete_log_stream_with_http_info(self, request):
|
||
"""删除日志流
|
||
|
||
该接口用于删除指定日志组下的指定日志流。当该日志流配置了日志转储,需要取消日志转储后才可删除。
|
||
|
||
:param DeleteLogStreamRequest request
|
||
:return: DeleteLogStreamResponse
|
||
"""
|
||
|
||
all_params = ['log_group_id', 'log_stream_id']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'log_group_id' in local_var_params:
|
||
path_params['log_group_id'] = local_var_params['log_group_id']
|
||
if 'log_stream_id' in local_var_params:
|
||
path_params['log_stream_id'] = local_var_params['log_stream_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/groups/{log_group_id}/streams/{log_stream_id}',
|
||
method='DELETE',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='DeleteLogStreamResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def delete_struct_template(self, request):
|
||
"""删除结构化配置
|
||
|
||
该接口用于删除指定日志流下的结构化配置。
|
||
|
||
:param DeleteStructTemplateRequest request
|
||
:return: DeleteStructTemplateResponse
|
||
"""
|
||
return self.delete_struct_template_with_http_info(request)
|
||
|
||
def delete_struct_template_with_http_info(self, request):
|
||
"""删除结构化配置
|
||
|
||
该接口用于删除指定日志流下的结构化配置。
|
||
|
||
:param DeleteStructTemplateRequest request
|
||
:return: DeleteStructTemplateResponse
|
||
"""
|
||
|
||
all_params = ['delete_struct_template_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json;charset=UTF-8'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/struct/template',
|
||
method='DELETE',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='DeleteStructTemplateResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def disable_log_collection(self, request):
|
||
"""关闭超额采集开关
|
||
|
||
该接口用于将超额采集日志功能关闭。
|
||
|
||
:param DisableLogCollectionRequest request
|
||
:return: DisableLogCollectionResponse
|
||
"""
|
||
return self.disable_log_collection_with_http_info(request)
|
||
|
||
def disable_log_collection_with_http_info(self, request):
|
||
"""关闭超额采集开关
|
||
|
||
该接口用于将超额采集日志功能关闭。
|
||
|
||
:param DisableLogCollectionRequest request
|
||
:return: DisableLogCollectionResponse
|
||
"""
|
||
|
||
all_params = []
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/collection/disable',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='DisableLogCollectionResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def enable_log_collection(self, request):
|
||
"""打开超额采集开关
|
||
|
||
该接口用于将超额采集日志功能打开。
|
||
|
||
:param EnableLogCollectionRequest request
|
||
:return: EnableLogCollectionResponse
|
||
"""
|
||
return self.enable_log_collection_with_http_info(request)
|
||
|
||
def enable_log_collection_with_http_info(self, request):
|
||
"""打开超额采集开关
|
||
|
||
该接口用于将超额采集日志功能打开。
|
||
|
||
:param EnableLogCollectionRequest request
|
||
:return: EnableLogCollectionResponse
|
||
"""
|
||
|
||
all_params = []
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/collection/enable',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='EnableLogCollectionResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def list_active_or_history_alarms(self, request):
|
||
"""查询活动或历史告警列表
|
||
|
||
该接口用于查询告警列表
|
||
|
||
:param ListActiveOrHistoryAlarmsRequest request
|
||
:return: ListActiveOrHistoryAlarmsResponse
|
||
"""
|
||
return self.list_active_or_history_alarms_with_http_info(request)
|
||
|
||
def list_active_or_history_alarms_with_http_info(self, request):
|
||
"""查询活动或历史告警列表
|
||
|
||
该接口用于查询告警列表
|
||
|
||
:param ListActiveOrHistoryAlarmsRequest request
|
||
:return: ListActiveOrHistoryAlarmsResponse
|
||
"""
|
||
|
||
all_params = ['domain_id', 'type', 'list_active_or_history_alarms_request_body', 'marker', 'limit']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'domain_id' in local_var_params:
|
||
path_params['domain_id'] = local_var_params['domain_id']
|
||
|
||
query_params = []
|
||
if 'type' in local_var_params:
|
||
query_params.append(('type', local_var_params['type']))
|
||
if 'marker' in local_var_params:
|
||
query_params.append(('marker', local_var_params['marker']))
|
||
if 'limit' in local_var_params:
|
||
query_params.append(('limit', local_var_params['limit']))
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json;charset=UTF-8'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/{domain_id}/lts/alarms/sql-alarm/query',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ListActiveOrHistoryAlarmsResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def list_charts(self, request):
|
||
"""查询日志流图表
|
||
|
||
该接口用于查询日志流图表
|
||
|
||
:param ListChartsRequest request
|
||
:return: ListChartsResponse
|
||
"""
|
||
return self.list_charts_with_http_info(request)
|
||
|
||
def list_charts_with_http_info(self, request):
|
||
"""查询日志流图表
|
||
|
||
该接口用于查询日志流图表
|
||
|
||
:param ListChartsRequest request
|
||
:return: ListChartsResponse
|
||
"""
|
||
|
||
all_params = ['log_group_id', 'log_stream_id']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'log_group_id' in local_var_params:
|
||
path_params['log_group_id'] = local_var_params['log_group_id']
|
||
if 'log_stream_id' in local_var_params:
|
||
path_params['log_stream_id'] = local_var_params['log_stream_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/groups/{log_group_id}/streams/{log_stream_id}/charts',
|
||
method='GET',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ListChartsResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def list_keywords_alarm_rules(self, request):
|
||
"""查询关键词告警规则
|
||
|
||
该接口用于查询关键词告警。
|
||
|
||
:param ListKeywordsAlarmRulesRequest request
|
||
:return: ListKeywordsAlarmRulesResponse
|
||
"""
|
||
return self.list_keywords_alarm_rules_with_http_info(request)
|
||
|
||
def list_keywords_alarm_rules_with_http_info(self, request):
|
||
"""查询关键词告警规则
|
||
|
||
该接口用于查询关键词告警。
|
||
|
||
:param ListKeywordsAlarmRulesRequest request
|
||
:return: ListKeywordsAlarmRulesResponse
|
||
"""
|
||
|
||
all_params = []
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/alarms/keywords-alarm-rule',
|
||
method='GET',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ListKeywordsAlarmRulesResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def list_log_groups(self, request):
|
||
"""查询账号下所有日志组
|
||
|
||
该接口用于查询账号下所有日志组。
|
||
|
||
:param ListLogGroupsRequest request
|
||
:return: ListLogGroupsResponse
|
||
"""
|
||
return self.list_log_groups_with_http_info(request)
|
||
|
||
def list_log_groups_with_http_info(self, request):
|
||
"""查询账号下所有日志组
|
||
|
||
该接口用于查询账号下所有日志组。
|
||
|
||
:param ListLogGroupsRequest request
|
||
:return: ListLogGroupsResponse
|
||
"""
|
||
|
||
all_params = []
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/groups',
|
||
method='GET',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ListLogGroupsResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def list_log_stream(self, request):
|
||
"""查询指定日志组下的所有日志流
|
||
|
||
该接口用于查询指定日志组下的所有日志流信息。
|
||
|
||
:param ListLogStreamRequest request
|
||
:return: ListLogStreamResponse
|
||
"""
|
||
return self.list_log_stream_with_http_info(request)
|
||
|
||
def list_log_stream_with_http_info(self, request):
|
||
"""查询指定日志组下的所有日志流
|
||
|
||
该接口用于查询指定日志组下的所有日志流信息。
|
||
|
||
:param ListLogStreamRequest request
|
||
:return: ListLogStreamResponse
|
||
"""
|
||
|
||
all_params = ['log_group_id', 'tag']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'log_group_id' in local_var_params:
|
||
path_params['log_group_id'] = local_var_params['log_group_id']
|
||
|
||
query_params = []
|
||
if 'tag' in local_var_params:
|
||
query_params.append(('tag', local_var_params['tag']))
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/groups/{log_group_id}/streams',
|
||
method='GET',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ListLogStreamResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def list_logs(self, request):
|
||
"""查询日志
|
||
|
||
该接口用于查询指定日志流下的日志内容。
|
||
|
||
:param ListLogsRequest request
|
||
:return: ListLogsResponse
|
||
"""
|
||
return self.list_logs_with_http_info(request)
|
||
|
||
def list_logs_with_http_info(self, request):
|
||
"""查询日志
|
||
|
||
该接口用于查询指定日志流下的日志内容。
|
||
|
||
:param ListLogsRequest request
|
||
:return: ListLogsResponse
|
||
"""
|
||
|
||
all_params = ['log_group_id', 'log_stream_id', 'list_logs_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'log_group_id' in local_var_params:
|
||
path_params['log_group_id'] = local_var_params['log_group_id']
|
||
if 'log_stream_id' in local_var_params:
|
||
path_params['log_stream_id'] = local_var_params['log_stream_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/groups/{log_group_id}/streams/{log_stream_id}/content/query',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ListLogsResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def list_notification_topics(self, request):
|
||
"""查询SMN主题
|
||
|
||
该接口用于查询SMN主题
|
||
|
||
:param ListNotificationTopicsRequest request
|
||
:return: ListNotificationTopicsResponse
|
||
"""
|
||
return self.list_notification_topics_with_http_info(request)
|
||
|
||
def list_notification_topics_with_http_info(self, request):
|
||
"""查询SMN主题
|
||
|
||
该接口用于查询SMN主题
|
||
|
||
:param ListNotificationTopicsRequest request
|
||
:return: ListNotificationTopicsResponse
|
||
"""
|
||
|
||
all_params = ['offset', 'limit']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
if 'offset' in local_var_params:
|
||
query_params.append(('offset', local_var_params['offset']))
|
||
if 'limit' in local_var_params:
|
||
query_params.append(('limit', local_var_params['limit']))
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/notifications/topics',
|
||
method='GET',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ListNotificationTopicsResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def list_query_structured_logs(self, request):
|
||
"""查询结构化日志
|
||
|
||
该接口用于查询指定日志流下的结构化日志内容。
|
||
|
||
:param ListQueryStructuredLogsRequest request
|
||
:return: ListQueryStructuredLogsResponse
|
||
"""
|
||
return self.list_query_structured_logs_with_http_info(request)
|
||
|
||
def list_query_structured_logs_with_http_info(self, request):
|
||
"""查询结构化日志
|
||
|
||
该接口用于查询指定日志流下的结构化日志内容。
|
||
|
||
:param ListQueryStructuredLogsRequest request
|
||
:return: ListQueryStructuredLogsResponse
|
||
"""
|
||
|
||
all_params = ['log_group_id', 'log_stream_id', 'list_query_structured_logs_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'log_group_id' in local_var_params:
|
||
path_params['log_group_id'] = local_var_params['log_group_id']
|
||
if 'log_stream_id' in local_var_params:
|
||
path_params['log_stream_id'] = local_var_params['log_stream_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/groups/{log_group_id}/streams/{log_stream_id}/struct-content/query',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ListQueryStructuredLogsResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def list_structured_logs_with_time_range(self, request):
|
||
"""查询结构化日志(新版)
|
||
|
||
该接口用于查询指定日志流下的结构化日志内容(新版)。
|
||
|
||
:param ListStructuredLogsWithTimeRangeRequest request
|
||
:return: ListStructuredLogsWithTimeRangeResponse
|
||
"""
|
||
return self.list_structured_logs_with_time_range_with_http_info(request)
|
||
|
||
def list_structured_logs_with_time_range_with_http_info(self, request):
|
||
"""查询结构化日志(新版)
|
||
|
||
该接口用于查询指定日志流下的结构化日志内容(新版)。
|
||
|
||
:param ListStructuredLogsWithTimeRangeRequest request
|
||
:return: ListStructuredLogsWithTimeRangeResponse
|
||
"""
|
||
|
||
all_params = ['log_stream_id', 'list_structured_logs_with_time_range_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'log_stream_id' in local_var_params:
|
||
path_params['log_stream_id'] = local_var_params['log_stream_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/streams/{log_stream_id}/struct-content/query',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ListStructuredLogsWithTimeRangeResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def show_struct_template(self, request):
|
||
"""查询结构化配置
|
||
|
||
该接口用于查询指定日志流下的结构化配置内容。
|
||
|
||
:param ShowStructTemplateRequest request
|
||
:return: ShowStructTemplateResponse
|
||
"""
|
||
return self.show_struct_template_with_http_info(request)
|
||
|
||
def show_struct_template_with_http_info(self, request):
|
||
"""查询结构化配置
|
||
|
||
该接口用于查询指定日志流下的结构化配置内容。
|
||
|
||
:param ShowStructTemplateRequest request
|
||
:return: ShowStructTemplateResponse
|
||
"""
|
||
|
||
all_params = ['log_group_id', 'log_stream_id']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
if 'log_group_id' in local_var_params:
|
||
query_params.append(('logGroupId', local_var_params['log_group_id']))
|
||
if 'log_stream_id' in local_var_params:
|
||
query_params.append(('logStreamId', local_var_params['log_stream_id']))
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/struct/template',
|
||
method='GET',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ShowStructTemplateResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def update_keywords_alarm_rule(self, request):
|
||
"""修改关键词告警规则
|
||
|
||
该接口用于修改关键词告警。
|
||
|
||
:param UpdateKeywordsAlarmRuleRequest request
|
||
:return: UpdateKeywordsAlarmRuleResponse
|
||
"""
|
||
return self.update_keywords_alarm_rule_with_http_info(request)
|
||
|
||
def update_keywords_alarm_rule_with_http_info(self, request):
|
||
"""修改关键词告警规则
|
||
|
||
该接口用于修改关键词告警。
|
||
|
||
:param UpdateKeywordsAlarmRuleRequest request
|
||
:return: UpdateKeywordsAlarmRuleResponse
|
||
"""
|
||
|
||
all_params = ['update_keywords_alarm_rule_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json;charset=UTF-8'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/alarms/keywords-alarm-rule',
|
||
method='PUT',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='UpdateKeywordsAlarmRuleResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def update_log_group(self, request):
|
||
"""修改日志组
|
||
|
||
该接口用于修改指定日志组下的日志存储时长。
|
||
|
||
:param UpdateLogGroupRequest request
|
||
:return: UpdateLogGroupResponse
|
||
"""
|
||
return self.update_log_group_with_http_info(request)
|
||
|
||
def update_log_group_with_http_info(self, request):
|
||
"""修改日志组
|
||
|
||
该接口用于修改指定日志组下的日志存储时长。
|
||
|
||
:param UpdateLogGroupRequest request
|
||
:return: UpdateLogGroupResponse
|
||
"""
|
||
|
||
all_params = ['log_group_id', 'update_log_group_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'log_group_id' in local_var_params:
|
||
path_params['log_group_id'] = local_var_params['log_group_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/groups/{log_group_id}',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='UpdateLogGroupResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def update_struct_template(self, request):
|
||
"""修改结构化配置
|
||
|
||
该接口用于修改指定日志流下的结构化配置。
|
||
|
||
:param UpdateStructTemplateRequest request
|
||
:return: UpdateStructTemplateResponse
|
||
"""
|
||
return self.update_struct_template_with_http_info(request)
|
||
|
||
def update_struct_template_with_http_info(self, request):
|
||
"""修改结构化配置
|
||
|
||
该接口用于修改指定日志流下的结构化配置。
|
||
|
||
:param UpdateStructTemplateRequest request
|
||
:return: UpdateStructTemplateResponse
|
||
"""
|
||
|
||
all_params = ['update_struct_template_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/struct/template',
|
||
method='PUT',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='UpdateStructTemplateResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def create_aom_mapping_rules(self, request):
|
||
"""创建日志接入lts规则
|
||
|
||
该接口用于创建aom日志接入lts规则
|
||
|
||
:param CreateAomMappingRulesRequest request
|
||
:return: CreateAomMappingRulesResponse
|
||
"""
|
||
return self.create_aom_mapping_rules_with_http_info(request)
|
||
|
||
def create_aom_mapping_rules_with_http_info(self, request):
|
||
"""创建日志接入lts规则
|
||
|
||
该接口用于创建aom日志接入lts规则
|
||
|
||
:param CreateAomMappingRulesRequest request
|
||
:return: CreateAomMappingRulesResponse
|
||
"""
|
||
|
||
all_params = ['is_batch', 'create_aom_mapping_rules_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
if 'is_batch' in local_var_params:
|
||
query_params.append(('isBatch', local_var_params['is_batch']))
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/aom-mapping',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='CreateAomMappingRulesResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def delete_aom_mapping_rules(self, request):
|
||
"""删除接入规则
|
||
|
||
该接口用于删除lts接入规则。
|
||
|
||
:param DeleteAomMappingRulesRequest request
|
||
:return: DeleteAomMappingRulesResponse
|
||
"""
|
||
return self.delete_aom_mapping_rules_with_http_info(request)
|
||
|
||
def delete_aom_mapping_rules_with_http_info(self, request):
|
||
"""删除接入规则
|
||
|
||
该接口用于删除lts接入规则。
|
||
|
||
:param DeleteAomMappingRulesRequest request
|
||
:return: DeleteAomMappingRulesResponse
|
||
"""
|
||
|
||
all_params = ['id']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
if 'id' in local_var_params:
|
||
query_params.append(('id', local_var_params['id']))
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/aom-mapping',
|
||
method='DELETE',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='DeleteAomMappingRulesResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def show_aom_mapping_rule(self, request):
|
||
"""查询接入规则
|
||
|
||
该接口用于查询单个aom日志接入lts
|
||
|
||
:param ShowAomMappingRuleRequest request
|
||
:return: ShowAomMappingRuleResponse
|
||
"""
|
||
return self.show_aom_mapping_rule_with_http_info(request)
|
||
|
||
def show_aom_mapping_rule_with_http_info(self, request):
|
||
"""查询接入规则
|
||
|
||
该接口用于查询单个aom日志接入lts
|
||
|
||
:param ShowAomMappingRuleRequest request
|
||
:return: ShowAomMappingRuleResponse
|
||
"""
|
||
|
||
all_params = ['rule_id']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'rule_id' in local_var_params:
|
||
path_params['rule_id'] = local_var_params['rule_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/aom-mapping/{rule_id}',
|
||
method='GET',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ShowAomMappingRuleResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def show_aom_mapping_rules(self, request):
|
||
"""查询接入规则
|
||
|
||
该接口用于查询aom日志所有接入lts规则
|
||
|
||
:param ShowAomMappingRulesRequest request
|
||
:return: ShowAomMappingRulesResponse
|
||
"""
|
||
return self.show_aom_mapping_rules_with_http_info(request)
|
||
|
||
def show_aom_mapping_rules_with_http_info(self, request):
|
||
"""查询接入规则
|
||
|
||
该接口用于查询aom日志所有接入lts规则
|
||
|
||
:param ShowAomMappingRulesRequest request
|
||
:return: ShowAomMappingRulesResponse
|
||
"""
|
||
|
||
all_params = []
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/aom-mapping',
|
||
method='GET',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ShowAomMappingRulesResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def update_aom_mapping_rules(self, request):
|
||
"""修改接入规则
|
||
|
||
该接口用于修改接入规则
|
||
|
||
:param UpdateAomMappingRulesRequest request
|
||
:return: UpdateAomMappingRulesResponse
|
||
"""
|
||
return self.update_aom_mapping_rules_with_http_info(request)
|
||
|
||
def update_aom_mapping_rules_with_http_info(self, request):
|
||
"""修改接入规则
|
||
|
||
该接口用于修改接入规则
|
||
|
||
:param UpdateAomMappingRulesRequest request
|
||
:return: UpdateAomMappingRulesResponse
|
||
"""
|
||
|
||
all_params = ['update_aom_mapping_rules_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/aom-mapping',
|
||
method='PUT',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='UpdateAomMappingRulesResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def create_sql_alarm_rule(self, request):
|
||
"""创建SQL告警规则
|
||
|
||
该接口用于创建SQL告警,目前每个帐户最多可以创建共200个关键词告警与SQL告警
|
||
|
||
:param CreateSqlAlarmRuleRequest request
|
||
:return: CreateSqlAlarmRuleResponse
|
||
"""
|
||
return self.create_sql_alarm_rule_with_http_info(request)
|
||
|
||
def create_sql_alarm_rule_with_http_info(self, request):
|
||
"""创建SQL告警规则
|
||
|
||
该接口用于创建SQL告警,目前每个帐户最多可以创建共200个关键词告警与SQL告警
|
||
|
||
:param CreateSqlAlarmRuleRequest request
|
||
:return: CreateSqlAlarmRuleResponse
|
||
"""
|
||
|
||
all_params = ['create_sql_alarm_rule_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json;charset=UTF-8'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/alarms/sql-alarm-rule',
|
||
method='POST',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='CreateSqlAlarmRuleResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def delete_sql_alarm_rule(self, request):
|
||
"""删除SQL告警规则
|
||
|
||
该接口用于删除SQL告警
|
||
|
||
:param DeleteSqlAlarmRuleRequest request
|
||
:return: DeleteSqlAlarmRuleResponse
|
||
"""
|
||
return self.delete_sql_alarm_rule_with_http_info(request)
|
||
|
||
def delete_sql_alarm_rule_with_http_info(self, request):
|
||
"""删除SQL告警规则
|
||
|
||
该接口用于删除SQL告警
|
||
|
||
:param DeleteSqlAlarmRuleRequest request
|
||
:return: DeleteSqlAlarmRuleResponse
|
||
"""
|
||
|
||
all_params = ['sql_alarm_rule_id']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
if 'sql_alarm_rule_id' in local_var_params:
|
||
path_params['sql_alarm_rule_id'] = local_var_params['sql_alarm_rule_id']
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/alarms/sql-alarm-rule/{sql_alarm_rule_id}',
|
||
method='DELETE',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='DeleteSqlAlarmRuleResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def list_sql_alarm_rules(self, request):
|
||
"""查询SQL告警规则
|
||
|
||
该接口用于查询SQL告警
|
||
|
||
:param ListSqlAlarmRulesRequest request
|
||
:return: ListSqlAlarmRulesResponse
|
||
"""
|
||
return self.list_sql_alarm_rules_with_http_info(request)
|
||
|
||
def list_sql_alarm_rules_with_http_info(self, request):
|
||
"""查询SQL告警规则
|
||
|
||
该接口用于查询SQL告警
|
||
|
||
:param ListSqlAlarmRulesRequest request
|
||
:return: ListSqlAlarmRulesResponse
|
||
"""
|
||
|
||
all_params = []
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/alarms/sql-alarm-rule',
|
||
method='GET',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='ListSqlAlarmRulesResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def update_sql_alarm_rule(self, request):
|
||
"""修改SQL告警规则
|
||
|
||
该接口用于修改SQL告警
|
||
|
||
:param UpdateSqlAlarmRuleRequest request
|
||
:return: UpdateSqlAlarmRuleResponse
|
||
"""
|
||
return self.update_sql_alarm_rule_with_http_info(request)
|
||
|
||
def update_sql_alarm_rule_with_http_info(self, request):
|
||
"""修改SQL告警规则
|
||
|
||
该接口用于修改SQL告警
|
||
|
||
:param UpdateSqlAlarmRuleRequest request
|
||
:return: UpdateSqlAlarmRuleResponse
|
||
"""
|
||
|
||
all_params = ['update_sql_alarm_rule_request_body']
|
||
local_var_params = {}
|
||
for attr in request.attribute_map:
|
||
if hasattr(request, attr):
|
||
local_var_params[attr] = getattr(request, attr)
|
||
|
||
collection_formats = {}
|
||
|
||
path_params = {}
|
||
|
||
query_params = []
|
||
|
||
header_params = {}
|
||
|
||
form_params = {}
|
||
|
||
body_params = None
|
||
if 'body' in local_var_params:
|
||
body_params = local_var_params['body']
|
||
if isinstance(request, SdkStreamRequest):
|
||
body_params = request.get_file_stream()
|
||
|
||
response_headers = []
|
||
|
||
header_params['Content-Type'] = http_utils.select_header_content_type(
|
||
['application/json;charset=UTF-8'])
|
||
|
||
auth_settings = []
|
||
|
||
return self.call_api(
|
||
resource_path='/v2/{project_id}/lts/alarms/sql-alarm-rule',
|
||
method='PUT',
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body_params,
|
||
post_params=form_params,
|
||
response_type='UpdateSqlAlarmRuleResponse',
|
||
response_headers=response_headers,
|
||
auth_settings=auth_settings,
|
||
collection_formats=collection_formats,
|
||
request_type=request.__class__.__name__)
|
||
|
||
|
||
def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
|
||
post_params=None, response_type=None, response_headers=None, auth_settings=None,
|
||
collection_formats=None, request_type=None):
|
||
"""Makes the HTTP request and returns deserialized data.
|
||
|
||
:param resource_path: Path to method endpoint.
|
||
:param method: Method to call.
|
||
:param path_params: Path parameters in the url.
|
||
:param query_params: Query parameters in the url.
|
||
:param header_params: Header parameters to be placed in the request header.
|
||
:param body: Request body.
|
||
:param post_params dict: Request post form parameters,
|
||
for `application/x-www-form-urlencoded`, `multipart/form-data`.
|
||
:param auth_settings list: Auth Settings names for the request.
|
||
:param response_type: Response data type.
|
||
:param response_headers: Header should be added to response data.
|
||
:param collection_formats: dict of collection formats for path, query,
|
||
header, and post parameters.
|
||
:param request_type: Request data type.
|
||
:return:
|
||
Return the response directly.
|
||
"""
|
||
return self.do_http_request(
|
||
method=method,
|
||
resource_path=resource_path,
|
||
path_params=path_params,
|
||
query_params=query_params,
|
||
header_params=header_params,
|
||
body=body,
|
||
post_params=post_params,
|
||
response_type=response_type,
|
||
response_headers=response_headers,
|
||
collection_formats=collection_formats,
|
||
request_type=request_type)
|