github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/java/docs/ImportApi.md (about) 1 # ImportApi 2 3 All URIs are relative to */api/v1* 4 5 | Method | HTTP request | Description | 6 |------------- | ------------- | -------------| 7 | [**importCancel**](ImportApi.md#importCancel) | **DELETE** /repositories/{repository}/branches/{branch}/import | cancel ongoing import | 8 | [**importStart**](ImportApi.md#importStart) | **POST** /repositories/{repository}/branches/{branch}/import | import data from object store | 9 | [**importStatus**](ImportApi.md#importStatus) | **GET** /repositories/{repository}/branches/{branch}/import | get import status | 10 11 12 <a id="importCancel"></a> 13 # **importCancel** 14 > importCancel(repository, branch, id).execute(); 15 16 cancel ongoing import 17 18 ### Example 19 ```java 20 // Import classes: 21 import io.lakefs.clients.sdk.ApiClient; 22 import io.lakefs.clients.sdk.ApiException; 23 import io.lakefs.clients.sdk.Configuration; 24 import io.lakefs.clients.sdk.auth.*; 25 import io.lakefs.clients.sdk.models.*; 26 import io.lakefs.clients.sdk.ImportApi; 27 28 public class Example { 29 public static void main(String[] args) { 30 ApiClient defaultClient = Configuration.getDefaultApiClient(); 31 defaultClient.setBasePath("/api/v1"); 32 33 // Configure HTTP basic authorization: basic_auth 34 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 35 basic_auth.setUsername("YOUR USERNAME"); 36 basic_auth.setPassword("YOUR PASSWORD"); 37 38 // Configure API key authorization: cookie_auth 39 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 40 cookie_auth.setApiKey("YOUR API KEY"); 41 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 42 //cookie_auth.setApiKeyPrefix("Token"); 43 44 // Configure API key authorization: oidc_auth 45 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 46 oidc_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 //oidc_auth.setApiKeyPrefix("Token"); 49 50 // Configure API key authorization: saml_auth 51 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 52 saml_auth.setApiKey("YOUR API KEY"); 53 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 54 //saml_auth.setApiKeyPrefix("Token"); 55 56 // Configure HTTP bearer authorization: jwt_token 57 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 58 jwt_token.setBearerToken("BEARER TOKEN"); 59 60 ImportApi apiInstance = new ImportApi(defaultClient); 61 String repository = "repository_example"; // String | 62 String branch = "branch_example"; // String | 63 String id = "id_example"; // String | Unique identifier of the import process 64 try { 65 apiInstance.importCancel(repository, branch, id) 66 .execute(); 67 } catch (ApiException e) { 68 System.err.println("Exception when calling ImportApi#importCancel"); 69 System.err.println("Status code: " + e.getCode()); 70 System.err.println("Reason: " + e.getResponseBody()); 71 System.err.println("Response headers: " + e.getResponseHeaders()); 72 e.printStackTrace(); 73 } 74 } 75 } 76 ``` 77 78 ### Parameters 79 80 | Name | Type | Description | Notes | 81 |------------- | ------------- | ------------- | -------------| 82 | **repository** | **String**| | | 83 | **branch** | **String**| | | 84 | **id** | **String**| Unique identifier of the import process | | 85 86 ### Return type 87 88 null (empty response body) 89 90 ### Authorization 91 92 [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) 93 94 ### HTTP request headers 95 96 - **Content-Type**: Not defined 97 - **Accept**: application/json 98 99 ### HTTP response details 100 | Status code | Description | Response headers | 101 |-------------|-------------|------------------| 102 | **204** | import canceled successfully | - | 103 | **401** | Unauthorized | - | 104 | **403** | Forbidden | - | 105 | **404** | Resource Not Found | - | 106 | **409** | Resource Conflicts With Target | - | 107 | **420** | too many requests | - | 108 | **0** | Internal Server Error | - | 109 110 <a id="importStart"></a> 111 # **importStart** 112 > ImportCreationResponse importStart(repository, branch, importCreation).execute(); 113 114 import data from object store 115 116 ### Example 117 ```java 118 // Import classes: 119 import io.lakefs.clients.sdk.ApiClient; 120 import io.lakefs.clients.sdk.ApiException; 121 import io.lakefs.clients.sdk.Configuration; 122 import io.lakefs.clients.sdk.auth.*; 123 import io.lakefs.clients.sdk.models.*; 124 import io.lakefs.clients.sdk.ImportApi; 125 126 public class Example { 127 public static void main(String[] args) { 128 ApiClient defaultClient = Configuration.getDefaultApiClient(); 129 defaultClient.setBasePath("/api/v1"); 130 131 // Configure HTTP basic authorization: basic_auth 132 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 133 basic_auth.setUsername("YOUR USERNAME"); 134 basic_auth.setPassword("YOUR PASSWORD"); 135 136 // Configure API key authorization: cookie_auth 137 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 138 cookie_auth.setApiKey("YOUR API KEY"); 139 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 140 //cookie_auth.setApiKeyPrefix("Token"); 141 142 // Configure API key authorization: oidc_auth 143 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 144 oidc_auth.setApiKey("YOUR API KEY"); 145 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 146 //oidc_auth.setApiKeyPrefix("Token"); 147 148 // Configure API key authorization: saml_auth 149 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 150 saml_auth.setApiKey("YOUR API KEY"); 151 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 152 //saml_auth.setApiKeyPrefix("Token"); 153 154 // Configure HTTP bearer authorization: jwt_token 155 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 156 jwt_token.setBearerToken("BEARER TOKEN"); 157 158 ImportApi apiInstance = new ImportApi(defaultClient); 159 String repository = "repository_example"; // String | 160 String branch = "branch_example"; // String | 161 ImportCreation importCreation = new ImportCreation(); // ImportCreation | 162 try { 163 ImportCreationResponse result = apiInstance.importStart(repository, branch, importCreation) 164 .execute(); 165 System.out.println(result); 166 } catch (ApiException e) { 167 System.err.println("Exception when calling ImportApi#importStart"); 168 System.err.println("Status code: " + e.getCode()); 169 System.err.println("Reason: " + e.getResponseBody()); 170 System.err.println("Response headers: " + e.getResponseHeaders()); 171 e.printStackTrace(); 172 } 173 } 174 } 175 ``` 176 177 ### Parameters 178 179 | Name | Type | Description | Notes | 180 |------------- | ------------- | ------------- | -------------| 181 | **repository** | **String**| | | 182 | **branch** | **String**| | | 183 | **importCreation** | [**ImportCreation**](ImportCreation.md)| | | 184 185 ### Return type 186 187 [**ImportCreationResponse**](ImportCreationResponse.md) 188 189 ### Authorization 190 191 [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) 192 193 ### HTTP request headers 194 195 - **Content-Type**: application/json 196 - **Accept**: application/json 197 198 ### HTTP response details 199 | Status code | Description | Response headers | 200 |-------------|-------------|------------------| 201 | **202** | Import started | - | 202 | **400** | Validation Error | - | 203 | **401** | Unauthorized | - | 204 | **403** | Forbidden | - | 205 | **404** | Resource Not Found | - | 206 | **420** | too many requests | - | 207 | **0** | Internal Server Error | - | 208 209 <a id="importStatus"></a> 210 # **importStatus** 211 > ImportStatus importStatus(repository, branch, id).execute(); 212 213 get import status 214 215 ### Example 216 ```java 217 // Import classes: 218 import io.lakefs.clients.sdk.ApiClient; 219 import io.lakefs.clients.sdk.ApiException; 220 import io.lakefs.clients.sdk.Configuration; 221 import io.lakefs.clients.sdk.auth.*; 222 import io.lakefs.clients.sdk.models.*; 223 import io.lakefs.clients.sdk.ImportApi; 224 225 public class Example { 226 public static void main(String[] args) { 227 ApiClient defaultClient = Configuration.getDefaultApiClient(); 228 defaultClient.setBasePath("/api/v1"); 229 230 // Configure HTTP basic authorization: basic_auth 231 HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); 232 basic_auth.setUsername("YOUR USERNAME"); 233 basic_auth.setPassword("YOUR PASSWORD"); 234 235 // Configure API key authorization: cookie_auth 236 ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); 237 cookie_auth.setApiKey("YOUR API KEY"); 238 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 239 //cookie_auth.setApiKeyPrefix("Token"); 240 241 // Configure API key authorization: oidc_auth 242 ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); 243 oidc_auth.setApiKey("YOUR API KEY"); 244 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 245 //oidc_auth.setApiKeyPrefix("Token"); 246 247 // Configure API key authorization: saml_auth 248 ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); 249 saml_auth.setApiKey("YOUR API KEY"); 250 // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) 251 //saml_auth.setApiKeyPrefix("Token"); 252 253 // Configure HTTP bearer authorization: jwt_token 254 HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); 255 jwt_token.setBearerToken("BEARER TOKEN"); 256 257 ImportApi apiInstance = new ImportApi(defaultClient); 258 String repository = "repository_example"; // String | 259 String branch = "branch_example"; // String | 260 String id = "id_example"; // String | Unique identifier of the import process 261 try { 262 ImportStatus result = apiInstance.importStatus(repository, branch, id) 263 .execute(); 264 System.out.println(result); 265 } catch (ApiException e) { 266 System.err.println("Exception when calling ImportApi#importStatus"); 267 System.err.println("Status code: " + e.getCode()); 268 System.err.println("Reason: " + e.getResponseBody()); 269 System.err.println("Response headers: " + e.getResponseHeaders()); 270 e.printStackTrace(); 271 } 272 } 273 } 274 ``` 275 276 ### Parameters 277 278 | Name | Type | Description | Notes | 279 |------------- | ------------- | ------------- | -------------| 280 | **repository** | **String**| | | 281 | **branch** | **String**| | | 282 | **id** | **String**| Unique identifier of the import process | | 283 284 ### Return type 285 286 [**ImportStatus**](ImportStatus.md) 287 288 ### Authorization 289 290 [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) 291 292 ### HTTP request headers 293 294 - **Content-Type**: Not defined 295 - **Accept**: application/json 296 297 ### HTTP response details 298 | Status code | Description | Response headers | 299 |-------------|-------------|------------------| 300 | **200** | import status | - | 301 | **401** | Unauthorized | - | 302 | **404** | Resource Not Found | - | 303 | **420** | too many requests | - | 304 | **0** | Internal Server Error | - | 305