Skip to content

Commit 059e5d0

Browse files
author
BitsAdmin
committed
Merge branch 'vefaas-Python-2024-06-06-online-1119-2025_04_22_20_32_36' into 'integration_2025-04-24_877407559426'
feat: [development task] vefaas-1119-Python (1181061) See merge request iaasng/volcengine-python-sdk!577
2 parents 4f8ec28 + cfd8661 commit 059e5d0

10 files changed

+612
-5
lines changed

volcenginesdkvefaas/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@
133133
from volcenginesdkvefaas.models.tag_for_list_functions_output import TagForListFunctionsOutput
134134
from volcenginesdkvefaas.models.tag_for_update_function_input import TagForUpdateFunctionInput
135135
from volcenginesdkvefaas.models.tag_for_update_function_output import TagForUpdateFunctionOutput
136+
from volcenginesdkvefaas.models.terminate_async_task_request import TerminateAsyncTaskRequest
137+
from volcenginesdkvefaas.models.terminate_async_task_response import TerminateAsyncTaskResponse
136138
from volcenginesdkvefaas.models.tls_config_for_create_function_input import TlsConfigForCreateFunctionInput
137139
from volcenginesdkvefaas.models.tls_config_for_create_function_output import TlsConfigForCreateFunctionOutput
138140
from volcenginesdkvefaas.models.tls_config_for_get_function_output import TlsConfigForGetFunctionOutput

volcenginesdkvefaas/api/vefaas_api.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,6 +2167,103 @@ def release_with_http_info(self, body, **kwargs): # noqa: E501
21672167
_request_timeout=params.get('_request_timeout'),
21682168
collection_formats=collection_formats)
21692169

2170+
def terminate_async_task(self, body, **kwargs): # noqa: E501
2171+
"""terminate_async_task # noqa: E501
2172+
2173+
This method makes a synchronous HTTP request by default. To make an
2174+
asynchronous HTTP request, please pass async_req=True
2175+
>>> thread = api.terminate_async_task(body, async_req=True)
2176+
>>> result = thread.get()
2177+
2178+
:param async_req bool
2179+
:param TerminateAsyncTaskRequest body: (required)
2180+
:return: TerminateAsyncTaskResponse
2181+
If the method is called asynchronously,
2182+
returns the request thread.
2183+
"""
2184+
kwargs['_return_http_data_only'] = True
2185+
if kwargs.get('async_req'):
2186+
return self.terminate_async_task_with_http_info(body, **kwargs) # noqa: E501
2187+
else:
2188+
(data) = self.terminate_async_task_with_http_info(body, **kwargs) # noqa: E501
2189+
return data
2190+
2191+
def terminate_async_task_with_http_info(self, body, **kwargs): # noqa: E501
2192+
"""terminate_async_task # noqa: E501
2193+
2194+
This method makes a synchronous HTTP request by default. To make an
2195+
asynchronous HTTP request, please pass async_req=True
2196+
>>> thread = api.terminate_async_task_with_http_info(body, async_req=True)
2197+
>>> result = thread.get()
2198+
2199+
:param async_req bool
2200+
:param TerminateAsyncTaskRequest body: (required)
2201+
:return: TerminateAsyncTaskResponse
2202+
If the method is called asynchronously,
2203+
returns the request thread.
2204+
"""
2205+
2206+
all_params = ['body'] # noqa: E501
2207+
all_params.append('async_req')
2208+
all_params.append('_return_http_data_only')
2209+
all_params.append('_preload_content')
2210+
all_params.append('_request_timeout')
2211+
2212+
params = locals()
2213+
for key, val in six.iteritems(params['kwargs']):
2214+
if key not in all_params:
2215+
raise TypeError(
2216+
"Got an unexpected keyword argument '%s'"
2217+
" to method terminate_async_task" % key
2218+
)
2219+
params[key] = val
2220+
del params['kwargs']
2221+
# verify the required parameter 'body' is set
2222+
if self.api_client.client_side_validation and ('body' not in params or
2223+
params['body'] is None): # noqa: E501
2224+
raise ValueError("Missing the required parameter `body` when calling `terminate_async_task`") # noqa: E501
2225+
2226+
collection_formats = {}
2227+
2228+
path_params = {}
2229+
2230+
query_params = []
2231+
2232+
header_params = {}
2233+
2234+
form_params = []
2235+
local_var_files = {}
2236+
2237+
body_params = None
2238+
if 'body' in params:
2239+
body_params = params['body']
2240+
# HTTP header `Accept`
2241+
header_params['Accept'] = self.api_client.select_header_accept(
2242+
['application/json']) # noqa: E501
2243+
2244+
# HTTP header `Content-Type`
2245+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
2246+
['application/json']) # noqa: E501
2247+
2248+
# Authentication setting
2249+
auth_settings = ['volcengineSign'] # noqa: E501
2250+
2251+
return self.api_client.call_api(
2252+
'/TerminateAsyncTask/2024-06-06/vefaas/post/application_json/', 'POST',
2253+
path_params,
2254+
query_params,
2255+
header_params,
2256+
body=body_params,
2257+
post_params=form_params,
2258+
files=local_var_files,
2259+
response_type='TerminateAsyncTaskResponse', # noqa: E501
2260+
auth_settings=auth_settings,
2261+
async_req=params.get('async_req'),
2262+
_return_http_data_only=params.get('_return_http_data_only'),
2263+
_preload_content=params.get('_preload_content', True),
2264+
_request_timeout=params.get('_request_timeout'),
2265+
collection_formats=collection_formats)
2266+
21702267
def update_function(self, body, **kwargs): # noqa: E501
21712268
"""update_function # noqa: E501
21722269

volcenginesdkvefaas/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@
129129
from volcenginesdkvefaas.models.tag_for_list_functions_output import TagForListFunctionsOutput
130130
from volcenginesdkvefaas.models.tag_for_update_function_input import TagForUpdateFunctionInput
131131
from volcenginesdkvefaas.models.tag_for_update_function_output import TagForUpdateFunctionOutput
132+
from volcenginesdkvefaas.models.terminate_async_task_request import TerminateAsyncTaskRequest
133+
from volcenginesdkvefaas.models.terminate_async_task_response import TerminateAsyncTaskResponse
132134
from volcenginesdkvefaas.models.tls_config_for_create_function_input import TlsConfigForCreateFunctionInput
133135
from volcenginesdkvefaas.models.tls_config_for_create_function_output import TlsConfigForCreateFunctionOutput
134136
from volcenginesdkvefaas.models.tls_config_for_get_function_output import TlsConfigForGetFunctionOutput

volcenginesdkvefaas/models/create_kafka_trigger_request.py

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class CreateKafkaTriggerRequest(object):
3333
and the value is json key in definition.
3434
"""
3535
swagger_types = {
36+
'batch_flush_duration_milliseconds': 'int',
37+
'batch_size': 'int',
3638
'description': 'str',
3739
'enabled': 'bool',
3840
'function_id': 'str',
@@ -45,6 +47,8 @@ class CreateKafkaTriggerRequest(object):
4547
}
4648

