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

     1  # lakefs_sdk.MetadataApi
     2  
     3  All URIs are relative to */api/v1*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**get_meta_range**](MetadataApi.md#get_meta_range) | **GET** /repositories/{repository}/metadata/meta_range/{meta_range} | return URI to a meta-range file
     8  [**get_range**](MetadataApi.md#get_range) | **GET** /repositories/{repository}/metadata/range/{range} | return URI to a range file
     9  
    10  
    11  # **get_meta_range**
    12  > StorageURI get_meta_range(repository, meta_range)
    13  
    14  return URI to a meta-range file
    15  
    16  ### Example
    17  
    18  * Basic Authentication (basic_auth):
    19  * Api Key Authentication (cookie_auth):
    20  * Api Key Authentication (oidc_auth):
    21  * Api Key Authentication (saml_auth):
    22  * Bearer (JWT) Authentication (jwt_token):
    23  
    24  ```python
    25  import time
    26  import os
    27  import lakefs_sdk
    28  from lakefs_sdk.models.storage_uri import StorageURI
    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.MetadataApi(api_client)
    76      repository = 'repository_example' # str | 
    77      meta_range = 'meta_range_example' # str | 
    78  
    79      try:
    80          # return URI to a meta-range file
    81          api_response = api_instance.get_meta_range(repository, meta_range)
    82          print("The response of MetadataApi->get_meta_range:\n")
    83          pprint(api_response)
    84      except Exception as e:
    85          print("Exception when calling MetadataApi->get_meta_range: %s\n" % e)
    86  ```
    87  
    88  
    89  
    90  ### Parameters
    91  
    92  
    93  Name | Type | Description  | Notes
    94  ------------- | ------------- | ------------- | -------------
    95   **repository** | **str**|  | 
    96   **meta_range** | **str**|  | 
    97  
    98  ### Return type
    99  
   100  [**StorageURI**](StorageURI.md)
   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  **200** | meta-range URI |  * Location - redirect to S3 <br>  |
   116  **401** | Unauthorized |  -  |
   117  **404** | Resource Not Found |  -  |
   118  **420** | too many requests |  -  |
   119  **0** | Internal Server Error |  -  |
   120  
   121  [[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)
   122  
   123  # **get_range**
   124  > StorageURI get_range(repository, range)
   125  
   126  return URI to a range file
   127  
   128  ### Example
   129  
   130  * Basic Authentication (basic_auth):
   131  * Api Key Authentication (cookie_auth):
   132  * Api Key Authentication (oidc_auth):
   133  * Api Key Authentication (saml_auth):
   134  * Bearer (JWT) Authentication (jwt_token):
   135  
   136  ```python
   137  import time
   138  import os
   139  import lakefs_sdk
   140  from lakefs_sdk.models.storage_uri import StorageURI
   141  from lakefs_sdk.rest import ApiException
   142  from pprint import pprint
   143  
   144  # Defining the host is optional and defaults to /api/v1
   145  # See configuration.py for a list of all supported configuration parameters.
   146  configuration = lakefs_sdk.Configuration(
   147      host = "/api/v1"
   148  )
   149  
   150  # The client must configure the authentication and authorization parameters
   151  # in accordance with the API server security policy.
   152  # Examples for each auth method are provided below, use the example that
   153  # satisfies your auth use case.
   154  
   155  # Configure HTTP basic authorization: basic_auth
   156  configuration = lakefs_sdk.Configuration(
   157      username = os.environ["USERNAME"],
   158      password = os.environ["PASSWORD"]
   159  )
   160  
   161  # Configure API key authorization: cookie_auth
   162  configuration.api_key['cookie_auth'] = os.environ["API_KEY"]
   163  
   164  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   165  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   166  
   167  # Configure API key authorization: oidc_auth
   168  configuration.api_key['oidc_auth'] = os.environ["API_KEY"]
   169  
   170  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   171  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   172  
   173  # Configure API key authorization: saml_auth
   174  configuration.api_key['saml_auth'] = os.environ["API_KEY"]
   175  
   176  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   177  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   178  
   179  # Configure Bearer authorization (JWT): jwt_token
   180  configuration = lakefs_sdk.Configuration(
   181      access_token = os.environ["BEARER_TOKEN"]
   182  )
   183  
   184  # Enter a context with an instance of the API client
   185  with lakefs_sdk.ApiClient(configuration) as api_client:
   186      # Create an instance of the API class
   187      api_instance = lakefs_sdk.MetadataApi(api_client)
   188      repository = 'repository_example' # str | 
   189      range = 'range_example' # str | 
   190  
   191      try:
   192          # return URI to a range file
   193          api_response = api_instance.get_range(repository, range)
   194          print("The response of MetadataApi->get_range:\n")
   195          pprint(api_response)
   196      except Exception as e:
   197          print("Exception when calling MetadataApi->get_range: %s\n" % e)
   198  ```
   199  
   200  
   201  
   202  ### Parameters
   203  
   204  
   205  Name | Type | Description  | Notes
   206  ------------- | ------------- | ------------- | -------------
   207   **repository** | **str**|  | 
   208   **range** | **str**|  | 
   209  
   210  ### Return type
   211  
   212  [**StorageURI**](StorageURI.md)
   213  
   214  ### Authorization
   215  
   216  [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)
   217  
   218  ### HTTP request headers
   219  
   220   - **Content-Type**: Not defined
   221   - **Accept**: application/json
   222  
   223  ### HTTP response details
   224  
   225  | Status code | Description | Response headers |
   226  |-------------|-------------|------------------|
   227  **200** | range URI |  * Location - redirect to S3 <br>  |
   228  **401** | Unauthorized |  -  |
   229  **404** | Resource Not Found |  -  |
   230  **420** | too many requests |  -  |
   231  **0** | Internal Server Error |  -  |
   232  
   233  [[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)
   234