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

     1  # lakefs_client.BranchesApi
     2  
     3  All URIs are relative to *http://localhost/api/v1*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**cherry_pick**](BranchesApi.md#cherry_pick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Replay the changes from the given commit on the branch
     8  [**create_branch**](BranchesApi.md#create_branch) | **POST** /repositories/{repository}/branches | create branch
     9  [**delete_branch**](BranchesApi.md#delete_branch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch
    10  [**diff_branch**](BranchesApi.md#diff_branch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch
    11  [**get_branch**](BranchesApi.md#get_branch) | **GET** /repositories/{repository}/branches/{branch} | get branch
    12  [**list_branches**](BranchesApi.md#list_branches) | **GET** /repositories/{repository}/branches | list branches
    13  [**reset_branch**](BranchesApi.md#reset_branch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch
    14  [**revert_branch**](BranchesApi.md#revert_branch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert
    15  
    16  
    17  # **cherry_pick**
    18  > Commit cherry_pick(repository, branch, cherry_pick_creation)
    19  
    20  Replay the changes from the given commit on the branch
    21  
    22  ### Example
    23  
    24  * Basic Authentication (basic_auth):
    25  * Api Key Authentication (cookie_auth):
    26  * Bearer (JWT) Authentication (jwt_token):
    27  * Api Key Authentication (oidc_auth):
    28  * Api Key Authentication (saml_auth):
    29  
    30  ```python
    31  import time
    32  import lakefs_client
    33  from lakefs_client.api import branches_api
    34  from lakefs_client.model.commit import Commit
    35  from lakefs_client.model.error import Error
    36  from lakefs_client.model.cherry_pick_creation import CherryPickCreation
    37  from pprint import pprint
    38  # Defining the host is optional and defaults to http://localhost/api/v1
    39  # See configuration.py for a list of all supported configuration parameters.
    40  configuration = lakefs_client.Configuration(
    41      host = "http://localhost/api/v1"
    42  )
    43  
    44  # The client must configure the authentication and authorization parameters
    45  # in accordance with the API server security policy.
    46  # Examples for each auth method are provided below, use the example that
    47  # satisfies your auth use case.
    48  
    49  # Configure HTTP basic authorization: basic_auth
    50  configuration = lakefs_client.Configuration(
    51      username = 'YOUR_USERNAME',
    52      password = 'YOUR_PASSWORD'
    53  )
    54  
    55  # Configure API key authorization: cookie_auth
    56  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
    57  
    58  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    59  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
    60  
    61  # Configure Bearer authorization (JWT): jwt_token
    62  configuration = lakefs_client.Configuration(
    63      access_token = 'YOUR_BEARER_TOKEN'
    64  )
    65  
    66  # Configure API key authorization: oidc_auth
    67  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
    68  
    69  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    70  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
    71  
    72  # Configure API key authorization: saml_auth
    73  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
    74  
    75  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    76  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
    77  
    78  # Enter a context with an instance of the API client
    79  with lakefs_client.ApiClient(configuration) as api_client:
    80      # Create an instance of the API class
    81      api_instance = branches_api.BranchesApi(api_client)
    82      repository = "repository_example" # str | 
    83      branch = "branch_example" # str | 
    84      cherry_pick_creation = CherryPickCreation(
    85          ref="ref_example",
    86          parent_number=1,
    87          force=False,
    88      ) # CherryPickCreation | 
    89  
    90      # example passing only required values which don't have defaults set
    91      try:
    92          # Replay the changes from the given commit on the branch
    93          api_response = api_instance.cherry_pick(repository, branch, cherry_pick_creation)
    94          pprint(api_response)
    95      except lakefs_client.ApiException as e:
    96          print("Exception when calling BranchesApi->cherry_pick: %s\n" % e)
    97  ```
    98  
    99  
   100  ### Parameters
   101  
   102  Name | Type | Description  | Notes
   103  ------------- | ------------- | ------------- | -------------
   104   **repository** | **str**|  |
   105   **branch** | **str**|  |
   106   **cherry_pick_creation** | [**CherryPickCreation**](CherryPickCreation.md)|  |
   107  
   108  ### Return type
   109  
   110  [**Commit**](Commit.md)
   111  
   112  ### Authorization
   113  
   114  [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)
   115  
   116  ### HTTP request headers
   117  
   118   - **Content-Type**: application/json
   119   - **Accept**: application/json
   120  
   121  
   122  ### HTTP response details
   123  
   124  | Status code | Description | Response headers |
   125  |-------------|-------------|------------------|
   126  **201** | the cherry-pick commit |  -  |
   127  **400** | Validation Error |  -  |
   128  **401** | Unauthorized |  -  |
   129  **403** | Forbidden |  -  |
   130  **404** | Resource Not Found |  -  |
   131  **409** | Conflict 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  # **create_branch**
   138  > str create_branch(repository, branch_creation)
   139  
   140  create branch
   141  
   142  ### Example
   143  
   144  * Basic Authentication (basic_auth):
   145  * Api Key Authentication (cookie_auth):
   146  * Bearer (JWT) Authentication (jwt_token):
   147  * Api Key Authentication (oidc_auth):
   148  * Api Key Authentication (saml_auth):
   149  
   150  ```python
   151  import time
   152  import lakefs_client
   153  from lakefs_client.api import branches_api
   154  from lakefs_client.model.branch_creation import BranchCreation
   155  from lakefs_client.model.error import Error
   156  from pprint import pprint
   157  # Defining the host is optional and defaults to http://localhost/api/v1
   158  # See configuration.py for a list of all supported configuration parameters.
   159  configuration = lakefs_client.Configuration(
   160      host = "http://localhost/api/v1"
   161  )
   162  
   163  # The client must configure the authentication and authorization parameters
   164  # in accordance with the API server security policy.
   165  # Examples for each auth method are provided below, use the example that
   166  # satisfies your auth use case.
   167  
   168  # Configure HTTP basic authorization: basic_auth
   169  configuration = lakefs_client.Configuration(
   170      username = 'YOUR_USERNAME',
   171      password = 'YOUR_PASSWORD'
   172  )
   173  
   174  # Configure API key authorization: cookie_auth
   175  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   176  
   177  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   178  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   179  
   180  # Configure Bearer authorization (JWT): jwt_token
   181  configuration = lakefs_client.Configuration(
   182      access_token = 'YOUR_BEARER_TOKEN'
   183  )
   184  
   185  # Configure API key authorization: oidc_auth
   186  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   187  
   188  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   189  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   190  
   191  # Configure API key authorization: saml_auth
   192  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   193  
   194  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   195  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   196  
   197  # Enter a context with an instance of the API client
   198  with lakefs_client.ApiClient(configuration) as api_client:
   199      # Create an instance of the API class
   200      api_instance = branches_api.BranchesApi(api_client)
   201      repository = "repository_example" # str | 
   202      branch_creation = BranchCreation(
   203          name="name_example",
   204          source="source_example",
   205          force=False,
   206      ) # BranchCreation | 
   207  
   208      # example passing only required values which don't have defaults set
   209      try:
   210          # create branch
   211          api_response = api_instance.create_branch(repository, branch_creation)
   212          pprint(api_response)
   213      except lakefs_client.ApiException as e:
   214          print("Exception when calling BranchesApi->create_branch: %s\n" % e)
   215  ```
   216  
   217  
   218  ### Parameters
   219  
   220  Name | Type | Description  | Notes
   221  ------------- | ------------- | ------------- | -------------
   222   **repository** | **str**|  |
   223   **branch_creation** | [**BranchCreation**](BranchCreation.md)|  |
   224  
   225  ### Return type
   226  
   227  **str**
   228  
   229  ### Authorization
   230  
   231  [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)
   232  
   233  ### HTTP request headers
   234  
   235   - **Content-Type**: application/json
   236   - **Accept**: text/html, application/json
   237  
   238  
   239  ### HTTP response details
   240  
   241  | Status code | Description | Response headers |
   242  |-------------|-------------|------------------|
   243  **201** | reference |  -  |
   244  **400** | Validation Error |  -  |
   245  **401** | Unauthorized |  -  |
   246  **403** | Forbidden |  -  |
   247  **404** | Resource Not Found |  -  |
   248  **409** | Resource Conflicts With Target |  -  |
   249  **420** | too many requests |  -  |
   250  **0** | Internal Server Error |  -  |
   251  
   252  [[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)
   253  
   254  # **delete_branch**
   255  > delete_branch(repository, branch)
   256  
   257  delete branch
   258  
   259  ### Example
   260  
   261  * Basic Authentication (basic_auth):
   262  * Api Key Authentication (cookie_auth):
   263  * Bearer (JWT) Authentication (jwt_token):
   264  * Api Key Authentication (oidc_auth):
   265  * Api Key Authentication (saml_auth):
   266  
   267  ```python
   268  import time
   269  import lakefs_client
   270  from lakefs_client.api import branches_api
   271  from lakefs_client.model.error import Error
   272  from pprint import pprint
   273  # Defining the host is optional and defaults to http://localhost/api/v1
   274  # See configuration.py for a list of all supported configuration parameters.
   275  configuration = lakefs_client.Configuration(
   276      host = "http://localhost/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_client.Configuration(
   286      username = 'YOUR_USERNAME',
   287      password = 'YOUR_PASSWORD'
   288  )
   289  
   290  # Configure API key authorization: cookie_auth
   291  configuration.api_key['cookie_auth'] = 'YOUR_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 Bearer authorization (JWT): jwt_token
   297  configuration = lakefs_client.Configuration(
   298      access_token = 'YOUR_BEARER_TOKEN'
   299  )
   300  
   301  # Configure API key authorization: oidc_auth
   302  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   303  
   304  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   305  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   306  
   307  # Configure API key authorization: saml_auth
   308  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   309  
   310  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   311  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   312  
   313  # Enter a context with an instance of the API client
   314  with lakefs_client.ApiClient(configuration) as api_client:
   315      # Create an instance of the API class
   316      api_instance = branches_api.BranchesApi(api_client)
   317      repository = "repository_example" # str | 
   318      branch = "branch_example" # str | 
   319      force = False # bool |  (optional) if omitted the server will use the default value of False
   320  
   321      # example passing only required values which don't have defaults set
   322      try:
   323          # delete branch
   324          api_instance.delete_branch(repository, branch)
   325      except lakefs_client.ApiException as e:
   326          print("Exception when calling BranchesApi->delete_branch: %s\n" % e)
   327  
   328      # example passing only required values which don't have defaults set
   329      # and optional values
   330      try:
   331          # delete branch
   332          api_instance.delete_branch(repository, branch, force=force)
   333      except lakefs_client.ApiException as e:
   334          print("Exception when calling BranchesApi->delete_branch: %s\n" % e)
   335  ```
   336  
   337  
   338  ### Parameters
   339  
   340  Name | Type | Description  | Notes
   341  ------------- | ------------- | ------------- | -------------
   342   **repository** | **str**|  |
   343   **branch** | **str**|  |
   344   **force** | **bool**|  | [optional] if omitted the server will use the default value of False
   345  
   346  ### Return type
   347  
   348  void (empty response body)
   349  
   350  ### Authorization
   351  
   352  [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)
   353  
   354  ### HTTP request headers
   355  
   356   - **Content-Type**: Not defined
   357   - **Accept**: application/json
   358  
   359  
   360  ### HTTP response details
   361  
   362  | Status code | Description | Response headers |
   363  |-------------|-------------|------------------|
   364  **204** | branch deleted successfully |  -  |
   365  **401** | Unauthorized |  -  |
   366  **403** | Forbidden |  -  |
   367  **404** | Resource Not Found |  -  |
   368  **420** | too many requests |  -  |
   369  **0** | Internal Server Error |  -  |
   370  
   371  [[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)
   372  
   373  # **diff_branch**
   374  > DiffList diff_branch(repository, branch)
   375  
   376  diff branch
   377  
   378  ### Example
   379  
   380  * Basic Authentication (basic_auth):
   381  * Api Key Authentication (cookie_auth):
   382  * Bearer (JWT) Authentication (jwt_token):
   383  * Api Key Authentication (oidc_auth):
   384  * Api Key Authentication (saml_auth):
   385  
   386  ```python
   387  import time
   388  import lakefs_client
   389  from lakefs_client.api import branches_api
   390  from lakefs_client.model.diff_list import DiffList
   391  from lakefs_client.model.error import Error
   392  from pprint import pprint
   393  # Defining the host is optional and defaults to http://localhost/api/v1
   394  # See configuration.py for a list of all supported configuration parameters.
   395  configuration = lakefs_client.Configuration(
   396      host = "http://localhost/api/v1"
   397  )
   398  
   399  # The client must configure the authentication and authorization parameters
   400  # in accordance with the API server security policy.
   401  # Examples for each auth method are provided below, use the example that
   402  # satisfies your auth use case.
   403  
   404  # Configure HTTP basic authorization: basic_auth
   405  configuration = lakefs_client.Configuration(
   406      username = 'YOUR_USERNAME',
   407      password = 'YOUR_PASSWORD'
   408  )
   409  
   410  # Configure API key authorization: cookie_auth
   411  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   412  
   413  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   414  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   415  
   416  # Configure Bearer authorization (JWT): jwt_token
   417  configuration = lakefs_client.Configuration(
   418      access_token = 'YOUR_BEARER_TOKEN'
   419  )
   420  
   421  # Configure API key authorization: oidc_auth
   422  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   423  
   424  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   425  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   426  
   427  # Configure API key authorization: saml_auth
   428  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   429  
   430  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   431  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   432  
   433  # Enter a context with an instance of the API client
   434  with lakefs_client.ApiClient(configuration) as api_client:
   435      # Create an instance of the API class
   436      api_instance = branches_api.BranchesApi(api_client)
   437      repository = "repository_example" # str | 
   438      branch = "branch_example" # str | 
   439      after = "after_example" # str | return items after this value (optional)
   440      amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100
   441      prefix = "prefix_example" # str | return items prefixed with this value (optional)
   442      delimiter = "delimiter_example" # str | delimiter used to group common prefixes by (optional)
   443  
   444      # example passing only required values which don't have defaults set
   445      try:
   446          # diff branch
   447          api_response = api_instance.diff_branch(repository, branch)
   448          pprint(api_response)
   449      except lakefs_client.ApiException as e:
   450          print("Exception when calling BranchesApi->diff_branch: %s\n" % e)
   451  
   452      # example passing only required values which don't have defaults set
   453      # and optional values
   454      try:
   455          # diff branch
   456          api_response = api_instance.diff_branch(repository, branch, after=after, amount=amount, prefix=prefix, delimiter=delimiter)
   457          pprint(api_response)
   458      except lakefs_client.ApiException as e:
   459          print("Exception when calling BranchesApi->diff_branch: %s\n" % e)
   460  ```
   461  
   462  
   463  ### Parameters
   464  
   465  Name | Type | Description  | Notes
   466  ------------- | ------------- | ------------- | -------------
   467   **repository** | **str**|  |
   468   **branch** | **str**|  |
   469   **after** | **str**| return items after this value | [optional]
   470   **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100
   471   **prefix** | **str**| return items prefixed with this value | [optional]
   472   **delimiter** | **str**| delimiter used to group common prefixes by | [optional]
   473  
   474  ### Return type
   475  
   476  [**DiffList**](DiffList.md)
   477  
   478  ### Authorization
   479  
   480  [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)
   481  
   482  ### HTTP request headers
   483  
   484   - **Content-Type**: Not defined
   485   - **Accept**: application/json
   486  
   487  
   488  ### HTTP response details
   489  
   490  | Status code | Description | Response headers |
   491  |-------------|-------------|------------------|
   492  **200** | diff of branch uncommitted changes |  -  |
   493  **401** | Unauthorized |  -  |
   494  **404** | Resource Not Found |  -  |
   495  **420** | too many requests |  -  |
   496  **0** | Internal Server Error |  -  |
   497  
   498  [[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)
   499  
   500  # **get_branch**
   501  > Ref get_branch(repository, branch)
   502  
   503  get branch
   504  
   505  ### Example
   506  
   507  * Basic Authentication (basic_auth):
   508  * Api Key Authentication (cookie_auth):
   509  * Bearer (JWT) Authentication (jwt_token):
   510  * Api Key Authentication (oidc_auth):
   511  * Api Key Authentication (saml_auth):
   512  
   513  ```python
   514  import time
   515  import lakefs_client
   516  from lakefs_client.api import branches_api
   517  from lakefs_client.model.error import Error
   518  from lakefs_client.model.ref import Ref
   519  from pprint import pprint
   520  # Defining the host is optional and defaults to http://localhost/api/v1
   521  # See configuration.py for a list of all supported configuration parameters.
   522  configuration = lakefs_client.Configuration(
   523      host = "http://localhost/api/v1"
   524  )
   525  
   526  # The client must configure the authentication and authorization parameters
   527  # in accordance with the API server security policy.
   528  # Examples for each auth method are provided below, use the example that
   529  # satisfies your auth use case.
   530  
   531  # Configure HTTP basic authorization: basic_auth
   532  configuration = lakefs_client.Configuration(
   533      username = 'YOUR_USERNAME',
   534      password = 'YOUR_PASSWORD'
   535  )
   536  
   537  # Configure API key authorization: cookie_auth
   538  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   539  
   540  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   541  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   542  
   543  # Configure Bearer authorization (JWT): jwt_token
   544  configuration = lakefs_client.Configuration(
   545      access_token = 'YOUR_BEARER_TOKEN'
   546  )
   547  
   548  # Configure API key authorization: oidc_auth
   549  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   550  
   551  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   552  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   553  
   554  # Configure API key authorization: saml_auth
   555  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   556  
   557  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   558  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   559  
   560  # Enter a context with an instance of the API client
   561  with lakefs_client.ApiClient(configuration) as api_client:
   562      # Create an instance of the API class
   563      api_instance = branches_api.BranchesApi(api_client)
   564      repository = "repository_example" # str | 
   565      branch = "branch_example" # str | 
   566  
   567      # example passing only required values which don't have defaults set
   568      try:
   569          # get branch
   570          api_response = api_instance.get_branch(repository, branch)
   571          pprint(api_response)
   572      except lakefs_client.ApiException as e:
   573          print("Exception when calling BranchesApi->get_branch: %s\n" % e)
   574  ```
   575  
   576  
   577  ### Parameters
   578  
   579  Name | Type | Description  | Notes
   580  ------------- | ------------- | ------------- | -------------
   581   **repository** | **str**|  |
   582   **branch** | **str**|  |
   583  
   584  ### Return type
   585  
   586  [**Ref**](Ref.md)
   587  
   588  ### Authorization
   589  
   590  [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)
   591  
   592  ### HTTP request headers
   593  
   594   - **Content-Type**: Not defined
   595   - **Accept**: application/json
   596  
   597  
   598  ### HTTP response details
   599  
   600  | Status code | Description | Response headers |
   601  |-------------|-------------|------------------|
   602  **200** | branch |  -  |
   603  **401** | Unauthorized |  -  |
   604  **404** | Resource Not Found |  -  |
   605  **420** | too many requests |  -  |
   606  **0** | Internal Server Error |  -  |
   607  
   608  [[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)
   609  
   610  # **list_branches**
   611  > RefList list_branches(repository)
   612  
   613  list branches
   614  
   615  ### Example
   616  
   617  * Basic Authentication (basic_auth):
   618  * Api Key Authentication (cookie_auth):
   619  * Bearer (JWT) Authentication (jwt_token):
   620  * Api Key Authentication (oidc_auth):
   621  * Api Key Authentication (saml_auth):
   622  
   623  ```python
   624  import time
   625  import lakefs_client
   626  from lakefs_client.api import branches_api
   627  from lakefs_client.model.error import Error
   628  from lakefs_client.model.ref_list import RefList
   629  from pprint import pprint
   630  # Defining the host is optional and defaults to http://localhost/api/v1
   631  # See configuration.py for a list of all supported configuration parameters.
   632  configuration = lakefs_client.Configuration(
   633      host = "http://localhost/api/v1"
   634  )
   635  
   636  # The client must configure the authentication and authorization parameters
   637  # in accordance with the API server security policy.
   638  # Examples for each auth method are provided below, use the example that
   639  # satisfies your auth use case.
   640  
   641  # Configure HTTP basic authorization: basic_auth
   642  configuration = lakefs_client.Configuration(
   643      username = 'YOUR_USERNAME',
   644      password = 'YOUR_PASSWORD'
   645  )
   646  
   647  # Configure API key authorization: cookie_auth
   648  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   649  
   650  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   651  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   652  
   653  # Configure Bearer authorization (JWT): jwt_token
   654  configuration = lakefs_client.Configuration(
   655      access_token = 'YOUR_BEARER_TOKEN'
   656  )
   657  
   658  # Configure API key authorization: oidc_auth
   659  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   660  
   661  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   662  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   663  
   664  # Configure API key authorization: saml_auth
   665  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   666  
   667  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   668  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   669  
   670  # Enter a context with an instance of the API client
   671  with lakefs_client.ApiClient(configuration) as api_client:
   672      # Create an instance of the API class
   673      api_instance = branches_api.BranchesApi(api_client)
   674      repository = "repository_example" # str | 
   675      prefix = "prefix_example" # str | return items prefixed with this value (optional)
   676      after = "after_example" # str | return items after this value (optional)
   677      amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100
   678  
   679      # example passing only required values which don't have defaults set
   680      try:
   681          # list branches
   682          api_response = api_instance.list_branches(repository)
   683          pprint(api_response)
   684      except lakefs_client.ApiException as e:
   685          print("Exception when calling BranchesApi->list_branches: %s\n" % e)
   686  
   687      # example passing only required values which don't have defaults set
   688      # and optional values
   689      try:
   690          # list branches
   691          api_response = api_instance.list_branches(repository, prefix=prefix, after=after, amount=amount)
   692          pprint(api_response)
   693      except lakefs_client.ApiException as e:
   694          print("Exception when calling BranchesApi->list_branches: %s\n" % e)
   695  ```
   696  
   697  
   698  ### Parameters
   699  
   700  Name | Type | Description  | Notes
   701  ------------- | ------------- | ------------- | -------------
   702   **repository** | **str**|  |
   703   **prefix** | **str**| return items prefixed with this value | [optional]
   704   **after** | **str**| return items after this value | [optional]
   705   **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100
   706  
   707  ### Return type
   708  
   709  [**RefList**](RefList.md)
   710  
   711  ### Authorization
   712  
   713  [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)
   714  
   715  ### HTTP request headers
   716  
   717   - **Content-Type**: Not defined
   718   - **Accept**: application/json
   719  
   720  
   721  ### HTTP response details
   722  
   723  | Status code | Description | Response headers |
   724  |-------------|-------------|------------------|
   725  **200** | branch list |  -  |
   726  **401** | Unauthorized |  -  |
   727  **404** | Resource Not Found |  -  |
   728  **420** | too many requests |  -  |
   729  **0** | Internal Server Error |  -  |
   730  
   731  [[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)
   732  
   733  # **reset_branch**
   734  > reset_branch(repository, branch, reset_creation)
   735  
   736  reset branch
   737  
   738  ### Example
   739  
   740  * Basic Authentication (basic_auth):
   741  * Api Key Authentication (cookie_auth):
   742  * Bearer (JWT) Authentication (jwt_token):
   743  * Api Key Authentication (oidc_auth):
   744  * Api Key Authentication (saml_auth):
   745  
   746  ```python
   747  import time
   748  import lakefs_client
   749  from lakefs_client.api import branches_api
   750  from lakefs_client.model.reset_creation import ResetCreation
   751  from lakefs_client.model.error import Error
   752  from pprint import pprint
   753  # Defining the host is optional and defaults to http://localhost/api/v1
   754  # See configuration.py for a list of all supported configuration parameters.
   755  configuration = lakefs_client.Configuration(
   756      host = "http://localhost/api/v1"
   757  )
   758  
   759  # The client must configure the authentication and authorization parameters
   760  # in accordance with the API server security policy.
   761  # Examples for each auth method are provided below, use the example that
   762  # satisfies your auth use case.
   763  
   764  # Configure HTTP basic authorization: basic_auth
   765  configuration = lakefs_client.Configuration(
   766      username = 'YOUR_USERNAME',
   767      password = 'YOUR_PASSWORD'
   768  )
   769  
   770  # Configure API key authorization: cookie_auth
   771  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   772  
   773  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   774  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   775  
   776  # Configure Bearer authorization (JWT): jwt_token
   777  configuration = lakefs_client.Configuration(
   778      access_token = 'YOUR_BEARER_TOKEN'
   779  )
   780  
   781  # Configure API key authorization: oidc_auth
   782  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   783  
   784  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   785  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   786  
   787  # Configure API key authorization: saml_auth
   788  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   789  
   790  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   791  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   792  
   793  # Enter a context with an instance of the API client
   794  with lakefs_client.ApiClient(configuration) as api_client:
   795      # Create an instance of the API class
   796      api_instance = branches_api.BranchesApi(api_client)
   797      repository = "repository_example" # str | 
   798      branch = "branch_example" # str | 
   799      reset_creation = ResetCreation(
   800          type="object",
   801          path="path_example",
   802          force=False,
   803      ) # ResetCreation | 
   804  
   805      # example passing only required values which don't have defaults set
   806      try:
   807          # reset branch
   808          api_instance.reset_branch(repository, branch, reset_creation)
   809      except lakefs_client.ApiException as e:
   810          print("Exception when calling BranchesApi->reset_branch: %s\n" % e)
   811  ```
   812  
   813  
   814  ### Parameters
   815  
   816  Name | Type | Description  | Notes
   817  ------------- | ------------- | ------------- | -------------
   818   **repository** | **str**|  |
   819   **branch** | **str**|  |
   820   **reset_creation** | [**ResetCreation**](ResetCreation.md)|  |
   821  
   822  ### Return type
   823  
   824  void (empty response body)
   825  
   826  ### Authorization
   827  
   828  [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)
   829  
   830  ### HTTP request headers
   831  
   832   - **Content-Type**: application/json
   833   - **Accept**: application/json
   834  
   835  
   836  ### HTTP response details
   837  
   838  | Status code | Description | Response headers |
   839  |-------------|-------------|------------------|
   840  **204** | reset successful |  -  |
   841  **400** | Bad Request |  -  |
   842  **401** | Unauthorized |  -  |
   843  **403** | Forbidden |  -  |
   844  **404** | Resource Not Found |  -  |
   845  **420** | too many requests |  -  |
   846  **0** | Internal Server Error |  -  |
   847  
   848  [[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)
   849  
   850  # **revert_branch**
   851  > revert_branch(repository, branch, revert_creation)
   852  
   853  revert
   854  
   855  ### Example
   856  
   857  * Basic Authentication (basic_auth):
   858  * Api Key Authentication (cookie_auth):
   859  * Bearer (JWT) Authentication (jwt_token):
   860  * Api Key Authentication (oidc_auth):
   861  * Api Key Authentication (saml_auth):
   862  
   863  ```python
   864  import time
   865  import lakefs_client
   866  from lakefs_client.api import branches_api
   867  from lakefs_client.model.revert_creation import RevertCreation
   868  from lakefs_client.model.error import Error
   869  from pprint import pprint
   870  # Defining the host is optional and defaults to http://localhost/api/v1
   871  # See configuration.py for a list of all supported configuration parameters.
   872  configuration = lakefs_client.Configuration(
   873      host = "http://localhost/api/v1"
   874  )
   875  
   876  # The client must configure the authentication and authorization parameters
   877  # in accordance with the API server security policy.
   878  # Examples for each auth method are provided below, use the example that
   879  # satisfies your auth use case.
   880  
   881  # Configure HTTP basic authorization: basic_auth
   882  configuration = lakefs_client.Configuration(
   883      username = 'YOUR_USERNAME',
   884      password = 'YOUR_PASSWORD'
   885  )
   886  
   887  # Configure API key authorization: cookie_auth
   888  configuration.api_key['cookie_auth'] = 'YOUR_API_KEY'
   889  
   890  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   891  # configuration.api_key_prefix['cookie_auth'] = 'Bearer'
   892  
   893  # Configure Bearer authorization (JWT): jwt_token
   894  configuration = lakefs_client.Configuration(
   895      access_token = 'YOUR_BEARER_TOKEN'
   896  )
   897  
   898  # Configure API key authorization: oidc_auth
   899  configuration.api_key['oidc_auth'] = 'YOUR_API_KEY'
   900  
   901  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   902  # configuration.api_key_prefix['oidc_auth'] = 'Bearer'
   903  
   904  # Configure API key authorization: saml_auth
   905  configuration.api_key['saml_auth'] = 'YOUR_API_KEY'
   906  
   907  # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
   908  # configuration.api_key_prefix['saml_auth'] = 'Bearer'
   909  
   910  # Enter a context with an instance of the API client
   911  with lakefs_client.ApiClient(configuration) as api_client:
   912      # Create an instance of the API class
   913      api_instance = branches_api.BranchesApi(api_client)
   914      repository = "repository_example" # str | 
   915      branch = "branch_example" # str | 
   916      revert_creation = RevertCreation(
   917          ref="ref_example",
   918          parent_number=1,
   919          force=False,
   920          allow_empty=False,
   921      ) # RevertCreation | 
   922  
   923      # example passing only required values which don't have defaults set
   924      try:
   925          # revert
   926          api_instance.revert_branch(repository, branch, revert_creation)
   927      except lakefs_client.ApiException as e:
   928          print("Exception when calling BranchesApi->revert_branch: %s\n" % e)
   929  ```
   930  
   931  
   932  ### Parameters
   933  
   934  Name | Type | Description  | Notes
   935  ------------- | ------------- | ------------- | -------------
   936   **repository** | **str**|  |
   937   **branch** | **str**|  |
   938   **revert_creation** | [**RevertCreation**](RevertCreation.md)|  |
   939  
   940  ### Return type
   941  
   942  void (empty response body)
   943  
   944  ### Authorization
   945  
   946  [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)
   947  
   948  ### HTTP request headers
   949  
   950   - **Content-Type**: application/json
   951   - **Accept**: application/json
   952  
   953  
   954  ### HTTP response details
   955  
   956  | Status code | Description | Response headers |
   957  |-------------|-------------|------------------|
   958  **204** | revert successful |  -  |
   959  **400** | Validation Error |  -  |
   960  **401** | Unauthorized |  -  |
   961  **403** | Forbidden |  -  |
   962  **404** | Resource Not Found |  -  |
   963  **409** | Conflict Found |  -  |
   964  **420** | too many requests |  -  |
   965  **0** | Internal Server Error |  -  |
   966  
   967  [[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)
   968