4749
attribute_map = {
50+
'batch_flush_duration_milliseconds': 'BatchFlushDurationMilliseconds',
51+
'batch_size': 'BatchSize',
4852
'description': 'Description',
4953
'enabled': 'Enabled',
5054
'function_id': 'FunctionId',
@@ -56,12 +60,14 @@ class CreateKafkaTriggerRequest(object):
5660
'topic_name': 'TopicName'
5761
}
5862

59-
def __init__(self, description=None, enabled=None, function_id=None, kafka_credentials=None, maximum_retry_attempts=None, mq_instance_id=None, name=None, starting_position=None, topic_name=None, _configuration=None): # noqa: E501
63+
def __init__(self, batch_flush_duration_milliseconds=None, batch_size=None, description=None, enabled=None, function_id=None, kafka_credentials=None, maximum_retry_attempts=None, mq_instance_id=None, name=None, starting_position=None, topic_name=None, _configuration=None): # noqa: E501
6064
"""CreateKafkaTriggerRequest - a model defined in Swagger""" # noqa: E501
6165
if _configuration is None:
6266
_configuration = Configuration()
6367
self._configuration = _configuration
6468

69+
self._batch_flush_duration_milliseconds = None
70+
self._batch_size = None
6571
self._description = None
6672
self._enabled = None
6773
self._function_id = None
@@ -73,6 +79,10 @@ def __init__(self, description=None, enabled=None, function_id=None, kafka_crede
7379
self._topic_name = None
7480
self.discriminator = None
7581

82+
if batch_flush_duration_milliseconds is not None:
83+
self.batch_flush_duration_milliseconds = batch_flush_duration_milliseconds
84+
if batch_size is not None:
85+
self.batch_size = batch_size
7686
if description is not None:
7787
self.description = description
7888
if enabled is not None:
@@ -88,6 +98,48 @@ def __init__(self, description=None, enabled=None, function_id=None, kafka_crede
8898
self.starting_position = starting_position
8999
self.topic_name = topic_name
90100

101+
@property
102+
def batch_flush_duration_milliseconds(self):
103+
"""Gets the batch_flush_duration_milliseconds of this CreateKafkaTriggerRequest. # noqa: E501
104+
105+
106+
:return: The batch_flush_duration_milliseconds of this CreateKafkaTriggerRequest. # noqa: E501
107+
:rtype: int
108+
"""
109+
return self._batch_flush_duration_milliseconds
110+
111+
@batch_flush_duration_milliseconds.setter
112+
def batch_flush_duration_milliseconds(self, batch_flush_duration_milliseconds):
113+
"""Sets the batch_flush_duration_milliseconds of this CreateKafkaTriggerRequest.
114+
115+
116+
:param batch_flush_duration_milliseconds: The batch_flush_duration_milliseconds of this CreateKafkaTriggerRequest. # noqa: E501
117+
:type: int
118+
"""
119+
120+
self._batch_flush_duration_milliseconds = batch_flush_duration_milliseconds
121+
122+
@property
123+
def batch_size(self):
124+
"""Gets the batch_size of this CreateKafkaTriggerRequest. # noqa: E501
125+
126+
127+
:return: The batch_size of this CreateKafkaTriggerRequest. # noqa: E501
128+
:rtype: int
129+
"""
130+
return self._batch_size
131+
132+
@batch_size.setter
133+
def batch_size(self, batch_size):
134+
"""Sets the batch_size of this CreateKafkaTriggerRequest.
135+
136+
137+
:param batch_size: The batch_size of this CreateKafkaTriggerRequest. # noqa: E501
138+
:type: int
139+
"""
140+
141+
self._batch_size = batch_size
142+
91143
@property
92144
def description(self):
93145
"""Gets the description of this CreateKafkaTriggerRequest. # noqa: E501

volcenginesdkvefaas/models/create_kafka_trigger_response.py

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class CreateKafkaTriggerResponse(object):
3333
and the value is json key in definition.
3434
"""
3535
swagger_types = {
36+
'batch_flush_duration_milliseconds': 'int',
37+
'batch_size': 'int',
3638
'consumer_group': 'str',
3739
'creation_time': 'str',
3840
'description': 'str',
@@ -49,6 +51,8 @@ class CreateKafkaTriggerResponse(object):
4951
}
5052

5153
attribute_map = {
54+
'batch_flush_duration_milliseconds': 'BatchFlushDurationMilliseconds',
55+
'batch_size': 'BatchSize',
5256
'consumer_group': 'ConsumerGroup',
5357
'creation_time': 'CreationTime',
5458
'description': 'Description',
@@ -64,12 +68,14 @@ class CreateKafkaTriggerResponse(object):
6468
'topic_name': 'TopicName'
6569
}
6670

67-
def __init__(self, consumer_group=None, creation_time=None, description=None, enabled=None, function_id=None, id=None, last_update_time=None, maximum_retry_attempts=None, mq_instance_id=None, name=None, starting_position=None, status=None, topic_name=None, _configuration=None): # noqa: E501
71+
def __init__(self, batch_flush_duration_milliseconds=None, batch_size=None, consumer_group=None, creation_time=None, description=None, enabled=None, function_id=None, id=None, last_update_time=None, maximum_retry_attempts=None, mq_instance_id=None, name=None, starting_position=None, status=None, topic_name=None, _configuration=None): # noqa: E501
6872
"""CreateKafkaTriggerResponse - a model defined in Swagger""" # noqa: E501
6973
if _configuration is None:
7074
_configuration = Configuration()
7175
self._configuration = _configuration
7276

77+
self._batch_flush_duration_milliseconds = None
78+
self._batch_size = None
7379
self._consumer_group = None
7480
self._creation_time = None
7581
self._description = None
@@ -85,6 +91,10 @@ def __init__(self, consumer_group=None, creation_time=None, description=None, en
8591
self._topic_name = None
8692
self.discriminator = None
8793

94+
if batch_flush_duration_milliseconds is not None:
95+
self.batch_flush_duration_milliseconds = batch_flush_duration_milliseconds
96+
if batch_size is not None:
97+
self.batch_size = batch_size
8898
if consumer_group is not None:
8999
self.consumer_group = consumer_group
90100
if creation_time is not None:
@@ -112,6 +122,48 @@ def __init__(self, consumer_group=None, creation_time=None, description=None, en
112122
if topic_name is not None:
113123
self.topic_name = topic_name
114124

125+
@property
126+
def batch_flush_duration_milliseconds(self):
127+
"""Gets the batch_flush_duration_milliseconds of this CreateKafkaTriggerResponse. # noqa: E501
128+
129+
130+
:return: The batch_flush_duration_milliseconds of this CreateKafkaTriggerResponse. # noqa: E501
131+
:rtype: int
132+
"""
133+
return self._batch_flush_duration_milliseconds
134+
135+
@batch_flush_duration_milliseconds.setter
136+
def batch_flush_duration_milliseconds(self, batch_flush_duration_milliseconds):
137+
"""Sets the batch_flush_duration_milliseconds of this CreateKafkaTriggerResponse.
138+
139+
140+
:param batch_flush_duration_milliseconds: The batch_flush_duration_milliseconds of this CreateKafkaTriggerResponse. # noqa: E501
141+
:type: int
142+
"""
143+
144+
self._batch_flush_duration_milliseconds = batch_flush_duration_milliseconds
145+
146+
@property
147+
def batch_size(self):
148+
"""Gets the batch_size of this CreateKafkaTriggerResponse. # noqa: E501
149+
150+
151+
:return: The batch_size of this CreateKafkaTriggerResponse. # noqa: E501
152+
:rtype: int
153+
"""
154+
return self._batch_size
155+
156+
@batch_size.setter
157+
def batch_size(self, batch_size):
158+
"""Sets the batch_size of this CreateKafkaTriggerResponse.
159+
160+
161+
:param batch_size: The batch_size of this CreateKafkaTriggerResponse. # noqa: E501
162+
:type: int
163+
"""
164+
165+
self._batch_size = batch_size
166+
115167
@property
116168
def consumer_group(self):
117169
"""Gets the consumer_group of this CreateKafkaTriggerResponse. # noqa: E501

0 commit comments

Comments
 (0)