github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/java-legacy/docs/ObjectsApi.md (about) 1 # ObjectsApi 2 3 All URIs are relative to *http://localhost/api/v1* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**copyObject**](ObjectsApi.md#copyObject) | **POST** /repositories/{repository}/branches/{branch}/objects/copy | create a copy of an object 8 [**deleteObject**](ObjectsApi.md#deleteObject) | **DELETE** /repositories/{repository}/branches/{branch}/objects | delete object. Missing objects will not return a NotFound error. 9 [**deleteObjects**](ObjectsApi.md#deleteObjects) | **POST** /repositories/{repository}/branches/{branch}/objects/delete | delete objects. Missing objects will not return a NotFound error. 10 [**getObject**](ObjectsApi.md#getObject) | **GET** /repositories/{repository}/refs/{ref}/objects | get object content 11 [**getUnderlyingProperties**](ObjectsApi.md#getUnderlyingProperties) | **GET** /repositories/{repository}/refs/{ref}/objects/underlyingProperties | get object properties on underlying storage 12 [**headObject**](ObjectsApi.md#headObject) | **HEAD** /repositories/{repository}/refs/{ref}/objects | check if object exists 13 [**listObjects**](ObjectsApi.md#listObjects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix 14 [**statObject**](ObjectsApi.md#statObject) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata 15 [**uploadObject**](ObjectsApi.md#uploadObject) | **POST** /repositories/{repository}/branches/{branch}/objects | 16 17 18 <a name="copyObject"></a> 19 # **copyObject** 20 > ObjectStats copyObject(repository, branch, destPath, objectCopyCreation) 21 22 create a copy of an object 23 24 ### Example 25 ```java 26 // Import classes: 27 import io.lakefs.clients.api.ApiClient; 28 import io.lakefs.clients.api.ApiException; 29 import io.lakefs.clients.api.Configuration; 30 import io.lakefs.clients.api.auth.*; 31 import io.lakefs.clients.api.models.*; 32 import io.lakefs.clients.api.ObjectsApi; 33 34 public class Example { 35 public static void main(String[] args) { 36 ApiClient defaultClient = Configuration.getDefaultApiClient(); 37 defaultClient.setBasePath("http://localhost/api/v1"); 38 39 // Configure HTTP basic authorization: basic_auth 40 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 41 basic_auth.setUsername("YOUR USERNAME"); 42 basic_auth.setPassword("YOUR PASSWORD"); 43 44 // Configure API key authorization: cookie_auth 45 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 46 cookie_auth.setApiKey("YOUR API KEY"); 47 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 48 //cookie_auth.setApiKeyPrefix("Token"); 49 50 // Configure HTTP bearer authorization: jwt_token 51 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 52 jwt_token.setBearerToken("BEARER TOKEN"); 53 54 // Configure API key authorization: oidc_auth 55 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 56 oidc_auth.setApiKey("YOUR API KEY"); 57 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 58 //oidc_auth.setApiKeyPrefix("Token"); 59 60 // Configure API key authorization: saml_auth 61 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 62 saml_auth.setApiKey("YOUR API KEY"); 63 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 64 //saml_auth.setApiKeyPrefix("Token"); 65 66 ObjectsApi apiInstance = new ObjectsApi(defaultClient); 67 String repository = "repository_example"; // String | 68 String branch = "branch_example"; // String | destination branch for the copy 69 String destPath = "destPath_example"; // String | destination path relative to the branch 70 ObjectCopyCreation objectCopyCreation = new ObjectCopyCreation(); // ObjectCopyCreation | 71 try { 72 ObjectStats result = apiInstance.copyObject(repository, branch, destPath, objectCopyCreation); 73 System.out.println(result); 74 } catch (ApiException e) { 75 System.err.println("Exception when calling ObjectsApi#copyObject"); 76 System.err.println("Status code: " + e.getCode()); 77 System.err.println("Reason: " + e.getResponseBody()); 78 System.err.println("Response headers: " + e.getResponseHeaders()); 79 e.printStackTrace(); 80 } 81 } 82 } 83 ``` 84 85 ### Parameters 86 87 Name | Type | Description | Notes 88 ------------- | ------------- | ------------- | ------------- 89 **repository** | **String**| | 90 **branch** | **String**| destination branch for the copy | 91 **destPath** | **String**| destination path relative to the branch | 92 **objectCopyCreation** | [**ObjectCopyCreation**](ObjectCopyCreation.md)| | 93 94 ### Return type 95 96 [**ObjectStats**](ObjectStats.md) 97 98 ### Authorization 99 100 [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) 101 102 ### HTTP request headers 103 104 - **Content-Type**: application/json 105 - **Accept**: application/json 106 107 ### HTTP response details 108 | Status code | Description | Response headers | 109 |-------------|-------------|------------------| 110 **201** | Copy object response | - | 111 **400** | Validation Error | - | 112 **401** | Unauthorized | - | 113 **403** | Forbidden | - | 114 **404** | Resource Not Found | - | 115 **420** | too many requests | - | 116 **0** | Internal Server Error | - | 117 118 <a name="deleteObject"></a> 119 # **deleteObject** 120 > deleteObject(repository, branch, path, force) 121 122 delete object. Missing objects will not return a NotFound error. 123 124 ### Example 125 ```java 126 // Import classes: 127 import io.lakefs.clients.api.ApiClient; 128 import io.lakefs.clients.api.ApiException; 129 import io.lakefs.clients.api.Configuration; 130 import io.lakefs.clients.api.auth.*; 131 import io.lakefs.clients.api.models.*; 132 import io.lakefs.clients.api.ObjectsApi; 133 134 public class Example { 135 public static void main(String[] args) { 136 ApiClient defaultClient = Configuration.getDefaultApiClient(); 137 defaultClient.setBasePath("http://localhost/api/v1"); 138 139 // Configure HTTP basic authorization: basic_auth 140 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 141 basic_auth.setUsername("YOUR USERNAME"); 142 basic_auth.setPassword("YOUR PASSWORD"); 143 144 // Configure API key authorization: cookie_auth 145 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 146 cookie_auth.setApiKey("YOUR API KEY"); 147 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 148 //cookie_auth.setApiKeyPrefix("Token"); 149 150 // Configure HTTP bearer authorization: jwt_token 151 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 152 jwt_token.setBearerToken("BEARER TOKEN"); 153 154 // Configure API key authorization: oidc_auth 155 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 156 oidc_auth.setApiKey("YOUR API KEY"); 157 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 158 //oidc_auth.setApiKeyPrefix("Token"); 159 160 // Configure API key authorization: saml_auth 161 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 162 saml_auth.setApiKey("YOUR API KEY"); 163 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 164 //saml_auth.setApiKeyPrefix("Token"); 165 166 ObjectsApi apiInstance = new ObjectsApi(defaultClient); 167 String repository = "repository_example"; // String | 168 String branch = "branch_example"; // String | 169 String path = "path_example"; // String | relative to the branch 170 Boolean force = false; // Boolean | 171 try { 172 apiInstance.deleteObject(repository, branch, path, force); 173 } catch (ApiException e) { 174 System.err.println("Exception when calling ObjectsApi#deleteObject"); 175 System.err.println("Status code: " + e.getCode()); 176 System.err.println("Reason: " + e.getResponseBody()); 177 System.err.println("Response headers: " + e.getResponseHeaders()); 178 e.printStackTrace(); 179 } 180 } 181 } 182 ``` 183 184 ### Parameters 185 186 Name | Type | Description | Notes 187 ------------- | ------------- | ------------- | ------------- 188 **repository** | **String**| | 189 **branch** | **String**| | 190 **path** | **String**| relative to the branch | 191 **force** | **Boolean**| | [optional] [default to false] 192 193 ### Return type 194 195 null (empty response body) 196 197 ### Authorization 198 199 [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) 200 201 ### HTTP request headers 202 203 - **Content-Type**: Not defined 204 - **Accept**: application/json 205 206 ### HTTP response details 207 | Status code | Description | Response headers | 208 |-------------|-------------|------------------| 209 **204** | object deleted successfully | - | 210 **401** | Unauthorized | - | 211 **403** | Forbidden | - | 212 **404** | Resource Not Found | - | 213 **420** | too many requests | - | 214 **0** | Internal Server Error | - | 215 216 <a name="deleteObjects"></a> 217 # **deleteObjects** 218 > ObjectErrorList deleteObjects(repository, branch, pathList, force) 219 220 delete objects. Missing objects will not return a NotFound error. 221 222 ### Example 223 ```java 224 // Import classes: 225 import io.lakefs.clients.api.ApiClient; 226 import io.lakefs.clients.api.ApiException; 227 import io.lakefs.clients.api.Configuration; 228 import io.lakefs.clients.api.auth.*; 229 import io.lakefs.clients.api.models.*; 230 import io.lakefs.clients.api.ObjectsApi; 231 232 public class Example { 233 public static void main(String[] args) { 234 ApiClient defaultClient = Configuration.getDefaultApiClient(); 235 defaultClient.setBasePath("http://localhost/api/v1"); 236 237 // Configure HTTP basic authorization: basic_auth 238 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 239 basic_auth.setUsername("YOUR USERNAME"); 240 basic_auth.setPassword("YOUR PASSWORD"); 241 242 // Configure API key authorization: cookie_auth 243 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 244 cookie_auth.setApiKey("YOUR API KEY"); 245 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 246 //cookie_auth.setApiKeyPrefix("Token"); 247 248 // Configure HTTP bearer authorization: jwt_token 249 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 250 jwt_token.setBearerToken("BEARER TOKEN"); 251 252 // Configure API key authorization: oidc_auth 253 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 254 oidc_auth.setApiKey("YOUR API KEY"); 255 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 256 //oidc_auth.setApiKeyPrefix("Token"); 257 258 // Configure API key authorization: saml_auth 259 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 260 saml_auth.setApiKey("YOUR API KEY"); 261 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 262 //saml_auth.setApiKeyPrefix("Token"); 263 264 ObjectsApi apiInstance = new ObjectsApi(defaultClient); 265 String repository = "repository_example"; // String | 266 String branch = "branch_example"; // String | 267 PathList pathList = new PathList(); // PathList | 268 Boolean force = false; // Boolean | 269 try { 270 ObjectErrorList result = apiInstance.deleteObjects(repository, branch, pathList, force); 271 System.out.println(result); 272 } catch (ApiException e) { 273 System.err.println("Exception when calling ObjectsApi#deleteObjects"); 274 System.err.println("Status code: " + e.getCode()); 275 System.err.println("Reason: " + e.getResponseBody()); 276 System.err.println("Response headers: " + e.getResponseHeaders()); 277 e.printStackTrace(); 278 } 279 } 280 } 281 ``` 282 283 ### Parameters 284 285 Name | Type | Description | Notes 286 ------------- | ------------- | ------------- | ------------- 287 **repository** | **String**| | 288 **branch** | **String**| | 289 **pathList** | [**PathList**](PathList.md)| | 290 **force** | **Boolean**| | [optional] [default to false] 291 292 ### Return type 293 294 [**ObjectErrorList**](ObjectErrorList.md) 295 296 ### Authorization 297 298 [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) 299 300 ### HTTP request headers 301 302 - **Content-Type**: application/json 303 - **Accept**: application/json 304 305 ### HTTP response details 306 | Status code | Description | Response headers | 307 |-------------|-------------|------------------| 308 **200** | Delete objects response | - | 309 **401** | Unauthorized | - | 310 **403** | Forbidden | - | 311 **404** | Resource Not Found | - | 312 **420** | too many requests | - | 313 **0** | Internal Server Error | - | 314 315 <a name="getObject"></a> 316 # **getObject** 317 > File getObject(repository, ref, path, range, ifNoneMatch, presign) 318 319 get object content 320 321 ### Example 322 ```java 323 // Import classes: 324 import io.lakefs.clients.api.ApiClient; 325 import io.lakefs.clients.api.ApiException; 326 import io.lakefs.clients.api.Configuration; 327 import io.lakefs.clients.api.auth.*; 328 import io.lakefs.clients.api.models.*; 329 import io.lakefs.clients.api.ObjectsApi; 330 331 public class Example { 332 public static void main(String[] args) { 333 ApiClient defaultClient = Configuration.getDefaultApiClient(); 334 defaultClient.setBasePath("http://localhost/api/v1"); 335 336 // Configure HTTP basic authorization: basic_auth 337 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 338 basic_auth.setUsername("YOUR USERNAME"); 339 basic_auth.setPassword("YOUR PASSWORD"); 340 341 // Configure API key authorization: cookie_auth 342 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 343 cookie_auth.setApiKey("YOUR API KEY"); 344 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 345 //cookie_auth.setApiKeyPrefix("Token"); 346 347 // Configure HTTP bearer authorization: jwt_token 348 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 349 jwt_token.setBearerToken("BEARER TOKEN"); 350 351 // Configure API key authorization: oidc_auth 352 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 353 oidc_auth.setApiKey("YOUR API KEY"); 354 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 355 //oidc_auth.setApiKeyPrefix("Token"); 356 357 // Configure API key authorization: saml_auth 358 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 359 saml_auth.setApiKey("YOUR API KEY"); 360 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 361 //saml_auth.setApiKeyPrefix("Token"); 362 363 ObjectsApi apiInstance = new ObjectsApi(defaultClient); 364 String repository = "repository_example"; // String | 365 String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) 366 String path = "path_example"; // String | relative to the ref 367 String range = "bytes=0-1023"; // String | Byte range to retrieve 368 String ifNoneMatch = "33a64df551425fcc55e4d42a148795d9f25f89d4"; // String | Returns response only if the object does not have a matching ETag 369 Boolean presign = true; // Boolean | 370 try { 371 File result = apiInstance.getObject(repository, ref, path, range, ifNoneMatch, presign); 372 System.out.println(result); 373 } catch (ApiException e) { 374 System.err.println("Exception when calling ObjectsApi#getObject"); 375 System.err.println("Status code: " + e.getCode()); 376 System.err.println("Reason: " + e.getResponseBody()); 377 System.err.println("Response headers: " + e.getResponseHeaders()); 378 e.printStackTrace(); 379 } 380 } 381 } 382 ``` 383 384 ### Parameters 385 386 Name | Type | Description | Notes 387 ------------- | ------------- | ------------- | ------------- 388 **repository** | **String**| | 389 **ref** | **String**| a reference (could be either a branch or a commit ID) | 390 **path** | **String**| relative to the ref | 391 **range** | **String**| Byte range to retrieve | [optional] 392 **ifNoneMatch** | **String**| Returns response only if the object does not have a matching ETag | [optional] 393 **presign** | **Boolean**| | [optional] 394 395 ### Return type 396 397 [**File**](File.md) 398 399 ### Authorization 400 401 [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) 402 403 ### HTTP request headers 404 405 - **Content-Type**: Not defined 406 - **Accept**: application/octet-stream, application/json 407 408 ### HTTP response details 409 | Status code | Description | Response headers | 410 |-------------|-------------|------------------| 411 **200** | object content | * Content-Length - <br> * Last-Modified - <br> * ETag - <br> | 412 **206** | partial object content | * Content-Length - <br> * Content-Range - <br> * Last-Modified - <br> * ETag - <br> | 413 **302** | Redirect to a pre-signed URL for the object | * Location - redirect to S3 <br> | 414 **304** | Content not modified | - | 415 **401** | Unauthorized | - | 416 **404** | Resource Not Found | - | 417 **410** | object expired | - | 418 **416** | Requested Range Not Satisfiable | - | 419 **420** | too many requests | - | 420 **0** | Internal Server Error | - | 421 422 <a name="getUnderlyingProperties"></a> 423 # **getUnderlyingProperties** 424 > UnderlyingObjectProperties getUnderlyingProperties(repository, ref, path) 425 426 get object properties on underlying storage 427 428 ### Example 429 ```java 430 // Import classes: 431 import io.lakefs.clients.api.ApiClient; 432 import io.lakefs.clients.api.ApiException; 433 import io.lakefs.clients.api.Configuration; 434 import io.lakefs.clients.api.auth.*; 435 import io.lakefs.clients.api.models.*; 436 import io.lakefs.clients.api.ObjectsApi; 437 438 public class Example { 439 public static void main(String[] args) { 440 ApiClient defaultClient = Configuration.getDefaultApiClient(); 441 defaultClient.setBasePath("http://localhost/api/v1"); 442 443 // Configure HTTP basic authorization: basic_auth 444 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 445 basic_auth.setUsername("YOUR USERNAME"); 446 basic_auth.setPassword("YOUR PASSWORD"); 447 448 // Configure API key authorization: cookie_auth 449 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 450 cookie_auth.setApiKey("YOUR API KEY"); 451 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 452 //cookie_auth.setApiKeyPrefix("Token"); 453 454 // Configure HTTP bearer authorization: jwt_token 455 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 456 jwt_token.setBearerToken("BEARER TOKEN"); 457 458 // Configure API key authorization: oidc_auth 459 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 460 oidc_auth.setApiKey("YOUR API KEY"); 461 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 462 //oidc_auth.setApiKeyPrefix("Token"); 463 464 // Configure API key authorization: saml_auth 465 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 466 saml_auth.setApiKey("YOUR API KEY"); 467 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 468 //saml_auth.setApiKeyPrefix("Token"); 469 470 ObjectsApi apiInstance = new ObjectsApi(defaultClient); 471 String repository = "repository_example"; // String | 472 String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) 473 String path = "path_example"; // String | relative to the branch 474 try { 475 UnderlyingObjectProperties result = apiInstance.getUnderlyingProperties(repository, ref, path); 476 System.out.println(result); 477 } catch (ApiException e) { 478 System.err.println("Exception when calling ObjectsApi#getUnderlyingProperties"); 479 System.err.println("Status code: " + e.getCode()); 480 System.err.println("Reason: " + e.getResponseBody()); 481 System.err.println("Response headers: " + e.getResponseHeaders()); 482 e.printStackTrace(); 483 } 484 } 485 } 486 ``` 487 488 ### Parameters 489 490 Name | Type | Description | Notes 491 ------------- | ------------- | ------------- | ------------- 492 **repository** | **String**| | 493 **ref** | **String**| a reference (could be either a branch or a commit ID) | 494 **path** | **String**| relative to the branch | 495 496 ### Return type 497 498 [**UnderlyingObjectProperties**](UnderlyingObjectProperties.md) 499 500 ### Authorization 501 502 [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) 503 504 ### HTTP request headers 505 506 - **Content-Type**: Not defined 507 - **Accept**: application/json 508 509 ### HTTP response details 510 | Status code | Description | Response headers | 511 |-------------|-------------|------------------| 512 **200** | object metadata on underlying storage | - | 513 **401** | Unauthorized | - | 514 **404** | Resource Not Found | - | 515 **420** | too many requests | - | 516 **0** | Internal Server Error | - | 517 518 <a name="headObject"></a> 519 # **headObject** 520 > headObject(repository, ref, path, range) 521 522 check if object exists 523 524 ### Example 525 ```java 526 // Import classes: 527 import io.lakefs.clients.api.ApiClient; 528 import io.lakefs.clients.api.ApiException; 529 import io.lakefs.clients.api.Configuration; 530 import io.lakefs.clients.api.auth.*; 531 import io.lakefs.clients.api.models.*; 532 import io.lakefs.clients.api.ObjectsApi; 533 534 public class Example { 535 public static void main(String[] args) { 536 ApiClient defaultClient = Configuration.getDefaultApiClient(); 537 defaultClient.setBasePath("http://localhost/api/v1"); 538 539 // Configure HTTP basic authorization: basic_auth 540 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 541 basic_auth.setUsername("YOUR USERNAME"); 542 basic_auth.setPassword("YOUR PASSWORD"); 543 544 // Configure API key authorization: cookie_auth 545 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 546 cookie_auth.setApiKey("YOUR API KEY"); 547 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 548 //cookie_auth.setApiKeyPrefix("Token"); 549 550 // Configure HTTP bearer authorization: jwt_token 551 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 552 jwt_token.setBearerToken("BEARER TOKEN"); 553 554 // Configure API key authorization: oidc_auth 555 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 556 oidc_auth.setApiKey("YOUR API KEY"); 557 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 558 //oidc_auth.setApiKeyPrefix("Token"); 559 560 // Configure API key authorization: saml_auth 561 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 562 saml_auth.setApiKey("YOUR API KEY"); 563 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 564 //saml_auth.setApiKeyPrefix("Token"); 565 566 ObjectsApi apiInstance = new ObjectsApi(defaultClient); 567 String repository = "repository_example"; // String | 568 String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) 569 String path = "path_example"; // String | relative to the ref 570 String range = "bytes=0-1023"; // String | Byte range to retrieve 571 try { 572 apiInstance.headObject(repository, ref, path, range); 573 } catch (ApiException e) { 574 System.err.println("Exception when calling ObjectsApi#headObject"); 575 System.err.println("Status code: " + e.getCode()); 576 System.err.println("Reason: " + e.getResponseBody()); 577 System.err.println("Response headers: " + e.getResponseHeaders()); 578 e.printStackTrace(); 579 } 580 } 581 } 582 ``` 583 584 ### Parameters 585 586 Name | Type | Description | Notes 587 ------------- | ------------- | ------------- | ------------- 588 **repository** | **String**| | 589 **ref** | **String**| a reference (could be either a branch or a commit ID) | 590 **path** | **String**| relative to the ref | 591 **range** | **String**| Byte range to retrieve | [optional] 592 593 ### Return type 594 595 null (empty response body) 596 597 ### Authorization 598 599 [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) 600 601 ### HTTP request headers 602 603 - **Content-Type**: Not defined 604 - **Accept**: Not defined 605 606 ### HTTP response details 607 | Status code | Description | Response headers | 608 |-------------|-------------|------------------| 609 **200** | object exists | * Content-Length - <br> * Last-Modified - <br> * ETag - <br> | 610 **206** | partial object content info | * Content-Length - <br> * Content-Range - <br> * Last-Modified - <br> * ETag - <br> | 611 **401** | Unauthorized | - | 612 **404** | object not found | - | 613 **410** | object expired | - | 614 **416** | Requested Range Not Satisfiable | - | 615 **420** | too many requests | - | 616 **0** | internal server error | - | 617 618 <a name="listObjects"></a> 619 # **listObjects** 620 > ObjectStatsList listObjects(repository, ref, userMetadata, presign, after, amount, delimiter, prefix) 621 622 list objects under a given prefix 623 624 ### Example 625 ```java 626 // Import classes: 627 import io.lakefs.clients.api.ApiClient; 628 import io.lakefs.clients.api.ApiException; 629 import io.lakefs.clients.api.Configuration; 630 import io.lakefs.clients.api.auth.*; 631 import io.lakefs.clients.api.models.*; 632 import io.lakefs.clients.api.ObjectsApi; 633 634 public class Example { 635 public static void main(String[] args) { 636 ApiClient defaultClient = Configuration.getDefaultApiClient(); 637 defaultClient.setBasePath("http://localhost/api/v1"); 638 639 // Configure HTTP basic authorization: basic_auth 640 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 641 basic_auth.setUsername("YOUR USERNAME"); 642 basic_auth.setPassword("YOUR PASSWORD"); 643 644 // Configure API key authorization: cookie_auth 645 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 646 cookie_auth.setApiKey("YOUR API KEY"); 647 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 648 //cookie_auth.setApiKeyPrefix("Token"); 649 650 // Configure HTTP bearer authorization: jwt_token 651 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 652 jwt_token.setBearerToken("BEARER TOKEN"); 653 654 // Configure API key authorization: oidc_auth 655 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 656 oidc_auth.setApiKey("YOUR API KEY"); 657 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 658 //oidc_auth.setApiKeyPrefix("Token"); 659 660 // Configure API key authorization: saml_auth 661 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 662 saml_auth.setApiKey("YOUR API KEY"); 663 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 664 //saml_auth.setApiKeyPrefix("Token"); 665 666 ObjectsApi apiInstance = new ObjectsApi(defaultClient); 667 String repository = "repository_example"; // String | 668 String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) 669 Boolean userMetadata = true; // Boolean | 670 Boolean presign = true; // Boolean | 671 String after = "after_example"; // String | return items after this value 672 Integer amount = 100; // Integer | how many items to return 673 String delimiter = "delimiter_example"; // String | delimiter used to group common prefixes by 674 String prefix = "prefix_example"; // String | return items prefixed with this value 675 try { 676 ObjectStatsList result = apiInstance.listObjects(repository, ref, userMetadata, presign, after, amount, delimiter, prefix); 677 System.out.println(result); 678 } catch (ApiException e) { 679 System.err.println("Exception when calling ObjectsApi#listObjects"); 680 System.err.println("Status code: " + e.getCode()); 681 System.err.println("Reason: " + e.getResponseBody()); 682 System.err.println("Response headers: " + e.getResponseHeaders()); 683 e.printStackTrace(); 684 } 685 } 686 } 687 ``` 688 689 ### Parameters 690 691 Name | Type | Description | Notes 692 ------------- | ------------- | ------------- | ------------- 693 **repository** | **String**| | 694 **ref** | **String**| a reference (could be either a branch or a commit ID) | 695 **userMetadata** | **Boolean**| | [optional] [default to true] 696 **presign** | **Boolean**| | [optional] 697 **after** | **String**| return items after this value | [optional] 698 **amount** | **Integer**| how many items to return | [optional] [default to 100] 699 **delimiter** | **String**| delimiter used to group common prefixes by | [optional] 700 **prefix** | **String**| return items prefixed with this value | [optional] 701 702 ### Return type 703 704 [**ObjectStatsList**](ObjectStatsList.md) 705 706 ### Authorization 707 708 [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) 709 710 ### HTTP request headers 711 712 - **Content-Type**: Not defined 713 - **Accept**: application/json 714 715 ### HTTP response details 716 | Status code | Description | Response headers | 717 |-------------|-------------|------------------| 718 **200** | object listing | - | 719 **401** | Unauthorized | - | 720 **404** | Resource Not Found | - | 721 **420** | too many requests | - | 722 **0** | Internal Server Error | - | 723 724 <a name="statObject"></a> 725 # **statObject** 726 > ObjectStats statObject(repository, ref, path, userMetadata, presign) 727 728 get object metadata 729 730 ### Example 731 ```java 732 // Import classes: 733 import io.lakefs.clients.api.ApiClient; 734 import io.lakefs.clients.api.ApiException; 735 import io.lakefs.clients.api.Configuration; 736 import io.lakefs.clients.api.auth.*; 737 import io.lakefs.clients.api.models.*; 738 import io.lakefs.clients.api.ObjectsApi; 739 740 public class Example { 741 public static void main(String[] args) { 742 ApiClient defaultClient = Configuration.getDefaultApiClient(); 743 defaultClient.setBasePath("http://localhost/api/v1"); 744 745 // Configure HTTP basic authorization: basic_auth 746 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 747 basic_auth.setUsername("YOUR USERNAME"); 748 basic_auth.setPassword("YOUR PASSWORD"); 749 750 // Configure API key authorization: cookie_auth 751 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 752 cookie_auth.setApiKey("YOUR API KEY"); 753 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 754 //cookie_auth.setApiKeyPrefix("Token"); 755 756 // Configure HTTP bearer authorization: jwt_token 757 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 758 jwt_token.setBearerToken("BEARER TOKEN"); 759 760 // Configure API key authorization: oidc_auth 761 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 762 oidc_auth.setApiKey("YOUR API KEY"); 763 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 764 //oidc_auth.setApiKeyPrefix("Token"); 765 766 // Configure API key authorization: saml_auth 767 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 768 saml_auth.setApiKey("YOUR API KEY"); 769 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 770 //saml_auth.setApiKeyPrefix("Token"); 771 772 ObjectsApi apiInstance = new ObjectsApi(defaultClient); 773 String repository = "repository_example"; // String | 774 String ref = "ref_example"; // String | a reference (could be either a branch or a commit ID) 775 String path = "path_example"; // String | relative to the branch 776 Boolean userMetadata = true; // Boolean | 777 Boolean presign = true; // Boolean | 778 try { 779 ObjectStats result = apiInstance.statObject(repository, ref, path, userMetadata, presign); 780 System.out.println(result); 781 } catch (ApiException e) { 782 System.err.println("Exception when calling ObjectsApi#statObject"); 783 System.err.println("Status code: " + e.getCode()); 784 System.err.println("Reason: " + e.getResponseBody()); 785 System.err.println("Response headers: " + e.getResponseHeaders()); 786 e.printStackTrace(); 787 } 788 } 789 } 790 ``` 791 792 ### Parameters 793 794 Name | Type | Description | Notes 795 ------------- | ------------- | ------------- | ------------- 796 **repository** | **String**| | 797 **ref** | **String**| a reference (could be either a branch or a commit ID) | 798 **path** | **String**| relative to the branch | 799 **userMetadata** | **Boolean**| | [optional] [default to true] 800 **presign** | **Boolean**| | [optional] 801 802 ### Return type 803 804 [**ObjectStats**](ObjectStats.md) 805 806 ### Authorization 807 808 [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) 809 810 ### HTTP request headers 811 812 - **Content-Type**: Not defined 813 - **Accept**: application/json 814 815 ### HTTP response details 816 | Status code | Description | Response headers | 817 |-------------|-------------|------------------| 818 **200** | object metadata | - | 819 **401** | Unauthorized | - | 820 **404** | Resource Not Found | - | 821 **400** | Bad Request | - | 822 **410** | object gone (but partial metadata may be available) | - | 823 **420** | too many requests | - | 824 **0** | Internal Server Error | - | 825 826 <a name="uploadObject"></a> 827 # **uploadObject** 828 > ObjectStats uploadObject(repository, branch, path, ifNoneMatch, storageClass, force, content) 829 830 831 832 ### Example 833 ```java 834 // Import classes: 835 import io.lakefs.clients.api.ApiClient; 836 import io.lakefs.clients.api.ApiException; 837 import io.lakefs.clients.api.Configuration; 838 import io.lakefs.clients.api.auth.*; 839 import io.lakefs.clients.api.models.*; 840 import io.lakefs.clients.api.ObjectsApi; 841 842 public class Example { 843 public static void main(String[] args) { 844 ApiClient defaultClient = Configuration.getDefaultApiClient(); 845 defaultClient.setBasePath("http://localhost/api/v1"); 846 847 // Configure HTTP basic authorization: basic_auth 848 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 849 basic_auth.setUsername("YOUR USERNAME"); 850 basic_auth.setPassword("YOUR PASSWORD"); 851 852 // Configure API key authorization: cookie_auth 853 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 854 cookie_auth.setApiKey("YOUR API KEY"); 855 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 856 //cookie_auth.setApiKeyPrefix("Token"); 857 858 // Configure HTTP bearer authorization: jwt_token 859 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 860 jwt_token.setBearerToken("BEARER TOKEN"); 861 862 // Configure API key authorization: oidc_auth 863 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 864 oidc_auth.setApiKey("YOUR API KEY"); 865 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 866 //oidc_auth.setApiKeyPrefix("Token"); 867 868 // Configure API key authorization: saml_auth 869 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 870 saml_auth.setApiKey("YOUR API KEY"); 871 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 872 //saml_auth.setApiKeyPrefix("Token"); 873 874 ObjectsApi apiInstance = new ObjectsApi(defaultClient); 875 String repository = "repository_example"; // String | 876 String branch = "branch_example"; // String | 877 String path = "path_example"; // String | relative to the branch 878 String ifNoneMatch = "*"; // String | Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. 879 String storageClass = "storageClass_example"; // String | Deprecated, this capability will not be supported in future releases. 880 Boolean force = false; // Boolean | 881 File content = new File("/path/to/file"); // File | Only a single file per upload which must be named \\\"content\\\". 882 try { 883 ObjectStats result = apiInstance.uploadObject(repository, branch, path, ifNoneMatch, storageClass, force, content); 884 System.out.println(result); 885 } catch (ApiException e) { 886 System.err.println("Exception when calling ObjectsApi#uploadObject"); 887 System.err.println("Status code: " + e.getCode()); 888 System.err.println("Reason: " + e.getResponseBody()); 889 System.err.println("Response headers: " + e.getResponseHeaders()); 890 e.printStackTrace(); 891 } 892 } 893 } 894 ``` 895 896 ### Parameters 897 898 Name | Type | Description | Notes 899 ------------- | ------------- | ------------- | ------------- 900 **repository** | **String**| | 901 **branch** | **String**| | 902 **path** | **String**| relative to the branch | 903 **ifNoneMatch** | **String**| Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. | [optional] 904 **storageClass** | **String**| Deprecated, this capability will not be supported in future releases. | [optional] 905 **force** | **Boolean**| | [optional] [default to false] 906 **content** | **File**| Only a single file per upload which must be named \\\"content\\\". | [optional] 907 908 ### Return type 909 910 [**ObjectStats**](ObjectStats.md) 911 912 ### Authorization 913 914 [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) 915 916 ### HTTP request headers 917 918 - **Content-Type**: multipart/form-data, application/octet-stream 919 - **Accept**: application/json 920 921 ### HTTP response details 922 | Status code | Description | Response headers | 923 |-------------|-------------|------------------| 924 **201** | object metadata | - | 925 **400** | Validation Error | - | 926 **401** | Unauthorized | - | 927 **403** | Forbidden | - | 928 **404** | Resource Not Found | - | 929 **412** | Precondition Failed | - | 930 **420** | too many requests | - | 931 **0** | Internal Server Error | - | 932