github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python/docs/ObjectsApi.md (about) 1 # lakefs_sdk.ObjectsApi 2 3 All URIs are relative to */api/v1* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**copy_object**](ObjectsApi.md#copy_object) | **POST** /repositories/{repository}/branches/{branch}/objects/copy | create a copy of an object 8 [**delete_object**](ObjectsApi.md#delete_object) | **DELETE** /repositories/{repository}/branches/{branch}/objects | delete object. Missing objects will not return a NotFound error. 9 [**delete_objects**](ObjectsApi.md#delete_objects) | **POST** /repositories/{repository}/branches/{branch}/objects/delete | delete objects. Missing objects will not return a NotFound error. 10 [**get_object**](ObjectsApi.md#get_object) | **GET** /repositories/{repository}/refs/{ref}/objects | get object content 11 [**get_underlying_properties**](ObjectsApi.md#get_underlying_properties) | **GET** /repositories/{repository}/refs/{ref}/objects/underlyingProperties | get object properties on underlying storage 12 [**head_object**](ObjectsApi.md#head_object) | **HEAD** /repositories/{repository}/refs/{ref}/objects | check if object exists 13 [**list_objects**](ObjectsApi.md#list_objects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix 14 [**stat_object**](ObjectsApi.md#stat_object) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata 15 [**upload_object**](ObjectsApi.md#upload_object) | **POST** /repositories/{repository}/branches/{branch}/objects | 16 17 18 # **copy_object** 19 > ObjectStats copy_object(repository, branch, dest_path, object_copy_creation) 20 21 create a copy of an object 22 23 ### Example 24 25 * Basic Authentication (basic_auth): 26 * Api Key Authentication (cookie_auth): 27 * Api Key Authentication (oidc_auth): 28 * Api Key Authentication (saml_auth): 29 * Bearer (JWT) Authentication (jwt_token): 30 31 ```python 32 import time 33 import os 34 import lakefs_sdk 35 from lakefs_sdk.models.object_copy_creation import ObjectCopyCreation 36 from lakefs_sdk.models.object_stats import ObjectStats 37 from lakefs_sdk.rest import ApiException 38 from pprint import pprint 39 40 # Defining the host is optional and defaults to /api/v1 41 # See configuration.py for a list of all supported configuration parameters. 42 configuration = lakefs_sdk.Configuration( 43 host = "/api/v1" 44 ) 45 46 # The client must configure the authentication and authorization parameters 47 # in accordance with the API server security policy. 48 # Examples for each auth method are provided below, use the example that 49 # satisfies your auth use case. 50 51 # Configure HTTP basic authorization: basic_auth 52 configuration = lakefs_sdk.Configuration( 53 username = os.environ["USERNAME"], 54 password = os.environ["PASSWORD"] 55 ) 56 57 # Configure API key authorization: cookie_auth 58 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 59 60 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 61 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 62 63 # Configure API key authorization: oidc_auth 64 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 65 66 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 67 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 68 69 # Configure API key authorization: saml_auth 70 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 71 72 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 73 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 74 75 # Configure Bearer authorization (JWT): jwt_token 76 configuration = lakefs_sdk.Configuration( 77 access_token = os.environ["BEARER_TOKEN"] 78 ) 79 80 # Enter a context with an instance of the API client 81 with lakefs_sdk.ApiClient(configuration) as api_client: 82 # Create an instance of the API class 83 api_instance = lakefs_sdk.ObjectsApi(api_client) 84 repository = 'repository_example' # str | 85 branch = 'branch_example' # str | destination branch for the copy 86 dest_path = 'dest_path_example' # str | destination path relative to the branch 87 object_copy_creation = lakefs_sdk.ObjectCopyCreation() # ObjectCopyCreation | 88 89 try: 90 # create a copy of an object 91 api_response = api_instance.copy_object(repository, branch, dest_path, object_copy_creation) 92 print("The response of ObjectsApi->copy_object:\n") 93 pprint(api_response) 94 except Exception as e: 95 print("Exception when calling ObjectsApi->copy_object: %s\n" % e) 96 ``` 97 98 99 100 ### Parameters 101 102 103 Name | Type | Description | Notes 104 ------------- | ------------- | ------------- | ------------- 105 **repository** | **str**| | 106 **branch** | **str**| destination branch for the copy | 107 **dest_path** | **str**| destination path relative to the branch | 108 **object_copy_creation** | [**ObjectCopyCreation**](ObjectCopyCreation.md)| | 109 110 ### Return type 111 112 [**ObjectStats**](ObjectStats.md) 113 114 ### Authorization 115 116 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 117 118 ### HTTP request headers 119 120 - **Content-Type**: application/json 121 - **Accept**: application/json 122 123 ### HTTP response details 124 125 | Status code | Description | Response headers | 126 |-------------|-------------|------------------| 127 **201** | Copy object response | - | 128 **400** | Validation Error | - | 129 **401** | Unauthorized | - | 130 **403** | Forbidden | - | 131 **404** | Resource Not Found | - | 132 **420** | too many requests | - | 133 **0** | Internal Server Error | - | 134 135 [[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) 136 137 # **delete_object** 138 > delete_object(repository, branch, path, force=force) 139 140 delete object. Missing objects will not return a NotFound error. 141 142 ### Example 143 144 * Basic Authentication (basic_auth): 145 * Api Key Authentication (cookie_auth): 146 * Api Key Authentication (oidc_auth): 147 * Api Key Authentication (saml_auth): 148 * Bearer (JWT) Authentication (jwt_token): 149 150 ```python 151 import time 152 import os 153 import lakefs_sdk 154 from lakefs_sdk.rest import ApiException 155 from pprint import pprint 156 157 # Defining the host is optional and defaults to /api/v1 158 # See configuration.py for a list of all supported configuration parameters. 159 configuration = lakefs_sdk.Configuration( 160 host = "/api/v1" 161 ) 162 163 # The client must configure the authentication and authorization parameters 164 # in accordance with the API server security policy. 165 # Examples for each auth method are provided below, use the example that 166 # satisfies your auth use case. 167 168 # Configure HTTP basic authorization: basic_auth 169 configuration = lakefs_sdk.Configuration( 170 username = os.environ["USERNAME"], 171 password = os.environ["PASSWORD"] 172 ) 173 174 # Configure API key authorization: cookie_auth 175 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 176 177 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 178 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 179 180 # Configure API key authorization: oidc_auth 181 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 182 183 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 184 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 185 186 # Configure API key authorization: saml_auth 187 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 188 189 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 190 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 191 192 # Configure Bearer authorization (JWT): jwt_token 193 configuration = lakefs_sdk.Configuration( 194 access_token = os.environ["BEARER_TOKEN"] 195 ) 196 197 # Enter a context with an instance of the API client 198 with lakefs_sdk.ApiClient(configuration) as api_client: 199 # Create an instance of the API class 200 api_instance = lakefs_sdk.ObjectsApi(api_client) 201 repository = 'repository_example' # str | 202 branch = 'branch_example' # str | 203 path = 'path_example' # str | relative to the branch 204 force = False # bool | (optional) (default to False) 205 206 try: 207 # delete object. Missing objects will not return a NotFound error. 208 api_instance.delete_object(repository, branch, path, force=force) 209 except Exception as e: 210 print("Exception when calling ObjectsApi->delete_object: %s\n" % e) 211 ``` 212 213 214 215 ### Parameters 216 217 218 Name | Type | Description | Notes 219 ------------- | ------------- | ------------- | ------------- 220 **repository** | **str**| | 221 **branch** | **str**| | 222 **path** | **str**| relative to the branch | 223 **force** | **bool**| | [optional] [default to False] 224 225 ### Return type 226 227 void (empty response body) 228 229 ### Authorization 230 231 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 232 233 ### HTTP request headers 234 235 - **Content-Type**: Not defined 236 - **Accept**: application/json 237 238 ### HTTP response details 239 240 | Status code | Description | Response headers | 241 |-------------|-------------|------------------| 242 **204** | object deleted successfully | - | 243 **401** | Unauthorized | - | 244 **403** | Forbidden | - | 245 **404** | Resource Not Found | - | 246 **420** | too many requests | - | 247 **0** | Internal Server Error | - | 248 249 [[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) 250 251 # **delete_objects** 252 > ObjectErrorList delete_objects(repository, branch, path_list, force=force) 253 254 delete objects. Missing objects will not return a NotFound error. 255 256 ### Example 257 258 * Basic Authentication (basic_auth): 259 * Api Key Authentication (cookie_auth): 260 * Api Key Authentication (oidc_auth): 261 * Api Key Authentication (saml_auth): 262 * Bearer (JWT) Authentication (jwt_token): 263 264 ```python 265 import time 266 import os 267 import lakefs_sdk 268 from lakefs_sdk.models.object_error_list import ObjectErrorList 269 from lakefs_sdk.models.path_list import PathList 270 from lakefs_sdk.rest import ApiException 271 from pprint import pprint 272 273 # Defining the host is optional and defaults to /api/v1 274 # See configuration.py for a list of all supported configuration parameters. 275 configuration = lakefs_sdk.Configuration( 276 host = "/api/v1" 277 ) 278 279 # The client must configure the authentication and authorization parameters 280 # in accordance with the API server security policy. 281 # Examples for each auth method are provided below, use the example that 282 # satisfies your auth use case. 283 284 # Configure HTTP basic authorization: basic_auth 285 configuration = lakefs_sdk.Configuration( 286 username = os.environ["USERNAME"], 287 password = os.environ["PASSWORD"] 288 ) 289 290 # Configure API key authorization: cookie_auth 291 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 292 293 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 294 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 295 296 # Configure API key authorization: oidc_auth 297 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 298 299 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 300 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 301 302 # Configure API key authorization: saml_auth 303 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 304 305 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 306 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 307 308 # Configure Bearer authorization (JWT): jwt_token 309 configuration = lakefs_sdk.Configuration( 310 access_token = os.environ["BEARER_TOKEN"] 311 ) 312 313 # Enter a context with an instance of the API client 314 with lakefs_sdk.ApiClient(configuration) as api_client: 315 # Create an instance of the API class 316 api_instance = lakefs_sdk.ObjectsApi(api_client) 317 repository = 'repository_example' # str | 318 branch = 'branch_example' # str | 319 path_list = lakefs_sdk.PathList() # PathList | 320 force = False # bool | (optional) (default to False) 321 322 try: 323 # delete objects. Missing objects will not return a NotFound error. 324 api_response = api_instance.delete_objects(repository, branch, path_list, force=force) 325 print("The response of ObjectsApi->delete_objects:\n") 326 pprint(api_response) 327 except Exception as e: 328 print("Exception when calling ObjectsApi->delete_objects: %s\n" % e) 329 ``` 330 331 332 333 ### Parameters 334 335 336 Name | Type | Description | Notes 337 ------------- | ------------- | ------------- | ------------- 338 **repository** | **str**| | 339 **branch** | **str**| | 340 **path_list** | [**PathList**](PathList.md)| | 341 **force** | **bool**| | [optional] [default to False] 342 343 ### Return type 344 345 [**ObjectErrorList**](ObjectErrorList.md) 346 347 ### Authorization 348 349 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 350 351 ### HTTP request headers 352 353 - **Content-Type**: application/json 354 - **Accept**: application/json 355 356 ### HTTP response details 357 358 | Status code | Description | Response headers | 359 |-------------|-------------|------------------| 360 **200** | Delete objects response | - | 361 **401** | Unauthorized | - | 362 **403** | Forbidden | - | 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 369 # **get_object** 370 > bytearray get_object(repository, ref, path, range=range, if_none_match=if_none_match, presign=presign) 371 372 get object content 373 374 ### Example 375 376 * Basic Authentication (basic_auth): 377 * Api Key Authentication (cookie_auth): 378 * Api Key Authentication (oidc_auth): 379 * Api Key Authentication (saml_auth): 380 * Bearer (JWT) Authentication (jwt_token): 381 382 ```python 383 import time 384 import os 385 import lakefs_sdk 386 from lakefs_sdk.rest import ApiException 387 from pprint import pprint 388 389 # Defining the host is optional and defaults to /api/v1 390 # See configuration.py for a list of all supported configuration parameters. 391 configuration = lakefs_sdk.Configuration( 392 host = "/api/v1" 393 ) 394 395 # The client must configure the authentication and authorization parameters 396 # in accordance with the API server security policy. 397 # Examples for each auth method are provided below, use the example that 398 # satisfies your auth use case. 399 400 # Configure HTTP basic authorization: basic_auth 401 configuration = lakefs_sdk.Configuration( 402 username = os.environ["USERNAME"], 403 password = os.environ["PASSWORD"] 404 ) 405 406 # Configure API key authorization: cookie_auth 407 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 408 409 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 410 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 411 412 # Configure API key authorization: oidc_auth 413 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 414 415 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 416 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 417 418 # Configure API key authorization: saml_auth 419 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 420 421 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 422 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 423 424 # Configure Bearer authorization (JWT): jwt_token 425 configuration = lakefs_sdk.Configuration( 426 access_token = os.environ["BEARER_TOKEN"] 427 ) 428 429 # Enter a context with an instance of the API client 430 with lakefs_sdk.ApiClient(configuration) as api_client: 431 # Create an instance of the API class 432 api_instance = lakefs_sdk.ObjectsApi(api_client) 433 repository = 'repository_example' # str | 434 ref = 'ref_example' # str | a reference (could be either a branch or a commit ID) 435 path = 'path_example' # str | relative to the ref 436 range = 'bytes=0-1023' # str | Byte range to retrieve (optional) 437 if_none_match = '33a64df551425fcc55e4d42a148795d9f25f89d4' # str | Returns response only if the object does not have a matching ETag (optional) 438 presign = True # bool | (optional) 439 440 try: 441 # get object content 442 api_response = api_instance.get_object(repository, ref, path, range=range, if_none_match=if_none_match, presign=presign) 443 print("The response of ObjectsApi->get_object:\n") 444 pprint(api_response) 445 except Exception as e: 446 print("Exception when calling ObjectsApi->get_object: %s\n" % e) 447 ``` 448 449 450 451 ### Parameters 452 453 454 Name | Type | Description | Notes 455 ------------- | ------------- | ------------- | ------------- 456 **repository** | **str**| | 457 **ref** | **str**| a reference (could be either a branch or a commit ID) | 458 **path** | **str**| relative to the ref | 459 **range** | **str**| Byte range to retrieve | [optional] 460 **if_none_match** | **str**| Returns response only if the object does not have a matching ETag | [optional] 461 **presign** | **bool**| | [optional] 462 463 ### Return type 464 465 **bytearray** 466 467 ### Authorization 468 469 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 470 471 ### HTTP request headers 472 473 - **Content-Type**: Not defined 474 - **Accept**: application/octet-stream, application/json 475 476 ### HTTP response details 477 478 | Status code | Description | Response headers | 479 |-------------|-------------|------------------| 480 **200** | object content | * Content-Length - <br> * Last-Modified - <br> * ETag - <br> | 481 **206** | partial object content | * Content-Length - <br> * Content-Range - <br> * Last-Modified - <br> * ETag - <br> | 482 **302** | Redirect to a pre-signed URL for the object | * Location - redirect to S3 <br> | 483 **304** | Content not modified | - | 484 **401** | Unauthorized | - | 485 **404** | Resource Not Found | - | 486 **410** | object expired | - | 487 **416** | Requested Range Not Satisfiable | - | 488 **420** | too many requests | - | 489 **0** | Internal Server Error | - | 490 491 [[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) 492 493 # **get_underlying_properties** 494 > UnderlyingObjectProperties get_underlying_properties(repository, ref, path) 495 496 get object properties on underlying storage 497 498 ### Example 499 500 * Basic Authentication (basic_auth): 501 * Api Key Authentication (cookie_auth): 502 * Api Key Authentication (oidc_auth): 503 * Api Key Authentication (saml_auth): 504 * Bearer (JWT) Authentication (jwt_token): 505 506 ```python 507 import time 508 import os 509 import lakefs_sdk 510 from lakefs_sdk.models.underlying_object_properties import UnderlyingObjectProperties 511 from lakefs_sdk.rest import ApiException 512 from pprint import pprint 513 514 # Defining the host is optional and defaults to /api/v1 515 # See configuration.py for a list of all supported configuration parameters. 516 configuration = lakefs_sdk.Configuration( 517 host = "/api/v1" 518 ) 519 520 # The client must configure the authentication and authorization parameters 521 # in accordance with the API server security policy. 522 # Examples for each auth method are provided below, use the example that 523 # satisfies your auth use case. 524 525 # Configure HTTP basic authorization: basic_auth 526 configuration = lakefs_sdk.Configuration( 527 username = os.environ["USERNAME"], 528 password = os.environ["PASSWORD"] 529 ) 530 531 # Configure API key authorization: cookie_auth 532 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 533 534 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 535 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 536 537 # Configure API key authorization: oidc_auth 538 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 539 540 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 541 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 542 543 # Configure API key authorization: saml_auth 544 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 545 546 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 547 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 548 549 # Configure Bearer authorization (JWT): jwt_token 550 configuration = lakefs_sdk.Configuration( 551 access_token = os.environ["BEARER_TOKEN"] 552 ) 553 554 # Enter a context with an instance of the API client 555 with lakefs_sdk.ApiClient(configuration) as api_client: 556 # Create an instance of the API class 557 api_instance = lakefs_sdk.ObjectsApi(api_client) 558 repository = 'repository_example' # str | 559 ref = 'ref_example' # str | a reference (could be either a branch or a commit ID) 560 path = 'path_example' # str | relative to the branch 561 562 try: 563 # get object properties on underlying storage 564 api_response = api_instance.get_underlying_properties(repository, ref, path) 565 print("The response of ObjectsApi->get_underlying_properties:\n") 566 pprint(api_response) 567 except Exception as e: 568 print("Exception when calling ObjectsApi->get_underlying_properties: %s\n" % e) 569 ``` 570 571 572 573 ### Parameters 574 575 576 Name | Type | Description | Notes 577 ------------- | ------------- | ------------- | ------------- 578 **repository** | **str**| | 579 **ref** | **str**| a reference (could be either a branch or a commit ID) | 580 **path** | **str**| relative to the branch | 581 582 ### Return type 583 584 [**UnderlyingObjectProperties**](UnderlyingObjectProperties.md) 585 586 ### Authorization 587 588 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 589 590 ### HTTP request headers 591 592 - **Content-Type**: Not defined 593 - **Accept**: application/json 594 595 ### HTTP response details 596 597 | Status code | Description | Response headers | 598 |-------------|-------------|------------------| 599 **200** | object metadata on underlying storage | - | 600 **401** | Unauthorized | - | 601 **404** | Resource Not Found | - | 602 **420** | too many requests | - | 603 **0** | Internal Server Error | - | 604 605 [[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) 606 607 # **head_object** 608 > head_object(repository, ref, path, range=range) 609 610 check if object exists 611 612 ### Example 613 614 * Basic Authentication (basic_auth): 615 * Api Key Authentication (cookie_auth): 616 * Api Key Authentication (oidc_auth): 617 * Api Key Authentication (saml_auth): 618 * Bearer (JWT) Authentication (jwt_token): 619 620 ```python 621 import time 622 import os 623 import lakefs_sdk 624 from lakefs_sdk.rest import ApiException 625 from pprint import pprint 626 627 # Defining the host is optional and defaults to /api/v1 628 # See configuration.py for a list of all supported configuration parameters. 629 configuration = lakefs_sdk.Configuration( 630 host = "/api/v1" 631 ) 632 633 # The client must configure the authentication and authorization parameters 634 # in accordance with the API server security policy. 635 # Examples for each auth method are provided below, use the example that 636 # satisfies your auth use case. 637 638 # Configure HTTP basic authorization: basic_auth 639 configuration = lakefs_sdk.Configuration( 640 username = os.environ["USERNAME"], 641 password = os.environ["PASSWORD"] 642 ) 643 644 # Configure API key authorization: cookie_auth 645 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 646 647 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 648 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 649 650 # Configure API key authorization: oidc_auth 651 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 652 653 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 654 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 655 656 # Configure API key authorization: saml_auth 657 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 658 659 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 660 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 661 662 # Configure Bearer authorization (JWT): jwt_token 663 configuration = lakefs_sdk.Configuration( 664 access_token = os.environ["BEARER_TOKEN"] 665 ) 666 667 # Enter a context with an instance of the API client 668 with lakefs_sdk.ApiClient(configuration) as api_client: 669 # Create an instance of the API class 670 api_instance = lakefs_sdk.ObjectsApi(api_client) 671 repository = 'repository_example' # str | 672 ref = 'ref_example' # str | a reference (could be either a branch or a commit ID) 673 path = 'path_example' # str | relative to the ref 674 range = 'bytes=0-1023' # str | Byte range to retrieve (optional) 675 676 try: 677 # check if object exists 678 api_instance.head_object(repository, ref, path, range=range) 679 except Exception as e: 680 print("Exception when calling ObjectsApi->head_object: %s\n" % e) 681 ``` 682 683 684 685 ### Parameters 686 687 688 Name | Type | Description | Notes 689 ------------- | ------------- | ------------- | ------------- 690 **repository** | **str**| | 691 **ref** | **str**| a reference (could be either a branch or a commit ID) | 692 **path** | **str**| relative to the ref | 693 **range** | **str**| Byte range to retrieve | [optional] 694 695 ### Return type 696 697 void (empty response body) 698 699 ### Authorization 700 701 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 702 703 ### HTTP request headers 704 705 - **Content-Type**: Not defined 706 - **Accept**: Not defined 707 708 ### HTTP response details 709 710 | Status code | Description | Response headers | 711 |-------------|-------------|------------------| 712 **200** | object exists | * Content-Length - <br> * Last-Modified - <br> * ETag - <br> | 713 **206** | partial object content info | * Content-Length - <br> * Content-Range - <br> * Last-Modified - <br> * ETag - <br> | 714 **401** | Unauthorized | - | 715 **404** | object not found | - | 716 **410** | object expired | - | 717 **416** | Requested Range Not Satisfiable | - | 718 **420** | too many requests | - | 719 **0** | internal server error | - | 720 721 [[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) 722 723 # **list_objects** 724 > ObjectStatsList list_objects(repository, ref, user_metadata=user_metadata, presign=presign, after=after, amount=amount, delimiter=delimiter, prefix=prefix) 725 726 list objects under a given prefix 727 728 ### Example 729 730 * Basic Authentication (basic_auth): 731 * Api Key Authentication (cookie_auth): 732 * Api Key Authentication (oidc_auth): 733 * Api Key Authentication (saml_auth): 734 * Bearer (JWT) Authentication (jwt_token): 735 736 ```python 737 import time 738 import os 739 import lakefs_sdk 740 from lakefs_sdk.models.object_stats_list import ObjectStatsList 741 from lakefs_sdk.rest import ApiException 742 from pprint import pprint 743 744 # Defining the host is optional and defaults to /api/v1 745 # See configuration.py for a list of all supported configuration parameters. 746 configuration = lakefs_sdk.Configuration( 747 host = "/api/v1" 748 ) 749 750 # The client must configure the authentication and authorization parameters 751 # in accordance with the API server security policy. 752 # Examples for each auth method are provided below, use the example that 753 # satisfies your auth use case. 754 755 # Configure HTTP basic authorization: basic_auth 756 configuration = lakefs_sdk.Configuration( 757 username = os.environ["USERNAME"], 758 password = os.environ["PASSWORD"] 759 ) 760 761 # Configure API key authorization: cookie_auth 762 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 763 764 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 765 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 766 767 # Configure API key authorization: oidc_auth 768 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 769 770 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 771 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 772 773 # Configure API key authorization: saml_auth 774 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 775 776 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 777 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 778 779 # Configure Bearer authorization (JWT): jwt_token 780 configuration = lakefs_sdk.Configuration( 781 access_token = os.environ["BEARER_TOKEN"] 782 ) 783 784 # Enter a context with an instance of the API client 785 with lakefs_sdk.ApiClient(configuration) as api_client: 786 # Create an instance of the API class 787 api_instance = lakefs_sdk.ObjectsApi(api_client) 788 repository = 'repository_example' # str | 789 ref = 'ref_example' # str | a reference (could be either a branch or a commit ID) 790 user_metadata = True # bool | (optional) (default to True) 791 presign = True # bool | (optional) 792 after = 'after_example' # str | return items after this value (optional) 793 amount = 100 # int | how many items to return (optional) (default to 100) 794 delimiter = 'delimiter_example' # str | delimiter used to group common prefixes by (optional) 795 prefix = 'prefix_example' # str | return items prefixed with this value (optional) 796 797 try: 798 # list objects under a given prefix 799 api_response = api_instance.list_objects(repository, ref, user_metadata=user_metadata, presign=presign, after=after, amount=amount, delimiter=delimiter, prefix=prefix) 800 print("The response of ObjectsApi->list_objects:\n") 801 pprint(api_response) 802 except Exception as e: 803 print("Exception when calling ObjectsApi->list_objects: %s\n" % e) 804 ``` 805 806 807 808 ### Parameters 809 810 811 Name | Type | Description | Notes 812 ------------- | ------------- | ------------- | ------------- 813 **repository** | **str**| | 814 **ref** | **str**| a reference (could be either a branch or a commit ID) | 815 **user_metadata** | **bool**| | [optional] [default to True] 816 **presign** | **bool**| | [optional] 817 **after** | **str**| return items after this value | [optional] 818 **amount** | **int**| how many items to return | [optional] [default to 100] 819 **delimiter** | **str**| delimiter used to group common prefixes by | [optional] 820 **prefix** | **str**| return items prefixed with this value | [optional] 821 822 ### Return type 823 824 [**ObjectStatsList**](ObjectStatsList.md) 825 826 ### Authorization 827 828 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 829 830 ### HTTP request headers 831 832 - **Content-Type**: Not defined 833 - **Accept**: application/json 834 835 ### HTTP response details 836 837 | Status code | Description | Response headers | 838 |-------------|-------------|------------------| 839 **200** | object listing | - | 840 **401** | Unauthorized | - | 841 **404** | Resource Not Found | - | 842 **420** | too many requests | - | 843 **0** | Internal Server Error | - | 844 845 [[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) 846 847 # **stat_object** 848 > ObjectStats stat_object(repository, ref, path, user_metadata=user_metadata, presign=presign) 849 850 get object metadata 851 852 ### Example 853 854 * Basic Authentication (basic_auth): 855 * Api Key Authentication (cookie_auth): 856 * Api Key Authentication (oidc_auth): 857 * Api Key Authentication (saml_auth): 858 * Bearer (JWT) Authentication (jwt_token): 859 860 ```python 861 import time 862 import os 863 import lakefs_sdk 864 from lakefs_sdk.models.object_stats import ObjectStats 865 from lakefs_sdk.rest import ApiException 866 from pprint import pprint 867 868 # Defining the host is optional and defaults to /api/v1 869 # See configuration.py for a list of all supported configuration parameters. 870 configuration = lakefs_sdk.Configuration( 871 host = "/api/v1" 872 ) 873 874 # The client must configure the authentication and authorization parameters 875 # in accordance with the API server security policy. 876 # Examples for each auth method are provided below, use the example that 877 # satisfies your auth use case. 878 879 # Configure HTTP basic authorization: basic_auth 880 configuration = lakefs_sdk.Configuration( 881 username = os.environ["USERNAME"], 882 password = os.environ["PASSWORD"] 883 ) 884 885 # Configure API key authorization: cookie_auth 886 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 887 888 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 889 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 890 891 # Configure API key authorization: oidc_auth 892 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 893 894 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 895 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 896 897 # Configure API key authorization: saml_auth 898 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 899 900 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 901 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 902 903 # Configure Bearer authorization (JWT): jwt_token 904 configuration = lakefs_sdk.Configuration( 905 access_token = os.environ["BEARER_TOKEN"] 906 ) 907 908 # Enter a context with an instance of the API client 909 with lakefs_sdk.ApiClient(configuration) as api_client: 910 # Create an instance of the API class 911 api_instance = lakefs_sdk.ObjectsApi(api_client) 912 repository = 'repository_example' # str | 913 ref = 'ref_example' # str | a reference (could be either a branch or a commit ID) 914 path = 'path_example' # str | relative to the branch 915 user_metadata = True # bool | (optional) (default to True) 916 presign = True # bool | (optional) 917 918 try: 919 # get object metadata 920 api_response = api_instance.stat_object(repository, ref, path, user_metadata=user_metadata, presign=presign) 921 print("The response of ObjectsApi->stat_object:\n") 922 pprint(api_response) 923 except Exception as e: 924 print("Exception when calling ObjectsApi->stat_object: %s\n" % e) 925 ``` 926 927 928 929 ### Parameters 930 931 932 Name | Type | Description | Notes 933 ------------- | ------------- | ------------- | ------------- 934 **repository** | **str**| | 935 **ref** | **str**| a reference (could be either a branch or a commit ID) | 936 **path** | **str**| relative to the branch | 937 **user_metadata** | **bool**| | [optional] [default to True] 938 **presign** | **bool**| | [optional] 939 940 ### Return type 941 942 [**ObjectStats**](ObjectStats.md) 943 944 ### Authorization 945 946 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 947 948 ### HTTP request headers 949 950 - **Content-Type**: Not defined 951 - **Accept**: application/json 952 953 ### HTTP response details 954 955 | Status code | Description | Response headers | 956 |-------------|-------------|------------------| 957 **200** | object metadata | - | 958 **401** | Unauthorized | - | 959 **404** | Resource Not Found | - | 960 **400** | Bad Request | - | 961 **410** | object gone (but partial metadata may be available) | - | 962 **420** | too many requests | - | 963 **0** | Internal Server Error | - | 964 965 [[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) 966 967 # **upload_object** 968 > ObjectStats upload_object(repository, branch, path, if_none_match=if_none_match, storage_class=storage_class, force=force, content=content) 969 970 971 972 ### Example 973 974 * Basic Authentication (basic_auth): 975 * Api Key Authentication (cookie_auth): 976 * Api Key Authentication (oidc_auth): 977 * Api Key Authentication (saml_auth): 978 * Bearer (JWT) Authentication (jwt_token): 979 980 ```python 981 import time 982 import os 983 import lakefs_sdk 984 from lakefs_sdk.models.object_stats import ObjectStats 985 from lakefs_sdk.rest import ApiException 986 from pprint import pprint 987 988 # Defining the host is optional and defaults to /api/v1 989 # See configuration.py for a list of all supported configuration parameters. 990 configuration = lakefs_sdk.Configuration( 991 host = "/api/v1" 992 ) 993 994 # The client must configure the authentication and authorization parameters 995 # in accordance with the API server security policy. 996 # Examples for each auth method are provided below, use the example that 997 # satisfies your auth use case. 998 999 # Configure HTTP basic authorization: basic_auth 1000 configuration = lakefs_sdk.Configuration( 1001 username = os.environ["USERNAME"], 1002 password = os.environ["PASSWORD"] 1003 ) 1004 1005 # Configure API key authorization: cookie_auth 1006 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 1007 1008 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1009 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 1010 1011 # Configure API key authorization: oidc_auth 1012 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 1013 1014 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1015 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 1016 1017 # Configure API key authorization: saml_auth 1018 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 1019 1020 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1021 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 1022 1023 # Configure Bearer authorization (JWT): jwt_token 1024 configuration = lakefs_sdk.Configuration( 1025 access_token = os.environ["BEARER_TOKEN"] 1026 ) 1027 1028 # Enter a context with an instance of the API client 1029 with lakefs_sdk.ApiClient(configuration) as api_client: 1030 # Create an instance of the API class 1031 api_instance = lakefs_sdk.ObjectsApi(api_client) 1032 repository = 'repository_example' # str | 1033 branch = 'branch_example' # str | 1034 path = 'path_example' # str | relative to the branch 1035 if_none_match = '*' # str | Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. (optional) 1036 storage_class = 'storage_class_example' # str | Deprecated, this capability will not be supported in future releases. (optional) 1037 force = False # bool | (optional) (default to False) 1038 content = None # bytearray | Only a single file per upload which must be named \\\"content\\\". (optional) 1039 1040 try: 1041 api_response = api_instance.upload_object(repository, branch, path, if_none_match=if_none_match, storage_class=storage_class, force=force, content=content) 1042 print("The response of ObjectsApi->upload_object:\n") 1043 pprint(api_response) 1044 except Exception as e: 1045 print("Exception when calling ObjectsApi->upload_object: %s\n" % e) 1046 ``` 1047 1048 1049 1050 ### Parameters 1051 1052 1053 Name | Type | Description | Notes 1054 ------------- | ------------- | ------------- | ------------- 1055 **repository** | **str**| | 1056 **branch** | **str**| | 1057 **path** | **str**| relative to the branch | 1058 **if_none_match** | **str**| Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. | [optional] 1059 **storage_class** | **str**| Deprecated, this capability will not be supported in future releases. | [optional] 1060 **force** | **bool**| | [optional] [default to False] 1061 **content** | **bytearray**| Only a single file per upload which must be named \\\"content\\\". | [optional] 1062 1063 ### Return type 1064 1065 [**ObjectStats**](ObjectStats.md) 1066 1067 ### Authorization 1068 1069 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 1070 1071 ### HTTP request headers 1072 1073 - **Content-Type**: multipart/form-data, application/octet-stream 1074 - **Accept**: application/json 1075 1076 ### HTTP response details 1077 1078 | Status code | Description | Response headers | 1079 |-------------|-------------|------------------| 1080 **201** | object metadata | - | 1081 **400** | Validation Error | - | 1082 **401** | Unauthorized | - | 1083 **403** | Forbidden | - | 1084 **404** | Resource Not Found | - | 1085 **412** | Precondition Failed | - | 1086 **420** | too many requests | - | 1087 **0** | Internal Server Error | - | 1088 1089 [[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) 1090