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

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