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

     1  # RefsApi
     2  
     3  All URIs are relative to *http://localhost/api/v1*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**diffRefs**](RefsApi.md#diffRefs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references
     8  [**findMergeBase**](RefsApi.md#findMergeBase) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references
     9  [**logCommits**](RefsApi.md#logCommits) | **GET** /repositories/{repository}/refs/{ref}/commits | get commit log from ref. If both objects and prefixes are empty, return all commits.
    10  [**mergeIntoBranch**](RefsApi.md#mergeIntoBranch) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | merge references
    11  
    12  
    13  <a name="diffRefs"></a>
    14  # **diffRefs**
    15  > DiffList diffRefs(repository, leftRef, rightRef, after, amount, prefix, delimiter, type)
    16  
    17  diff references
    18  
    19  ### Example
    20  ```java
    21  // Import classes:
    22  import io.lakefs.clients.api.ApiClient;
    23  import io.lakefs.clients.api.ApiException;
    24  import io.lakefs.clients.api.Configuration;
    25  import io.lakefs.clients.api.auth.*;
    26  import io.lakefs.clients.api.models.*;
    27  import io.lakefs.clients.api.RefsApi;
    28  
    29  public class Example {
    30    public static void main(String[] args) {
    31      ApiClient defaultClient = Configuration.getDefaultApiClient();
    32      defaultClient.setBasePath("http://localhost/api/v1");
    33      
    34      // Configure HTTP basic authorization: basic_auth
    35      HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth");
    36      basic_auth.setUsername("YOUR USERNAME");
    37      basic_auth.setPassword("YOUR PASSWORD");
    38  
    39      // Configure API key authorization: cookie_auth
    40      ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth");
    41      cookie_auth.setApiKey("YOUR API KEY");
    42      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    43      //cookie_auth.setApiKeyPrefix("Token");
    44  
    45      // Configure HTTP bearer authorization: jwt_token
    46      HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token");
    47      jwt_token.setBearerToken("BEARER TOKEN");
    48  
    49      // Configure API key authorization: oidc_auth
    50      ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth");
    51      oidc_auth.setApiKey("YOUR API KEY");
    52      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    53      //oidc_auth.setApiKeyPrefix("Token");
    54  
    55      // Configure API key authorization: saml_auth
    56      ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth");
    57      saml_auth.setApiKey("YOUR API KEY");
    58      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    59      //saml_auth.setApiKeyPrefix("Token");
    60  
    61      RefsApi apiInstance = new RefsApi(defaultClient);
    62      String repository = "repository_example"; // String | 
    63      String leftRef = "leftRef_example"; // String | a reference (could be either a branch or a commit ID)
    64      String rightRef = "rightRef_example"; // String | a reference (could be either a branch or a commit ID) to compare against
    65      String after = "after_example"; // String | return items after this value
    66      Integer amount = 100; // Integer | how many items to return
    67      String prefix = "prefix_example"; // String | return items prefixed with this value
    68      String delimiter = "delimiter_example"; // String | delimiter used to group common prefixes by
    69      String type = "two_dot"; // String | 
    70      try {
    71        DiffList result = apiInstance.diffRefs(repository, leftRef, rightRef, after, amount, prefix, delimiter, type);
    72        System.out.println(result);
    73      } catch (ApiException e) {
    74        System.err.println("Exception when calling RefsApi#diffRefs");
    75        System.err.println("Status code: " + e.getCode());
    76        System.err.println("Reason: " + e.getResponseBody());
    77        System.err.println("Response headers: " + e.getResponseHeaders());
    78        e.printStackTrace();
    79      }
    80    }
    81  }
    82  ```
    83  
    84  ### Parameters
    85  
    86  Name | Type | Description  | Notes
    87  ------------- | ------------- | ------------- | -------------
    88   **repository** | **String**|  |
    89   **leftRef** | **String**| a reference (could be either a branch or a commit ID) |
    90   **rightRef** | **String**| a reference (could be either a branch or a commit ID) to compare against |
    91   **after** | **String**| return items after this value | [optional]
    92   **amount** | **Integer**| how many items to return | [optional] [default to 100]
    93   **prefix** | **String**| return items prefixed with this value | [optional]
    94   **delimiter** | **String**| delimiter used to group common prefixes by | [optional]
    95   **type** | **String**|  | [optional] [default to three_dot] [enum: two_dot, three_dot]
    96  
    97  ### Return type
    98  
    99  [**DiffList**](DiffList.md)
   100  
   101  ### Authorization
   102  
   103  [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)
   104  
   105  ### HTTP request headers
   106  
   107   - **Content-Type**: Not defined
   108   - **Accept**: application/json
   109  
   110  ### HTTP response details
   111  | Status code | Description | Response headers |
   112  |-------------|-------------|------------------|
   113  **200** | diff between refs |  -  |
   114  **401** | Unauthorized |  -  |
   115  **404** | Resource Not Found |  -  |
   116  **420** | too many requests |  -  |
   117  **0** | Internal Server Error |  -  |
   118  
   119  <a name="findMergeBase"></a>
   120  # **findMergeBase**
   121  > FindMergeBaseResult findMergeBase(repository, sourceRef, destinationBranch)
   122  
   123  find the merge base for 2 references
   124  
   125  ### Example
   126  ```java
   127  // Import classes:
   128  import io.lakefs.clients.api.ApiClient;
   129  import io.lakefs.clients.api.ApiException;
   130  import io.lakefs.clients.api.Configuration;
   131  import io.lakefs.clients.api.auth.*;
   132  import io.lakefs.clients.api.models.*;
   133  import io.lakefs.clients.api.RefsApi;
   134  
   135  public class Example {
   136    public static void main(String[] args) {
   137      ApiClient defaultClient = Configuration.getDefaultApiClient();
   138      defaultClient.setBasePath("http://localhost/api/v1");
   139      
   140      // Configure HTTP basic authorization: basic_auth
   141      HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth");
   142      basic_auth.setUsername("YOUR USERNAME");
   143      basic_auth.setPassword("YOUR PASSWORD");
   144  
   145      // Configure API key authorization: cookie_auth
   146      ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth");
   147      cookie_auth.setApiKey("YOUR API KEY");
   148      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
   149      //cookie_auth.setApiKeyPrefix("Token");
   150  
   151      // Configure HTTP bearer authorization: jwt_token
   152      HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token");
   153      jwt_token.setBearerToken("BEARER TOKEN");
   154  
   155      // Configure API key authorization: oidc_auth
   156      ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth");
   157      oidc_auth.setApiKey("YOUR API KEY");
   158      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
   159      //oidc_auth.setApiKeyPrefix("Token");
   160  
   161      // Configure API key authorization: saml_auth
   162      ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth");
   163      saml_auth.setApiKey("YOUR API KEY");
   164      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
   165      //saml_auth.setApiKeyPrefix("Token");
   166  
   167      RefsApi apiInstance = new RefsApi(defaultClient);
   168      String repository = "repository_example"; // String | 
   169      String sourceRef = "sourceRef_example"; // String | source ref
   170      String destinationBranch = "destinationBranch_example"; // String | destination branch name
   171      try {
   172        FindMergeBaseResult result = apiInstance.findMergeBase(repository, sourceRef, destinationBranch);
   173        System.out.println(result);
   174      } catch (ApiException e) {
   175        System.err.println("Exception when calling RefsApi#findMergeBase");
   176        System.err.println("Status code: " + e.getCode());
   177        System.err.println("Reason: " + e.getResponseBody());
   178        System.err.println("Response headers: " + e.getResponseHeaders());
   179        e.printStackTrace();
   180      }
   181    }
   182  }
   183  ```
   184  
   185  ### Parameters
   186  
   187  Name | Type | Description  | Notes
   188  ------------- | ------------- | ------------- | -------------
   189   **repository** | **String**|  |
   190   **sourceRef** | **String**| source ref |
   191   **destinationBranch** | **String**| destination branch name |
   192  
   193  ### Return type
   194  
   195  [**FindMergeBaseResult**](FindMergeBaseResult.md)
   196  
   197  ### Authorization
   198  
   199  [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)
   200  
   201  ### HTTP request headers
   202  
   203   - **Content-Type**: Not defined
   204   - **Accept**: application/json
   205  
   206  ### HTTP response details
   207  | Status code | Description | Response headers |
   208  |-------------|-------------|------------------|
   209  **200** | Found the merge base |  -  |
   210  **400** | Validation Error |  -  |
   211  **401** | Unauthorized |  -  |
   212  **404** | Resource Not Found |  -  |
   213  **420** | too many requests |  -  |
   214  **0** | Internal Server Error |  -  |
   215  
   216  <a name="logCommits"></a>
   217  # **logCommits**
   218  > CommitList logCommits(repository, ref, after, amount, objects, prefixes, limit, firstParent, since, stopAt)
   219  
   220  get commit log from ref. If both objects and prefixes are empty, return all commits.
   221  
   222  ### Example
   223  ```java
   224  // Import classes:
   225  import io.lakefs.clients.api.ApiClient;
   226  import io.lakefs.clients.api.ApiException;
   227  import io.lakefs.clients.api.Configuration;
   228  import io.lakefs.clients.api.auth.*;
   229  import io.lakefs.clients.api.models.*;
   230  import io.lakefs.clients.api.RefsApi;
   231  
   232  public class Example {
   233    public static void main(String[] args) {
   234      ApiClient defaultClient = Configuration.getDefaultApiClient();
   235      defaultClient.setBasePath("http://localhost/api/v1");
   236      
   237      // Configure HTTP basic authorization: basic_auth
   238      HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth");
   239      basic_auth.setUsername("YOUR USERNAME");
   240      basic_auth.setPassword("YOUR PASSWORD");
   241  
   242      // Configure API key authorization: cookie_auth
   243      ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth");
   244      cookie_auth.setApiKey("YOUR API KEY");
   245      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
   246      //cookie_auth.setApiKeyPrefix("Token");
   247  
   248      // Configure HTTP bearer authorization: jwt_token
   249      HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token");
   250      jwt_token.setBearerToken("BEARER TOKEN");
   251  
   252      // Configure API key authorization: oidc_auth
   253      ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth");
   254      oidc_auth.setApiKey("YOUR API KEY");
   255      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
   256      //oidc_auth.setApiKeyPrefix("Token");
   257  
   258      // Configure API key authorization: saml_auth
   259      ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth");
   260      saml_auth.setApiKey("YOUR API KEY");
   261      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
   262      //saml_auth.setApiKeyPrefix("Token");
   263  
   264      RefsApi apiInstance = new RefsApi(defaultClient);
   265      String repository = "repository_example"; // String | 
   266      String ref = "ref_example"; // String | 
   267      String after = "after_example"; // String | return items after this value
   268      Integer amount = 100; // Integer | how many items to return
   269      List<String> objects = Arrays.asList(); // List<String> | list of paths, each element is a path of a specific object
   270      List<String> prefixes = Arrays.asList(); // List<String> | list of paths, each element is a path of a prefix
   271      Boolean limit = true; // Boolean | limit the number of items in return to 'amount'. Without further indication on actual number of items.
   272      Boolean firstParent = true; // Boolean | if set to true, follow only the first parent upon reaching a merge commit
   273      OffsetDateTime since = OffsetDateTime.now(); // OffsetDateTime | 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.
   274      String stopAt = "stopAt_example"; // String | A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.
   275      try {
   276        CommitList result = apiInstance.logCommits(repository, ref, after, amount, objects, prefixes, limit, firstParent, since, stopAt);
   277        System.out.println(result);
   278      } catch (ApiException e) {
   279        System.err.println("Exception when calling RefsApi#logCommits");
   280        System.err.println("Status code: " + e.getCode());
   281        System.err.println("Reason: " + e.getResponseBody());
   282        System.err.println("Response headers: " + e.getResponseHeaders());
   283        e.printStackTrace();
   284      }
   285    }
   286  }
   287  ```
   288  
   289  ### Parameters
   290  
   291  Name | Type | Description  | Notes
   292  ------------- | ------------- | ------------- | -------------
   293   **repository** | **String**|  |
   294   **ref** | **String**|  |
   295   **after** | **String**| return items after this value | [optional]
   296   **amount** | **Integer**| how many items to return | [optional] [default to 100]
   297   **objects** | [**List&lt;String&gt;**](String.md)| list of paths, each element is a path of a specific object | [optional]
   298   **prefixes** | [**List&lt;String&gt;**](String.md)| list of paths, each element is a path of a prefix | [optional]
   299   **limit** | **Boolean**| limit the number of items in return to &#39;amount&#39;. Without further indication on actual number of items. | [optional]
   300   **firstParent** | **Boolean**| if set to true, follow only the first parent upon reaching a merge commit | [optional]
   301   **since** | **OffsetDateTime**| 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]
   302   **stopAt** | **String**| A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. | [optional]
   303  
   304  ### Return type
   305  
   306  [**CommitList**](CommitList.md)
   307  
   308  ### Authorization
   309  
   310  [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)
   311  
   312  ### HTTP request headers
   313  
   314   - **Content-Type**: Not defined
   315   - **Accept**: application/json
   316  
   317  ### HTTP response details
   318  | Status code | Description | Response headers |
   319  |-------------|-------------|------------------|
   320  **200** | commit log |  -  |
   321  **401** | Unauthorized |  -  |
   322  **404** | Resource Not Found |  -  |
   323  **420** | too many requests |  -  |
   324  **0** | Internal Server Error |  -  |
   325  
   326  <a name="mergeIntoBranch"></a>
   327  # **mergeIntoBranch**
   328  > MergeResult mergeIntoBranch(repository, sourceRef, destinationBranch, merge)
   329  
   330  merge references
   331  
   332  ### Example
   333  ```java
   334  // Import classes:
   335  import io.lakefs.clients.api.ApiClient;
   336  import io.lakefs.clients.api.ApiException;
   337  import io.lakefs.clients.api.Configuration;
   338  import io.lakefs.clients.api.auth.*;
   339  import io.lakefs.clients.api.models.*;
   340  import io.lakefs.clients.api.RefsApi;
   341  
   342  public class Example {
   343    public static void main(String[] args) {
   344      ApiClient defaultClient = Configuration.getDefaultApiClient();
   345      defaultClient.setBasePath("http://localhost/api/v1");
   346      
   347      // Configure HTTP basic authorization: basic_auth
   348      HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth");
   349      basic_auth.setUsername("YOUR USERNAME");
   350      basic_auth.setPassword("YOUR PASSWORD");
   351  
   352      // Configure API key authorization: cookie_auth
   353      ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth");
   354      cookie_auth.setApiKey("YOUR API KEY");
   355      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
   356      //cookie_auth.setApiKeyPrefix("Token");
   357  
   358      // Configure HTTP bearer authorization: jwt_token
   359      HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token");
   360      jwt_token.setBearerToken("BEARER TOKEN");
   361  
   362      // Configure API key authorization: oidc_auth
   363      ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth");
   364      oidc_auth.setApiKey("YOUR API KEY");
   365      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
   366      //oidc_auth.setApiKeyPrefix("Token");
   367  
   368      // Configure API key authorization: saml_auth
   369      ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth");
   370      saml_auth.setApiKey("YOUR API KEY");
   371      // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
   372      //saml_auth.setApiKeyPrefix("Token");
   373  
   374      RefsApi apiInstance = new RefsApi(defaultClient);
   375      String repository = "repository_example"; // String | 
   376      String sourceRef = "sourceRef_example"; // String | source ref
   377      String destinationBranch = "destinationBranch_example"; // String | destination branch name
   378      Merge merge = new Merge(); // Merge | 
   379      try {
   380        MergeResult result = apiInstance.mergeIntoBranch(repository, sourceRef, destinationBranch, merge);
   381        System.out.println(result);
   382      } catch (ApiException e) {
   383        System.err.println("Exception when calling RefsApi#mergeIntoBranch");
   384        System.err.println("Status code: " + e.getCode());
   385        System.err.println("Reason: " + e.getResponseBody());
   386        System.err.println("Response headers: " + e.getResponseHeaders());
   387        e.printStackTrace();
   388      }
   389    }
   390  }
   391  ```
   392  
   393  ### Parameters
   394  
   395  Name | Type | Description  | Notes
   396  ------------- | ------------- | ------------- | -------------
   397   **repository** | **String**|  |
   398   **sourceRef** | **String**| source ref |
   399   **destinationBranch** | **String**| destination branch name |
   400   **merge** | [**Merge**](Merge.md)|  | [optional]
   401  
   402  ### Return type
   403  
   404  [**MergeResult**](MergeResult.md)
   405  
   406  ### Authorization
   407  
   408  [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)
   409  
   410  ### HTTP request headers
   411  
   412   - **Content-Type**: application/json
   413   - **Accept**: application/json
   414  
   415  ### HTTP response details
   416  | Status code | Description | Response headers |
   417  |-------------|-------------|------------------|
   418  **200** | merge completed |  -  |
   419  **400** | Validation Error |  -  |
   420  **401** | Unauthorized |  -  |
   421  **403** | Forbidden |  -  |
   422  **404** | Resource Not Found |  -  |
   423  **409** | Conflict Deprecated: content schema will return Error format and not an empty MergeResult  |  -  |
   424  **412** | precondition failed (e.g. a pre-merge hook returned a failure) |  -  |
   425  **420** | too many requests |  -  |
   426  **0** | Internal Server Error |  -  |
   427