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

     1  # lakefs_client.RefsApi
     2  
     3  All URIs are relative to *http://localhost/api/v1*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**diff_refs**](RefsApi.md#diff_refs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references
     8  [**find_merge_base**](RefsApi.md#find_merge_base) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references
     9  [**log_commits**](RefsApi.md#log_commits) | **GET** /repositories/{repository}/refs/{ref}/commits | get commit log from ref. If both objects and prefixes are empty, return all commits.
    10  [**merge_into_branch**](RefsApi.md#merge_into_branch) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | merge references
    11  
    12  
    13  # **diff_refs**
    14  > DiffList diff_refs(repository, left_ref, right_ref)
    15  
    16  diff references
    17  
    18  ### Example
    19  
    20  * Basic Authentication (basic_auth):
    21  * Api Key Authentication (cookie_auth):
    22  * Bearer (JWT) Authentication (jwt_token):
    23  * Api Key Authentication (oidc_auth):
    24  * Api Key Authentication (saml_auth):
    25  
    26  ```python
    27  import time
    28  import lakefs_client
    29  from lakefs_client.api import refs_api
    30  from lakefs_client.model.diff_list import DiffList
    31  from lakefs_client.model.error import Error
    32  from pprint import pprint
    33  # Defining the host is optional and defaults to http://localhost/api/v1
    34  # See configuration.py for a list of all supported configuration parameters.
    35  configuration = lakefs_client.Configuration(
    36      host = "http://localhost/api/v1"
    37  )
    38  
    39  # The client must configure the authentication and authorization parameters
    40  # in accordance with the API server security policy.
    41  # Examples for each auth method are provided below, use the example that
    42  # satisfies your auth use case.
    43  
    44  # Configure HTTP basic authorization: basic_auth
    45  configuration = lakefs_client.Configuration(
    46      username = 'YOUR_USERNAME',
    47      password = 'YOUR_PASSWORD'
    48  )
    49  
    50  # Configure API key authorization: cookie_auth
    51  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
    52  
    53  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    54  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
    55  
    56  # Configure Bearer authorization (JWT): jwt_token
    57  configuration = lakefs_client.Configuration(
    58      access_token = 'YOUR_BEARER_TOKEN'
    59  )
    60  
    61  # Configure API key authorization: oidc_auth
    62  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
    63  
    64  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    65  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
    66  
    67  # Configure API key authorization: saml_auth
    68  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
    69  
    70  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    71  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
    72  
    73  # Enter a context with an instance of the API client
    74  with lakefs_client.ApiClient(configuration) as api_client:
    75      # Create an instance of the API class
    76      api_instance = refs_api.RefsApi(api_client)
    77      repository = "repository_example" # str | 
    78      left_ref = "leftRef_example" # str | a reference (could be either a branch or a commit ID)
    79      right_ref = "rightRef_example" # str | a reference (could be either a branch or a commit ID) to compare against
    80      after = "after_example" # str | return items after this value (optional)
    81      amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100
    82      prefix = "prefix_example" # str | return items prefixed with this value (optional)
    83      delimiter = "delimiter_example" # str | delimiter used to group common prefixes by (optional)
    84      type = "three_dot" # str |  (optional) if omitted the server will use the default value of "three_dot"
    85  
    86      # example passing only required values which don't have defaults set
    87      try:
    88          # diff references
    89          api_response = api_instance.diff_refs(repository, left_ref, right_ref)
    90          pprint(api_response)
    91      except lakefs_client.ApiException as e:
    92          print("Exception when calling RefsApi->diff_refs: %s\n" % e)
    93  
    94      # example passing only required values which don't have defaults set
    95      # and optional values
    96      try:
    97          # diff references
    98          api_response = api_instance.diff_refs(repository, left_ref, right_ref, after=after, amount=amount, prefix=prefix, delimiter=delimiter, type=type)
    99          pprint(api_response)
   100      except lakefs_client.ApiException as e:
   101          print("Exception when calling RefsApi->diff_refs: %s\n" % e)
   102  ```
   103  
   104  
   105  ### Parameters
   106  
   107  Name | Type | Description  | Notes
   108  ------------- | ------------- | ------------- | -------------
   109   **repository** | **str**|  |
   110   **left_ref** | **str**| a reference (could be either a branch or a commit ID) |
   111   **right_ref** | **str**| a reference (could be either a branch or a commit ID) to compare against |
   112   **after** | **str**| return items after this value | [optional]
   113   **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100
   114   **prefix** | **str**| return items prefixed with this value | [optional]
   115   **delimiter** | **str**| delimiter used to group common prefixes by | [optional]
   116   **type** | **str**|  | [optional] if omitted the server will use the default value of "three_dot"
   117  
   118  ### Return type
   119  
   120  [**DiffList**](DiffList.md)
   121  
   122  ### Authorization
   123  
   124  [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)
   125  
   126  ### HTTP request headers
   127  
   128   - **Content-Type**: Not defined
   129   - **Accept**: application/json
   130  
   131  
   132  ### HTTP response details
   133  
   134  | Status code | Description | Response headers |
   135  |-------------|-------------|------------------|
   136  **200** | diff between refs |  -  |
   137  **401** | Unauthorized |  -  |
   138  **404** | Resource Not Found |  -  |
   139  **420** | too many requests |  -  |
   140  **0** | Internal Server Error |  -  |
   141  
   142  [[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)
   143  
   144  # **find_merge_base**
   145  > FindMergeBaseResult find_merge_base(repository, source_ref, destination_branch)
   146  
   147  find the merge base for 2 references
   148  
   149  ### Example
   150  
   151  * Basic Authentication (basic_auth):
   152  * Api Key Authentication (cookie_auth):
   153  * Bearer (JWT) Authentication (jwt_token):
   154  * Api Key Authentication (oidc_auth):
   155  * Api Key Authentication (saml_auth):
   156  
   157  ```python
   158  import time
   159  import lakefs_client
   160  from lakefs_client.api import refs_api
   161  from lakefs_client.model.find_merge_base_result import FindMergeBaseResult
   162  from lakefs_client.model.error import Error
   163  from pprint import pprint
   164  # Defining the host is optional and defaults to http://localhost/api/v1
   165  # See configuration.py for a list of all supported configuration parameters.
   166  configuration = lakefs_client.Configuration(
   167      host = "http://localhost/api/v1"
   168  )
   169  
   170  # The client must configure the authentication and authorization parameters
   171  # in accordance with the API server security policy.
   172  # Examples for each auth method are provided below, use the example that
   173  # satisfies your auth use case.
   174  
   175  # Configure HTTP basic authorization: basic_auth
   176  configuration = lakefs_client.Configuration(
   177      username = 'YOUR_USERNAME',
   178      password = 'YOUR_PASSWORD'
   179  )
   180  
   181  # Configure API key authorization: cookie_auth
   182  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   183  
   184  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   185  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   186  
   187  # Configure Bearer authorization (JWT): jwt_token
   188  configuration = lakefs_client.Configuration(
   189      access_token = 'YOUR_BEARER_TOKEN'
   190  )
   191  
   192  # Configure API key authorization: oidc_auth
   193  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   194  
   195  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   196  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   197  
   198  # Configure API key authorization: saml_auth
   199  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   200  
   201  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   202  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   203  
   204  # Enter a context with an instance of the API client
   205  with lakefs_client.ApiClient(configuration) as api_client:
   206      # Create an instance of the API class
   207      api_instance = refs_api.RefsApi(api_client)
   208      repository = "repository_example" # str | 
   209      source_ref = "sourceRef_example" # str | source ref
   210      destination_branch = "destinationBranch_example" # str | destination branch name
   211  
   212      # example passing only required values which don't have defaults set
   213      try:
   214          # find the merge base for 2 references
   215          api_response = api_instance.find_merge_base(repository, source_ref, destination_branch)
   216          pprint(api_response)
   217      except lakefs_client.ApiException as e:
   218          print("Exception when calling RefsApi->find_merge_base: %s\n" % e)
   219  ```
   220  
   221  
   222  ### Parameters
   223  
   224  Name | Type | Description  | Notes
   225  ------------- | ------------- | ------------- | -------------
   226   **repository** | **str**|  |
   227   **source_ref** | **str**| source ref |
   228   **destination_branch** | **str**| destination branch name |
   229  
   230  ### Return type
   231  
   232  [**FindMergeBaseResult**](FindMergeBaseResult.md)
   233  
   234  ### Authorization
   235  
   236  [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)
   237  
   238  ### HTTP request headers
   239  
   240   - **Content-Type**: Not defined
   241   - **Accept**: application/json
   242  
   243  
   244  ### HTTP response details
   245  
   246  | Status code | Description | Response headers |
   247  |-------------|-------------|------------------|
   248  **200** | Found the merge base |  -  |
   249  **400** | Validation Error |  -  |
   250  **401** | Unauthorized |  -  |
   251  **404** | Resource Not Found |  -  |
   252  **420** | too many requests |  -  |
   253  **0** | Internal Server Error |  -  |
   254  
   255  [[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)
   256  
   257  # **log_commits**
   258  > CommitList log_commits(repository, ref)
   259  
   260  get commit log from ref. If both objects and prefixes are empty, return all commits.
   261  
   262  ### Example
   263  
   264  * Basic Authentication (basic_auth):
   265  * Api Key Authentication (cookie_auth):
   266  * Bearer (JWT) Authentication (jwt_token):
   267  * Api Key Authentication (oidc_auth):
   268  * Api Key Authentication (saml_auth):
   269  
   270  ```python
   271  import time
   272  import lakefs_client
   273  from lakefs_client.api import refs_api
   274  from lakefs_client.model.commit_list import CommitList
   275  from lakefs_client.model.error import Error
   276  from pprint import pprint
   277  # Defining the host is optional and defaults to http://localhost/api/v1
   278  # See configuration.py for a list of all supported configuration parameters.
   279  configuration = lakefs_client.Configuration(
   280      host = "http://localhost/api/v1"
   281  )
   282  
   283  # The client must configure the authentication and authorization parameters
   284  # in accordance with the API server security policy.
   285  # Examples for each auth method are provided below, use the example that
   286  # satisfies your auth use case.
   287  
   288  # Configure HTTP basic authorization: basic_auth
   289  configuration = lakefs_client.Configuration(
   290      username = 'YOUR_USERNAME',
   291      password = 'YOUR_PASSWORD'
   292  )
   293  
   294  # Configure API key authorization: cookie_auth
   295  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   296  
   297  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   298  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   299  
   300  # Configure Bearer authorization (JWT): jwt_token
   301  configuration = lakefs_client.Configuration(
   302      access_token = 'YOUR_BEARER_TOKEN'
   303  )
   304  
   305  # Configure API key authorization: oidc_auth
   306  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   307  
   308  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   309  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   310  
   311  # Configure API key authorization: saml_auth
   312  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   313  
   314  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   315  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   316  
   317  # Enter a context with an instance of the API client
   318  with lakefs_client.ApiClient(configuration) as api_client:
   319      # Create an instance of the API class
   320      api_instance = refs_api.RefsApi(api_client)
   321      repository = "repository_example" # str | 
   322      ref = "ref_example" # str | 
   323      after = "after_example" # str | return items after this value (optional)
   324      amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100
   325      objects = [
   326          "objects_example",
   327      ] # [str] | list of paths, each element is a path of a specific object (optional)
   328      prefixes = [
   329          "prefixes_example",
   330      ] # [str] | list of paths, each element is a path of a prefix (optional)
   331      limit = True # bool | limit the number of items in return to 'amount'. Without further indication on actual number of items. (optional)
   332      first_parent = True # bool | if set to true, follow only the first parent upon reaching a merge commit (optional)
   333      since = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. (optional)
   334      stop_at = "stop_at_example" # str | A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. (optional)
   335  
   336      # example passing only required values which don't have defaults set
   337      try:
   338          # get commit log from ref. If both objects and prefixes are empty, return all commits.
   339          api_response = api_instance.log_commits(repository, ref)
   340          pprint(api_response)
   341      except lakefs_client.ApiException as e:
   342          print("Exception when calling RefsApi->log_commits: %s\n" % e)
   343  
   344      # example passing only required values which don't have defaults set
   345      # and optional values
   346      try:
   347          # get commit log from ref. If both objects and prefixes are empty, return all commits.
   348          api_response = api_instance.log_commits(repository, ref, after=after, amount=amount, objects=objects, prefixes=prefixes, limit=limit, first_parent=first_parent, since=since, stop_at=stop_at)
   349          pprint(api_response)
   350      except lakefs_client.ApiException as e:
   351          print("Exception when calling RefsApi->log_commits: %s\n" % e)
   352  ```
   353  
   354  
   355  ### Parameters
   356  
   357  Name | Type | Description  | Notes
   358  ------------- | ------------- | ------------- | -------------
   359   **repository** | **str**|  |
   360   **ref** | **str**|  |
   361   **after** | **str**| return items after this value | [optional]
   362   **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100
   363   **objects** | **[str]**| list of paths, each element is a path of a specific object | [optional]
   364   **prefixes** | **[str]**| list of paths, each element is a path of a prefix | [optional]
   365   **limit** | **bool**| limit the number of items in return to 'amount'. Without further indication on actual number of items. | [optional]
   366   **first_parent** | **bool**| if set to true, follow only the first parent upon reaching a merge commit | [optional]
   367   **since** | **datetime**| Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. | [optional]
   368   **stop_at** | **str**| A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. | [optional]
   369  
   370  ### Return type
   371  
   372  [**CommitList**](CommitList.md)
   373  
   374  ### Authorization
   375  
   376  [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)
   377  
   378  ### HTTP request headers
   379  
   380   - **Content-Type**: Not defined
   381   - **Accept**: application/json
   382  
   383  
   384  ### HTTP response details
   385  
   386  | Status code | Description | Response headers |
   387  |-------------|-------------|------------------|
   388  **200** | commit log |  -  |
   389  **401** | Unauthorized |  -  |
   390  **404** | Resource Not Found |  -  |
   391  **420** | too many requests |  -  |
   392  **0** | Internal Server Error |  -  |
   393  
   394  [[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)
   395  
   396  # **merge_into_branch**
   397  > MergeResult merge_into_branch(repository, source_ref, destination_branch)
   398  
   399  merge references
   400  
   401  ### Example
   402  
   403  * Basic Authentication (basic_auth):
   404  * Api Key Authentication (cookie_auth):
   405  * Bearer (JWT) Authentication (jwt_token):
   406  * Api Key Authentication (oidc_auth):
   407  * Api Key Authentication (saml_auth):
   408  
   409  ```python
   410  import time
   411  import lakefs_client
   412  from lakefs_client.api import refs_api
   413  from lakefs_client.model.merge import Merge
   414  from lakefs_client.model.error import Error
   415  from lakefs_client.model.merge_result import MergeResult
   416  from pprint import pprint
   417  # Defining the host is optional and defaults to http://localhost/api/v1
   418  # See configuration.py for a list of all supported configuration parameters.
   419  configuration = lakefs_client.Configuration(
   420      host = "http://localhost/api/v1"
   421  )
   422  
   423  # The client must configure the authentication and authorization parameters
   424  # in accordance with the API server security policy.
   425  # Examples for each auth method are provided below, use the example that
   426  # satisfies your auth use case.
   427  
   428  # Configure HTTP basic authorization: basic_auth
   429  configuration = lakefs_client.Configuration(
   430      username = 'YOUR_USERNAME',
   431      password = 'YOUR_PASSWORD'
   432  )
   433  
   434  # Configure API key authorization: cookie_auth
   435  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   436  
   437  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   438  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   439  
   440  # Configure Bearer authorization (JWT): jwt_token
   441  configuration = lakefs_client.Configuration(
   442      access_token = 'YOUR_BEARER_TOKEN'
   443  )
   444  
   445  # Configure API key authorization: oidc_auth
   446  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   447  
   448  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   449  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   450  
   451  # Configure API key authorization: saml_auth
   452  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   453  
   454  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   455  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   456  
   457  # Enter a context with an instance of the API client
   458  with lakefs_client.ApiClient(configuration) as api_client:
   459      # Create an instance of the API class
   460      api_instance = refs_api.RefsApi(api_client)
   461      repository = "repository_example" # str | 
   462      source_ref = "sourceRef_example" # str | source ref
   463      destination_branch = "destinationBranch_example" # str | destination branch name
   464      merge = Merge(
   465          message="message_example",
   466          metadata={
   467              "key": "key_example",
   468          },
   469          strategy="strategy_example",
   470          force=False,
   471      ) # Merge |  (optional)
   472  
   473      # example passing only required values which don't have defaults set
   474      try:
   475          # merge references
   476          api_response = api_instance.merge_into_branch(repository, source_ref, destination_branch)
   477          pprint(api_response)
   478      except lakefs_client.ApiException as e:
   479          print("Exception when calling RefsApi->merge_into_branch: %s\n" % e)
   480  
   481      # example passing only required values which don't have defaults set
   482      # and optional values
   483      try:
   484          # merge references
   485          api_response = api_instance.merge_into_branch(repository, source_ref, destination_branch, merge=merge)
   486          pprint(api_response)
   487      except lakefs_client.ApiException as e:
   488          print("Exception when calling RefsApi->merge_into_branch: %s\n" % e)
   489  ```
   490  
   491  
   492  ### Parameters
   493  
   494  Name | Type | Description  | Notes
   495  ------------- | ------------- | ------------- | -------------
   496   **repository** | **str**|  |
   497   **source_ref** | **str**| source ref |
   498   **destination_branch** | **str**| destination branch name |
   499   **merge** | [**Merge**](Merge.md)|  | [optional]
   500  
   501  ### Return type
   502  
   503  [**MergeResult**](MergeResult.md)
   504  
   505  ### Authorization
   506  
   507  [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)
   508  
   509  ### HTTP request headers
   510  
   511   - **Content-Type**: application/json
   512   - **Accept**: application/json
   513  
   514  
   515  ### HTTP response details
   516  
   517  | Status code | Description | Response headers |
   518  |-------------|-------------|------------------|
   519  **200** | merge completed |  -  |
   520  **400** | Validation Error |  -  |
   521  **401** | Unauthorized |  -  |
   522  **403** | Forbidden |  -  |
   523  **404** | Resource Not Found |  -  |
   524  **409** | Conflict Deprecated: content schema will return Error format and not an empty MergeResult  |  -  |
   525  **412** | precondition failed (e.g. a pre-merge hook returned a failure) |  -  |
   526  **420** | too many requests |  -  |
   527  **0** | Internal Server Error |  -  |
   528  
   529  [[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)
   530