github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/java-legacy/docs/ImportApi.md (about)

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