github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python-legacy/lakefs_client/api/import_api.py (about) 1 """ 2 lakeFS API 3 4 lakeFS HTTP API # noqa: E501 5 6 The version of the OpenAPI document: 1.0.0 7 Contact: services@treeverse.io 8 Generated by: https://openapi-generator.tech 9 """ 10 11 12 import re # noqa: F401 13 import sys # noqa: F401 14 15 from lakefs_client.api_client import ApiClient, Endpoint as _Endpoint 16 from lakefs_client.model_utils import ( # noqa: F401 17 check_allowed_values, 18 check_validations, 19 date, 20 datetime, 21 file_type, 22 none_type, 23 validate_and_convert_types 24 ) 25 from lakefs_client.model.error import Error 26 from lakefs_client.model.import_creation import ImportCreation 27 from lakefs_client.model.import_creation_response import ImportCreationResponse 28 from lakefs_client.model.import_status import ImportStatus 29 30 31 class ImportApi(object): 32 """NOTE: This class is auto generated by OpenAPI Generator 33 Ref: https://openapi-generator.tech 34 35 Do not edit the class manually. 36 """ 37 38 def __init__(self, api_client=None): 39 if api_client is None: 40 api_client = ApiClient() 41 self.api_client = api_client 42 self.import_cancel_endpoint = _Endpoint( 43 settings={ 44 'response_type': None, 45 'auth': [ 46 'basic_auth', 47 'cookie_auth', 48 'jwt_token', 49 'oidc_auth', 50 'saml_auth' 51 ], 52 'endpoint_path': '/repositories/{repository}/branches/{branch}/import', 53 'operation_id': 'import_cancel', 54 'http_method': 'DELETE', 55 'servers': None, 56 }, 57 params_map={ 58 'all': [ 59 'repository', 60 'branch', 61 'id', 62 ], 63 'required': [ 64 'repository', 65 'branch', 66 'id', 67 ], 68 'nullable': [ 69 ], 70 'enum': [ 71 ], 72 'validation': [ 73 ] 74 }, 75 root_map={ 76 'validations': { 77 }, 78 'allowed_values': { 79 }, 80 'openapi_types': { 81 'repository': 82 (str,), 83 'branch': 84 (str,), 85 'id': 86 (str,), 87 }, 88 'attribute_map': { 89 'repository': 'repository', 90 'branch': 'branch', 91 'id': 'id', 92 }, 93 'location_map': { 94 'repository': 'path', 95 'branch': 'path', 96 'id': 'query', 97 }, 98 'collection_format_map': { 99 } 100 }, 101 headers_map={ 102 'accept': [ 103 'application/json' 104 ], 105 'content_type': [], 106 }, 107 api_client=api_client 108 ) 109 self.import_start_endpoint = _Endpoint( 110 settings={ 111 'response_type': (ImportCreationResponse,), 112 'auth': [ 113 'basic_auth', 114 'cookie_auth', 115 'jwt_token', 116 'oidc_auth', 117 'saml_auth' 118 ], 119 'endpoint_path': '/repositories/{repository}/branches/{branch}/import', 120 'operation_id': 'import_start', 121 'http_method': 'POST', 122 'servers': None, 123 }, 124 params_map={ 125 'all': [ 126 'repository', 127 'branch', 128 'import_creation', 129 ], 130 'required': [ 131 'repository', 132 'branch', 133 'import_creation', 134 ], 135 'nullable': [ 136 ], 137 'enum': [ 138 ], 139 'validation': [ 140 ] 141 }, 142 root_map={ 143 'validations': { 144 }, 145 'allowed_values': { 146 }, 147 'openapi_types': { 148 'repository': 149 (str,), 150 'branch': 151 (str,), 152 'import_creation': 153 (ImportCreation,), 154 }, 155 'attribute_map': { 156 'repository': 'repository', 157 'branch': 'branch', 158 }, 159 'location_map': { 160 'repository': 'path', 161 'branch': 'path', 162 'import_creation': 'body', 163 }, 164 'collection_format_map': { 165 } 166 }, 167 headers_map={ 168 'accept': [ 169 'application/json' 170 ], 171 'content_type': [ 172 'application/json' 173 ] 174 }, 175 api_client=api_client 176 ) 177 self.import_status_endpoint = _Endpoint( 178 settings={ 179 'response_type': (ImportStatus,), 180 'auth': [ 181 'basic_auth', 182 'cookie_auth', 183 'jwt_token', 184 'oidc_auth', 185 'saml_auth' 186 ], 187 'endpoint_path': '/repositories/{repository}/branches/{branch}/import', 188 'operation_id': 'import_status', 189 'http_method': 'GET', 190 'servers': None, 191 }, 192 params_map={ 193 'all': [ 194 'repository', 195 'branch', 196 'id', 197 ], 198 'required': [ 199 'repository', 200 'branch', 201 'id', 202 ], 203 'nullable': [ 204 ], 205 'enum': [ 206 ], 207 'validation': [ 208 ] 209 }, 210 root_map={ 211 'validations': { 212 }, 213 'allowed_values': { 214 }, 215 'openapi_types': { 216 'repository': 217 (str,), 218 'branch': 219 (str,), 220 'id': 221 (str,), 222 }, 223 'attribute_map': { 224 'repository': 'repository', 225 'branch': 'branch', 226 'id': 'id', 227 }, 228 'location_map': { 229 'repository': 'path', 230 'branch': 'path', 231 'id': 'query', 232 }, 233 'collection_format_map': { 234 } 235 }, 236 headers_map={ 237 'accept': [ 238 'application/json' 239 ], 240 'content_type': [], 241 }, 242 api_client=api_client 243 ) 244 245 def import_cancel( 246 self, 247 repository, 248 branch, 249 id, 250 **kwargs 251 ): 252 """cancel ongoing import # noqa: E501 253 254 This method makes a synchronous HTTP request by default. To make an 255 asynchronous HTTP request, please pass async_req=True 256 257 >>> thread = api.import_cancel(repository, branch, id, async_req=True) 258 >>> result = thread.get() 259 260 Args: 261 repository (str): 262 branch (str): 263 id (str): Unique identifier of the import process 264 265 Keyword Args: 266 _return_http_data_only (bool): response data without head status 267 code and headers. Default is True. 268 _preload_content (bool): if False, the urllib3.HTTPResponse object 269 will be returned without reading/decoding response data. 270 Default is True. 271 _request_timeout (int/float/tuple): timeout setting for this request. If 272 one number provided, it will be total request timeout. It can also 273 be a pair (tuple) of (connection, read) timeouts. 274 Default is None. 275 _check_input_type (bool): specifies if type checking 276 should be done one the data sent to the server. 277 Default is True. 278 _check_return_type (bool): specifies if type checking 279 should be done one the data received from the server. 280 Default is True. 281 _host_index (int/None): specifies the index of the server 282 that we want to use. 283 Default is read from the configuration. 284 async_req (bool): execute request asynchronously 285 286 Returns: 287 None 288 If the method is called asynchronously, returns the request 289 thread. 290 """ 291 kwargs['async_req'] = kwargs.get( 292 'async_req', False 293 ) 294 kwargs['_return_http_data_only'] = kwargs.get( 295 '_return_http_data_only', True 296 ) 297 kwargs['_preload_content'] = kwargs.get( 298 '_preload_content', True 299 ) 300 kwargs['_request_timeout'] = kwargs.get( 301 '_request_timeout', None 302 ) 303 kwargs['_check_input_type'] = kwargs.get( 304 '_check_input_type', True 305 ) 306 kwargs['_check_return_type'] = kwargs.get( 307 '_check_return_type', True 308 ) 309 kwargs['_host_index'] = kwargs.get('_host_index') 310 kwargs['repository'] = \ 311 repository 312 kwargs['branch'] = \ 313 branch 314 kwargs['id'] = \ 315 id 316 return self.import_cancel_endpoint.call_with_http_info(**kwargs) 317 318 def import_start( 319 self, 320 repository, 321 branch, 322 import_creation, 323 **kwargs 324 ): 325 """import data from object store # noqa: E501 326 327 This method makes a synchronous HTTP request by default. To make an 328 asynchronous HTTP request, please pass async_req=True 329 330 >>> thread = api.import_start(repository, branch, import_creation, async_req=True) 331 >>> result = thread.get() 332 333 Args: 334 repository (str): 335 branch (str): 336 import_creation (ImportCreation): 337 338 Keyword Args: 339 _return_http_data_only (bool): response data without head status 340 code and headers. Default is True. 341 _preload_content (bool): if False, the urllib3.HTTPResponse object 342 will be returned without reading/decoding response data. 343 Default is True. 344 _request_timeout (int/float/tuple): timeout setting for this request. If 345 one number provided, it will be total request timeout. It can also 346 be a pair (tuple) of (connection, read) timeouts. 347 Default is None. 348 _check_input_type (bool): specifies if type checking 349 should be done one the data sent to the server. 350 Default is True. 351 _check_return_type (bool): specifies if type checking 352 should be done one the data received from the server. 353 Default is True. 354 _host_index (int/None): specifies the index of the server 355 that we want to use. 356 Default is read from the configuration. 357 async_req (bool): execute request asynchronously 358 359 Returns: 360 ImportCreationResponse 361 If the method is called asynchronously, returns the request 362 thread. 363 """ 364 kwargs['async_req'] = kwargs.get( 365 'async_req', False 366 ) 367 kwargs['_return_http_data_only'] = kwargs.get( 368 '_return_http_data_only', True 369 ) 370 kwargs['_preload_content'] = kwargs.get( 371 '_preload_content', True 372 ) 373 kwargs['_request_timeout'] = kwargs.get( 374 '_request_timeout', None 375 ) 376 kwargs['_check_input_type'] = kwargs.get( 377 '_check_input_type', True 378 ) 379 kwargs['_check_return_type'] = kwargs.get( 380 '_check_return_type', True 381 ) 382 kwargs['_host_index'] = kwargs.get('_host_index') 383 kwargs['repository'] = \ 384 repository 385 kwargs['branch'] = \ 386 branch 387 kwargs['import_creation'] = \ 388 import_creation 389 return self.import_start_endpoint.call_with_http_info(**kwargs) 390 391 def import_status( 392 self, 393 repository, 394 branch, 395 id, 396 **kwargs 397 ): 398 """get import status # noqa: E501 399 400 This method makes a synchronous HTTP request by default. To make an 401 asynchronous HTTP request, please pass async_req=True 402 403 >>> thread = api.import_status(repository, branch, id, async_req=True) 404 >>> result = thread.get() 405 406 Args: 407 repository (str): 408 branch (str): 409 id (str): Unique identifier of the import process 410 411 Keyword Args: 412 _return_http_data_only (bool): response data without head status 413 code and headers. Default is True. 414 _preload_content (bool): if False, the urllib3.HTTPResponse object 415 will be returned without reading/decoding response data. 416 Default is True. 417 _request_timeout (int/float/tuple): timeout setting for this request. If 418 one number provided, it will be total request timeout. It can also 419 be a pair (tuple) of (connection, read) timeouts. 420 Default is None. 421 _check_input_type (bool): specifies if type checking 422 should be done one the data sent to the server. 423 Default is True. 424 _check_return_type (bool): specifies if type checking 425 should be done one the data received from the server. 426 Default is True. 427 _host_index (int/None): specifies the index of the server 428 that we want to use. 429 Default is read from the configuration. 430 async_req (bool): execute request asynchronously 431 432 Returns: 433 ImportStatus 434 If the method is called asynchronously, returns the request 435 thread. 436 """ 437 kwargs['async_req'] = kwargs.get( 438 'async_req', False 439 ) 440 kwargs['_return_http_data_only'] = kwargs.get( 441 '_return_http_data_only', True 442 ) 443 kwargs['_preload_content'] = kwargs.get( 444 '_preload_content', True 445 ) 446 kwargs['_request_timeout'] = kwargs.get( 447 '_request_timeout', None 448 ) 449 kwargs['_check_input_type'] = kwargs.get( 450 '_check_input_type', True 451 ) 452 kwargs['_check_return_type'] = kwargs.get( 453 '_check_return_type', True 454 ) 455 kwargs['_host_index'] = kwargs.get('_host_index') 456 kwargs['repository'] = \ 457 repository 458 kwargs['branch'] = \ 459 branch 460 kwargs['id'] = \ 461 id 462 return self.import_status_endpoint.call_with_http_info(**kwargs) 463