2020-06-15 07:04:23 +00:00
|
|
|
|
# coding: utf-8
|
|
|
|
|
|
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
|
|
import datetime
|
|
|
|
|
import re
|
|
|
|
|
import importlib
|
|
|
|
|
|
|
|
|
|
import six
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
from huaweicloudsdkcore.client import Client, ClientBuilder
|
2020-06-15 07:04:23 +00:00
|
|
|
|
from huaweicloudsdkcore.exceptions import exceptions
|
|
|
|
|
from huaweicloudsdkcore.utils import http_utils
|
2020-07-15 09:30:15 +00:00
|
|
|
|
from huaweicloudsdkcore.sdk_stream_request import SdkStreamRequest
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CtsAsyncClient(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(CtsAsyncClient, self).__init__()
|
2020-06-30 12:45:36 +00:00
|
|
|
|
self.model_package = importlib.import_module("huaweicloudsdkcts.v3.model")
|
2020-06-15 07:04:23 +00:00
|
|
|
|
self.preset_headers = {'User-Agent': 'HuaweiCloud-SDK-Python'}
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
@staticmethod
|
|
|
|
|
def new_builder(clazz):
|
|
|
|
|
return ClientBuilder(clazz)
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
def create_tracker_async(self, request):
|
|
|
|
|
"""创建追踪器
|
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
云审计服务开通后系统会自动创建一个追踪器,用来关联系统记录的所有操作。目前,一个云账户在一个Region下支持创建一个管理类追踪器和多个数据类追踪器。 云审计服务支持在管理控制台查询近7天内的操作记录。如需保存更长时间的操作记录,您可以在创建追踪器之后通过对象存储服务(Object Storage Service,以下简称OBS)将操作记录实时保存至OBS桶中。
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
:param CreateTrackerRequest request
|
|
|
|
|
:return: CreateTrackerResponse
|
|
|
|
|
"""
|
|
|
|
|
return self.create_tracker_with_http_info(request)
|
|
|
|
|
|
|
|
|
|
def create_tracker_with_http_info(self, request):
|
|
|
|
|
"""创建追踪器
|
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
云审计服务开通后系统会自动创建一个追踪器,用来关联系统记录的所有操作。目前,一个云账户在一个Region下支持创建一个管理类追踪器和多个数据类追踪器。 云审计服务支持在管理控制台查询近7天内的操作记录。如需保存更长时间的操作记录,您可以在创建追踪器之后通过对象存储服务(Object Storage Service,以下简称OBS)将操作记录实时保存至OBS桶中。
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
:param CreateTrackerRequest request
|
2020-07-15 09:30:15 +00:00
|
|
|
|
:return: CreateTrackerResponse
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
all_params = ['create_tracker_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 = {}
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
form_params = {}
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
body_params = None
|
|
|
|
|
if 'body' in local_var_params:
|
|
|
|
|
body_params = local_var_params['body']
|
2020-07-15 09:30:15 +00:00
|
|
|
|
if isinstance(request, SdkStreamRequest):
|
|
|
|
|
body_params = request.get_file_stream()
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
2020-08-28 10:16:33 +00:00
|
|
|
|
['application/json;charset=UTF-8'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-06-15 07:04:23 +00:00
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
2020-07-15 09:30:15 +00:00
|
|
|
|
resource_path='/v3/{project_id}/tracker',
|
|
|
|
|
method='POST',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
2020-06-15 07:04:23 +00:00
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
|
|
|
|
response_type='CreateTrackerResponse',
|
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-06-15 07:04:23 +00:00
|
|
|
|
def delete_tracker_async(self, request):
|
|
|
|
|
"""删除追踪器
|
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
云审计服务目前仅支持删除已创建的数据类追踪器。删除追踪器对已有的操作记录没有影响,当您重新开通云审计服务后,依旧可以查看已有的操作记录。
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
:param DeleteTrackerRequest request
|
2020-07-15 09:30:15 +00:00
|
|
|
|
:return: DeleteTrackerResponse
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""
|
|
|
|
|
return self.delete_tracker_with_http_info(request)
|
|
|
|
|
|
|
|
|
|
def delete_tracker_with_http_info(self, request):
|
|
|
|
|
"""删除追踪器
|
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
云审计服务目前仅支持删除已创建的数据类追踪器。删除追踪器对已有的操作记录没有影响,当您重新开通云审计服务后,依旧可以查看已有的操作记录。
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
:param DeleteTrackerRequest request
|
2020-07-15 09:30:15 +00:00
|
|
|
|
:return: DeleteTrackerResponse
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""
|
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
all_params = ['tracker_name', 'tracker_type']
|
2020-06-15 07:04:23 +00:00
|
|
|
|
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 'tracker_name' in local_var_params:
|
|
|
|
|
query_params.append(('tracker_name', local_var_params['tracker_name']))
|
2020-06-30 12:45:36 +00:00
|
|
|
|
if 'tracker_type' in local_var_params:
|
|
|
|
|
query_params.append(('tracker_type', local_var_params['tracker_type']))
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
header_params = {}
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
form_params = {}
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
body_params = None
|
2020-07-15 09:30:15 +00:00
|
|
|
|
if isinstance(request, SdkStreamRequest):
|
|
|
|
|
body_params = request.get_file_stream()
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
2020-07-15 09:30:15 +00:00
|
|
|
|
resource_path='/v3/{project_id}/trackers',
|
|
|
|
|
method='DELETE',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
2020-06-15 07:04:23 +00:00
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
response_type='DeleteTrackerResponse',
|
2020-06-15 07:04:23 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
def list_traces_async(self, request):
|
|
|
|
|
"""查询事件列表
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
通过事件列表查询接口,可以查出系统记录的7天内资源操作记录。
|
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
:param ListTracesRequest request
|
|
|
|
|
:return: ListTracesResponse
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""
|
2020-06-30 12:45:36 +00:00
|
|
|
|
return self.list_traces_with_http_info(request)
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
def list_traces_with_http_info(self, request):
|
|
|
|
|
"""查询事件列表
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
通过事件列表查询接口,可以查出系统记录的7天内资源操作记录。
|
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
:param ListTracesRequest request
|
2020-07-15 09:30:15 +00:00
|
|
|
|
:return: ListTracesResponse
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""
|
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
all_params = ['trace_type', 'limit', '_from', 'next', 'to', 'tracker_name', 'service_type', 'user', 'resource_id', 'resource_name', 'resource_type', 'trace_id', 'trace_name', 'trace_rating']
|
2020-06-15 07:04:23 +00:00
|
|
|
|
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 = []
|
2020-06-30 12:45:36 +00:00
|
|
|
|
if 'trace_type' in local_var_params:
|
|
|
|
|
query_params.append(('trace_type', local_var_params['trace_type']))
|
2020-06-15 07:04:23 +00:00
|
|
|
|
if 'limit' in local_var_params:
|
|
|
|
|
query_params.append(('limit', local_var_params['limit']))
|
2020-06-30 12:45:36 +00:00
|
|
|
|
if '_from' in local_var_params:
|
|
|
|
|
query_params.append(('from', local_var_params['_from']))
|
2020-06-15 07:04:23 +00:00
|
|
|
|
if 'next' in local_var_params:
|
|
|
|
|
query_params.append(('next', local_var_params['next']))
|
2020-06-30 12:45:36 +00:00
|
|
|
|
if 'to' in local_var_params:
|
|
|
|
|
query_params.append(('to', local_var_params['to']))
|
|
|
|
|
if 'tracker_name' in local_var_params:
|
|
|
|
|
query_params.append(('tracker_name', local_var_params['tracker_name']))
|
|
|
|
|
if 'service_type' in local_var_params:
|
|
|
|
|
query_params.append(('service_type', local_var_params['service_type']))
|
|
|
|
|
if 'user' in local_var_params:
|
|
|
|
|
query_params.append(('user', local_var_params['user']))
|
2020-06-15 07:04:23 +00:00
|
|
|
|
if 'resource_id' in local_var_params:
|
|
|
|
|
query_params.append(('resource_id', local_var_params['resource_id']))
|
|
|
|
|
if 'resource_name' in local_var_params:
|
|
|
|
|
query_params.append(('resource_name', local_var_params['resource_name']))
|
|
|
|
|
if 'resource_type' in local_var_params:
|
|
|
|
|
query_params.append(('resource_type', local_var_params['resource_type']))
|
|
|
|
|
if 'trace_id' in local_var_params:
|
|
|
|
|
query_params.append(('trace_id', local_var_params['trace_id']))
|
|
|
|
|
if 'trace_name' in local_var_params:
|
|
|
|
|
query_params.append(('trace_name', local_var_params['trace_name']))
|
|
|
|
|
if 'trace_rating' in local_var_params:
|
|
|
|
|
query_params.append(('trace_rating', local_var_params['trace_rating']))
|
|
|
|
|
|
|
|
|
|
header_params = {}
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
form_params = {}
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
body_params = None
|
2020-07-15 09:30:15 +00:00
|
|
|
|
if isinstance(request, SdkStreamRequest):
|
|
|
|
|
body_params = request.get_file_stream()
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
2020-07-15 09:30:15 +00:00
|
|
|
|
resource_path='/v3/{project_id}/traces',
|
|
|
|
|
method='GET',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
2020-06-15 07:04:23 +00:00
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-06-30 12:45:36 +00:00
|
|
|
|
response_type='ListTracesResponse',
|
2020-06-15 07:04:23 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
def list_trackers_async(self, request):
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""查询追踪器
|
|
|
|
|
|
2020-08-28 10:16:33 +00:00
|
|
|
|
开通云审计服务成功后,您可以在追踪器信息页面查看追踪器的详细信息。详细信息主要包括追踪器名称,用于存储操作事件的OBS桶名称和OBS桶中的事件文件前缀。
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
:param ListTrackersRequest request
|
|
|
|
|
:return: ListTrackersResponse
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""
|
2020-06-30 12:45:36 +00:00
|
|
|
|
return self.list_trackers_with_http_info(request)
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
def list_trackers_with_http_info(self, request):
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""查询追踪器
|
|
|
|
|
|
2020-08-28 10:16:33 +00:00
|
|
|
|
开通云审计服务成功后,您可以在追踪器信息页面查看追踪器的详细信息。详细信息主要包括追踪器名称,用于存储操作事件的OBS桶名称和OBS桶中的事件文件前缀。
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
:param ListTrackersRequest request
|
2020-07-15 09:30:15 +00:00
|
|
|
|
:return: ListTrackersResponse
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""
|
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
all_params = ['tracker_name', 'tracker_type']
|
2020-06-15 07:04:23 +00:00
|
|
|
|
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 'tracker_name' in local_var_params:
|
|
|
|
|
query_params.append(('tracker_name', local_var_params['tracker_name']))
|
2020-06-30 12:45:36 +00:00
|
|
|
|
if 'tracker_type' in local_var_params:
|
|
|
|
|
query_params.append(('tracker_type', local_var_params['tracker_type']))
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
header_params = {}
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
form_params = {}
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
body_params = None
|
2020-07-15 09:30:15 +00:00
|
|
|
|
if isinstance(request, SdkStreamRequest):
|
|
|
|
|
body_params = request.get_file_stream()
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
2020-07-15 09:30:15 +00:00
|
|
|
|
resource_path='/v3/{project_id}/trackers',
|
|
|
|
|
method='GET',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
2020-06-15 07:04:23 +00:00
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-06-30 12:45:36 +00:00
|
|
|
|
response_type='ListTrackersResponse',
|
2020-06-15 07:04:23 +00:00
|
|
|
|
auth_settings=auth_settings,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request.__class__.__name__)
|
|
|
|
|
|
2020-07-30 11:19:13 +00:00
|
|
|
|
|
2020-06-15 07:04:23 +00:00
|
|
|
|
def update_tracker_async(self, request):
|
|
|
|
|
"""修改追踪器
|
|
|
|
|
|
|
|
|
|
云审计服务支持修改已创建追踪器的配置项,包括OBS桶转储、关键事件通知、事件转储加密、通过LTS对管理类事件进行检索、事件文件完整性校验以及追踪器启停状态等相关参数,修改追踪器对已有的操作记录没有影响。修改追踪器完成后,系统立即以新的规则开始记录操作。
|
|
|
|
|
|
|
|
|
|
:param UpdateTrackerRequest request
|
2020-07-15 09:30:15 +00:00
|
|
|
|
:return: UpdateTrackerResponse
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""
|
|
|
|
|
return self.update_tracker_with_http_info(request)
|
|
|
|
|
|
|
|
|
|
def update_tracker_with_http_info(self, request):
|
|
|
|
|
"""修改追踪器
|
|
|
|
|
|
|
|
|
|
云审计服务支持修改已创建追踪器的配置项,包括OBS桶转储、关键事件通知、事件转储加密、通过LTS对管理类事件进行检索、事件文件完整性校验以及追踪器启停状态等相关参数,修改追踪器对已有的操作记录没有影响。修改追踪器完成后,系统立即以新的规则开始记录操作。
|
|
|
|
|
|
|
|
|
|
:param UpdateTrackerRequest request
|
2020-07-15 09:30:15 +00:00
|
|
|
|
:return: UpdateTrackerResponse
|
2020-06-15 07:04:23 +00:00
|
|
|
|
"""
|
|
|
|
|
|
2020-06-30 12:45:36 +00:00
|
|
|
|
all_params = ['update_tracker_request_body']
|
2020-06-15 07:04:23 +00:00
|
|
|
|
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 = {}
|
|
|
|
|
|
2020-07-15 09:30:15 +00:00
|
|
|
|
form_params = {}
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
body_params = None
|
|
|
|
|
if 'body' in local_var_params:
|
|
|
|
|
body_params = local_var_params['body']
|
2020-07-15 09:30:15 +00:00
|
|
|
|
if isinstance(request, SdkStreamRequest):
|
|
|
|
|
body_params = request.get_file_stream()
|
2020-06-15 07:04:23 +00:00
|
|
|
|
|
|
|
|
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
2020-08-28 10:16:33 +00:00
|
|
|
|
['application/json;charset=UTF-8'])
|
2020-07-15 09:30:15 +00:00
|
|
|
|
|
2020-06-15 07:04:23 +00:00
|
|
|
|
auth_settings = []
|
|
|
|
|
|
|
|
|
|
return self.call_api(
|
2020-07-15 09:30:15 +00:00
|
|
|
|
resource_path='/v3/{project_id}/tracker',
|
|
|
|
|
method='PUT',
|
|
|
|
|
path_params=path_params,
|
|
|
|
|
query_params=query_params,
|
|
|
|
|
header_params=header_params,
|
2020-06-15 07:04:23 +00:00
|
|
|
|
body=body_params,
|
|
|
|
|
post_params=form_params,
|
2020-07-15 09:30:15 +00:00
|
|
|
|
response_type='UpdateTrackerResponse',
|
2020-06-15 07:04:23 +00:00
|
|
|
|
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, 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 collection_formats: dict of collection formats for path, query,
|
|
|
|
|
header, and post parameters.
|
|
|
|
|
:return:
|
|
|
|
|
Return the response directly.
|
|
|
|
|
"""
|
2020-07-15 09:30:15 +00:00
|
|
|
|
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,
|
|
|
|
|
collection_formats=collection_formats,
|
|
|
|
|
request_type=request_type,
|
|
|
|
|
async_request=True)
|