github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python-legacy/docs/ImportApi.md (about) 1 # lakefs_client.ImportApi 2 3 All URIs are relative to *http://localhost/api/v1* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**import_cancel**](ImportApi.md#import_cancel) | **DELETE** /repositories/{repository}/branches/{branch}/import | cancel ongoing import 8 [**import_start**](ImportApi.md#import_start) | **POST** /repositories/{repository}/branches/{branch}/import | import data from object store 9 [**import_status**](ImportApi.md#import_status) | **GET** /repositories/{repository}/branches/{branch}/import | get import status 10 11 12 # **import_cancel** 13 > import_cancel(repository, branch, id) 14 15 cancel ongoing import 16 17 ### Example 18 19 * Basic Authentication (basic_auth): 20 * Api Key Authentication (cookie_auth): 21 * Bearer (JWT) Authentication (jwt_token): 22 * Api Key Authentication (oidc_auth): 23 * Api Key Authentication (saml_auth): 24 25 ```python 26 import time 27 import lakefs_client 28 from lakefs_client.api import import_api 29 from lakefs_client.model.error import Error 30 from pprint import pprint 31 # Defining the host is optional and defaults to http://localhost/api/v1 32 # See configuration.py for a list of all supported configuration parameters. 33 configuration = lakefs_client.Configuration( 34 host = "http://localhost/api/v1" 35 ) 36 37 # The client must configure the authentication and authorization parameters 38 # in accordance with the API server security policy. 39 # Examples for each auth method are provided below, use the example that 40 # satisfies your auth use case. 41 42 # Configure HTTP basic authorization: basic_auth 43 configuration = lakefs_client.Configuration( 44 username = 'YOUR_USERNAME', 45 password = 'YOUR_PASSWORD' 46 ) 47 48 # Configure API key authorization: cookie_auth 49 configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' 50 51 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 52 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 53 54 # Configure Bearer authorization (JWT): jwt_token 55 configuration = lakefs_client.Configuration( 56 access_token = 'YOUR_BEARER_TOKEN' 57 ) 58 59 # Configure API key authorization: oidc_auth 60 configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' 61 62 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 63 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 64 65 # Configure API key authorization: saml_auth 66 configuration.api_key['saml_auth'] = 'YOUR_API_KEY' 67 68 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 69 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 70 71 # Enter a context with an instance of the API client 72 with lakefs_client.ApiClient(configuration) as api_client: 73 # Create an instance of the API class 74 api_instance = import_api.ImportApi(api_client) 75 repository = "repository_example" # str | 76 branch = "branch_example" # str | 77 id = "id_example" # str | Unique identifier of the import process 78 79 # example passing only required values which don't have defaults set 80 try: 81 # cancel ongoing import 82 api_instance.import_cancel(repository, branch, id) 83 except lakefs_client.ApiException as e: 84 print("Exception when calling ImportApi->import_cancel: %s\n" % e) 85 ``` 86 87 88 ### Parameters 89 90 Name | Type | Description | Notes 91 ------------- | ------------- | ------------- | ------------- 92 **repository** | **str**| | 93 **branch** | **str**| | 94 **id** | **str**| Unique identifier of the import process | 95 96 ### Return type 97 98 void (empty response body) 99 100 ### Authorization 101 102 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) 103 104 ### HTTP request headers 105 106 - **Content-Type**: Not defined 107 - **Accept**: application/json 108 109 110 ### HTTP response details 111 112 | Status code | Description | Response headers | 113 |-------------|-------------|------------------| 114 **204** | import canceled successfully | - | 115 **401** | Unauthorized | - | 116 **403** | Forbidden | - | 117 **404** | Resource Not Found | - | 118 **409** | Resource Conflicts With Target | - | 119 **420** | too many requests | - | 120 **0** | Internal Server Error | - | 121 122 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 123 124 # **import_start** 125 > ImportCreationResponse import_start(repository, branch, import_creation) 126 127 import data from object store 128 129 ### Example 130 131 * Basic Authentication (basic_auth): 132 * Api Key Authentication (cookie_auth): 133 * Bearer (JWT) Authentication (jwt_token): 134 * Api Key Authentication (oidc_auth): 135 * Api Key Authentication (saml_auth): 136 137 ```python 138 import time 139 import lakefs_client 140 from lakefs_client.api import import_api 141 from lakefs_client.model.import_creation import ImportCreation 142 from lakefs_client.model.error import Error 143 from lakefs_client.model.import_creation_response import ImportCreationResponse 144 from pprint import pprint 145 # Defining the host is optional and defaults to http://localhost/api/v1 146 # See configuration.py for a list of all supported configuration parameters. 147 configuration = lakefs_client.Configuration( 148 host = "http://localhost/api/v1" 149 ) 150 151 # The client must configure the authentication and authorization parameters 152 # in accordance with the API server security policy. 153 # Examples for each auth method are provided below, use the example that 154 # satisfies your auth use case. 155 156 # Configure HTTP basic authorization: basic_auth 157 configuration = lakefs_client.Configuration( 158 username = 'YOUR_USERNAME', 159 password = 'YOUR_PASSWORD' 160 ) 161 162 # Configure API key authorization: cookie_auth 163 configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' 164 165 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 166 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 167 168 # Configure Bearer authorization (JWT): jwt_token 169 configuration = lakefs_client.Configuration( 170 access_token = 'YOUR_BEARER_TOKEN' 171 ) 172 173 # Configure API key authorization: oidc_auth 174 configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' 175 176 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 177 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 178 179 # Configure API key authorization: saml_auth 180 configuration.api_key['saml_auth'] = 'YOUR_API_KEY' 181 182 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 183 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 184 185 # Enter a context with an instance of the API client 186 with lakefs_client.ApiClient(configuration) as api_client: 187 # Create an instance of the API class 188 api_instance = import_api.ImportApi(api_client) 189 repository = "repository_example" # str | 190 branch = "branch_example" # str | 191 import_creation = ImportCreation( 192 paths=[ 193 ImportLocation( 194 type="common_prefix", 195 path="s3://my-bucket/production/collections/", 196 destination="collections/", 197 ), 198 ], 199 commit=CommitCreation( 200 message="message_example", 201 metadata={ 202 "key": "key_example", 203 }, 204 date=1, 205 allow_empty=False, 206 force=False, 207 ), 208 force=False, 209 ) # ImportCreation | 210 211 # example passing only required values which don't have defaults set 212 try: 213 # import data from object store 214 api_response = api_instance.import_start(repository, branch, import_creation) 215 pprint(api_response) 216 except lakefs_client.ApiException as e: 217 print("Exception when calling ImportApi->import_start: %s\n" % e) 218 ``` 219 220 221 ### Parameters 222 223 Name | Type | Description | Notes 224 ------------- | ------------- | ------------- | ------------- 225 **repository** | **str**| | 226 **branch** | **str**| | 227 **import_creation** | [**ImportCreation**](ImportCreation.md)| | 228 229 ### Return type 230 231 [**ImportCreationResponse**](ImportCreationResponse.md) 232 233 ### Authorization 234 235 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) 236 237 ### HTTP request headers 238 239 - **Content-Type**: application/json 240 - **Accept**: application/json 241 242 243 ### HTTP response details 244 245 | Status code | Description | Response headers | 246 |-------------|-------------|------------------| 247 **202** | Import started | - | 248 **400** | Validation Error | - | 249 **401** | Unauthorized | - | 250 **403** | Forbidden | - | 251 **404** | Resource Not Found | - | 252 **420** | too many requests | - | 253 **0** | Internal Server Error | - | 254 255 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 256 257 # **import_status** 258 > ImportStatus import_status(repository, branch, id) 259 260 get import status 261 262 ### Example 263 264 * Basic Authentication (basic_auth): 265 * Api Key Authentication (cookie_auth): 266 * Bearer (JWT) Authentication (jwt_token): 267 * Api Key Authentication (oidc_auth): 268 * Api Key Authentication (saml_auth): 269 270 ```python 271 import time 272 import lakefs_client 273 from lakefs_client.api import import_api 274 from lakefs_client.model.import_status import ImportStatus 275 from lakefs_client.model.error import Error 276 from pprint import pprint 277 # Defining the host is optional and defaults to http://localhost/api/v1 278 # See configuration.py for a list of all supported configuration parameters. 279 configuration = lakefs_client.Configuration( 280 host = "http://localhost/api/v1" 281 ) 282 283 # The client must configure the authentication and authorization parameters 284 # in accordance with the API server security policy. 285 # Examples for each auth method are provided below, use the example that 286 # satisfies your auth use case. 287 288 # Configure HTTP basic authorization: basic_auth 289 configuration = lakefs_client.Configuration( 290 username = 'YOUR_USERNAME', 291 password = 'YOUR_PASSWORD' 292 ) 293 294 # Configure API key authorization: cookie_auth 295 configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' 296 297 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 298 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 299 300 # Configure Bearer authorization (JWT): jwt_token 301 configuration = lakefs_client.Configuration( 302 access_token = 'YOUR_BEARER_TOKEN' 303 ) 304 305 # Configure API key authorization: oidc_auth 306 configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' 307 308 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 309 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 310 311 # Configure API key authorization: saml_auth 312 configuration.api_key['saml_auth'] = 'YOUR_API_KEY' 313 314 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 315 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 316 317 # Enter a context with an instance of the API client 318 with lakefs_client.ApiClient(configuration) as api_client: 319 # Create an instance of the API class 320 api_instance = import_api.ImportApi(api_client) 321 repository = "repository_example" # str | 322 branch = "branch_example" # str | 323 id = "id_example" # str | Unique identifier of the import process 324 325 # example passing only required values which don't have defaults set 326 try: 327 # get import status 328 api_response = api_instance.import_status(repository, branch, id) 329 pprint(api_response) 330 except lakefs_client.ApiException as e: 331 print("Exception when calling ImportApi->import_status: %s\n" % e) 332 ``` 333 334 335 ### Parameters 336 337 Name | Type | Description | Notes 338 ------------- | ------------- | ------------- | ------------- 339 **repository** | **str**| | 340 **branch** | **str**| | 341 **id** | **str**| Unique identifier of the import process | 342 343 ### Return type 344 345 [**ImportStatus**](ImportStatus.md) 346 347 ### Authorization 348 349 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) 350 351 ### HTTP request headers 352 353 - **Content-Type**: Not defined 354 - **Accept**: application/json 355 356 357 ### HTTP response details 358 359 | Status code | Description | Response headers | 360 |-------------|-------------|------------------| 361 **200** | import status | - | 362 **401** | Unauthorized | - | 363 **404** | Resource Not Found | - | 364 **420** | too many requests | - | 365 **0** | Internal Server Error | - | 366 367 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 368