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

     1  # lakefs_sdk.ImportApi
     2  
     3  All URIs are relative to */api/v1*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**import_cancel**](ImportApi.md#import_cancel) | **DELETE** /repositories/{repository}/branches/{branch}/import | cancel ongoing import
     8  [**import_start**](ImportApi.md#import_start) | **POST** /repositories/{repository}/branches/{branch}/import | import data from object store
     9  [**import_status**](ImportApi.md#import_status) | **GET** /repositories/{repository}/branches/{branch}/import | get import status
    10  
    11  
    12  # **import_cancel**
    13  > import_cancel(repository, branch, id)
    14  
    15  cancel ongoing import
    16  
    17  ### Example
    18  
    19  * Basic Authentication (basic_auth):
    20  * Api Key Authentication (cookie_auth):
    21  * Api Key Authentication (oidc_auth):
    22  * Api Key Authentication (saml_auth):
    23  * Bearer (JWT) Authentication (jwt_token):
    24  
    25  ```python
    26  import time
    27  import os
    28  import lakefs_sdk
    29  from lakefs_sdk.rest import ApiException
    30  from pprint import pprint
    31  
    32  # Defining the host is optional and defaults to /api/v1
    33  # See configuration.py for a list of all supported configuration parameters.
    34  configuration = lakefs_sdk.Configuration(
    35      host = "/api/v1"
    36  )
    37  
    38  # The client must configure the authentication and authorization parameters
    39  # in accordance with the API server security policy.
    40  # Examples for each auth method are provided below, use the example that
    41  # satisfies your auth use case.
    42  
    43  # Configure HTTP basic authorization: basic_auth
    44  configuration = lakefs_sdk.Configuration(
    45      username = os.environ["USERNAME"],
    46      password = os.environ["PASSWORD"]
    47  )
    48  
    49  # Configure API key authorization: cookie_auth
    50  configuration.api_key['cookie_auth'] = os.environ["API_KEY"]
    51  
    52  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    53  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
    54  
    55  # Configure API key authorization: oidc_auth
    56  configuration.api_key['oidc_auth'] = os.environ["API_KEY"]
    57  
    58  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    59  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
    60  
    61  # Configure API key authorization: saml_auth
    62  configuration.api_key['saml_auth'] = os.environ["API_KEY"]
    63  
    64  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    65  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
    66  
    67  # Configure Bearer authorization (JWT): jwt_token
    68  configuration = lakefs_sdk.Configuration(
    69      access_token = os.environ["BEARER_TOKEN"]
    70  )
    71  
    72  # Enter a context with an instance of the API client
    73  with lakefs_sdk.ApiClient(configuration) as api_client:
    74      # Create an instance of the API class
    75      api_instance = lakefs_sdk.ImportApi(api_client)
    76      repository = 'repository_example' # str | 
    77      branch = 'branch_example' # str | 
    78      id = 'id_example' # str | Unique identifier of the import process
    79  
    80      try:
    81          # cancel ongoing import
    82          api_instance.import_cancel(repository, branch, id)
    83      except Exception as e:
    84          print("Exception when calling ImportApi->import_cancel: %s\n" % e)
    85  ```
    86  
    87  
    88  
    89  ### Parameters
    90  
    91  
    92  Name | Type | Description  | Notes
    93  ------------- | ------------- | ------------- | -------------
    94   **repository** | **str**|  | 
    95   **branch** | **str**|  | 
    96   **id** | **str**| Unique identifier of the import process | 
    97  
    98  ### Return type
    99  
   100  void (empty response body)
   101  
   102  ### Authorization
   103  
   104  [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)
   105  
   106  ### HTTP request headers
   107  
   108   - **Content-Type**: Not defined
   109   - **Accept**: application/json
   110  
   111  ### HTTP response details
   112  
   113  | Status code | Description | Response headers |
   114  |-------------|-------------|------------------|
   115  **204** | import canceled successfully |  -  |
   116  **401** | Unauthorized |  -  |
   117  **403** | Forbidden |  -  |
   118  **404** | Resource Not Found |  -  |
   119  **409** | Resource Conflicts With Target |  -  |
   120  **420** | too many requests |  -  |
   121  **0** | Internal Server Error |  -  |
   122  
   123  [[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)
   124  
   125  # **import_start**
   126  > ImportCreationResponse import_start(repository, branch, import_creation)
   127  
   128  import data from object store
   129  
   130  ### Example
   131  
   132  * Basic Authentication (basic_auth):
   133  * Api Key Authentication (cookie_auth):
   134  * Api Key Authentication (oidc_auth):
   135  * Api Key Authentication (saml_auth):
   136  * Bearer (JWT) Authentication (jwt_token):
   137  
   138  ```python
   139  import time
   140  import os
   141  import lakefs_sdk
   142  from lakefs_sdk.models.import_creation import ImportCreation
   143  from lakefs_sdk.models.import_creation_response import ImportCreationResponse
   144  from lakefs_sdk.rest import ApiException
   145  from pprint import pprint
   146  
   147  # Defining the host is optional and defaults to /api/v1
   148  # See configuration.py for a list of all supported configuration parameters.
   149  configuration = lakefs_sdk.Configuration(
   150      host = "/api/v1"
   151  )
   152  
   153  # The client must configure the authentication and authorization parameters
   154  # in accordance with the API server security policy.
   155  # Examples for each auth method are provided below, use the example that
   156  # satisfies your auth use case.
   157  
   158  # Configure HTTP basic authorization: basic_auth
   159  configuration = lakefs_sdk.Configuration(
   160      username = os.environ["USERNAME"],
   161      password = os.environ["PASSWORD"]
   162  )
   163  
   164  # Configure API key authorization: cookie_auth
   165  configuration.api_key['cookie_auth'] = os.environ["API_KEY"]
   166  
   167  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   168  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   169  
   170  # Configure API key authorization: oidc_auth
   171  configuration.api_key['oidc_auth'] = os.environ["API_KEY"]
   172  
   173  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   174  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   175  
   176  # Configure API key authorization: saml_auth
   177  configuration.api_key['saml_auth'] = os.environ["API_KEY"]
   178  
   179  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   180  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   181  
   182  # Configure Bearer authorization (JWT): jwt_token
   183  configuration = lakefs_sdk.Configuration(
   184      access_token = os.environ["BEARER_TOKEN"]
   185  )
   186  
   187  # Enter a context with an instance of the API client
   188  with lakefs_sdk.ApiClient(configuration) as api_client:
   189      # Create an instance of the API class
   190      api_instance = lakefs_sdk.ImportApi(api_client)
   191      repository = 'repository_example' # str | 
   192      branch = 'branch_example' # str | 
   193      import_creation = lakefs_sdk.ImportCreation() # ImportCreation | 
   194  
   195      try:
   196          # import data from object store
   197          api_response = api_instance.import_start(repository, branch, import_creation)
   198          print("The response of ImportApi->import_start:\n")
   199          pprint(api_response)
   200      except Exception as e:
   201          print("Exception when calling ImportApi->import_start: %s\n" % e)
   202  ```
   203  
   204  
   205  
   206  ### Parameters
   207  
   208  
   209  Name | Type | Description  | Notes
   210  ------------- | ------------- | ------------- | -------------
   211   **repository** | **str**|  | 
   212   **branch** | **str**|  | 
   213   **import_creation** | [**ImportCreation**](ImportCreation.md)|  | 
   214  
   215  ### Return type
   216  
   217  [**ImportCreationResponse**](ImportCreationResponse.md)
   218  
   219  ### Authorization
   220  
   221  [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)
   222  
   223  ### HTTP request headers
   224  
   225   - **Content-Type**: application/json
   226   - **Accept**: application/json
   227  
   228  ### HTTP response details
   229  
   230  | Status code | Description | Response headers |
   231  |-------------|-------------|------------------|
   232  **202** | Import started |  -  |
   233  **400** | Validation Error |  -  |
   234  **401** | Unauthorized |  -  |
   235  **403** | Forbidden |  -  |
   236  **404** | Resource Not Found |  -  |
   237  **420** | too many requests |  -  |
   238  **0** | Internal Server Error |  -  |
   239  
   240  [[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)
   241  
   242  # **import_status**
   243  > ImportStatus import_status(repository, branch, id)
   244  
   245  get import status
   246  
   247  ### Example
   248  
   249  * Basic Authentication (basic_auth):
   250  * Api Key Authentication (cookie_auth):
   251  * Api Key Authentication (oidc_auth):
   252  * Api Key Authentication (saml_auth):
   253  * Bearer (JWT) Authentication (jwt_token):
   254  
   255  ```python
   256  import time
   257  import os
   258  import lakefs_sdk
   259  from lakefs_sdk.models.import_status import ImportStatus
   260  from lakefs_sdk.rest import ApiException
   261  from pprint import pprint
   262  
   263  # Defining the host is optional and defaults to /api/v1
   264  # See configuration.py for a list of all supported configuration parameters.
   265  configuration = lakefs_sdk.Configuration(
   266      host = "/api/v1"
   267  )
   268  
   269  # The client must configure the authentication and authorization parameters
   270  # in accordance with the API server security policy.
   271  # Examples for each auth method are provided below, use the example that
   272  # satisfies your auth use case.
   273  
   274  # Configure HTTP basic authorization: basic_auth
   275  configuration = lakefs_sdk.Configuration(
   276      username = os.environ["USERNAME"],
   277      password = os.environ["PASSWORD"]
   278  )
   279  
   280  # Configure API key authorization: cookie_auth
   281  configuration.api_key['cookie_auth'] = os.environ["API_KEY"]
   282  
   283  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   284  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   285  
   286  # Configure API key authorization: oidc_auth
   287  configuration.api_key['oidc_auth'] = os.environ["API_KEY"]
   288  
   289  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   290  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   291  
   292  # Configure API key authorization: saml_auth
   293  configuration.api_key['saml_auth'] = os.environ["API_KEY"]
   294  
   295  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   296  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   297  
   298  # Configure Bearer authorization (JWT): jwt_token
   299  configuration = lakefs_sdk.Configuration(
   300      access_token = os.environ["BEARER_TOKEN"]
   301  )
   302  
   303  # Enter a context with an instance of the API client
   304  with lakefs_sdk.ApiClient(configuration) as api_client:
   305      # Create an instance of the API class
   306      api_instance = lakefs_sdk.ImportApi(api_client)
   307      repository = 'repository_example' # str | 
   308      branch = 'branch_example' # str | 
   309      id = 'id_example' # str | Unique identifier of the import process
   310  
   311      try:
   312          # get import status
   313          api_response = api_instance.import_status(repository, branch, id)
   314          print("The response of ImportApi->import_status:\n")
   315          pprint(api_response)
   316      except Exception as e:
   317          print("Exception when calling ImportApi->import_status: %s\n" % e)
   318  ```
   319  
   320  
   321  
   322  ### Parameters
   323  
   324  
   325  Name | Type | Description  | Notes
   326  ------------- | ------------- | ------------- | -------------
   327   **repository** | **str**|  | 
   328   **branch** | **str**|  | 
   329   **id** | **str**| Unique identifier of the import process | 
   330  
   331  ### Return type
   332  
   333  [**ImportStatus**](ImportStatus.md)
   334  
   335  ### Authorization
   336  
   337  [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)
   338  
   339  ### HTTP request headers
   340  
   341   - **Content-Type**: Not defined
   342   - **Accept**: application/json
   343  
   344  ### HTTP response details
   345  
   346  | Status code | Description | Response headers |
   347  |-------------|-------------|------------------|
   348  **200** | import status |  -  |
   349  **401** | Unauthorized |  -  |
   350  **404** | Resource Not Found |  -  |
   351  **420** | too many requests |  -  |
   352  **0** | Internal Server Error |  -  |
   353  
   354  [[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)
   355