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