huaweicloud-sdk-python-v3/huaweicloud-sdk-antiddos/huaweicloudsdkantiddos/v1/antiddos_async_client.py

915 lines
32 KiB
Python
Raw Normal View History

2021-08-17 07:57:38 +00:00
# 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 AntiDDoSAsyncClient(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(AntiDDoSAsyncClient, self).__init__()
self.model_package = importlib.import_module("huaweicloudsdkantiddos.v1.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__ != "AntiDDoSClient":
raise TypeError("client type error, support client type is AntiDDoSClient")
return ClientBuilder(clazz)
def create_default_config_async(self, request):
"""配置Anti-DDoS默认防护策略
配置用户的默认防护策略配置防护策略后新购买的资源在自动开启防护时会按照该默认防护策略进行配置
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for CreateDefaultConfig
:type request: :class:`huaweicloudsdkantiddos.v1.CreateDefaultConfigRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.CreateDefaultConfigResponse`
2021-08-17 07:57:38 +00:00
"""
return self.create_default_config_with_http_info(request)
def create_default_config_with_http_info(self, request):
all_params = ['create_default_config_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='/v1/{project_id}/antiddos/default-config',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='CreateDefaultConfigResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def delete_default_config_async(self, request):
"""删除Ani-DDoS默认防护策略
删除用户配置的默认防护策略
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for DeleteDefaultConfig
:type request: :class:`huaweicloudsdkantiddos.v1.DeleteDefaultConfigRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.DeleteDefaultConfigResponse`
2021-08-17 07:57:38 +00:00
"""
return self.delete_default_config_with_http_info(request)
def delete_default_config_with_http_info(self, request):
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='/v1/{project_id}/antiddos/default-config',
method='DELETE',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='DeleteDefaultConfigResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_alert_config_async(self, request):
"""查询告警配置信息
查询用户配置信息用户可以通过此接口查询是否接收某类告警同时可以配置是手机短信还是电子邮件接收告警信息
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for ShowAlertConfig
:type request: :class:`huaweicloudsdkantiddos.v1.ShowAlertConfigRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.ShowAlertConfigResponse`
2021-08-17 07:57:38 +00:00
"""
return self.show_alert_config_with_http_info(request)
def show_alert_config_with_http_info(self, request):
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}/warnalert/alertconfig/query',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowAlertConfigResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_default_config_async(self, request):
"""查询Ani-DDoS默认防护策略
查询用户配置的默认防护策略
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for ShowDefaultConfig
:type request: :class:`huaweicloudsdkantiddos.v1.ShowDefaultConfigRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.ShowDefaultConfigResponse`
2021-08-17 07:57:38 +00:00
"""
return self.show_default_config_with_http_info(request)
def show_default_config_with_http_info(self, request):
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='/v1/{project_id}/antiddos/default-config',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowDefaultConfigResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_alert_config_async(self, request):
"""更新告警配置信息
更新用户配置信息用户可以通过此接口更新是否接收某类告警同时可以配置是手机短信还是电子邮件接收告警信息
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for UpdateAlertConfig
:type request: :class:`huaweicloudsdkantiddos.v1.UpdateAlertConfigRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.UpdateAlertConfigResponse`
2021-08-17 07:57:38 +00:00
"""
return self.update_alert_config_with_http_info(request)
def update_alert_config_with_http_info(self, request):
all_params = ['update_alert_config_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}/warnalert/alertconfig/update',
method='POST',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='UpdateAlertConfigResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_d_dos_status_async(self, request):
"""查询EIP防护状态列表
查询用户所有EIP的Anti-DDoS防护状态信息用户的EIP无论是否绑定到云服务器都可以进行查询
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for ListDDosStatus
:type request: :class:`huaweicloudsdkantiddos.v1.ListDDosStatusRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.ListDDosStatusResponse`
2021-08-17 07:57:38 +00:00
"""
return self.list_d_dos_status_with_http_info(request)
def list_d_dos_status_with_http_info(self, request):
all_params = ['status', 'limit', 'offset', 'ip']
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 'status' in local_var_params:
query_params.append(('status', local_var_params['status']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'ip' in local_var_params:
query_params.append(('ip', local_var_params['ip']))
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='/v1/{project_id}/antiddos',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListDDosStatusResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_daily_log_async(self, request):
"""查询指定EIP异常事件
查询指定EIP在过去24小时之内的异常事件信息异常事件包括清洗事件和黑洞事件查询延迟在5分钟之内
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for ListDailyLog
:type request: :class:`huaweicloudsdkantiddos.v1.ListDailyLogRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.ListDailyLogResponse`
2021-08-17 07:57:38 +00:00
"""
return self.list_daily_log_with_http_info(request)
def list_daily_log_with_http_info(self, request):
all_params = ['floating_ip_id', 'sort_dir', 'limit', 'offset', 'ip']
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 'floating_ip_id' in local_var_params:
path_params['floating_ip_id'] = local_var_params['floating_ip_id']
query_params = []
if 'sort_dir' in local_var_params:
query_params.append(('sort_dir', local_var_params['sort_dir']))
if 'limit' in local_var_params:
query_params.append(('limit', local_var_params['limit']))
if 'offset' in local_var_params:
query_params.append(('offset', local_var_params['offset']))
if 'ip' in local_var_params:
query_params.append(('ip', local_var_params['ip']))
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='/v1/{project_id}/antiddos/{floating_ip_id}/logs',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListDailyLogResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_daily_report_async(self, request):
"""查询指定EIP防护流量
查询指定EIP在过去24小时之内的防护流量信息流量的间隔时间单位为5分钟
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for ListDailyReport
:type request: :class:`huaweicloudsdkantiddos.v1.ListDailyReportRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.ListDailyReportResponse`
2021-08-17 07:57:38 +00:00
"""
return self.list_daily_report_with_http_info(request)
def list_daily_report_with_http_info(self, request):
all_params = ['floating_ip_id', 'ip']
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 'floating_ip_id' in local_var_params:
path_params['floating_ip_id'] = local_var_params['floating_ip_id']
query_params = []
if 'ip' in local_var_params:
query_params.append(('ip', local_var_params['ip']))
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='/v1/{project_id}/antiddos/{floating_ip_id}/daily',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListDailyReportResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_new_configs_async(self, request):
"""查询Anti-DDoS配置可选范围
查询系统支持的Anti-DDoS防护策略配置的可选范围用户根据范围列表选择适合自已业务的防护策略进行Anti-DDoS流量清洗
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for ListNewConfigs
:type request: :class:`huaweicloudsdkantiddos.v1.ListNewConfigsRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.ListNewConfigsResponse`
2021-08-17 07:57:38 +00:00
"""
return self.list_new_configs_with_http_info(request)
def list_new_configs_with_http_info(self, request):
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}/antiddos/query-config-list',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListNewConfigsResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def list_weekly_reports_async(self, request):
"""查询周防护统计情况
查询用户所有Anti-DDoS防护周统计情况包括一周内DDoS拦截次数和攻击次数以及按照被攻击次数进行的排名信息等统计数据系统支持当前时间之前四周的周统计数据查询超过这个时间的请求是查询不到统计数据的
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for ListWeeklyReports
:type request: :class:`huaweicloudsdkantiddos.v1.ListWeeklyReportsRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.ListWeeklyReportsResponse`
2021-08-17 07:57:38 +00:00
"""
return self.list_weekly_reports_with_http_info(request)
def list_weekly_reports_with_http_info(self, request):
all_params = ['period_start_date']
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 'period_start_date' in local_var_params:
query_params.append(('period_start_date', local_var_params['period_start_date']))
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='/v1/{project_id}/antiddos/weekly',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ListWeeklyReportsResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_d_dos_async(self, request):
"""查询Anti-DDoS服务
查询配置的Anti-DDoS防护策略用户可以查询指定EIP的Anti-DDoS防护策略
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for ShowDDos
:type request: :class:`huaweicloudsdkantiddos.v1.ShowDDosRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.ShowDDosResponse`
2021-08-17 07:57:38 +00:00
"""
return self.show_d_dos_with_http_info(request)
def show_d_dos_with_http_info(self, request):
all_params = ['floating_ip_id', 'ip']
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 'floating_ip_id' in local_var_params:
path_params['floating_ip_id'] = local_var_params['floating_ip_id']
query_params = []
if 'ip' in local_var_params:
query_params.append(('ip', local_var_params['ip']))
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='/v1/{project_id}/antiddos/{floating_ip_id}',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowDDosResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_d_dos_status_async(self, request):
"""查询指定EIP防护状态
查询指定EIP的Anti-DDoS防护状态
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for ShowDDosStatus
:type request: :class:`huaweicloudsdkantiddos.v1.ShowDDosStatusRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.ShowDDosStatusResponse`
2021-08-17 07:57:38 +00:00
"""
return self.show_d_dos_status_with_http_info(request)
def show_d_dos_status_with_http_info(self, request):
all_params = ['floating_ip_id', 'ip']
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 'floating_ip_id' in local_var_params:
path_params['floating_ip_id'] = local_var_params['floating_ip_id']
query_params = []
if 'ip' in local_var_params:
query_params.append(('ip', local_var_params['ip']))
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='/v1/{project_id}/antiddos/{floating_ip_id}/status',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowDDosStatusResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def show_new_task_status_async(self, request):
"""查询Anti-DDoS任务
用户查询指定的Anti-DDoS防护配置任务得到任务当前执行的状态
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for ShowNewTaskStatus
:type request: :class:`huaweicloudsdkantiddos.v1.ShowNewTaskStatusRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.ShowNewTaskStatusResponse`
2021-08-17 07:57:38 +00:00
"""
return self.show_new_task_status_with_http_info(request)
def show_new_task_status_with_http_info(self, request):
all_params = ['task_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 'task_id' in local_var_params:
query_params.append(('task_id', local_var_params['task_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}/query-task-status',
method='GET',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='ShowNewTaskStatusResponse',
response_headers=response_headers,
auth_settings=auth_settings,
collection_formats=collection_formats,
request_type=request.__class__.__name__)
def update_d_dos_async(self, request):
"""更新Anti-DDoS服务
更新指定EIP的Anti-DDoS防护策略配置调用成功只是说明服务节点收到了关闭更新配置请求操作是否成功需要通过任务查询接口查询该任务的执行状态具体请参考查询Anti-DDoS任务
2022-04-21 12:03:46 +00:00
详细说明请参考华为云API Explorer
Please refer to Huawei cloud API Explorer for details.
2021-08-17 07:57:38 +00:00
2022-04-21 12:03:46 +00:00
:param request: Request instance for UpdateDDos
:type request: :class:`huaweicloudsdkantiddos.v1.UpdateDDosRequest`
:rtype: :class:`huaweicloudsdkantiddos.v1.UpdateDDosResponse`
2021-08-17 07:57:38 +00:00
"""
return self.update_d_dos_with_http_info(request)
def update_d_dos_with_http_info(self, request):
all_params = ['floating_ip_id', 'update_d_dos_request_body', 'ip']
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 'floating_ip_id' in local_var_params:
path_params['floating_ip_id'] = local_var_params['floating_ip_id']
query_params = []
if 'ip' in local_var_params:
query_params.append(('ip', local_var_params['ip']))
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='/v1/{project_id}/antiddos/{floating_ip_id}',
method='PUT',
path_params=path_params,
query_params=query_params,
header_params=header_params,
body=body_params,
post_params=form_params,
response_type='UpdateDDosResponse',
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,
async_request=True)