From e53c71cf0ce13f8126f87284e3b6bf4c5633579a Mon Sep 17 00:00:00 2001 From: Itai Admi Date: Tue, 14 Mar 2023 20:16:39 +0200 Subject: [PATCH 1/8] cherry-pick --- api/swagger.yml | 53 + clients/java/README.md | 2 + clients/java/api/openapi.yaml | 77 ++ clients/java/docs/BranchesApi.md | 109 ++ clients/java/docs/CherryPickCreation.md | 14 + .../io/lakefs/clients/api/BranchesApi.java | 148 +++ .../clients/api/model/CherryPickCreation.java | 127 ++ .../lakefs/clients/api/BranchesApiTest.java | 18 + .../api/model/CherryPickCreationTest.java | 59 + clients/python/.openapi-generator/FILES | 212 +++ clients/python/README.md | 188 +++ clients/python/docs/BranchesApi.md | 938 +++++++++++++ clients/python/docs/CherryPickCreation.md | 13 + .../python/lakefs_client/api/branches_api.py | 1165 +++++++++++++++++ .../model/cherry_pick_creation.py | 266 ++++ .../python/lakefs_client/models/__init__.py | 1 + clients/python/test/test_branches_api.py | 85 ++ .../python/test/test_cherry_pick_creation.py | 36 + docs/assets/js/swagger.yml | 53 + pkg/api/controller.go | 41 + pkg/catalog/catalog.go | 26 + pkg/catalog/interface.go | 9 + pkg/graveler/errors.go | 3 +- pkg/graveler/graveler.go | 87 +- pkg/validator/validate.go | 14 + 25 files changed, 3742 insertions(+), 2 deletions(-) create mode 100644 clients/java/docs/CherryPickCreation.md create mode 100644 clients/java/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java create mode 100644 clients/java/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java create mode 100644 clients/python/docs/BranchesApi.md create mode 100644 clients/python/docs/CherryPickCreation.md create mode 100644 clients/python/lakefs_client/api/branches_api.py create mode 100644 clients/python/lakefs_client/model/cherry_pick_creation.py create mode 100644 clients/python/test/test_branches_api.py create mode 100644 clients/python/test/test_cherry_pick_creation.py diff --git a/api/swagger.yml b/api/swagger.yml index f7ed261e51a..9b9a8c7ff86 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -474,6 +474,18 @@ components: type: integer description: when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert. + CherryPickCreation: + type: object + required: + - ref + properties: + ref: + type: string + description: the commit to cherry-pick, given by a ref + parent_number: + type: integer + description: when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. + Commit: type: object required: @@ -2734,6 +2746,47 @@ paths: default: $ref: "#/components/responses/ServerError" + /repositories/{repository}/branches/{branch}/cherry-pick: + parameters: + - in: path + name: repository + required: true + schema: + type: string + - in: path + name: branch + required: true + schema: + type: string + post: + tags: + - branches + operationId: cherryPick + summary: Cherry-Pick the given reference commit into the given branch + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CherryPickCreation" + responses: + 204: + description: successful cherry-pick + 400: + $ref: "#/components/responses/ValidationError" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + 409: + description: Conflict Found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + $ref: "#/components/responses/ServerError" + /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}: parameters: - in: path diff --git a/clients/java/README.md b/clients/java/README.md index 8b1fd3d65f3..7fd8f9445cc 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -178,6 +178,7 @@ Class | Method | HTTP request | Description *AuthApi* | [**login**](docs/AuthApi.md#login) | **POST** /auth/login | perform a login *AuthApi* | [**updatePassword**](docs/AuthApi.md#updatePassword) | **POST** /auth/password | Update user password by reset_password token *AuthApi* | [**updatePolicy**](docs/AuthApi.md#updatePolicy) | **PUT** /auth/policies/{policyId} | update policy +*BranchesApi* | [**cherryPick**](docs/BranchesApi.md#cherryPick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Cherry-Pick the given reference commit into the given branch *BranchesApi* | [**createBranch**](docs/BranchesApi.md#createBranch) | **POST** /repositories/{repository}/branches | create branch *BranchesApi* | [**deleteBranch**](docs/BranchesApi.md#deleteBranch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch *BranchesApi* | [**diffBranch**](docs/BranchesApi.md#diffBranch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch @@ -249,6 +250,7 @@ Class | Method | HTTP request | Description - [AuthenticationToken](docs/AuthenticationToken.md) - [BranchCreation](docs/BranchCreation.md) - [BranchProtectionRule](docs/BranchProtectionRule.md) + - [CherryPickCreation](docs/CherryPickCreation.md) - [CommPrefsInput](docs/CommPrefsInput.md) - [Commit](docs/Commit.md) - [CommitCreation](docs/CommitCreation.md) diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index df475e3ce0d..b1331aa4b91 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -2683,6 +2683,68 @@ paths: - branches x-content-type: application/json x-accepts: application/json + /repositories/{repository}/branches/{branch}/cherry-pick: + post: + operationId: cherryPick + parameters: + - explode: false + in: path + name: repository + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: branch + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CherryPickCreation' + required: true + responses: + "204": + description: successful cherry-pick + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Validation Error + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Resource Not Found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Conflict Found + default: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error + summary: Cherry-Pick the given reference commit into the given branch + tags: + - branches + x-contentType: application/json + x-accepts: application/json /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}: get: operationId: findMergeBase @@ -5638,6 +5700,21 @@ components: - parent_number - ref type: object + CherryPickCreation: + example: + ref: ref + parent_number: 0 + properties: + ref: + description: the commit to cherry-pick, given by a ref + type: string + parent_number: + description: when cherry-picking a merge commit, the parent number (starting + from 1) relative to which to perform the diff. + type: integer + required: + - ref + type: object Commit: example: metadata: diff --git a/clients/java/docs/BranchesApi.md b/clients/java/docs/BranchesApi.md index fd0dd2fedbd..c01fca1ec01 100644 --- a/clients/java/docs/BranchesApi.md +++ b/clients/java/docs/BranchesApi.md @@ -2,6 +2,7 @@ All URIs are relative to */api/v1* +<<<<<<< HEAD | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**createBranch**](BranchesApi.md#createBranch) | **POST** /repositories/{repository}/branches | create branch | @@ -11,7 +12,115 @@ All URIs are relative to */api/v1* | [**listBranches**](BranchesApi.md#listBranches) | **GET** /repositories/{repository}/branches | list branches | | [**resetBranch**](BranchesApi.md#resetBranch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch | | [**revertBranch**](BranchesApi.md#revertBranch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert | +======= +Method | HTTP request | Description +------------- | ------------- | ------------- +[**cherryPick**](BranchesApi.md#cherryPick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Cherry-Pick the given reference commit into the given branch +[**createBranch**](BranchesApi.md#createBranch) | **POST** /repositories/{repository}/branches | create branch +[**deleteBranch**](BranchesApi.md#deleteBranch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch +[**diffBranch**](BranchesApi.md#diffBranch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch +[**getBranch**](BranchesApi.md#getBranch) | **GET** /repositories/{repository}/branches/{branch} | get branch +[**listBranches**](BranchesApi.md#listBranches) | **GET** /repositories/{repository}/branches | list branches +[**resetBranch**](BranchesApi.md#resetBranch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch +[**revertBranch**](BranchesApi.md#revertBranch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert +>>>>>>> cfd08d6a7 (cherry-pick) + + + +# **cherryPick** +> cherryPick(repository, branch, cherryPickCreation) + +Cherry-Pick the given reference commit into the given branch +### Example +```java +// Import classes: +import io.lakefs.clients.api.ApiClient; +import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.Configuration; +import io.lakefs.clients.api.auth.*; +import io.lakefs.clients.api.models.*; +import io.lakefs.clients.api.BranchesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost/api/v1"); + + // Configure HTTP basic authorization: basic_auth + HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); + basic_auth.setUsername("YOUR USERNAME"); + basic_auth.setPassword("YOUR PASSWORD"); + + // Configure API key authorization: cookie_auth + ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth"); + cookie_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //cookie_auth.setApiKeyPrefix("Token"); + + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + + // Configure API key authorization: oidc_auth + ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); + oidc_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //oidc_auth.setApiKeyPrefix("Token"); + + // Configure API key authorization: saml_auth + ApiKeyAuth saml_auth = (ApiKeyAuth) defaultClient.getAuthentication("saml_auth"); + saml_auth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //saml_auth.setApiKeyPrefix("Token"); + + BranchesApi apiInstance = new BranchesApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + CherryPickCreation cherryPickCreation = new CherryPickCreation(); // CherryPickCreation | + try { + apiInstance.cherryPick(repository, branch, cherryPickCreation); + } catch (ApiException e) { + System.err.println("Exception when calling BranchesApi#cherryPick"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **String**| | + **branch** | **String**| | + **cherryPickCreation** | [**CherryPickCreation**](CherryPickCreation.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[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) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | successful cherry-pick | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**409** | Conflict Found | - | +**0** | Internal Server Error | - | # **createBranch** diff --git a/clients/java/docs/CherryPickCreation.md b/clients/java/docs/CherryPickCreation.md new file mode 100644 index 00000000000..fac8129f68e --- /dev/null +++ b/clients/java/docs/CherryPickCreation.md @@ -0,0 +1,14 @@ + + +# CherryPickCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ref** | **String** | the commit to cherry-pick, given by a ref | +**parentNumber** | **Integer** | when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. | [optional] + + + diff --git a/clients/java/src/main/java/io/lakefs/clients/api/BranchesApi.java b/clients/java/src/main/java/io/lakefs/clients/api/BranchesApi.java index c03ae368151..63d09bf70d9 100644 --- a/clients/java/src/main/java/io/lakefs/clients/api/BranchesApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/api/BranchesApi.java @@ -28,6 +28,7 @@ import io.lakefs.clients.api.model.BranchCreation; +import io.lakefs.clients.api.model.CherryPickCreation; import io.lakefs.clients.api.model.DiffList; import io.lakefs.clients.api.model.Error; import io.lakefs.clients.api.model.Ref; @@ -79,6 +80,153 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for cherryPick + * @param repository (required) + * @param branch (required) + * @param cherryPickCreation (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 successful cherry-pick -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public okhttp3.Call cherryPickCall(String repository, String branch, CherryPickCreation cherryPickCreation, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = cherryPickCreation; + + // create path and map variables + String localVarPath = "/repositories/{repository}/branches/{branch}/cherry-pick" + .replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())) + .replaceAll("\\{" + "branch" + "\\}", localVarApiClient.escapeString(branch.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call cherryPickValidateBeforeCall(String repository, String branch, CherryPickCreation cherryPickCreation, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'repository' is set + if (repository == null) { + throw new ApiException("Missing the required parameter 'repository' when calling cherryPick(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling cherryPick(Async)"); + } + + // verify the required parameter 'cherryPickCreation' is set + if (cherryPickCreation == null) { + throw new ApiException("Missing the required parameter 'cherryPickCreation' when calling cherryPick(Async)"); + } + + + okhttp3.Call localVarCall = cherryPickCall(repository, branch, cherryPickCreation, _callback); + return localVarCall; + + } + + /** + * Cherry-Pick the given reference commit into the given branch + * + * @param repository (required) + * @param branch (required) + * @param cherryPickCreation (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 successful cherry-pick -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public void cherryPick(String repository, String branch, CherryPickCreation cherryPickCreation) throws ApiException { + cherryPickWithHttpInfo(repository, branch, cherryPickCreation); + } + + /** + * Cherry-Pick the given reference commit into the given branch + * + * @param repository (required) + * @param branch (required) + * @param cherryPickCreation (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 successful cherry-pick -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public ApiResponse cherryPickWithHttpInfo(String repository, String branch, CherryPickCreation cherryPickCreation) throws ApiException { + okhttp3.Call localVarCall = cherryPickValidateBeforeCall(repository, branch, cherryPickCreation, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Cherry-Pick the given reference commit into the given branch (asynchronously) + * + * @param repository (required) + * @param branch (required) + * @param cherryPickCreation (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
204 successful cherry-pick -
400 Validation Error -
401 Unauthorized -
404 Resource Not Found -
409 Conflict Found -
0 Internal Server Error -
+ */ + public okhttp3.Call cherryPickAsync(String repository, String branch, CherryPickCreation cherryPickCreation, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = cherryPickValidateBeforeCall(repository, branch, cherryPickCreation, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } /** * Build call for createBranch * @param repository (required) diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java b/clients/java/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java new file mode 100644 index 00000000000..91a408e904e --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java @@ -0,0 +1,127 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * CherryPickCreation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CherryPickCreation { + public static final String SERIALIZED_NAME_REF = "ref"; + @SerializedName(SERIALIZED_NAME_REF) + private String ref; + + public static final String SERIALIZED_NAME_PARENT_NUMBER = "parent_number"; + @SerializedName(SERIALIZED_NAME_PARENT_NUMBER) + private Integer parentNumber; + + + public CherryPickCreation ref(String ref) { + + this.ref = ref; + return this; + } + + /** + * the commit to cherry-pick, given by a ref + * @return ref + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "the commit to cherry-pick, given by a ref") + + public String getRef() { + return ref; + } + + + public void setRef(String ref) { + this.ref = ref; + } + + + public CherryPickCreation parentNumber(Integer parentNumber) { + + this.parentNumber = parentNumber; + return this; + } + + /** + * when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. + * @return parentNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff.") + + public Integer getParentNumber() { + return parentNumber; + } + + + public void setParentNumber(Integer parentNumber) { + this.parentNumber = parentNumber; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CherryPickCreation cherryPickCreation = (CherryPickCreation) o; + return Objects.equals(this.ref, cherryPickCreation.ref) && + Objects.equals(this.parentNumber, cherryPickCreation.parentNumber); + } + + @Override + public int hashCode() { + return Objects.hash(ref, parentNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CherryPickCreation {\n"); + sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); + sb.append(" parentNumber: ").append(toIndentedString(parentNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/clients/java/src/test/java/io/lakefs/clients/api/BranchesApiTest.java b/clients/java/src/test/java/io/lakefs/clients/api/BranchesApiTest.java index 68cc758b91a..d0137b64508 100644 --- a/clients/java/src/test/java/io/lakefs/clients/api/BranchesApiTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/api/BranchesApiTest.java @@ -15,6 +15,7 @@ import io.lakefs.clients.api.ApiException; import io.lakefs.clients.api.model.BranchCreation; +import io.lakefs.clients.api.model.CherryPickCreation; import io.lakefs.clients.api.model.DiffList; import io.lakefs.clients.api.model.Error; import io.lakefs.clients.api.model.Ref; @@ -37,6 +38,23 @@ public class BranchesApiTest { private final BranchesApi api = new BranchesApi(); + /** + * Cherry-Pick the given reference commit into the given branch + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void cherryPickTest() throws ApiException { + String repository = null; + String branch = null; + CherryPickCreation cherryPickCreation = null; + api.cherryPick(repository, branch, cherryPickCreation); + // TODO: test validations + } + /** * create branch * diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java new file mode 100644 index 00000000000..433531687dc --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java @@ -0,0 +1,59 @@ +/* + * lakeFS API + * lakeFS HTTP API + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package io.lakefs.clients.api.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for CherryPickCreation + */ +public class CherryPickCreationTest { + private final CherryPickCreation model = new CherryPickCreation(); + + /** + * Model tests for CherryPickCreation + */ + @Test + public void testCherryPickCreation() { + // TODO: test CherryPickCreation + } + + /** + * Test the property 'ref' + */ + @Test + public void refTest() { + // TODO: test ref + } + + /** + * Test the property 'parentNumber' + */ + @Test + public void parentNumberTest() { + // TODO: test parentNumber + } + +} diff --git a/clients/python/.openapi-generator/FILES b/clients/python/.openapi-generator/FILES index 1dd0531c6e3..ab2751336cc 100644 --- a/clients/python/.openapi-generator/FILES +++ b/clients/python/.openapi-generator/FILES @@ -1,6 +1,7 @@ .gitignore .travis.yml README.md +<<<<<<< HEAD docs/apis/tags/ActionsApi.md docs/apis/tags/AuthApi.md docs/apis/tags/BranchesApi.md @@ -100,6 +101,109 @@ docs/models/User.md docs/models/UserCreation.md docs/models/UserList.md docs/models/VersionConfig.md +======= +docs/AccessKeyCredentials.md +docs/ActionRun.md +docs/ActionRunList.md +docs/ActionsApi.md +docs/AuthApi.md +docs/AuthCapabilities.md +docs/AuthenticationToken.md +docs/BranchCreation.md +docs/BranchProtectionRule.md +docs/BranchesApi.md +docs/CherryPickCreation.md +docs/CommPrefsInput.md +docs/Commit.md +docs/CommitCreation.md +docs/CommitList.md +docs/CommitsApi.md +docs/ConfigApi.md +docs/Credentials.md +docs/CredentialsList.md +docs/CredentialsWithSecret.md +docs/CurrentUser.md +docs/Diff.md +docs/DiffList.md +docs/Error.md +docs/ExperimentalApi.md +docs/FindMergeBaseResult.md +docs/ForgotPasswordRequest.md +docs/GarbageCollectionConfig.md +docs/GarbageCollectionPrepareRequest.md +docs/GarbageCollectionPrepareResponse.md +docs/GarbageCollectionRule.md +docs/GarbageCollectionRules.md +docs/Group.md +docs/GroupCreation.md +docs/GroupList.md +docs/HealthCheckApi.md +docs/HookRun.md +docs/HookRunList.md +docs/ImportApi.md +docs/ImportPagination.md +docs/IngestRangeCreationResponse.md +docs/InlineObject1.md +docs/LoginConfig.md +docs/LoginInformation.md +docs/Merge.md +docs/MergeResult.md +docs/MergeResultSummary.md +docs/MetaRangeCreation.md +docs/MetaRangeCreationResponse.md +docs/MetadataApi.md +docs/NextStep.md +docs/ObjectCopyCreation.md +docs/ObjectError.md +docs/ObjectErrorList.md +docs/ObjectStageCreation.md +docs/ObjectStats.md +docs/ObjectStatsList.md +docs/ObjectUserMetadata.md +docs/ObjectsApi.md +docs/OtfDiffApi.md +docs/OtfDiffEntry.md +docs/OtfDiffList.md +docs/Pagination.md +docs/PathList.md +docs/Policy.md +docs/PolicyList.md +docs/PrepareGCUncommittedRequest.md +docs/PrepareGCUncommittedResponse.md +docs/RangeMetadata.md +docs/Ref.md +docs/RefList.md +docs/RefsApi.md +docs/RefsDump.md +docs/RepositoriesApi.md +docs/Repository.md +docs/RepositoryCreation.md +docs/RepositoryList.md +docs/ResetCreation.md +docs/RetentionApi.md +docs/RevertCreation.md +docs/Setup.md +docs/SetupState.md +docs/StageRangeCreation.md +docs/StagingApi.md +docs/StagingLocation.md +docs/StagingMetadata.md +docs/Statement.md +docs/StatisticsApi.md +docs/StatsEvent.md +docs/StatsEventsList.md +docs/StorageConfig.md +docs/StorageURI.md +docs/TagCreation.md +docs/TagsApi.md +docs/TemplatesApi.md +docs/UnderlyingObjectProperties.md +docs/UpdatePasswordByToken.md +docs/User.md +docs/UserCreation.md +docs/UserList.md +docs/VersionConfig.md +>>>>>>> cfd08d6a7 (cherry-pick) lakefs_client/__init__.py lakefs_client/api_client.py lakefs_client/apis/__init__.py @@ -137,7 +241,11 @@ lakefs_client/model/authentication_token.pyi lakefs_client/model/branch_creation.py lakefs_client/model/branch_creation.pyi lakefs_client/model/branch_protection_rule.py +<<<<<<< HEAD lakefs_client/model/branch_protection_rule.pyi +======= +lakefs_client/model/cherry_pick_creation.py +>>>>>>> cfd08d6a7 (cherry-pick) lakefs_client/model/comm_prefs_input.py lakefs_client/model/comm_prefs_input.pyi lakefs_client/model/commit.py @@ -294,6 +402,7 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +<<<<<<< HEAD test/test_models/__init__.py test/test_models/test_access_key_credentials.py test/test_models/test_action_run.py @@ -376,4 +485,107 @@ test/test_models/test_user.py test/test_models/test_user_creation.py test/test_models/test_user_list.py test/test_models/test_version_config.py +======= +test/test_access_key_credentials.py +test/test_action_run.py +test/test_action_run_list.py +test/test_actions_api.py +test/test_auth_api.py +test/test_auth_capabilities.py +test/test_authentication_token.py +test/test_branch_creation.py +test/test_branch_protection_rule.py +test/test_branches_api.py +test/test_cherry_pick_creation.py +test/test_comm_prefs_input.py +test/test_commit.py +test/test_commit_creation.py +test/test_commit_list.py +test/test_commits_api.py +test/test_config_api.py +test/test_credentials.py +test/test_credentials_list.py +test/test_credentials_with_secret.py +test/test_current_user.py +test/test_diff.py +test/test_diff_list.py +test/test_error.py +test/test_experimental_api.py +test/test_find_merge_base_result.py +test/test_forgot_password_request.py +test/test_garbage_collection_config.py +test/test_garbage_collection_prepare_request.py +test/test_garbage_collection_prepare_response.py +test/test_garbage_collection_rule.py +test/test_garbage_collection_rules.py +test/test_group.py +test/test_group_creation.py +test/test_group_list.py +test/test_health_check_api.py +test/test_hook_run.py +test/test_hook_run_list.py +test/test_import_api.py +test/test_import_pagination.py +test/test_ingest_range_creation_response.py +test/test_inline_object1.py +test/test_login_config.py +test/test_login_information.py +test/test_merge.py +test/test_merge_result.py +test/test_merge_result_summary.py +test/test_meta_range_creation.py +test/test_meta_range_creation_response.py +test/test_metadata_api.py +test/test_next_step.py +test/test_object_copy_creation.py +test/test_object_error.py +test/test_object_error_list.py +test/test_object_stage_creation.py +test/test_object_stats.py +test/test_object_stats_list.py +test/test_object_user_metadata.py +test/test_objects_api.py +test/test_otf_diff_api.py +test/test_otf_diff_entry.py +test/test_otf_diff_list.py +test/test_pagination.py +test/test_path_list.py +test/test_policy.py +test/test_policy_list.py +test/test_prepare_gc_uncommitted_request.py +test/test_prepare_gc_uncommitted_response.py +test/test_range_metadata.py +test/test_ref.py +test/test_ref_list.py +test/test_refs_api.py +test/test_refs_dump.py +test/test_repositories_api.py +test/test_repository.py +test/test_repository_creation.py +test/test_repository_list.py +test/test_reset_creation.py +test/test_retention_api.py +test/test_revert_creation.py +test/test_setup.py +test/test_setup_state.py +test/test_stage_range_creation.py +test/test_staging_api.py +test/test_staging_location.py +test/test_staging_metadata.py +test/test_statement.py +test/test_statistics_api.py +test/test_stats_event.py +test/test_stats_events_list.py +test/test_storage_config.py +test/test_storage_uri.py +test/test_tag_creation.py +test/test_tags_api.py +test/test_templates_api.py +test/test_underlying_object_properties.py +test/test_update_password_by_token.py +test/test_user.py +test/test_user_creation.py +test/test_user_list.py +test/test_version_config.py +>>>>>>> cfd08d6a7 (cherry-pick) tox.ini diff --git a/clients/python/README.md b/clients/python/README.md index 48de5797a8a..36dbb0a5bea 100644 --- a/clients/python/README.md +++ b/clients/python/README.md @@ -206,6 +206,7 @@ All URIs are relative to */api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +<<<<<<< HEAD *ActionsApi* | [**get_run**](docs/apis/tags/ActionsApi.md#get_run) | **get** /repositories/{repository}/actions/runs/{run_id} | get a run *ActionsApi* | [**get_run_hook_output**](docs/apis/tags/ActionsApi.md#get_run_hook_output) | **get** /repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output | get run hook output *ActionsApi* | [**list_repository_runs**](docs/apis/tags/ActionsApi.md#list_repository_runs) | **get** /repositories/{repository}/actions/runs | list runs @@ -386,6 +387,193 @@ Class | Method | HTTP request | Description - [UserCreation](docs/models/UserCreation.md) - [UserList](docs/models/UserList.md) - [VersionConfig](docs/models/VersionConfig.md) +======= +*ActionsApi* | [**get_run**](docs/ActionsApi.md#get_run) | **GET** /repositories/{repository}/actions/runs/{run_id} | get a run +*ActionsApi* | [**get_run_hook_output**](docs/ActionsApi.md#get_run_hook_output) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output | get run hook output +*ActionsApi* | [**list_repository_runs**](docs/ActionsApi.md#list_repository_runs) | **GET** /repositories/{repository}/actions/runs | list runs +*ActionsApi* | [**list_run_hooks**](docs/ActionsApi.md#list_run_hooks) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks | list run hooks +*AuthApi* | [**add_group_membership**](docs/AuthApi.md#add_group_membership) | **PUT** /auth/groups/{groupId}/members/{userId} | add group membership +*AuthApi* | [**attach_policy_to_group**](docs/AuthApi.md#attach_policy_to_group) | **PUT** /auth/groups/{groupId}/policies/{policyId} | attach policy to group +*AuthApi* | [**attach_policy_to_user**](docs/AuthApi.md#attach_policy_to_user) | **PUT** /auth/users/{userId}/policies/{policyId} | attach policy to user +*AuthApi* | [**create_credentials**](docs/AuthApi.md#create_credentials) | **POST** /auth/users/{userId}/credentials | create credentials +*AuthApi* | [**create_group**](docs/AuthApi.md#create_group) | **POST** /auth/groups | create group +*AuthApi* | [**create_policy**](docs/AuthApi.md#create_policy) | **POST** /auth/policies | create policy +*AuthApi* | [**create_user**](docs/AuthApi.md#create_user) | **POST** /auth/users | create user +*AuthApi* | [**delete_credentials**](docs/AuthApi.md#delete_credentials) | **DELETE** /auth/users/{userId}/credentials/{accessKeyId} | delete credentials +*AuthApi* | [**delete_group**](docs/AuthApi.md#delete_group) | **DELETE** /auth/groups/{groupId} | delete group +*AuthApi* | [**delete_group_membership**](docs/AuthApi.md#delete_group_membership) | **DELETE** /auth/groups/{groupId}/members/{userId} | delete group membership +*AuthApi* | [**delete_policy**](docs/AuthApi.md#delete_policy) | **DELETE** /auth/policies/{policyId} | delete policy +*AuthApi* | [**delete_user**](docs/AuthApi.md#delete_user) | **DELETE** /auth/users/{userId} | delete user +*AuthApi* | [**detach_policy_from_group**](docs/AuthApi.md#detach_policy_from_group) | **DELETE** /auth/groups/{groupId}/policies/{policyId} | detach policy from group +*AuthApi* | [**detach_policy_from_user**](docs/AuthApi.md#detach_policy_from_user) | **DELETE** /auth/users/{userId}/policies/{policyId} | detach policy from user +*AuthApi* | [**forgot_password**](docs/AuthApi.md#forgot_password) | **POST** /auth/password/forgot | forgot password request initiates the password reset process +*AuthApi* | [**get_auth_capabilities**](docs/AuthApi.md#get_auth_capabilities) | **GET** /auth/capabilities | list authentication capabilities supported +*AuthApi* | [**get_credentials**](docs/AuthApi.md#get_credentials) | **GET** /auth/users/{userId}/credentials/{accessKeyId} | get credentials +*AuthApi* | [**get_current_user**](docs/AuthApi.md#get_current_user) | **GET** /user | get current user +*AuthApi* | [**get_group**](docs/AuthApi.md#get_group) | **GET** /auth/groups/{groupId} | get group +*AuthApi* | [**get_policy**](docs/AuthApi.md#get_policy) | **GET** /auth/policies/{policyId} | get policy +*AuthApi* | [**get_user**](docs/AuthApi.md#get_user) | **GET** /auth/users/{userId} | get user +*AuthApi* | [**list_group_members**](docs/AuthApi.md#list_group_members) | **GET** /auth/groups/{groupId}/members | list group members +*AuthApi* | [**list_group_policies**](docs/AuthApi.md#list_group_policies) | **GET** /auth/groups/{groupId}/policies | list group policies +*AuthApi* | [**list_groups**](docs/AuthApi.md#list_groups) | **GET** /auth/groups | list groups +*AuthApi* | [**list_policies**](docs/AuthApi.md#list_policies) | **GET** /auth/policies | list policies +*AuthApi* | [**list_user_credentials**](docs/AuthApi.md#list_user_credentials) | **GET** /auth/users/{userId}/credentials | list user credentials +*AuthApi* | [**list_user_groups**](docs/AuthApi.md#list_user_groups) | **GET** /auth/users/{userId}/groups | list user groups +*AuthApi* | [**list_user_policies**](docs/AuthApi.md#list_user_policies) | **GET** /auth/users/{userId}/policies | list user policies +*AuthApi* | [**list_users**](docs/AuthApi.md#list_users) | **GET** /auth/users | list users +*AuthApi* | [**login**](docs/AuthApi.md#login) | **POST** /auth/login | perform a login +*AuthApi* | [**update_password**](docs/AuthApi.md#update_password) | **POST** /auth/password | Update user password by reset_password token +*AuthApi* | [**update_policy**](docs/AuthApi.md#update_policy) | **PUT** /auth/policies/{policyId} | update policy +*BranchesApi* | [**cherry_pick**](docs/BranchesApi.md#cherry_pick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Cherry-Pick the given reference commit into the given branch +*BranchesApi* | [**create_branch**](docs/BranchesApi.md#create_branch) | **POST** /repositories/{repository}/branches | create branch +*BranchesApi* | [**delete_branch**](docs/BranchesApi.md#delete_branch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch +*BranchesApi* | [**diff_branch**](docs/BranchesApi.md#diff_branch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch +*BranchesApi* | [**get_branch**](docs/BranchesApi.md#get_branch) | **GET** /repositories/{repository}/branches/{branch} | get branch +*BranchesApi* | [**list_branches**](docs/BranchesApi.md#list_branches) | **GET** /repositories/{repository}/branches | list branches +*BranchesApi* | [**reset_branch**](docs/BranchesApi.md#reset_branch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch +*BranchesApi* | [**revert_branch**](docs/BranchesApi.md#revert_branch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert +*CommitsApi* | [**commit**](docs/CommitsApi.md#commit) | **POST** /repositories/{repository}/branches/{branch}/commits | create commit +*CommitsApi* | [**get_commit**](docs/CommitsApi.md#get_commit) | **GET** /repositories/{repository}/commits/{commitId} | get commit +*CommitsApi* | [**log_branch_commits**](docs/CommitsApi.md#log_branch_commits) | **GET** /repositories/{repository}/branches/{branch}/commits | get commit log from branch. Deprecated: replaced by logCommits by passing branch name as ref +*ConfigApi* | [**get_garbage_collection_config**](docs/ConfigApi.md#get_garbage_collection_config) | **GET** /config/garbage-collection | +*ConfigApi* | [**get_lake_fs_version**](docs/ConfigApi.md#get_lake_fs_version) | **GET** /config/version | +*ConfigApi* | [**get_setup_state**](docs/ConfigApi.md#get_setup_state) | **GET** /setup_lakefs | check if the lakeFS installation is already set up +*ConfigApi* | [**get_storage_config**](docs/ConfigApi.md#get_storage_config) | **GET** /config/storage | +*ConfigApi* | [**setup**](docs/ConfigApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user +*ConfigApi* | [**setup_comm_prefs**](docs/ConfigApi.md#setup_comm_prefs) | **POST** /setup_comm_prefs | setup communications preferences +*ExperimentalApi* | [**otf_diff**](docs/ExperimentalApi.md#otf_diff) | **GET** /repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref} | perform otf diff +*HealthCheckApi* | [**health_check**](docs/HealthCheckApi.md#health_check) | **GET** /healthcheck | +*ImportApi* | [**create_meta_range**](docs/ImportApi.md#create_meta_range) | **POST** /repositories/{repository}/branches/metaranges | create a lakeFS metarange file from the given ranges +*ImportApi* | [**ingest_range**](docs/ImportApi.md#ingest_range) | **POST** /repositories/{repository}/branches/ranges | create a lakeFS range file from the source uri +*MetadataApi* | [**create_symlink_file**](docs/MetadataApi.md#create_symlink_file) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory +*MetadataApi* | [**get_meta_range**](docs/MetadataApi.md#get_meta_range) | **GET** /repositories/{repository}/metadata/meta_range/{meta_range} | return URI to a meta-range file +*MetadataApi* | [**get_range**](docs/MetadataApi.md#get_range) | **GET** /repositories/{repository}/metadata/range/{range} | return URI to a range file +*ObjectsApi* | [**copy_object**](docs/ObjectsApi.md#copy_object) | **POST** /repositories/{repository}/branches/{branch}/objects/copy | create a copy of an object +*ObjectsApi* | [**delete_object**](docs/ObjectsApi.md#delete_object) | **DELETE** /repositories/{repository}/branches/{branch}/objects | delete object. Missing objects will not return a NotFound error. +*ObjectsApi* | [**delete_objects**](docs/ObjectsApi.md#delete_objects) | **POST** /repositories/{repository}/branches/{branch}/objects/delete | delete objects. Missing objects will not return a NotFound error. +*ObjectsApi* | [**get_object**](docs/ObjectsApi.md#get_object) | **GET** /repositories/{repository}/refs/{ref}/objects | get object content +*ObjectsApi* | [**get_underlying_properties**](docs/ObjectsApi.md#get_underlying_properties) | **GET** /repositories/{repository}/refs/{ref}/objects/underlyingProperties | get object properties on underlying storage +*ObjectsApi* | [**head_object**](docs/ObjectsApi.md#head_object) | **HEAD** /repositories/{repository}/refs/{ref}/objects | check if object exists +*ObjectsApi* | [**list_objects**](docs/ObjectsApi.md#list_objects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix +*ObjectsApi* | [**stage_object**](docs/ObjectsApi.md#stage_object) | **PUT** /repositories/{repository}/branches/{branch}/objects | stage an object's metadata for the given branch +*ObjectsApi* | [**stat_object**](docs/ObjectsApi.md#stat_object) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata +*ObjectsApi* | [**upload_object**](docs/ObjectsApi.md#upload_object) | **POST** /repositories/{repository}/branches/{branch}/objects | +*OtfDiffApi* | [**otf_diff**](docs/OtfDiffApi.md#otf_diff) | **GET** /repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref} | perform otf diff +*RefsApi* | [**diff_refs**](docs/RefsApi.md#diff_refs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references +*RefsApi* | [**dump_refs**](docs/RefsApi.md#dump_refs) | **PUT** /repositories/{repository}/refs/dump | Dump repository refs (tags, commits, branches) to object store +*RefsApi* | [**find_merge_base**](docs/RefsApi.md#find_merge_base) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references +*RefsApi* | [**log_commits**](docs/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. +*RefsApi* | [**merge_into_branch**](docs/RefsApi.md#merge_into_branch) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | merge references +*RefsApi* | [**restore_refs**](docs/RefsApi.md#restore_refs) | **PUT** /repositories/{repository}/refs/restore | Restore repository refs (tags, commits, branches) from object store +*RepositoriesApi* | [**create_branch_protection_rule**](docs/RepositoriesApi.md#create_branch_protection_rule) | **POST** /repositories/{repository}/branch_protection | +*RepositoriesApi* | [**create_repository**](docs/RepositoriesApi.md#create_repository) | **POST** /repositories | create repository +*RepositoriesApi* | [**delete_branch_protection_rule**](docs/RepositoriesApi.md#delete_branch_protection_rule) | **DELETE** /repositories/{repository}/branch_protection | +*RepositoriesApi* | [**delete_repository**](docs/RepositoriesApi.md#delete_repository) | **DELETE** /repositories/{repository} | delete repository +*RepositoriesApi* | [**get_branch_protection_rules**](docs/RepositoriesApi.md#get_branch_protection_rules) | **GET** /repositories/{repository}/branch_protection | get branch protection rules +*RepositoriesApi* | [**get_repository**](docs/RepositoriesApi.md#get_repository) | **GET** /repositories/{repository} | get repository +*RepositoriesApi* | [**list_repositories**](docs/RepositoriesApi.md#list_repositories) | **GET** /repositories | list repositories +*RetentionApi* | [**delete_garbage_collection_rules**](docs/RetentionApi.md#delete_garbage_collection_rules) | **DELETE** /repositories/{repository}/gc/rules | +*RetentionApi* | [**get_garbage_collection_rules**](docs/RetentionApi.md#get_garbage_collection_rules) | **GET** /repositories/{repository}/gc/rules | +*RetentionApi* | [**prepare_garbage_collection_commits**](docs/RetentionApi.md#prepare_garbage_collection_commits) | **POST** /repositories/{repository}/gc/prepare_commits | save lists of active and expired commits for garbage collection +*RetentionApi* | [**prepare_garbage_collection_uncommitted**](docs/RetentionApi.md#prepare_garbage_collection_uncommitted) | **POST** /repositories/{repository}/gc/prepare_uncommited | save repository uncommitted metadata for garbage collection +*RetentionApi* | [**set_garbage_collection_rules**](docs/RetentionApi.md#set_garbage_collection_rules) | **POST** /repositories/{repository}/gc/rules | +*StagingApi* | [**get_physical_address**](docs/StagingApi.md#get_physical_address) | **GET** /repositories/{repository}/branches/{branch}/staging/backing | get a physical address and a return token to write object to underlying storage +*StagingApi* | [**link_physical_address**](docs/StagingApi.md#link_physical_address) | **PUT** /repositories/{repository}/branches/{branch}/staging/backing | associate staging on this physical address with a path +*StatisticsApi* | [**post_stats_events**](docs/StatisticsApi.md#post_stats_events) | **POST** /statistics | post stats events, this endpoint is meant for internal use only +*TagsApi* | [**create_tag**](docs/TagsApi.md#create_tag) | **POST** /repositories/{repository}/tags | create tag +*TagsApi* | [**delete_tag**](docs/TagsApi.md#delete_tag) | **DELETE** /repositories/{repository}/tags/{tag} | delete tag +*TagsApi* | [**get_tag**](docs/TagsApi.md#get_tag) | **GET** /repositories/{repository}/tags/{tag} | get tag +*TagsApi* | [**list_tags**](docs/TagsApi.md#list_tags) | **GET** /repositories/{repository}/tags | list tags +*TemplatesApi* | [**expand_template**](docs/TemplatesApi.md#expand_template) | **GET** /templates/{template_location} | + + +## Documentation For Models + + - [AccessKeyCredentials](docs/AccessKeyCredentials.md) + - [ActionRun](docs/ActionRun.md) + - [ActionRunList](docs/ActionRunList.md) + - [AuthCapabilities](docs/AuthCapabilities.md) + - [AuthenticationToken](docs/AuthenticationToken.md) + - [BranchCreation](docs/BranchCreation.md) + - [BranchProtectionRule](docs/BranchProtectionRule.md) + - [CherryPickCreation](docs/CherryPickCreation.md) + - [CommPrefsInput](docs/CommPrefsInput.md) + - [Commit](docs/Commit.md) + - [CommitCreation](docs/CommitCreation.md) + - [CommitList](docs/CommitList.md) + - [Credentials](docs/Credentials.md) + - [CredentialsList](docs/CredentialsList.md) + - [CredentialsWithSecret](docs/CredentialsWithSecret.md) + - [CurrentUser](docs/CurrentUser.md) + - [Diff](docs/Diff.md) + - [DiffList](docs/DiffList.md) + - [Error](docs/Error.md) + - [FindMergeBaseResult](docs/FindMergeBaseResult.md) + - [ForgotPasswordRequest](docs/ForgotPasswordRequest.md) + - [GarbageCollectionConfig](docs/GarbageCollectionConfig.md) + - [GarbageCollectionPrepareRequest](docs/GarbageCollectionPrepareRequest.md) + - [GarbageCollectionPrepareResponse](docs/GarbageCollectionPrepareResponse.md) + - [GarbageCollectionRule](docs/GarbageCollectionRule.md) + - [GarbageCollectionRules](docs/GarbageCollectionRules.md) + - [Group](docs/Group.md) + - [GroupCreation](docs/GroupCreation.md) + - [GroupList](docs/GroupList.md) + - [HookRun](docs/HookRun.md) + - [HookRunList](docs/HookRunList.md) + - [ImportPagination](docs/ImportPagination.md) + - [IngestRangeCreationResponse](docs/IngestRangeCreationResponse.md) + - [InlineObject1](docs/InlineObject1.md) + - [LoginConfig](docs/LoginConfig.md) + - [LoginInformation](docs/LoginInformation.md) + - [Merge](docs/Merge.md) + - [MergeResult](docs/MergeResult.md) + - [MergeResultSummary](docs/MergeResultSummary.md) + - [MetaRangeCreation](docs/MetaRangeCreation.md) + - [MetaRangeCreationResponse](docs/MetaRangeCreationResponse.md) + - [NextStep](docs/NextStep.md) + - [ObjectCopyCreation](docs/ObjectCopyCreation.md) + - [ObjectError](docs/ObjectError.md) + - [ObjectErrorList](docs/ObjectErrorList.md) + - [ObjectStageCreation](docs/ObjectStageCreation.md) + - [ObjectStats](docs/ObjectStats.md) + - [ObjectStatsList](docs/ObjectStatsList.md) + - [ObjectUserMetadata](docs/ObjectUserMetadata.md) + - [OtfDiffEntry](docs/OtfDiffEntry.md) + - [OtfDiffList](docs/OtfDiffList.md) + - [Pagination](docs/Pagination.md) + - [PathList](docs/PathList.md) + - [Policy](docs/Policy.md) + - [PolicyList](docs/PolicyList.md) + - [PrepareGCUncommittedRequest](docs/PrepareGCUncommittedRequest.md) + - [PrepareGCUncommittedResponse](docs/PrepareGCUncommittedResponse.md) + - [RangeMetadata](docs/RangeMetadata.md) + - [Ref](docs/Ref.md) + - [RefList](docs/RefList.md) + - [RefsDump](docs/RefsDump.md) + - [Repository](docs/Repository.md) + - [RepositoryCreation](docs/RepositoryCreation.md) + - [RepositoryList](docs/RepositoryList.md) + - [ResetCreation](docs/ResetCreation.md) + - [RevertCreation](docs/RevertCreation.md) + - [Setup](docs/Setup.md) + - [SetupState](docs/SetupState.md) + - [StageRangeCreation](docs/StageRangeCreation.md) + - [StagingLocation](docs/StagingLocation.md) + - [StagingMetadata](docs/StagingMetadata.md) + - [Statement](docs/Statement.md) + - [StatsEvent](docs/StatsEvent.md) + - [StatsEventsList](docs/StatsEventsList.md) + - [StorageConfig](docs/StorageConfig.md) + - [StorageURI](docs/StorageURI.md) + - [TagCreation](docs/TagCreation.md) + - [UnderlyingObjectProperties](docs/UnderlyingObjectProperties.md) + - [UpdatePasswordByToken](docs/UpdatePasswordByToken.md) + - [User](docs/User.md) + - [UserCreation](docs/UserCreation.md) + - [UserList](docs/UserList.md) + - [VersionConfig](docs/VersionConfig.md) + +>>>>>>> cfd08d6a7 (cherry-pick) ## Documentation For Authorization diff --git a/clients/python/docs/BranchesApi.md b/clients/python/docs/BranchesApi.md new file mode 100644 index 00000000000..2f2c87b3456 --- /dev/null +++ b/clients/python/docs/BranchesApi.md @@ -0,0 +1,938 @@ +# lakefs_client.BranchesApi + +All URIs are relative to *http://localhost/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**cherry_pick**](BranchesApi.md#cherry_pick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Cherry-Pick the given reference commit into the given branch +[**create_branch**](BranchesApi.md#create_branch) | **POST** /repositories/{repository}/branches | create branch +[**delete_branch**](BranchesApi.md#delete_branch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch +[**diff_branch**](BranchesApi.md#diff_branch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch +[**get_branch**](BranchesApi.md#get_branch) | **GET** /repositories/{repository}/branches/{branch} | get branch +[**list_branches**](BranchesApi.md#list_branches) | **GET** /repositories/{repository}/branches | list branches +[**reset_branch**](BranchesApi.md#reset_branch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch +[**revert_branch**](BranchesApi.md#revert_branch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert + + +# **cherry_pick** +> cherry_pick(repository, branch, cherry_pick_creation) + +Cherry-Pick the given reference commit into the given branch + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import branches_api +from lakefs_client.model.error import Error +from lakefs_client.model.cherry_pick_creation import CherryPickCreation +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = branches_api.BranchesApi(api_client) + repository = "repository_example" # str | + branch = "branch_example" # str | + cherry_pick_creation = CherryPickCreation( + ref="ref_example", + parent_number=1, + ) # CherryPickCreation | + + # example passing only required values which don't have defaults set + try: + # Cherry-Pick the given reference commit into the given branch + api_instance.cherry_pick(repository, branch, cherry_pick_creation) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->cherry_pick: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **branch** | **str**| | + **cherry_pick_creation** | [**CherryPickCreation**](CherryPickCreation.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[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) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | successful cherry-pick | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**409** | Conflict Found | - | +**0** | Internal Server Error | - | + +[[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) + +# **create_branch** +> str create_branch(repository, branch_creation) + +create branch + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import branches_api +from lakefs_client.model.branch_creation import BranchCreation +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = branches_api.BranchesApi(api_client) + repository = "repository_example" # str | + branch_creation = BranchCreation( + name="name_example", + source="source_example", + ) # BranchCreation | + + # example passing only required values which don't have defaults set + try: + # create branch + api_response = api_instance.create_branch(repository, branch_creation) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->create_branch: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **branch_creation** | [**BranchCreation**](BranchCreation.md)| | + +### Return type + +**str** + +### Authorization + +[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) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/html, application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | reference | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**409** | Resource Conflicts With Target | - | +**0** | Internal Server Error | - | + +[[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) + +# **delete_branch** +> delete_branch(repository, branch) + +delete branch + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import branches_api +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = branches_api.BranchesApi(api_client) + repository = "repository_example" # str | + branch = "branch_example" # str | + + # example passing only required values which don't have defaults set + try: + # delete branch + api_instance.delete_branch(repository, branch) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->delete_branch: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **branch** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[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) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | branch deleted successfully | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + +[[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) + +# **diff_branch** +> DiffList diff_branch(repository, branch) + +diff branch + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import branches_api +from lakefs_client.model.diff_list import DiffList +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = branches_api.BranchesApi(api_client) + repository = "repository_example" # str | + branch = "branch_example" # str | + after = "after_example" # str | return items after this value (optional) + amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100 + prefix = "prefix_example" # str | return items prefixed with this value (optional) + delimiter = "delimiter_example" # str | delimiter used to group common prefixes by (optional) + + # example passing only required values which don't have defaults set + try: + # diff branch + api_response = api_instance.diff_branch(repository, branch) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->diff_branch: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # diff branch + api_response = api_instance.diff_branch(repository, branch, after=after, amount=amount, prefix=prefix, delimiter=delimiter) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->diff_branch: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **branch** | **str**| | + **after** | **str**| return items after this value | [optional] + **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100 + **prefix** | **str**| return items prefixed with this value | [optional] + **delimiter** | **str**| delimiter used to group common prefixes by | [optional] + +### Return type + +[**DiffList**](DiffList.md) + +### Authorization + +[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) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | diff of branch uncommitted changes | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + +[[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) + +# **get_branch** +> Ref get_branch(repository, branch) + +get branch + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import branches_api +from lakefs_client.model.error import Error +from lakefs_client.model.ref import Ref +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = branches_api.BranchesApi(api_client) + repository = "repository_example" # str | + branch = "branch_example" # str | + + # example passing only required values which don't have defaults set + try: + # get branch + api_response = api_instance.get_branch(repository, branch) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->get_branch: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **branch** | **str**| | + +### Return type + +[**Ref**](Ref.md) + +### Authorization + +[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) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | branch | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + +[[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) + +# **list_branches** +> RefList list_branches(repository) + +list branches + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import branches_api +from lakefs_client.model.error import Error +from lakefs_client.model.ref_list import RefList +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = branches_api.BranchesApi(api_client) + repository = "repository_example" # str | + prefix = "prefix_example" # str | return items prefixed with this value (optional) + after = "after_example" # str | return items after this value (optional) + amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100 + + # example passing only required values which don't have defaults set + try: + # list branches + api_response = api_instance.list_branches(repository) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->list_branches: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # list branches + api_response = api_instance.list_branches(repository, prefix=prefix, after=after, amount=amount) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->list_branches: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **prefix** | **str**| return items prefixed with this value | [optional] + **after** | **str**| return items after this value | [optional] + **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100 + +### Return type + +[**RefList**](RefList.md) + +### Authorization + +[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) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | branch list | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + +[[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) + +# **reset_branch** +> reset_branch(repository, branch, reset_creation) + +reset branch + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import branches_api +from lakefs_client.model.reset_creation import ResetCreation +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = branches_api.BranchesApi(api_client) + repository = "repository_example" # str | + branch = "branch_example" # str | + reset_creation = ResetCreation( + type="object", + path="path_example", + ) # ResetCreation | + + # example passing only required values which don't have defaults set + try: + # reset branch + api_instance.reset_branch(repository, branch, reset_creation) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->reset_branch: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **branch** | **str**| | + **reset_creation** | [**ResetCreation**](ResetCreation.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[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) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | reset successful | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + +[[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) + +# **revert_branch** +> revert_branch(repository, branch, revert_creation) + +revert + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Bearer (JWT) Authentication (jwt_token): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): + +```python +import time +import lakefs_client +from lakefs_client.api import branches_api +from lakefs_client.model.revert_creation import RevertCreation +from lakefs_client.model.error import Error +from pprint import pprint +# Defining the host is optional and defaults to http://localhost/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "http://localhost/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = branches_api.BranchesApi(api_client) + repository = "repository_example" # str | + branch = "branch_example" # str | + revert_creation = RevertCreation( + ref="ref_example", + parent_number=1, + ) # RevertCreation | + + # example passing only required values which don't have defaults set + try: + # revert + api_instance.revert_branch(repository, branch, revert_creation) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->revert_branch: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **branch** | **str**| | + **revert_creation** | [**RevertCreation**](RevertCreation.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[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) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | revert successful | - | +**400** | Validation Error | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**409** | Conflict Found | - | +**0** | Internal Server Error | - | + +[[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) + diff --git a/clients/python/docs/CherryPickCreation.md b/clients/python/docs/CherryPickCreation.md new file mode 100644 index 00000000000..e5ca3dcd1c3 --- /dev/null +++ b/clients/python/docs/CherryPickCreation.md @@ -0,0 +1,13 @@ +# CherryPickCreation + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ref** | **str** | the commit to cherry-pick, given by a ref | +**parent_number** | **int** | when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/clients/python/lakefs_client/api/branches_api.py b/clients/python/lakefs_client/api/branches_api.py new file mode 100644 index 00000000000..798c91f26fb --- /dev/null +++ b/clients/python/lakefs_client/api/branches_api.py @@ -0,0 +1,1165 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 0.1.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lakefs_client.api_client import ApiClient, Endpoint as _Endpoint +from lakefs_client.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from lakefs_client.model.branch_creation import BranchCreation +from lakefs_client.model.cherry_pick_creation import CherryPickCreation +from lakefs_client.model.diff_list import DiffList +from lakefs_client.model.error import Error +from lakefs_client.model.ref import Ref +from lakefs_client.model.ref_list import RefList +from lakefs_client.model.reset_creation import ResetCreation +from lakefs_client.model.revert_creation import RevertCreation + + +class BranchesApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.cherry_pick_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/branches/{branch}/cherry-pick', + 'operation_id': 'cherry_pick', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'branch', + 'cherry_pick_creation', + ], + 'required': [ + 'repository', + 'branch', + 'cherry_pick_creation', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'branch': + (str,), + 'cherry_pick_creation': + (CherryPickCreation,), + }, + 'attribute_map': { + 'repository': 'repository', + 'branch': 'branch', + }, + 'location_map': { + 'repository': 'path', + 'branch': 'path', + 'cherry_pick_creation': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.create_branch_endpoint = _Endpoint( + settings={ + 'response_type': (str,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/branches', + 'operation_id': 'create_branch', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'branch_creation', + ], + 'required': [ + 'repository', + 'branch_creation', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'branch_creation': + (BranchCreation,), + }, + 'attribute_map': { + 'repository': 'repository', + }, + 'location_map': { + 'repository': 'path', + 'branch_creation': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'text/html', + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.delete_branch_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/branches/{branch}', + 'operation_id': 'delete_branch', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'branch', + ], + 'required': [ + 'repository', + 'branch', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'branch': + (str,), + }, + 'attribute_map': { + 'repository': 'repository', + 'branch': 'branch', + }, + 'location_map': { + 'repository': 'path', + 'branch': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.diff_branch_endpoint = _Endpoint( + settings={ + 'response_type': (DiffList,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/branches/{branch}/diff', + 'operation_id': 'diff_branch', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'branch', + 'after', + 'amount', + 'prefix', + 'delimiter', + ], + 'required': [ + 'repository', + 'branch', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'amount', + ] + }, + root_map={ + 'validations': { + ('amount',): { + + 'inclusive_maximum': 1000, + 'inclusive_minimum': -1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'branch': + (str,), + 'after': + (str,), + 'amount': + (int,), + 'prefix': + (str,), + 'delimiter': + (str,), + }, + 'attribute_map': { + 'repository': 'repository', + 'branch': 'branch', + 'after': 'after', + 'amount': 'amount', + 'prefix': 'prefix', + 'delimiter': 'delimiter', + }, + 'location_map': { + 'repository': 'path', + 'branch': 'path', + 'after': 'query', + 'amount': 'query', + 'prefix': 'query', + 'delimiter': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_branch_endpoint = _Endpoint( + settings={ + 'response_type': (Ref,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/branches/{branch}', + 'operation_id': 'get_branch', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'branch', + ], + 'required': [ + 'repository', + 'branch', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'branch': + (str,), + }, + 'attribute_map': { + 'repository': 'repository', + 'branch': 'branch', + }, + 'location_map': { + 'repository': 'path', + 'branch': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.list_branches_endpoint = _Endpoint( + settings={ + 'response_type': (RefList,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/branches', + 'operation_id': 'list_branches', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'prefix', + 'after', + 'amount', + ], + 'required': [ + 'repository', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'amount', + ] + }, + root_map={ + 'validations': { + ('amount',): { + + 'inclusive_maximum': 1000, + 'inclusive_minimum': -1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'prefix': + (str,), + 'after': + (str,), + 'amount': + (int,), + }, + 'attribute_map': { + 'repository': 'repository', + 'prefix': 'prefix', + 'after': 'after', + 'amount': 'amount', + }, + 'location_map': { + 'repository': 'path', + 'prefix': 'query', + 'after': 'query', + 'amount': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.reset_branch_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/branches/{branch}', + 'operation_id': 'reset_branch', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'branch', + 'reset_creation', + ], + 'required': [ + 'repository', + 'branch', + 'reset_creation', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'branch': + (str,), + 'reset_creation': + (ResetCreation,), + }, + 'attribute_map': { + 'repository': 'repository', + 'branch': 'branch', + }, + 'location_map': { + 'repository': 'path', + 'branch': 'path', + 'reset_creation': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.revert_branch_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/branches/{branch}/revert', + 'operation_id': 'revert_branch', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'branch', + 'revert_creation', + ], + 'required': [ + 'repository', + 'branch', + 'revert_creation', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'branch': + (str,), + 'revert_creation': + (RevertCreation,), + }, + 'attribute_map': { + 'repository': 'repository', + 'branch': 'branch', + }, + 'location_map': { + 'repository': 'path', + 'branch': 'path', + 'revert_creation': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + + def cherry_pick( + self, + repository, + branch, + cherry_pick_creation, + **kwargs + ): + """Cherry-Pick the given reference commit into the given branch # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.cherry_pick(repository, branch, cherry_pick_creation, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch (str): + cherry_pick_creation (CherryPickCreation): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['branch'] = \ + branch + kwargs['cherry_pick_creation'] = \ + cherry_pick_creation + return self.cherry_pick_endpoint.call_with_http_info(**kwargs) + + def create_branch( + self, + repository, + branch_creation, + **kwargs + ): + """create branch # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_branch(repository, branch_creation, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch_creation (BranchCreation): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['branch_creation'] = \ + branch_creation + return self.create_branch_endpoint.call_with_http_info(**kwargs) + + def delete_branch( + self, + repository, + branch, + **kwargs + ): + """delete branch # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_branch(repository, branch, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch (str): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['branch'] = \ + branch + return self.delete_branch_endpoint.call_with_http_info(**kwargs) + + def diff_branch( + self, + repository, + branch, + **kwargs + ): + """diff branch # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.diff_branch(repository, branch, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch (str): + + Keyword Args: + after (str): return items after this value. [optional] + amount (int): how many items to return. [optional] if omitted the server will use the default value of 100 + prefix (str): return items prefixed with this value. [optional] + delimiter (str): delimiter used to group common prefixes by. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + DiffList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['branch'] = \ + branch + return self.diff_branch_endpoint.call_with_http_info(**kwargs) + + def get_branch( + self, + repository, + branch, + **kwargs + ): + """get branch # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_branch(repository, branch, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch (str): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Ref + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['branch'] = \ + branch + return self.get_branch_endpoint.call_with_http_info(**kwargs) + + def list_branches( + self, + repository, + **kwargs + ): + """list branches # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_branches(repository, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + + Keyword Args: + prefix (str): return items prefixed with this value. [optional] + after (str): return items after this value. [optional] + amount (int): how many items to return. [optional] if omitted the server will use the default value of 100 + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + RefList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + return self.list_branches_endpoint.call_with_http_info(**kwargs) + + def reset_branch( + self, + repository, + branch, + reset_creation, + **kwargs + ): + """reset branch # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.reset_branch(repository, branch, reset_creation, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch (str): + reset_creation (ResetCreation): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['branch'] = \ + branch + kwargs['reset_creation'] = \ + reset_creation + return self.reset_branch_endpoint.call_with_http_info(**kwargs) + + def revert_branch( + self, + repository, + branch, + revert_creation, + **kwargs + ): + """revert # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.revert_branch(repository, branch, revert_creation, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch (str): + revert_creation (RevertCreation): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['repository'] = \ + repository + kwargs['branch'] = \ + branch + kwargs['revert_creation'] = \ + revert_creation + return self.revert_branch_endpoint.call_with_http_info(**kwargs) + diff --git a/clients/python/lakefs_client/model/cherry_pick_creation.py b/clients/python/lakefs_client/model/cherry_pick_creation.py new file mode 100644 index 00000000000..256f0359acc --- /dev/null +++ b/clients/python/lakefs_client/model/cherry_pick_creation.py @@ -0,0 +1,266 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 0.1.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lakefs_client.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from ..model_utils import OpenApiModel +from lakefs_client.exceptions import ApiAttributeError + + + +class CherryPickCreation(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'ref': (str,), # noqa: E501 + 'parent_number': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'ref': 'ref', # noqa: E501 + 'parent_number': 'parent_number', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, ref, *args, **kwargs): # noqa: E501 + """CherryPickCreation - a model defined in OpenAPI + + Args: + ref (str): the commit to cherry-pick, given by a ref + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + parent_number (int): when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.ref = ref + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, ref, *args, **kwargs): # noqa: E501 + """CherryPickCreation - a model defined in OpenAPI + + Args: + ref (str): the commit to cherry-pick, given by a ref + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + parent_number (int): when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.ref = ref + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/clients/python/lakefs_client/models/__init__.py b/clients/python/lakefs_client/models/__init__.py index 32ff5251fc9..28ddb221de2 100644 --- a/clients/python/lakefs_client/models/__init__.py +++ b/clients/python/lakefs_client/models/__init__.py @@ -18,6 +18,7 @@ from lakefs_client.model.authentication_token import AuthenticationToken from lakefs_client.model.branch_creation import BranchCreation from lakefs_client.model.branch_protection_rule import BranchProtectionRule +from lakefs_client.model.cherry_pick_creation import CherryPickCreation from lakefs_client.model.comm_prefs_input import CommPrefsInput from lakefs_client.model.commit import Commit from lakefs_client.model.commit_creation import CommitCreation diff --git a/clients/python/test/test_branches_api.py b/clients/python/test/test_branches_api.py new file mode 100644 index 00000000000..0a645933bbb --- /dev/null +++ b/clients/python/test/test_branches_api.py @@ -0,0 +1,85 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 0.1.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import unittest + +import lakefs_client +from lakefs_client.api.branches_api import BranchesApi # noqa: E501 + + +class TestBranchesApi(unittest.TestCase): + """BranchesApi unit test stubs""" + + def setUp(self): + self.api = BranchesApi() # noqa: E501 + + def tearDown(self): + pass + + def test_cherry_pick(self): + """Test case for cherry_pick + + Cherry-Pick the given reference commit into the given branch # noqa: E501 + """ + pass + + def test_create_branch(self): + """Test case for create_branch + + create branch # noqa: E501 + """ + pass + + def test_delete_branch(self): + """Test case for delete_branch + + delete branch # noqa: E501 + """ + pass + + def test_diff_branch(self): + """Test case for diff_branch + + diff branch # noqa: E501 + """ + pass + + def test_get_branch(self): + """Test case for get_branch + + get branch # noqa: E501 + """ + pass + + def test_list_branches(self): + """Test case for list_branches + + list branches # noqa: E501 + """ + pass + + def test_reset_branch(self): + """Test case for reset_branch + + reset branch # noqa: E501 + """ + pass + + def test_revert_branch(self): + """Test case for revert_branch + + revert # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_cherry_pick_creation.py b/clients/python/test/test_cherry_pick_creation.py new file mode 100644 index 00000000000..a725c5e37ff --- /dev/null +++ b/clients/python/test/test_cherry_pick_creation.py @@ -0,0 +1,36 @@ +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 0.1.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import lakefs_client +from lakefs_client.model.cherry_pick_creation import CherryPickCreation + + +class TestCherryPickCreation(unittest.TestCase): + """CherryPickCreation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCherryPickCreation(self): + """Test CherryPickCreation""" + # FIXME: construct object with mandatory attributes with example values + # model = CherryPickCreation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/docs/assets/js/swagger.yml b/docs/assets/js/swagger.yml index f7ed261e51a..9b9a8c7ff86 100644 --- a/docs/assets/js/swagger.yml +++ b/docs/assets/js/swagger.yml @@ -474,6 +474,18 @@ components: type: integer description: when reverting a merge commit, the parent number (starting from 1) relative to which to perform the revert. + CherryPickCreation: + type: object + required: + - ref + properties: + ref: + type: string + description: the commit to cherry-pick, given by a ref + parent_number: + type: integer + description: when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. + Commit: type: object required: @@ -2734,6 +2746,47 @@ paths: default: $ref: "#/components/responses/ServerError" + /repositories/{repository}/branches/{branch}/cherry-pick: + parameters: + - in: path + name: repository + required: true + schema: + type: string + - in: path + name: branch + required: true + schema: + type: string + post: + tags: + - branches + operationId: cherryPick + summary: Cherry-Pick the given reference commit into the given branch + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CherryPickCreation" + responses: + 204: + description: successful cherry-pick + 400: + $ref: "#/components/responses/ValidationError" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + 409: + description: Conflict Found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + default: + $ref: "#/components/responses/ServerError" + /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}: parameters: - in: path diff --git a/pkg/api/controller.go b/pkg/api/controller.go index 42ffd4a6a19..af33a0ded3c 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -1850,6 +1850,8 @@ func (c *Controller) handleAPIErrorCallback(ctx context.Context, w http.Response errors.Is(err, graveler.ErrInvalidRef), errors.Is(err, actions.ErrParamConflict), errors.Is(err, graveler.ErrDereferenceCommitWithStaging), + errors.Is(err, graveler.ErrParentOutOfRange), + errors.Is(err, graveler.ErrCherryPickMergeNoParent), errors.Is(err, graveler.ErrInvalidMergeStrategy): log.Debug("Bad request") cb(w, r, http.StatusBadRequest, err) @@ -2442,6 +2444,45 @@ func (c *Controller) RevertBranch(w http.ResponseWriter, r *http.Request, body R writeResponse(w, r, http.StatusNoContent, nil) } +func (c *Controller) CherryPick(w http.ResponseWriter, r *http.Request, body CherryPickJSONRequestBody, repository string, branch string) { + if !c.authorize(w, r, permissions.Node{ + Type: permissions.NodeTypeAnd, + Nodes: []permissions.Node{ + { + Permission: permissions.Permission{ + Action: permissions.CreateCommitAction, + Resource: permissions.BranchArn(repository, branch), + }, + }, + { + Permission: permissions.Permission{ + Action: permissions.ReadCommitAction, + Resource: permissions.RepoArn(repository), + }, + }, + }, + }) { + return + } + ctx := r.Context() + c.LogAction(ctx, "cherry_pick", r, repository, branch, body.Ref) + user, err := auth.GetUser(ctx) + if err != nil { + writeError(w, r, http.StatusUnauthorized, "user not found") + return + } + committer := user.Username + err = c.Catalog.CherryPick(ctx, repository, branch, catalog.CherryPickParams{ + Reference: body.Ref, + Committer: committer, + ParentNumber: body.ParentNumber, + }) + if c.handleAPIError(ctx, w, r, err) { + return + } + writeResponse(w, r, http.StatusNoContent, nil) +} + func (c *Controller) GetCommit(w http.ResponseWriter, r *http.Request, repository, commitID string) { if !c.authorize(w, r, permissions.Node{ Permission: permissions.Permission{ diff --git a/pkg/catalog/catalog.go b/pkg/catalog/catalog.go index 119c14f026a..dfbdae583df 100644 --- a/pkg/catalog/catalog.go +++ b/pkg/catalog/catalog.go @@ -1399,6 +1399,32 @@ func (c *Catalog) Revert(ctx context.Context, repositoryID string, branch string return err } +func (c *Catalog) CherryPick(ctx context.Context, repositoryID string, branch string, params CherryPickParams) error { + branchID := graveler.BranchID(branch) + reference := graveler.Ref(params.Reference) + commitParams := graveler.CommitParams{ + Committer: params.Committer, + Message: fmt.Sprintf("Cherry pick %s", params.Reference), + } + parentNumber := params.ParentNumber + if err := validator.Validate([]validator.ValidateArg{ + {Name: "repository", Value: repositoryID, Fn: graveler.ValidateRepositoryID}, + {Name: "branch", Value: branchID, Fn: graveler.ValidateBranchID}, + {Name: "ref", Value: reference, Fn: graveler.ValidateRef}, + {Name: "committer", Value: commitParams.Committer, Fn: validator.ValidateRequiredString}, + {Name: "parentNumber", Value: parentNumber, Fn: validator.ValidateNonNegativeInt}, + }); err != nil { + return err + } + repository, err := c.getRepository(ctx, repositoryID) + if err != nil { + return err + } + + _, err = c.Store.CherryPick(ctx, repository, branchID, reference, parentNumber, commitParams) + return err +} + func (c *Catalog) Diff(ctx context.Context, repositoryID string, leftReference string, rightReference string, params DiffParams) (Differences, bool, error) { left := graveler.Ref(leftReference) right := graveler.Ref(rightReference) diff --git a/pkg/catalog/interface.go b/pkg/catalog/interface.go index 06e31f72120..887174db4e7 100644 --- a/pkg/catalog/interface.go +++ b/pkg/catalog/interface.go @@ -25,6 +25,12 @@ type RevertParams struct { Committer string } +type CherryPickParams struct { + Reference string // the commit to pick + ParentNumber *int // if a merge commit was pocked, the change will be picked relative to this parent number (1-based). + Committer string +} + type PathRecord struct { Path Path IsPrefix bool @@ -110,6 +116,9 @@ type Interface interface { // Revert creates a reverse patch to the given commit, and applies it as a new commit on the given branch. Revert(ctx context.Context, repository, branch string, params RevertParams) error + // CherryPick creates a patch to the given commit, and applies it as a new commit on the given branch. + CherryPick(ctx context.Context, repository, branch string, params CherryPickParams) error + Diff(ctx context.Context, repository, leftReference string, rightReference string, params DiffParams) (Differences, bool, error) Compare(ctx context.Context, repository, leftReference string, rightReference string, params DiffParams) (Differences, bool, error) DiffUncommitted(ctx context.Context, repository, branch, prefix, delimiter string, limit int, after string) (Differences, bool, error) diff --git a/pkg/graveler/errors.go b/pkg/graveler/errors.go index 40ce30f9eed..f1d38cb9017 100644 --- a/pkg/graveler/errors.go +++ b/pkg/graveler/errors.go @@ -51,9 +51,10 @@ var ( ErrMetaRangeNotFound = errors.New("metarange not found") ErrLockNotAcquired = errors.New("lock not acquired") ErrRevertMergeNoParent = wrapError(ErrUserVisible, "must specify 1-based parent number for reverting merge commit") + ErrCherryPickMergeNoParent = wrapError(ErrUserVisible, "must specify 1-based parent number for cherry-picking merge commit") ErrAddCommitNoParent = errors.New("added commit must have a parent") ErrMultipleParents = errors.New("cannot have more than a single parent") - ErrRevertParentOutOfRange = errors.New("given commit does not have the given parent number") + ErrParentOutOfRange = errors.New("given commit does not have the given parent number") ErrDereferenceCommitWithStaging = wrapError(ErrUserVisible, "reference to staging area with $ is not a commit") ErrDeleteDefaultBranch = wrapError(ErrUserVisible, "cannot delete repository default branch") ErrCommitMetaRangeDirtyBranch = wrapError(ErrUserVisible, "cannot use source MetaRange on a branch with uncommitted changes") diff --git a/pkg/graveler/graveler.go b/pkg/graveler/graveler.go index 7c113c17783..0ef6845eddd 100644 --- a/pkg/graveler/graveler.go +++ b/pkg/graveler/graveler.go @@ -524,6 +524,9 @@ type VersionController interface { // Revert creates a reverse patch to the commit given as 'ref', and applies it as a new commit on the given branch. Revert(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref, parentNumber int, commitParams CommitParams) (CommitID, error) + // CherryPick creates a patch to the commit given as 'ref', and applies it as a new commit on the given branch. + CherryPick(ctx context.Context, repository *RepositoryRecord, id BranchID, reference Ref, number *int, commitParams CommitParams) (CommitID, error) + // Merge merges 'source' into 'destination' and returns the commit id for the created merge commit. Merge(ctx context.Context, repository *RepositoryRecord, destination BranchID, source Ref, commitParams CommitParams, strategy string) (CommitID, error) @@ -2188,7 +2191,7 @@ func (g *Graveler) Revert(ctx context.Context, repository *RepositoryRecord, bra if parentNumber > 0 { // validate parent is in range: if parentNumber > len(commitRecord.Parents) { // parent number is 1-based - return "", fmt.Errorf("%w: parent %d", ErrRevertParentOutOfRange, parentNumber) + return "", fmt.Errorf("%w: parent %d", ErrParentOutOfRange, parentNumber) } parentNumber-- } @@ -2251,6 +2254,88 @@ func (g *Graveler) Revert(ctx context.Context, repository *RepositoryRecord, bra return commitID, nil } +// CherryPick creates a new commit on the given branch, with the changes from the given commit. +// If the commit is a merge commit, 'parentNumber' is the parent number (1-based) relative to which the cherry-pick is done. +func (g *Graveler) CherryPick(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref, parentNumber *int, commitParams CommitParams) (CommitID, error) { + commitRecord, err := g.dereferenceCommit(ctx, repository, ref) + if err != nil { + return "", fmt.Errorf("get commit from ref %s: %w", ref, err) + } + + pn := 1 + if parentNumber == nil { + if len(commitRecord.Parents) > 1 { + return "", ErrCherryPickMergeNoParent + } + } else { + pn = *parentNumber + } + if pn > len(commitRecord.Parents) { + // validate parent is in range: + return "", fmt.Errorf("parent %d: %w", pn, ErrParentOutOfRange) + } + pn-- + + if err := g.prepareForCommitIDUpdate(ctx, repository, branchID); err != nil { + return "", err + } + + var parentMetaRangeID MetaRangeID + if len(commitRecord.Parents) > 0 { + parentCommit, err := g.dereferenceCommit(ctx, repository, commitRecord.Parents[pn].Ref()) + if err != nil { + return "", fmt.Errorf("get commit from ref %s: %w", commitRecord.Parents[pn], err) + } + parentMetaRangeID = parentCommit.MetaRangeID + } + + var commitID CommitID + var tokensToDrop []StagingToken + err = g.RefManager.BranchUpdate(ctx, repository, branchID, func(branch *Branch) (*Branch, error) { + if empty, err := g.isSealedEmpty(ctx, repository, branch); err != nil { + return nil, err + } else if !empty { + return nil, fmt.Errorf("%s: %w", branchID, ErrDirtyBranch) + } + + branchCommit, err := g.dereferenceCommit(ctx, repository, branch.CommitID.Ref()) + if err != nil { + return nil, fmt.Errorf("get commit from ref %s: %w", branch.CommitID, err) + } + // merge from the parent to the top of the branch, with the given ref as the merge base: + metaRangeID, err := g.CommittedManager.Merge(ctx, repository.StorageNamespace, branchCommit.MetaRangeID, + commitRecord.MetaRangeID, parentMetaRangeID, MergeStrategyNone) + if err != nil { + if !errors.Is(err, ErrUserVisible) { + err = fmt.Errorf("merge: %w", err) + } + return nil, err + } + commit := NewCommit() + commit.Committer = commitParams.Committer + commit.Message = commitRecord.Message + commit.MetaRangeID = metaRangeID + commit.Parents = []CommitID{branch.CommitID} + commit.Metadata = commitParams.Metadata + commit.Generation = branchCommit.Generation + 1 + commitID, err = g.RefManager.AddCommit(ctx, repository, commit) + if err != nil { + return nil, fmt.Errorf("add commit: %w", err) + } + + tokensToDrop = branch.SealedTokens + branch.SealedTokens = []StagingToken{} + branch.CommitID = commitID + return branch, nil + }) + if err != nil { + return "", fmt.Errorf("update branch: %w", err) + } + + g.dropTokens(ctx, tokensToDrop...) + return commitID, nil +} + func (g *Graveler) Merge(ctx context.Context, repository *RepositoryRecord, destination BranchID, source Ref, commitParams CommitParams, strategy string) (CommitID, error) { var ( preRunID string diff --git a/pkg/validator/validate.go b/pkg/validator/validate.go index 64c8cead953..733f6f8ba88 100644 --- a/pkg/validator/validate.go +++ b/pkg/validator/validate.go @@ -84,3 +84,17 @@ func ValidateNonNegativeInt(v interface{}) error { } return nil } + +func ValidateNilOrNonNegativeInt(v interface{}) error { + i, ok := v.(*int) + if !ok { + panic(ErrInvalidType) + } + if i == nil { + return nil + } + if *i < 0 { + return ErrInvalidValue + } + return nil +} From 6a4987bfb685f6bc74c7b8de6cb02191031b4353 Mon Sep 17 00:00:00 2001 From: Itai Admi Date: Tue, 14 Mar 2023 21:17:42 +0200 Subject: [PATCH 2/8] Add lakectl support --- cmd/lakectl/cmd/cherry_pick.go | 63 ++++++++++++++++++++++++++++++++++ pkg/uri/parser.go | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 cmd/lakectl/cmd/cherry_pick.go diff --git a/cmd/lakectl/cmd/cherry_pick.go b/cmd/lakectl/cmd/cherry_pick.go new file mode 100644 index 00000000000..75f9ca7939a --- /dev/null +++ b/cmd/lakectl/cmd/cherry_pick.go @@ -0,0 +1,63 @@ +package cmd + +import ( + "github.com/spf13/cobra" + "github.com/treeverse/lakefs/pkg/api" + "github.com/treeverse/lakefs/pkg/uri" + "net/http" +) + +const ( + cherryPickCmdArgs = 2 +) + +// lakectl cherry-pick lakefs://myrepo/main lakefs://myrepo/some-ref +var cherryPick = &cobra.Command{ + Use: "cherry-pick ", + Short: "cherry-pick a ref into a branch", + Long: "The commit will be applied to the branch as a new commit", + Example: `lakectl cherry-pick lakefs://myrepo/main lakefs://myrepo/some-ref + Cherry picks the commit represented by some-ref into the main branch + by applying all the changes between the commit and its parent on the destination branch. + `, + Args: cobra.ExactArgs(cherryPickCmdArgs), + ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + return validRepositoryToComplete(cmd.Context(), toComplete) + }, + Run: func(cmd *cobra.Command, args []string) { + branch := MustParseBranchURI("branch", args[0]) + Fmt("Branch: %s\n", branch.String()) + + ref := MustParseRefURI("ref", args[1]) + + if branch.Repository != ref.Repository { + Die("Repository mismatch for destination branch and cherry-pick ref", 1) + } + hasParentNumber := cmd.Flags().Changed(ParentNumberFlagName) + parentNumber, _ := cmd.Flags().GetInt(ParentNumberFlagName) + if hasParentNumber && parentNumber <= 0 { + Die("parent number must be non-negative, if specified", 1) + } + + clt := getClient() + resp, err := clt.CherryPickWithResponse(cmd.Context(), branch.Repository, branch.Ref, api.CherryPickJSONRequestBody{ + Ref: ref.Ref, + ParentNumber: &parentNumber, // TODO: handle default value 0 + }) + DieOnErrorOrUnexpectedStatusCode(resp, err, http.StatusNoContent) + + resp2, err := clt.GetCommitWithResponse(cmd.Context(), branch.Repository, branch.Ref) + DieOnErrorOrUnexpectedStatusCode(resp2, err, http.StatusOK) + Write(commitCreateTemplate, struct { + Branch *uri.URI + Commit *api.Commit + }{Branch: branch, Commit: resp2.JSON200}) + }, +} + +//nolint:gochecknoinits +func init() { + rootCmd.AddCommand(cherryPick) + + cherryPick.Flags().IntP(ParentNumberFlagName, "m", 0, "the parent number (starting from 1) of the mainline. The cherry-pick will apply the change relative to the specified parent.") +} diff --git a/pkg/uri/parser.go b/pkg/uri/parser.go index 85cc6785b36..76fc7e7a4d6 100644 --- a/pkg/uri/parser.go +++ b/pkg/uri/parser.go @@ -29,7 +29,7 @@ type URI struct { // Ref represents the reference in the repository (commit, tag, branch, etc.) Ref string // Path is a path to an object (or prefix of such) in lakeFS. It *could* be null since there's a difference between - // an empty path ("lakefs://repo@branch/", and no path at all e.g. "lakefs://repo@branch"). + // an empty path ("lakefs://repo/branch/", and no path at all e.g. "lakefs://repo/branch"). // Since path is the only URI part that is allowed to be empty, it is represented as a pointer. Path *string } From c97c20742c96fe7f2ba5b263054e983f6c0e75bd Mon Sep 17 00:00:00 2001 From: Itai Admi Date: Wed, 15 Mar 2023 17:48:54 +0200 Subject: [PATCH 3/8] Add tests to controller and catalog --- cmd/lakectl/cmd/cherry_pick.go | 3 +- docs/reference/cli.md | 33 +++++++ esti/golden/lakectl_help.golden | 1 + pkg/api/controller.go | 2 + pkg/api/controller_test.go | 160 +++++++++++++++++++++++++++++++ pkg/catalog/catalog.go | 10 +- pkg/graveler/graveler.go | 15 ++- pkg/graveler/graveler_v2_test.go | 67 +++++++++++++ pkg/validator/validate.go | 6 +- 9 files changed, 282 insertions(+), 15 deletions(-) diff --git a/cmd/lakectl/cmd/cherry_pick.go b/cmd/lakectl/cmd/cherry_pick.go index 75f9ca7939a..168f69cfc23 100644 --- a/cmd/lakectl/cmd/cherry_pick.go +++ b/cmd/lakectl/cmd/cherry_pick.go @@ -1,10 +1,11 @@ package cmd import ( + "net/http" + "github.com/spf13/cobra" "github.com/treeverse/lakefs/pkg/api" "github.com/treeverse/lakefs/pkg/uri" - "net/http" ) const ( diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 05e1956a8fd..74ae0770a52 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -1589,6 +1589,39 @@ lakectl cat-sst [flags] +### lakectl cherry-pick + +cherry-pick a ref into a branch + +#### Synopsis +{:.no_toc} + +The commit will be applied to the branch as a new commit + +``` +lakectl cherry-pick [flags] +``` + +#### Examples +{:.no_toc} + +``` +lakectl cherry-pick lakefs://myrepo/main lakefs://myrepo/some-ref + Cherry picks the commit represented by some-ref into the main branch + by applying all the changes between the commit and its parent on the destination branch. + +``` + +#### Options +{:.no_toc} + +``` + -h, --help help for cherry-pick + -m, --parent-number int the parent number (starting from 1) of the mainline. The cherry-pick will apply the change relative to the specified parent. +``` + + + ### lakectl commit Commit changes on a given branch diff --git a/esti/golden/lakectl_help.golden b/esti/golden/lakectl_help.golden index 65b9699ff8b..c3f11ee40b4 100644 --- a/esti/golden/lakectl_help.golden +++ b/esti/golden/lakectl_help.golden @@ -9,6 +9,7 @@ Available Commands: auth Manage authentication and authorization branch Create and manage branches within a repository branch-protect Create and manage branch protection rules + cherry-pick Cherry-Pick a ref into a branch commit Commit changes on a given branch completion Generate completion script config Create/update local lakeFS configuration diff --git a/pkg/api/controller.go b/pkg/api/controller.go index af33a0ded3c..ef42d405092 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -43,6 +43,7 @@ import ( "github.com/treeverse/lakefs/pkg/stats" "github.com/treeverse/lakefs/pkg/templater" "github.com/treeverse/lakefs/pkg/upload" + "github.com/treeverse/lakefs/pkg/validator" "github.com/treeverse/lakefs/pkg/version" ) @@ -1842,6 +1843,7 @@ func (c *Controller) handleAPIErrorCallback(ctx context.Context, w http.Response case errors.Is(err, graveler.ErrDirtyBranch), errors.Is(err, graveler.ErrCommitMetaRangeDirtyBranch), errors.Is(err, graveler.ErrInvalidValue), + errors.Is(err, validator.ErrInvalidValue), errors.Is(err, catalog.ErrPathRequiredValue), errors.Is(err, graveler.ErrNoChanges), errors.Is(err, permissions.ErrInvalidServiceName), diff --git a/pkg/api/controller_test.go b/pkg/api/controller_test.go index 1965afc00ff..d6bfcf04056 100644 --- a/pkg/api/controller_test.go +++ b/pkg/api/controller_test.go @@ -3378,6 +3378,166 @@ func TestController_RevertConflict(t *testing.T) { } } +func TestController_CherryPick(t *testing.T) { + clt, deps := setupClientWithAdmin(t) + ctx := context.Background() + // setup env + repo := testUniqueRepoName() + _, err := deps.catalog.CreateRepository(ctx, repo, onBlock(deps, repo), "main") + testutil.Must(t, err) + testutil.MustDo(t, "create entry bar1", deps.catalog.CreateEntry(ctx, repo, "main", catalog.DBEntry{Path: "foo/bar1", PhysicalAddress: "bar1addr", CreationDate: time.Now(), Size: 1, Checksum: "cksum1"})) + _, err = deps.catalog.Commit(ctx, repo, "main", "message1", DefaultUserID, nil, nil, nil) + testutil.Must(t, err) + + _, err = deps.catalog.CreateBranch(ctx, repo, "branch1", "main") + testutil.Must(t, err) + _, err = deps.catalog.CreateBranch(ctx, repo, "branch2", "main") + testutil.Must(t, err) + _, err = deps.catalog.CreateBranch(ctx, repo, "branch3", "main") + testutil.Must(t, err) + _, err = deps.catalog.CreateBranch(ctx, repo, "dest-branch1", "main") + testutil.Must(t, err) + _, err = deps.catalog.CreateBranch(ctx, repo, "dest-branch2", "main") + testutil.Must(t, err) + _, err = deps.catalog.CreateBranch(ctx, repo, "dest-branch3", "main") + testutil.Must(t, err) + _, err = deps.catalog.CreateBranch(ctx, repo, "dest-branch4", "main") + testutil.Must(t, err) + + testutil.MustDo(t, "create entry bar2", deps.catalog.CreateEntry(ctx, repo, "branch1", catalog.DBEntry{Path: "foo/bar2", PhysicalAddress: "bar2addr", CreationDate: time.Now(), Size: 2, Checksum: "cksum2"})) + commit2, err := deps.catalog.Commit(ctx, repo, "branch1", "message2", DefaultUserID, nil, nil, nil) + testutil.Must(t, err) + + testutil.MustDo(t, "create entry bar3", deps.catalog.CreateEntry(ctx, repo, "branch1", catalog.DBEntry{Path: "foo/bar3", PhysicalAddress: "bar3addr", CreationDate: time.Now(), Size: 3, Checksum: "cksum3"})) + testutil.MustDo(t, "create entry bar4", deps.catalog.CreateEntry(ctx, repo, "branch1", catalog.DBEntry{Path: "foo/bar4", PhysicalAddress: "bar4addr", CreationDate: time.Now(), Size: 4, Checksum: "cksum4"})) + _, err = deps.catalog.Commit(ctx, repo, "branch1", "message34", DefaultUserID, nil, nil, nil) + testutil.Must(t, err) + + testutil.MustDo(t, "create entry bar6", deps.catalog.CreateEntry(ctx, repo, "branch2", catalog.DBEntry{Path: "foo/bar6", PhysicalAddress: "bar6addr", CreationDate: time.Now(), Size: 6, Checksum: "cksum6"})) + testutil.MustDo(t, "create entry bar7", deps.catalog.CreateEntry(ctx, repo, "branch2", catalog.DBEntry{Path: "foo/bar7", PhysicalAddress: "bar7addr", CreationDate: time.Now(), Size: 7, Checksum: "cksum7"})) + _, err = deps.catalog.Commit(ctx, repo, "branch2", "message34", DefaultUserID, nil, nil, nil) + testutil.Must(t, err) + + testutil.MustDo(t, "create entry bar8", deps.catalog.CreateEntry(ctx, repo, "branch3", catalog.DBEntry{Path: "foo/bar8", PhysicalAddress: "bar8addr", CreationDate: time.Now(), Size: 8, Checksum: "cksum8"})) + _, err = deps.catalog.Commit(ctx, repo, "branch3", "message8", DefaultUserID, nil, nil, nil) + testutil.Must(t, err) + + _, err = deps.catalog.Merge(ctx, repo, "branch3", "branch1", DefaultUserID, + "merge message", catalog.Metadata{"foo": "bar"}, "") + testutil.Must(t, err) + + t.Run("from branch", func(t *testing.T) { + cherryResponse, err := clt.CherryPickWithResponse(ctx, repo, "dest-branch1", api.CherryPickJSONRequestBody{Ref: "branch1"}) + verifyResponseOK(t, cherryResponse, err) + + // verify that the cherry-pick worked as expected + resp, err := clt.GetObjectWithResponse(ctx, repo, "dest-branch1", &api.GetObjectParams{Path: "foo/bar2"}) + testutil.Must(t, err) + if resp.JSON404 == nil { + t.Error("expected to not find object foo/bar2 in dest-branch1 branch") + } + resp, err = clt.GetObjectWithResponse(ctx, repo, "dest-branch1", &api.GetObjectParams{Path: "foo/bar3"}) + verifyResponseOK(t, cherryResponse, err) + + resp, err = clt.GetObjectWithResponse(ctx, repo, "dest-branch1", &api.GetObjectParams{Path: "foo/bar4"}) + verifyResponseOK(t, cherryResponse, err) + }) + + t.Run("from commit", func(t *testing.T) { + cherryResponse, err := clt.CherryPickWithResponse(ctx, repo, "dest-branch2", api.CherryPickJSONRequestBody{Ref: commit2.Reference, ParentNumber: swag.Int(1)}) + verifyResponseOK(t, cherryResponse, err) + + // verify that the cherry-pick worked as expected + resp, err := clt.GetObjectWithResponse(ctx, repo, "dest-branch2", &api.GetObjectParams{Path: "foo/bar2"}) + verifyResponseOK(t, cherryResponse, err) + + resp, err = clt.GetObjectWithResponse(ctx, repo, "dest-branch2", &api.GetObjectParams{Path: "foo/bar3"}) + testutil.Must(t, err) + if resp.JSON404 == nil { + t.Error("expected to not find object foo/bar3 in dest-branch2 branch") + } + }) + + t.Run("invalid parent id (too big)", func(t *testing.T) { + resp, err := clt.CherryPickWithResponse(ctx, repo, "dest-branch1", api.CherryPickJSONRequestBody{Ref: commit2.Reference, ParentNumber: swag.Int(2)}) + testutil.Must(t, err) + if resp.JSON400 == nil { + t.Error("expected to get bad request") + } + }) + + t.Run("invalid parent id (too small)", func(t *testing.T) { + resp, err := clt.CherryPickWithResponse(ctx, repo, "dest-branch1", api.CherryPickJSONRequestBody{Ref: commit2.Reference, ParentNumber: swag.Int(0)}) + testutil.Must(t, err) + if resp.JSON400 == nil { + t.Error("expected to get bad request") + } + }) + + t.Run("dirty branch", func(t *testing.T) { + // create branch with entry without commit + _, err := deps.catalog.CreateBranch(ctx, repo, "dirty", "main") + testutil.Must(t, err) + err = deps.catalog.CreateEntry(ctx, repo, "dirty", catalog.DBEntry{Path: "foo/bar5", PhysicalAddress: "bar50addr", CreationDate: time.Now(), Size: 5, Checksum: "cksum5"}) + testutil.Must(t, err) + + cherryPickResp, err := clt.CherryPickWithResponse(ctx, repo, "dirty", api.CherryPickJSONRequestBody{Ref: "branch1"}) + testutil.Must(t, err) + if cherryPickResp.JSON400 == nil || cherryPickResp.JSON400.Message != graveler.ErrDirtyBranch.Error() { + t.Errorf("Cherry-Pick dirty branch should fail with ErrDirtyBranch, got %+v", cherryPickResp) + } + }) + + t.Run("from branch - merge commit - first parent", func(t *testing.T) { + cherryResponse, err := clt.CherryPickWithResponse(ctx, repo, "dest-branch4", api.CherryPickJSONRequestBody{Ref: "branch3", ParentNumber: swag.Int(1)}) + verifyResponseOK(t, cherryResponse, err) + // verify that the cherry-pick worked as expected + + resp, err := clt.GetObjectWithResponse(ctx, repo, "dest-branch4", &api.GetObjectParams{Path: "foo/bar2"}) + verifyResponseOK(t, cherryResponse, err) + + resp, err = clt.GetObjectWithResponse(ctx, repo, "dest-branch4", &api.GetObjectParams{Path: "foo/bar3"}) + verifyResponseOK(t, cherryResponse, err) + + resp, err = clt.GetObjectWithResponse(ctx, repo, "dest-branch4", &api.GetObjectParams{Path: "foo/bar4"}) + verifyResponseOK(t, cherryResponse, err) + + resp, err = clt.GetObjectWithResponse(ctx, repo, "dest-branch4", &api.GetObjectParams{Path: "foo/bar8"}) + testutil.Must(t, err) + if resp.JSON404 == nil { + t.Error("expected to not find object foo/bar8 in dest-branch4 branch") + } + }) + + t.Run("from branch - merge commit - second parent", func(t *testing.T) { + cherryResponse, err := clt.CherryPickWithResponse(ctx, repo, "dest-branch3", api.CherryPickJSONRequestBody{Ref: "branch3", ParentNumber: swag.Int(2)}) + verifyResponseOK(t, cherryResponse, err) + + // verify that the cherry-pick worked as expected + resp, err := clt.GetObjectWithResponse(ctx, repo, "dest-branch3", &api.GetObjectParams{Path: "foo/bar2"}) + testutil.Must(t, err) + if resp.JSON404 == nil { + t.Error("expected to not find object foo/bar2 in dest-branch3 branch") + } + resp, err = clt.GetObjectWithResponse(ctx, repo, "dest-branch3", &api.GetObjectParams{Path: "foo/bar4"}) + testutil.Must(t, err) + if resp.JSON404 == nil { + t.Error("expected to not find object foo/bar6 in dest-branch3 branch") + } + + resp, err = clt.GetObjectWithResponse(ctx, repo, "dest-branch3", &api.GetObjectParams{Path: "foo/bar8"}) + verifyResponseOK(t, cherryResponse, err) + }) + + t.Run("invalid parent id (too big)- merge commit", func(t *testing.T) { + cherryResponse, err := clt.CherryPickWithResponse(ctx, repo, "dest-branch3", api.CherryPickJSONRequestBody{Ref: "branch3", ParentNumber: swag.Int(3)}) + testutil.Must(t, err) + if cherryResponse.JSON400 == nil { + t.Error("expected to get bad request") + } + }) +} + func TestController_ExpandTemplate(t *testing.T) { clt, _ := setupClientWithAdmin(t) ctx := context.Background() diff --git a/pkg/catalog/catalog.go b/pkg/catalog/catalog.go index dfbdae583df..63f63ac0ce7 100644 --- a/pkg/catalog/catalog.go +++ b/pkg/catalog/catalog.go @@ -1402,17 +1402,13 @@ func (c *Catalog) Revert(ctx context.Context, repositoryID string, branch string func (c *Catalog) CherryPick(ctx context.Context, repositoryID string, branch string, params CherryPickParams) error { branchID := graveler.BranchID(branch) reference := graveler.Ref(params.Reference) - commitParams := graveler.CommitParams{ - Committer: params.Committer, - Message: fmt.Sprintf("Cherry pick %s", params.Reference), - } parentNumber := params.ParentNumber if err := validator.Validate([]validator.ValidateArg{ {Name: "repository", Value: repositoryID, Fn: graveler.ValidateRepositoryID}, {Name: "branch", Value: branchID, Fn: graveler.ValidateBranchID}, {Name: "ref", Value: reference, Fn: graveler.ValidateRef}, - {Name: "committer", Value: commitParams.Committer, Fn: validator.ValidateRequiredString}, - {Name: "parentNumber", Value: parentNumber, Fn: validator.ValidateNonNegativeInt}, + {Name: "committer", Value: params.Committer, Fn: validator.ValidateRequiredString}, + {Name: "parentNumber", Value: parentNumber, Fn: validator.ValidateNilOrPositiveInt}, }); err != nil { return err } @@ -1421,7 +1417,7 @@ func (c *Catalog) CherryPick(ctx context.Context, repositoryID string, branch st return err } - _, err = c.Store.CherryPick(ctx, repository, branchID, reference, parentNumber, commitParams) + _, err = c.Store.CherryPick(ctx, repository, branchID, reference, parentNumber, params.Committer) return err } diff --git a/pkg/graveler/graveler.go b/pkg/graveler/graveler.go index 0ef6845eddd..1e6bf0506ff 100644 --- a/pkg/graveler/graveler.go +++ b/pkg/graveler/graveler.go @@ -525,7 +525,7 @@ type VersionController interface { Revert(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref, parentNumber int, commitParams CommitParams) (CommitID, error) // CherryPick creates a patch to the commit given as 'ref', and applies it as a new commit on the given branch. - CherryPick(ctx context.Context, repository *RepositoryRecord, id BranchID, reference Ref, number *int, commitParams CommitParams) (CommitID, error) + CherryPick(ctx context.Context, repository *RepositoryRecord, id BranchID, reference Ref, number *int, committer string) (CommitID, error) // Merge merges 'source' into 'destination' and returns the commit id for the created merge commit. Merge(ctx context.Context, repository *RepositoryRecord, destination BranchID, source Ref, commitParams CommitParams, strategy string) (CommitID, error) @@ -2256,7 +2256,7 @@ func (g *Graveler) Revert(ctx context.Context, repository *RepositoryRecord, bra // CherryPick creates a new commit on the given branch, with the changes from the given commit. // If the commit is a merge commit, 'parentNumber' is the parent number (1-based) relative to which the cherry-pick is done. -func (g *Graveler) CherryPick(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref, parentNumber *int, commitParams CommitParams) (CommitID, error) { +func (g *Graveler) CherryPick(ctx context.Context, repository *RepositoryRecord, branchID BranchID, ref Ref, parentNumber *int, committer string) (CommitID, error) { commitRecord, err := g.dereferenceCommit(ctx, repository, ref) if err != nil { return "", fmt.Errorf("get commit from ref %s: %w", ref, err) @@ -2312,12 +2312,19 @@ func (g *Graveler) CherryPick(ctx context.Context, repository *RepositoryRecord, return nil, err } commit := NewCommit() - commit.Committer = commitParams.Committer + commit.Committer = committer commit.Message = commitRecord.Message commit.MetaRangeID = metaRangeID commit.Parents = []CommitID{branch.CommitID} - commit.Metadata = commitParams.Metadata commit.Generation = branchCommit.Generation + 1 + + commit.Metadata = commitRecord.Metadata + if commit.Metadata == nil { + commit.Metadata = make(map[string]string) + } + commit.Metadata["cherry-pick-origin"] = string(commitRecord.CommitID) + commit.Metadata["cherry-pick-committer"] = commitRecord.Committer + commitID, err = g.RefManager.AddCommit(ctx, repository, commit) if err != nil { return nil, fmt.Errorf("add commit: %w", err) diff --git a/pkg/graveler/graveler_v2_test.go b/pkg/graveler/graveler_v2_test.go index a04451ff24f..7b8b81a66da 100644 --- a/pkg/graveler/graveler_v2_test.go +++ b/pkg/graveler/graveler_v2_test.go @@ -415,6 +415,73 @@ func TestGravelerRevert(t *testing.T) { }) } +func TestGravelerCherryPick(t *testing.T) { + ctx := context.Background() + + firstUpdateBranch := func(test *testutil.GravelerTest) { + test.RefManager.EXPECT().BranchUpdate(ctx, repository, branch1ID, gomock.Any()). + Do(func(_ context.Context, _ *graveler.RepositoryRecord, _ graveler.BranchID, f graveler.BranchUpdateFunc) error { + branchTest := branch1 + updatedBranch, err := f(&branchTest) + require.NoError(t, err) + require.Equal(t, []graveler.StagingToken{stagingToken1, stagingToken2, stagingToken3}, updatedBranch.SealedTokens) + require.NotEmpty(t, updatedBranch.StagingToken) + require.NotEqual(t, stagingToken1, updatedBranch.StagingToken) + return nil + }).Times(1) + } + emptyStagingTokenCombo := func(test *testutil.GravelerTest, times int) { + test.StagingManager.EXPECT().List(ctx, stagingToken1, gomock.Any()).Times(times).Return(testutils.NewFakeValueIterator([]*graveler.ValueRecord{{ + Key: key1, + Value: nil, // tombstone + }}), nil) + test.StagingManager.EXPECT().List(ctx, stagingToken2, gomock.Any()).Times(times).Return(testutils.NewFakeValueIterator(nil), nil) + test.StagingManager.EXPECT().List(ctx, stagingToken3, gomock.Any()).Times(times).Return(testutils.NewFakeValueIterator([]*graveler.ValueRecord{{ + Key: key1, + Value: value1, + }}), nil) + } + t.Run("cherry-pick successful", func(t *testing.T) { + test := testutil.InitGravelerTest(t) + firstUpdateBranch(test) + emptyStagingTokenCombo(test, 2) + test.RefManager.EXPECT().GetCommit(ctx, repository, commit1ID).Times(3).Return(&commit1, nil) + test.CommittedManager.EXPECT().List(ctx, repository.StorageNamespace, mr1ID).Times(2).Return(testutils.NewFakeValueIterator(nil), nil) + test.RefManager.EXPECT().ParseRef(graveler.Ref(commit2ID)).Times(1).Return(rawRefCommit2, nil) + test.RefManager.EXPECT().ParseRef(graveler.Ref(commit1ID)).Times(1).Return(rawRefCommit1, nil) + test.RefManager.EXPECT().ParseRef(graveler.Ref(commit4ID)).Times(1).Return(rawRefCommit4, nil) + test.RefManager.EXPECT().ResolveRawRef(ctx, repository, rawRefCommit2).Times(1).Return(&graveler.ResolvedRef{Type: graveler.ReferenceTypeCommit, BranchRecord: graveler.BranchRecord{Branch: &graveler.Branch{CommitID: commit2ID}}}, nil) + test.RefManager.EXPECT().ResolveRawRef(ctx, repository, rawRefCommit1).Times(1).Return(&graveler.ResolvedRef{Type: graveler.ReferenceTypeCommit, BranchRecord: graveler.BranchRecord{Branch: &graveler.Branch{CommitID: commit1ID}}}, nil) + test.RefManager.EXPECT().ResolveRawRef(ctx, repository, rawRefCommit4).Times(1).Return(&graveler.ResolvedRef{Type: graveler.ReferenceTypeCommit, BranchRecord: graveler.BranchRecord{Branch: &graveler.Branch{CommitID: commit4ID}}}, nil) + test.RefManager.EXPECT().GetCommit(ctx, repository, commit2ID).Times(1).Return(&commit2, nil) + test.RefManager.EXPECT().GetCommit(ctx, repository, commit4ID).Times(1).Return(&commit4, nil) + test.CommittedManager.EXPECT().Merge(ctx, repository.StorageNamespace, mr1ID, mr2ID, mr4ID, graveler.MergeStrategyNone).Times(1).Return(mr3ID, nil) + test.RefManager.EXPECT().AddCommit(ctx, repository, gomock.Any()).DoAndReturn(func(ctx context.Context, repository *graveler.RepositoryRecord, commit graveler.Commit) (graveler.CommitID, error) { + require.Equal(t, mr3ID, commit.MetaRangeID) + return commit3ID, nil + }).Times(1) + test.RefManager.EXPECT().BranchUpdate(ctx, repository, branch1ID, gomock.Any()). + Do(func(_ context.Context, _ *graveler.RepositoryRecord, _ graveler.BranchID, f graveler.BranchUpdateFunc) error { + branchTest := &graveler.Branch{StagingToken: stagingToken4, CommitID: commit1ID, SealedTokens: []graveler.StagingToken{stagingToken1, stagingToken2, stagingToken3}} + updatedBranch, err := f(branchTest) + require.NoError(t, err) + require.Equal(t, []graveler.StagingToken{}, updatedBranch.SealedTokens) + require.NotEmpty(t, updatedBranch.StagingToken) + require.Equal(t, commit3ID, updatedBranch.CommitID) + return nil + }).Times(1) + test.StagingManager.EXPECT().DropAsync(ctx, stagingToken1).Times(1) + test.StagingManager.EXPECT().DropAsync(ctx, stagingToken2).Times(1) + test.StagingManager.EXPECT().DropAsync(ctx, stagingToken3).Times(1) + parent := 1 + val, err := test.Sut.CherryPick(ctx, repository, branch1ID, graveler.Ref(commit2ID), &parent, "tester") + + require.NoError(t, err) + require.NotNil(t, val) + require.Equal(t, commit3ID, graveler.CommitID(val.Ref())) + }) +} + func TestGravelerCommit_v2(t *testing.T) { ctx := context.Background() diff --git a/pkg/validator/validate.go b/pkg/validator/validate.go index 733f6f8ba88..d4652ff78b1 100644 --- a/pkg/validator/validate.go +++ b/pkg/validator/validate.go @@ -85,7 +85,7 @@ func ValidateNonNegativeInt(v interface{}) error { return nil } -func ValidateNilOrNonNegativeInt(v interface{}) error { +func ValidateNilOrPositiveInt(v interface{}) error { i, ok := v.(*int) if !ok { panic(ErrInvalidType) @@ -93,8 +93,8 @@ func ValidateNilOrNonNegativeInt(v interface{}) error { if i == nil { return nil } - if *i < 0 { - return ErrInvalidValue + if *i <= 0 { + return fmt.Errorf("value should be greater than 0: %w", ErrInvalidValue) } return nil } From eb23dfba69071afd9692ddd74945ebe42e18fa5b Mon Sep 17 00:00:00 2001 From: Itai Admi Date: Thu, 16 Mar 2023 10:03:48 +0200 Subject: [PATCH 4/8] Add generated code --- clients/java/api/openapi.yaml | 8 +- clients/java/docs/BranchesApi.md | 48 +- clients/java/docs/CherryPickCreation.md | 8 +- .../io/lakefs/clients/api/BranchesApi.java | 34 +- .../main/java/io/lakefs/clients/api/JSON.java | 1 + .../clients/api/model/CherryPickCreation.java | 123 +- .../lakefs/clients/api/BranchesApiTest.java | 9 +- .../api/model/CherryPickCreationTest.java | 7 +- clients/python/.openapi-generator/FILES | 214 +-- clients/python/README.md | 190 +-- clients/python/docs/BranchesApi.md | 938 ------------- clients/python/docs/CherryPickCreation.md | 13 - clients/python/docs/apis/tags/BranchesApi.md | 214 +++ .../python/docs/models/CherryPickCreation.md | 16 + .../python/lakefs_client/api/branches_api.py | 1165 ----------------- .../python/lakefs_client/apis/path_to_api.py | 3 + ..._repository_branches_branch_cherry_pick.py | 7 + .../lakefs_client/apis/tags/branches_api.py | 2 + .../model/cherry_pick_creation.py | 314 +---- .../model/cherry_pick_creation.pyi | 94 ++ .../python/lakefs_client/paths/__init__.py | 1 + .../__init__.py | 7 + .../post.py | 514 ++++++++ .../post.pyi | 497 +++++++ clients/python/test/test_branches_api.py | 85 -- .../test_cherry_pick_creation.py | 18 +- .../__init__.py | 0 .../test_post.py | 42 + cmd/lakectl/cmd/cherry_pick.go | 2 +- docs/reference/cli.md | 2 +- esti/lakectl_test.go | 49 + 31 files changed, 1702 insertions(+), 2923 deletions(-) delete mode 100644 clients/python/docs/BranchesApi.md delete mode 100644 clients/python/docs/CherryPickCreation.md create mode 100644 clients/python/docs/models/CherryPickCreation.md delete mode 100644 clients/python/lakefs_client/api/branches_api.py create mode 100644 clients/python/lakefs_client/apis/paths/repositories_repository_branches_branch_cherry_pick.py create mode 100644 clients/python/lakefs_client/model/cherry_pick_creation.pyi create mode 100644 clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/__init__.py create mode 100644 clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/post.py create mode 100644 clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/post.pyi delete mode 100644 clients/python/test/test_branches_api.py rename clients/python/test/{ => test_models}/test_cherry_pick_creation.py (59%) create mode 100644 clients/python/test/test_paths/test_repositories_repository_branches_branch_cherry_pick/__init__.py create mode 100644 clients/python/test/test_paths/test_repositories_repository_branches_branch_cherry_pick/test_post.py diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index b1331aa4b91..8e138bed259 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -2743,7 +2743,7 @@ paths: summary: Cherry-Pick the given reference commit into the given branch tags: - branches - x-contentType: application/json + x-content-type: application/json x-accepts: application/json /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}: get: @@ -5706,11 +5706,11 @@ components: parent_number: 0 properties: ref: - description: the commit to cherry-pick, given by a ref + description: "the commit to cherry-pick, given by a ref" type: string parent_number: - description: when cherry-picking a merge commit, the parent number (starting - from 1) relative to which to perform the diff. + description: "when cherry-picking a merge commit, the parent number (starting\ + \ from 1) relative to which to perform the diff." type: integer required: - ref diff --git a/clients/java/docs/BranchesApi.md b/clients/java/docs/BranchesApi.md index c01fca1ec01..b37738592db 100644 --- a/clients/java/docs/BranchesApi.md +++ b/clients/java/docs/BranchesApi.md @@ -2,9 +2,9 @@ All URIs are relative to */api/v1* -<<<<<<< HEAD | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**cherryPick**](BranchesApi.md#cherryPick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Cherry-Pick the given reference commit into the given branch | | [**createBranch**](BranchesApi.md#createBranch) | **POST** /repositories/{repository}/branches | create branch | | [**deleteBranch**](BranchesApi.md#deleteBranch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch | | [**diffBranch**](BranchesApi.md#diffBranch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch | @@ -12,18 +12,6 @@ All URIs are relative to */api/v1* | [**listBranches**](BranchesApi.md#listBranches) | **GET** /repositories/{repository}/branches | list branches | | [**resetBranch**](BranchesApi.md#resetBranch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch | | [**revertBranch**](BranchesApi.md#revertBranch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert | -======= -Method | HTTP request | Description -------------- | ------------- | ------------- -[**cherryPick**](BranchesApi.md#cherryPick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Cherry-Pick the given reference commit into the given branch -[**createBranch**](BranchesApi.md#createBranch) | **POST** /repositories/{repository}/branches | create branch -[**deleteBranch**](BranchesApi.md#deleteBranch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch -[**diffBranch**](BranchesApi.md#diffBranch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch -[**getBranch**](BranchesApi.md#getBranch) | **GET** /repositories/{repository}/branches/{branch} | get branch -[**listBranches**](BranchesApi.md#listBranches) | **GET** /repositories/{repository}/branches | list branches -[**resetBranch**](BranchesApi.md#resetBranch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch -[**revertBranch**](BranchesApi.md#revertBranch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert ->>>>>>> cfd08d6a7 (cherry-pick) @@ -45,7 +33,7 @@ import io.lakefs.clients.api.BranchesApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost/api/v1"); + defaultClient.setBasePath("/api/v1"); // Configure HTTP basic authorization: basic_auth HttpBasicAuth basic_auth = (HttpBasicAuth) defaultClient.getAuthentication("basic_auth"); @@ -58,10 +46,6 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //cookie_auth.setApiKeyPrefix("Token"); - // Configure HTTP bearer authorization: jwt_token - HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); - jwt_token.setBearerToken("BEARER TOKEN"); - // Configure API key authorization: oidc_auth ApiKeyAuth oidc_auth = (ApiKeyAuth) defaultClient.getAuthentication("oidc_auth"); oidc_auth.setApiKey("YOUR API KEY"); @@ -74,6 +58,10 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //saml_auth.setApiKeyPrefix("Token"); + // Configure HTTP bearer authorization: jwt_token + HttpBearerAuth jwt_token = (HttpBearerAuth) defaultClient.getAuthentication("jwt_token"); + jwt_token.setBearerToken("BEARER TOKEN"); + BranchesApi apiInstance = new BranchesApi(defaultClient); String repository = "repository_example"; // String | String branch = "branch_example"; // String | @@ -93,11 +81,11 @@ public class Example { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **String**| | - **branch** | **String**| | - **cherryPickCreation** | [**CherryPickCreation**](CherryPickCreation.md)| | +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **repository** | **String**| | | +| **branch** | **String**| | | +| **cherryPickCreation** | [**CherryPickCreation**](CherryPickCreation.md)| | | ### Return type @@ -105,7 +93,7 @@ null (empty response body) ### Authorization -[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) +[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) ### HTTP request headers @@ -115,12 +103,12 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | successful cherry-pick | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**409** | Conflict Found | - | -**0** | Internal Server Error | - | +| **204** | successful cherry-pick | - | +| **400** | Validation Error | - | +| **401** | Unauthorized | - | +| **404** | Resource Not Found | - | +| **409** | Conflict Found | - | +| **0** | Internal Server Error | - | # **createBranch** diff --git a/clients/java/docs/CherryPickCreation.md b/clients/java/docs/CherryPickCreation.md index fac8129f68e..18bcf81f87e 100644 --- a/clients/java/docs/CherryPickCreation.md +++ b/clients/java/docs/CherryPickCreation.md @@ -5,10 +5,10 @@ ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ref** | **String** | the commit to cherry-pick, given by a ref | -**parentNumber** | **Integer** | when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. | [optional] +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ref** | **String** | the commit to cherry-pick, given by a ref | | +|**parentNumber** | **Integer** | when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. | [optional] | diff --git a/clients/java/src/main/java/io/lakefs/clients/api/BranchesApi.java b/clients/java/src/main/java/io/lakefs/clients/api/BranchesApi.java index 63d09bf70d9..815fb279106 100644 --- a/clients/java/src/main/java/io/lakefs/clients/api/BranchesApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/api/BranchesApi.java @@ -100,12 +100,25 @@ public void setCustomBaseUrl(String customBaseUrl) { */ public okhttp3.Call cherryPickCall(String repository, String branch, CherryPickCreation cherryPickCreation, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + Object localVarPostBody = cherryPickCreation; // create path and map variables String localVarPath = "/repositories/{repository}/branches/{branch}/cherry-pick" - .replaceAll("\\{" + "repository" + "\\}", localVarApiClient.escapeString(repository.toString())) - .replaceAll("\\{" + "branch" + "\\}", localVarApiClient.escapeString(branch.toString())); + .replace("{" + "repository" + "}", localVarApiClient.escapeString(repository.toString())) + .replace("{" + "branch" + "}", localVarApiClient.escapeString(branch.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -125,33 +138,32 @@ public okhttp3.Call cherryPickCall(String repository, String branch, CherryPickC "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } - String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "jwt_token", "oidc_auth", "saml_auth" }; - return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + String[] localVarAuthNames = new String[] { "basic_auth", "cookie_auth", "oidc_auth", "saml_auth", "jwt_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call cherryPickValidateBeforeCall(String repository, String branch, CherryPickCreation cherryPickCreation, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'repository' is set if (repository == null) { throw new ApiException("Missing the required parameter 'repository' when calling cherryPick(Async)"); } - + // verify the required parameter 'branch' is set if (branch == null) { throw new ApiException("Missing the required parameter 'branch' when calling cherryPick(Async)"); } - + // verify the required parameter 'cherryPickCreation' is set if (cherryPickCreation == null) { throw new ApiException("Missing the required parameter 'cherryPickCreation' when calling cherryPick(Async)"); } - - okhttp3.Call localVarCall = cherryPickCall(repository, branch, cherryPickCreation, _callback); - return localVarCall; + return cherryPickCall(repository, branch, cherryPickCreation, _callback); } diff --git a/clients/java/src/main/java/io/lakefs/clients/api/JSON.java b/clients/java/src/main/java/io/lakefs/clients/api/JSON.java index df49661a3a8..c2b1c8bb6a5 100644 --- a/clients/java/src/main/java/io/lakefs/clients/api/JSON.java +++ b/clients/java/src/main/java/io/lakefs/clients/api/JSON.java @@ -100,6 +100,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.api.model.AuthenticationToken.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.api.model.BranchCreation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.api.model.BranchProtectionRule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.api.model.CherryPickCreation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.api.model.CommPrefsInput.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.api.model.Commit.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new io.lakefs.clients.api.model.CommitCreation.CustomTypeAdapterFactory()); diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java b/clients/java/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java index 91a408e904e..aab6baa782c 100644 --- a/clients/java/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java +++ b/clients/java/src/main/java/io/lakefs/clients/api/model/CherryPickCreation.java @@ -20,10 +20,29 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import io.lakefs.clients.api.JSON; + /** * CherryPickCreation */ @@ -37,6 +56,8 @@ public class CherryPickCreation { @SerializedName(SERIALIZED_NAME_PARENT_NUMBER) private Integer parentNumber; + public CherryPickCreation() { + } public CherryPickCreation ref(String ref) { @@ -49,7 +70,6 @@ public CherryPickCreation ref(String ref) { * @return ref **/ @javax.annotation.Nonnull - @ApiModelProperty(required = true, value = "the commit to cherry-pick, given by a ref") public String getRef() { return ref; @@ -72,7 +92,6 @@ public CherryPickCreation parentNumber(Integer parentNumber) { * @return parentNumber **/ @javax.annotation.Nullable - @ApiModelProperty(value = "when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff.") public Integer getParentNumber() { return parentNumber; @@ -84,6 +103,7 @@ public void setParentNumber(Integer parentNumber) { } + @Override public boolean equals(Object o) { if (this == o) { @@ -123,5 +143,100 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("ref"); + openapiFields.add("parent_number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("ref"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CherryPickCreation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!CherryPickCreation.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CherryPickCreation is not found in the empty JSON string", CherryPickCreation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CherryPickCreation.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CherryPickCreation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CherryPickCreation.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + if (!jsonObj.get("ref").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ref` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ref").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CherryPickCreation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CherryPickCreation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CherryPickCreation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CherryPickCreation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CherryPickCreation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CherryPickCreation given an JSON string + * + * @param jsonString JSON string + * @return An instance of CherryPickCreation + * @throws IOException if the JSON string is invalid with respect to CherryPickCreation + */ + public static CherryPickCreation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CherryPickCreation.class); + } + + /** + * Convert an instance of CherryPickCreation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/clients/java/src/test/java/io/lakefs/clients/api/BranchesApiTest.java b/clients/java/src/test/java/io/lakefs/clients/api/BranchesApiTest.java index d0137b64508..580f753ad24 100644 --- a/clients/java/src/test/java/io/lakefs/clients/api/BranchesApiTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/api/BranchesApiTest.java @@ -41,20 +41,17 @@ public class BranchesApiTest { /** * Cherry-Pick the given reference commit into the given branch * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void cherryPickTest() throws ApiException { String repository = null; String branch = null; CherryPickCreation cherryPickCreation = null; - api.cherryPick(repository, branch, cherryPickCreation); + api.cherryPick(repository, branch, cherryPickCreation); // TODO: test validations } - + /** * create branch * diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java b/clients/java/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java index 433531687dc..f557da92a96 100644 --- a/clients/java/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/api/model/CherryPickCreationTest.java @@ -18,12 +18,9 @@ import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** diff --git a/clients/python/.openapi-generator/FILES b/clients/python/.openapi-generator/FILES index ab2751336cc..4edd7ac97d6 100644 --- a/clients/python/.openapi-generator/FILES +++ b/clients/python/.openapi-generator/FILES @@ -1,7 +1,6 @@ .gitignore .travis.yml README.md -<<<<<<< HEAD docs/apis/tags/ActionsApi.md docs/apis/tags/AuthApi.md docs/apis/tags/BranchesApi.md @@ -27,6 +26,7 @@ docs/models/AuthCapabilities.md docs/models/AuthenticationToken.md docs/models/BranchCreation.md docs/models/BranchProtectionRule.md +docs/models/CherryPickCreation.md docs/models/CommPrefsInput.md docs/models/Commit.md docs/models/CommitCreation.md @@ -101,109 +101,6 @@ docs/models/User.md docs/models/UserCreation.md docs/models/UserList.md docs/models/VersionConfig.md -======= -docs/AccessKeyCredentials.md -docs/ActionRun.md -docs/ActionRunList.md -docs/ActionsApi.md -docs/AuthApi.md -docs/AuthCapabilities.md -docs/AuthenticationToken.md -docs/BranchCreation.md -docs/BranchProtectionRule.md -docs/BranchesApi.md -docs/CherryPickCreation.md -docs/CommPrefsInput.md -docs/Commit.md -docs/CommitCreation.md -docs/CommitList.md -docs/CommitsApi.md -docs/ConfigApi.md -docs/Credentials.md -docs/CredentialsList.md -docs/CredentialsWithSecret.md -docs/CurrentUser.md -docs/Diff.md -docs/DiffList.md -docs/Error.md -docs/ExperimentalApi.md -docs/FindMergeBaseResult.md -docs/ForgotPasswordRequest.md -docs/GarbageCollectionConfig.md -docs/GarbageCollectionPrepareRequest.md -docs/GarbageCollectionPrepareResponse.md -docs/GarbageCollectionRule.md -docs/GarbageCollectionRules.md -docs/Group.md -docs/GroupCreation.md -docs/GroupList.md -docs/HealthCheckApi.md -docs/HookRun.md -docs/HookRunList.md -docs/ImportApi.md -docs/ImportPagination.md -docs/IngestRangeCreationResponse.md -docs/InlineObject1.md -docs/LoginConfig.md -docs/LoginInformation.md -docs/Merge.md -docs/MergeResult.md -docs/MergeResultSummary.md -docs/MetaRangeCreation.md -docs/MetaRangeCreationResponse.md -docs/MetadataApi.md -docs/NextStep.md -docs/ObjectCopyCreation.md -docs/ObjectError.md -docs/ObjectErrorList.md -docs/ObjectStageCreation.md -docs/ObjectStats.md -docs/ObjectStatsList.md -docs/ObjectUserMetadata.md -docs/ObjectsApi.md -docs/OtfDiffApi.md -docs/OtfDiffEntry.md -docs/OtfDiffList.md -docs/Pagination.md -docs/PathList.md -docs/Policy.md -docs/PolicyList.md -docs/PrepareGCUncommittedRequest.md -docs/PrepareGCUncommittedResponse.md -docs/RangeMetadata.md -docs/Ref.md -docs/RefList.md -docs/RefsApi.md -docs/RefsDump.md -docs/RepositoriesApi.md -docs/Repository.md -docs/RepositoryCreation.md -docs/RepositoryList.md -docs/ResetCreation.md -docs/RetentionApi.md -docs/RevertCreation.md -docs/Setup.md -docs/SetupState.md -docs/StageRangeCreation.md -docs/StagingApi.md -docs/StagingLocation.md -docs/StagingMetadata.md -docs/Statement.md -docs/StatisticsApi.md -docs/StatsEvent.md -docs/StatsEventsList.md -docs/StorageConfig.md -docs/StorageURI.md -docs/TagCreation.md -docs/TagsApi.md -docs/TemplatesApi.md -docs/UnderlyingObjectProperties.md -docs/UpdatePasswordByToken.md -docs/User.md -docs/UserCreation.md -docs/UserList.md -docs/VersionConfig.md ->>>>>>> cfd08d6a7 (cherry-pick) lakefs_client/__init__.py lakefs_client/api_client.py lakefs_client/apis/__init__.py @@ -241,11 +138,9 @@ lakefs_client/model/authentication_token.pyi lakefs_client/model/branch_creation.py lakefs_client/model/branch_creation.pyi lakefs_client/model/branch_protection_rule.py -<<<<<<< HEAD lakefs_client/model/branch_protection_rule.pyi -======= lakefs_client/model/cherry_pick_creation.py ->>>>>>> cfd08d6a7 (cherry-pick) +lakefs_client/model/cherry_pick_creation.pyi lakefs_client/model/comm_prefs_input.py lakefs_client/model/comm_prefs_input.pyi lakefs_client/model/commit.py @@ -402,7 +297,6 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -<<<<<<< HEAD test/test_models/__init__.py test/test_models/test_access_key_credentials.py test/test_models/test_action_run.py @@ -411,6 +305,7 @@ test/test_models/test_auth_capabilities.py test/test_models/test_authentication_token.py test/test_models/test_branch_creation.py test/test_models/test_branch_protection_rule.py +test/test_models/test_cherry_pick_creation.py test/test_models/test_comm_prefs_input.py test/test_models/test_commit.py test/test_models/test_commit_creation.py @@ -485,107 +380,4 @@ test/test_models/test_user.py test/test_models/test_user_creation.py test/test_models/test_user_list.py test/test_models/test_version_config.py -======= -test/test_access_key_credentials.py -test/test_action_run.py -test/test_action_run_list.py -test/test_actions_api.py -test/test_auth_api.py -test/test_auth_capabilities.py -test/test_authentication_token.py -test/test_branch_creation.py -test/test_branch_protection_rule.py -test/test_branches_api.py -test/test_cherry_pick_creation.py -test/test_comm_prefs_input.py -test/test_commit.py -test/test_commit_creation.py -test/test_commit_list.py -test/test_commits_api.py -test/test_config_api.py -test/test_credentials.py -test/test_credentials_list.py -test/test_credentials_with_secret.py -test/test_current_user.py -test/test_diff.py -test/test_diff_list.py -test/test_error.py -test/test_experimental_api.py -test/test_find_merge_base_result.py -test/test_forgot_password_request.py -test/test_garbage_collection_config.py -test/test_garbage_collection_prepare_request.py -test/test_garbage_collection_prepare_response.py -test/test_garbage_collection_rule.py -test/test_garbage_collection_rules.py -test/test_group.py -test/test_group_creation.py -test/test_group_list.py -test/test_health_check_api.py -test/test_hook_run.py -test/test_hook_run_list.py -test/test_import_api.py -test/test_import_pagination.py -test/test_ingest_range_creation_response.py -test/test_inline_object1.py -test/test_login_config.py -test/test_login_information.py -test/test_merge.py -test/test_merge_result.py -test/test_merge_result_summary.py -test/test_meta_range_creation.py -test/test_meta_range_creation_response.py -test/test_metadata_api.py -test/test_next_step.py -test/test_object_copy_creation.py -test/test_object_error.py -test/test_object_error_list.py -test/test_object_stage_creation.py -test/test_object_stats.py -test/test_object_stats_list.py -test/test_object_user_metadata.py -test/test_objects_api.py -test/test_otf_diff_api.py -test/test_otf_diff_entry.py -test/test_otf_diff_list.py -test/test_pagination.py -test/test_path_list.py -test/test_policy.py -test/test_policy_list.py -test/test_prepare_gc_uncommitted_request.py -test/test_prepare_gc_uncommitted_response.py -test/test_range_metadata.py -test/test_ref.py -test/test_ref_list.py -test/test_refs_api.py -test/test_refs_dump.py -test/test_repositories_api.py -test/test_repository.py -test/test_repository_creation.py -test/test_repository_list.py -test/test_reset_creation.py -test/test_retention_api.py -test/test_revert_creation.py -test/test_setup.py -test/test_setup_state.py -test/test_stage_range_creation.py -test/test_staging_api.py -test/test_staging_location.py -test/test_staging_metadata.py -test/test_statement.py -test/test_statistics_api.py -test/test_stats_event.py -test/test_stats_events_list.py -test/test_storage_config.py -test/test_storage_uri.py -test/test_tag_creation.py -test/test_tags_api.py -test/test_templates_api.py -test/test_underlying_object_properties.py -test/test_update_password_by_token.py -test/test_user.py -test/test_user_creation.py -test/test_user_list.py -test/test_version_config.py ->>>>>>> cfd08d6a7 (cherry-pick) tox.ini diff --git a/clients/python/README.md b/clients/python/README.md index 36dbb0a5bea..2a45c69e7a0 100644 --- a/clients/python/README.md +++ b/clients/python/README.md @@ -206,7 +206,6 @@ All URIs are relative to */api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -<<<<<<< HEAD *ActionsApi* | [**get_run**](docs/apis/tags/ActionsApi.md#get_run) | **get** /repositories/{repository}/actions/runs/{run_id} | get a run *ActionsApi* | [**get_run_hook_output**](docs/apis/tags/ActionsApi.md#get_run_hook_output) | **get** /repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output | get run hook output *ActionsApi* | [**list_repository_runs**](docs/apis/tags/ActionsApi.md#list_repository_runs) | **get** /repositories/{repository}/actions/runs | list runs @@ -243,6 +242,7 @@ Class | Method | HTTP request | Description *AuthApi* | [**login**](docs/apis/tags/AuthApi.md#login) | **post** /auth/login | perform a login *AuthApi* | [**update_password**](docs/apis/tags/AuthApi.md#update_password) | **post** /auth/password | Update user password by reset_password token *AuthApi* | [**update_policy**](docs/apis/tags/AuthApi.md#update_policy) | **put** /auth/policies/{policyId} | update policy +*BranchesApi* | [**cherry_pick**](docs/apis/tags/BranchesApi.md#cherry_pick) | **post** /repositories/{repository}/branches/{branch}/cherry-pick | Cherry-Pick the given reference commit into the given branch *BranchesApi* | [**create_branch**](docs/apis/tags/BranchesApi.md#create_branch) | **post** /repositories/{repository}/branches | create branch *BranchesApi* | [**delete_branch**](docs/apis/tags/BranchesApi.md#delete_branch) | **delete** /repositories/{repository}/branches/{branch} | delete branch *BranchesApi* | [**diff_branch**](docs/apis/tags/BranchesApi.md#diff_branch) | **get** /repositories/{repository}/branches/{branch}/diff | diff branch @@ -313,6 +313,7 @@ Class | Method | HTTP request | Description - [AuthenticationToken](docs/models/AuthenticationToken.md) - [BranchCreation](docs/models/BranchCreation.md) - [BranchProtectionRule](docs/models/BranchProtectionRule.md) + - [CherryPickCreation](docs/models/CherryPickCreation.md) - [CommPrefsInput](docs/models/CommPrefsInput.md) - [Commit](docs/models/Commit.md) - [CommitCreation](docs/models/CommitCreation.md) @@ -387,193 +388,6 @@ Class | Method | HTTP request | Description - [UserCreation](docs/models/UserCreation.md) - [UserList](docs/models/UserList.md) - [VersionConfig](docs/models/VersionConfig.md) -======= -*ActionsApi* | [**get_run**](docs/ActionsApi.md#get_run) | **GET** /repositories/{repository}/actions/runs/{run_id} | get a run -*ActionsApi* | [**get_run_hook_output**](docs/ActionsApi.md#get_run_hook_output) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks/{hook_run_id}/output | get run hook output -*ActionsApi* | [**list_repository_runs**](docs/ActionsApi.md#list_repository_runs) | **GET** /repositories/{repository}/actions/runs | list runs -*ActionsApi* | [**list_run_hooks**](docs/ActionsApi.md#list_run_hooks) | **GET** /repositories/{repository}/actions/runs/{run_id}/hooks | list run hooks -*AuthApi* | [**add_group_membership**](docs/AuthApi.md#add_group_membership) | **PUT** /auth/groups/{groupId}/members/{userId} | add group membership -*AuthApi* | [**attach_policy_to_group**](docs/AuthApi.md#attach_policy_to_group) | **PUT** /auth/groups/{groupId}/policies/{policyId} | attach policy to group -*AuthApi* | [**attach_policy_to_user**](docs/AuthApi.md#attach_policy_to_user) | **PUT** /auth/users/{userId}/policies/{policyId} | attach policy to user -*AuthApi* | [**create_credentials**](docs/AuthApi.md#create_credentials) | **POST** /auth/users/{userId}/credentials | create credentials -*AuthApi* | [**create_group**](docs/AuthApi.md#create_group) | **POST** /auth/groups | create group -*AuthApi* | [**create_policy**](docs/AuthApi.md#create_policy) | **POST** /auth/policies | create policy -*AuthApi* | [**create_user**](docs/AuthApi.md#create_user) | **POST** /auth/users | create user -*AuthApi* | [**delete_credentials**](docs/AuthApi.md#delete_credentials) | **DELETE** /auth/users/{userId}/credentials/{accessKeyId} | delete credentials -*AuthApi* | [**delete_group**](docs/AuthApi.md#delete_group) | **DELETE** /auth/groups/{groupId} | delete group -*AuthApi* | [**delete_group_membership**](docs/AuthApi.md#delete_group_membership) | **DELETE** /auth/groups/{groupId}/members/{userId} | delete group membership -*AuthApi* | [**delete_policy**](docs/AuthApi.md#delete_policy) | **DELETE** /auth/policies/{policyId} | delete policy -*AuthApi* | [**delete_user**](docs/AuthApi.md#delete_user) | **DELETE** /auth/users/{userId} | delete user -*AuthApi* | [**detach_policy_from_group**](docs/AuthApi.md#detach_policy_from_group) | **DELETE** /auth/groups/{groupId}/policies/{policyId} | detach policy from group -*AuthApi* | [**detach_policy_from_user**](docs/AuthApi.md#detach_policy_from_user) | **DELETE** /auth/users/{userId}/policies/{policyId} | detach policy from user -*AuthApi* | [**forgot_password**](docs/AuthApi.md#forgot_password) | **POST** /auth/password/forgot | forgot password request initiates the password reset process -*AuthApi* | [**get_auth_capabilities**](docs/AuthApi.md#get_auth_capabilities) | **GET** /auth/capabilities | list authentication capabilities supported -*AuthApi* | [**get_credentials**](docs/AuthApi.md#get_credentials) | **GET** /auth/users/{userId}/credentials/{accessKeyId} | get credentials -*AuthApi* | [**get_current_user**](docs/AuthApi.md#get_current_user) | **GET** /user | get current user -*AuthApi* | [**get_group**](docs/AuthApi.md#get_group) | **GET** /auth/groups/{groupId} | get group -*AuthApi* | [**get_policy**](docs/AuthApi.md#get_policy) | **GET** /auth/policies/{policyId} | get policy -*AuthApi* | [**get_user**](docs/AuthApi.md#get_user) | **GET** /auth/users/{userId} | get user -*AuthApi* | [**list_group_members**](docs/AuthApi.md#list_group_members) | **GET** /auth/groups/{groupId}/members | list group members -*AuthApi* | [**list_group_policies**](docs/AuthApi.md#list_group_policies) | **GET** /auth/groups/{groupId}/policies | list group policies -*AuthApi* | [**list_groups**](docs/AuthApi.md#list_groups) | **GET** /auth/groups | list groups -*AuthApi* | [**list_policies**](docs/AuthApi.md#list_policies) | **GET** /auth/policies | list policies -*AuthApi* | [**list_user_credentials**](docs/AuthApi.md#list_user_credentials) | **GET** /auth/users/{userId}/credentials | list user credentials -*AuthApi* | [**list_user_groups**](docs/AuthApi.md#list_user_groups) | **GET** /auth/users/{userId}/groups | list user groups -*AuthApi* | [**list_user_policies**](docs/AuthApi.md#list_user_policies) | **GET** /auth/users/{userId}/policies | list user policies -*AuthApi* | [**list_users**](docs/AuthApi.md#list_users) | **GET** /auth/users | list users -*AuthApi* | [**login**](docs/AuthApi.md#login) | **POST** /auth/login | perform a login -*AuthApi* | [**update_password**](docs/AuthApi.md#update_password) | **POST** /auth/password | Update user password by reset_password token -*AuthApi* | [**update_policy**](docs/AuthApi.md#update_policy) | **PUT** /auth/policies/{policyId} | update policy -*BranchesApi* | [**cherry_pick**](docs/BranchesApi.md#cherry_pick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Cherry-Pick the given reference commit into the given branch -*BranchesApi* | [**create_branch**](docs/BranchesApi.md#create_branch) | **POST** /repositories/{repository}/branches | create branch -*BranchesApi* | [**delete_branch**](docs/BranchesApi.md#delete_branch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch -*BranchesApi* | [**diff_branch**](docs/BranchesApi.md#diff_branch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch -*BranchesApi* | [**get_branch**](docs/BranchesApi.md#get_branch) | **GET** /repositories/{repository}/branches/{branch} | get branch -*BranchesApi* | [**list_branches**](docs/BranchesApi.md#list_branches) | **GET** /repositories/{repository}/branches | list branches -*BranchesApi* | [**reset_branch**](docs/BranchesApi.md#reset_branch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch -*BranchesApi* | [**revert_branch**](docs/BranchesApi.md#revert_branch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert -*CommitsApi* | [**commit**](docs/CommitsApi.md#commit) | **POST** /repositories/{repository}/branches/{branch}/commits | create commit -*CommitsApi* | [**get_commit**](docs/CommitsApi.md#get_commit) | **GET** /repositories/{repository}/commits/{commitId} | get commit -*CommitsApi* | [**log_branch_commits**](docs/CommitsApi.md#log_branch_commits) | **GET** /repositories/{repository}/branches/{branch}/commits | get commit log from branch. Deprecated: replaced by logCommits by passing branch name as ref -*ConfigApi* | [**get_garbage_collection_config**](docs/ConfigApi.md#get_garbage_collection_config) | **GET** /config/garbage-collection | -*ConfigApi* | [**get_lake_fs_version**](docs/ConfigApi.md#get_lake_fs_version) | **GET** /config/version | -*ConfigApi* | [**get_setup_state**](docs/ConfigApi.md#get_setup_state) | **GET** /setup_lakefs | check if the lakeFS installation is already set up -*ConfigApi* | [**get_storage_config**](docs/ConfigApi.md#get_storage_config) | **GET** /config/storage | -*ConfigApi* | [**setup**](docs/ConfigApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user -*ConfigApi* | [**setup_comm_prefs**](docs/ConfigApi.md#setup_comm_prefs) | **POST** /setup_comm_prefs | setup communications preferences -*ExperimentalApi* | [**otf_diff**](docs/ExperimentalApi.md#otf_diff) | **GET** /repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref} | perform otf diff -*HealthCheckApi* | [**health_check**](docs/HealthCheckApi.md#health_check) | **GET** /healthcheck | -*ImportApi* | [**create_meta_range**](docs/ImportApi.md#create_meta_range) | **POST** /repositories/{repository}/branches/metaranges | create a lakeFS metarange file from the given ranges -*ImportApi* | [**ingest_range**](docs/ImportApi.md#ingest_range) | **POST** /repositories/{repository}/branches/ranges | create a lakeFS range file from the source uri -*MetadataApi* | [**create_symlink_file**](docs/MetadataApi.md#create_symlink_file) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory -*MetadataApi* | [**get_meta_range**](docs/MetadataApi.md#get_meta_range) | **GET** /repositories/{repository}/metadata/meta_range/{meta_range} | return URI to a meta-range file -*MetadataApi* | [**get_range**](docs/MetadataApi.md#get_range) | **GET** /repositories/{repository}/metadata/range/{range} | return URI to a range file -*ObjectsApi* | [**copy_object**](docs/ObjectsApi.md#copy_object) | **POST** /repositories/{repository}/branches/{branch}/objects/copy | create a copy of an object -*ObjectsApi* | [**delete_object**](docs/ObjectsApi.md#delete_object) | **DELETE** /repositories/{repository}/branches/{branch}/objects | delete object. Missing objects will not return a NotFound error. -*ObjectsApi* | [**delete_objects**](docs/ObjectsApi.md#delete_objects) | **POST** /repositories/{repository}/branches/{branch}/objects/delete | delete objects. Missing objects will not return a NotFound error. -*ObjectsApi* | [**get_object**](docs/ObjectsApi.md#get_object) | **GET** /repositories/{repository}/refs/{ref}/objects | get object content -*ObjectsApi* | [**get_underlying_properties**](docs/ObjectsApi.md#get_underlying_properties) | **GET** /repositories/{repository}/refs/{ref}/objects/underlyingProperties | get object properties on underlying storage -*ObjectsApi* | [**head_object**](docs/ObjectsApi.md#head_object) | **HEAD** /repositories/{repository}/refs/{ref}/objects | check if object exists -*ObjectsApi* | [**list_objects**](docs/ObjectsApi.md#list_objects) | **GET** /repositories/{repository}/refs/{ref}/objects/ls | list objects under a given prefix -*ObjectsApi* | [**stage_object**](docs/ObjectsApi.md#stage_object) | **PUT** /repositories/{repository}/branches/{branch}/objects | stage an object's metadata for the given branch -*ObjectsApi* | [**stat_object**](docs/ObjectsApi.md#stat_object) | **GET** /repositories/{repository}/refs/{ref}/objects/stat | get object metadata -*ObjectsApi* | [**upload_object**](docs/ObjectsApi.md#upload_object) | **POST** /repositories/{repository}/branches/{branch}/objects | -*OtfDiffApi* | [**otf_diff**](docs/OtfDiffApi.md#otf_diff) | **GET** /repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref} | perform otf diff -*RefsApi* | [**diff_refs**](docs/RefsApi.md#diff_refs) | **GET** /repositories/{repository}/refs/{leftRef}/diff/{rightRef} | diff references -*RefsApi* | [**dump_refs**](docs/RefsApi.md#dump_refs) | **PUT** /repositories/{repository}/refs/dump | Dump repository refs (tags, commits, branches) to object store -*RefsApi* | [**find_merge_base**](docs/RefsApi.md#find_merge_base) | **GET** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | find the merge base for 2 references -*RefsApi* | [**log_commits**](docs/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. -*RefsApi* | [**merge_into_branch**](docs/RefsApi.md#merge_into_branch) | **POST** /repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch} | merge references -*RefsApi* | [**restore_refs**](docs/RefsApi.md#restore_refs) | **PUT** /repositories/{repository}/refs/restore | Restore repository refs (tags, commits, branches) from object store -*RepositoriesApi* | [**create_branch_protection_rule**](docs/RepositoriesApi.md#create_branch_protection_rule) | **POST** /repositories/{repository}/branch_protection | -*RepositoriesApi* | [**create_repository**](docs/RepositoriesApi.md#create_repository) | **POST** /repositories | create repository -*RepositoriesApi* | [**delete_branch_protection_rule**](docs/RepositoriesApi.md#delete_branch_protection_rule) | **DELETE** /repositories/{repository}/branch_protection | -*RepositoriesApi* | [**delete_repository**](docs/RepositoriesApi.md#delete_repository) | **DELETE** /repositories/{repository} | delete repository -*RepositoriesApi* | [**get_branch_protection_rules**](docs/RepositoriesApi.md#get_branch_protection_rules) | **GET** /repositories/{repository}/branch_protection | get branch protection rules -*RepositoriesApi* | [**get_repository**](docs/RepositoriesApi.md#get_repository) | **GET** /repositories/{repository} | get repository -*RepositoriesApi* | [**list_repositories**](docs/RepositoriesApi.md#list_repositories) | **GET** /repositories | list repositories -*RetentionApi* | [**delete_garbage_collection_rules**](docs/RetentionApi.md#delete_garbage_collection_rules) | **DELETE** /repositories/{repository}/gc/rules | -*RetentionApi* | [**get_garbage_collection_rules**](docs/RetentionApi.md#get_garbage_collection_rules) | **GET** /repositories/{repository}/gc/rules | -*RetentionApi* | [**prepare_garbage_collection_commits**](docs/RetentionApi.md#prepare_garbage_collection_commits) | **POST** /repositories/{repository}/gc/prepare_commits | save lists of active and expired commits for garbage collection -*RetentionApi* | [**prepare_garbage_collection_uncommitted**](docs/RetentionApi.md#prepare_garbage_collection_uncommitted) | **POST** /repositories/{repository}/gc/prepare_uncommited | save repository uncommitted metadata for garbage collection -*RetentionApi* | [**set_garbage_collection_rules**](docs/RetentionApi.md#set_garbage_collection_rules) | **POST** /repositories/{repository}/gc/rules | -*StagingApi* | [**get_physical_address**](docs/StagingApi.md#get_physical_address) | **GET** /repositories/{repository}/branches/{branch}/staging/backing | get a physical address and a return token to write object to underlying storage -*StagingApi* | [**link_physical_address**](docs/StagingApi.md#link_physical_address) | **PUT** /repositories/{repository}/branches/{branch}/staging/backing | associate staging on this physical address with a path -*StatisticsApi* | [**post_stats_events**](docs/StatisticsApi.md#post_stats_events) | **POST** /statistics | post stats events, this endpoint is meant for internal use only -*TagsApi* | [**create_tag**](docs/TagsApi.md#create_tag) | **POST** /repositories/{repository}/tags | create tag -*TagsApi* | [**delete_tag**](docs/TagsApi.md#delete_tag) | **DELETE** /repositories/{repository}/tags/{tag} | delete tag -*TagsApi* | [**get_tag**](docs/TagsApi.md#get_tag) | **GET** /repositories/{repository}/tags/{tag} | get tag -*TagsApi* | [**list_tags**](docs/TagsApi.md#list_tags) | **GET** /repositories/{repository}/tags | list tags -*TemplatesApi* | [**expand_template**](docs/TemplatesApi.md#expand_template) | **GET** /templates/{template_location} | - - -## Documentation For Models - - - [AccessKeyCredentials](docs/AccessKeyCredentials.md) - - [ActionRun](docs/ActionRun.md) - - [ActionRunList](docs/ActionRunList.md) - - [AuthCapabilities](docs/AuthCapabilities.md) - - [AuthenticationToken](docs/AuthenticationToken.md) - - [BranchCreation](docs/BranchCreation.md) - - [BranchProtectionRule](docs/BranchProtectionRule.md) - - [CherryPickCreation](docs/CherryPickCreation.md) - - [CommPrefsInput](docs/CommPrefsInput.md) - - [Commit](docs/Commit.md) - - [CommitCreation](docs/CommitCreation.md) - - [CommitList](docs/CommitList.md) - - [Credentials](docs/Credentials.md) - - [CredentialsList](docs/CredentialsList.md) - - [CredentialsWithSecret](docs/CredentialsWithSecret.md) - - [CurrentUser](docs/CurrentUser.md) - - [Diff](docs/Diff.md) - - [DiffList](docs/DiffList.md) - - [Error](docs/Error.md) - - [FindMergeBaseResult](docs/FindMergeBaseResult.md) - - [ForgotPasswordRequest](docs/ForgotPasswordRequest.md) - - [GarbageCollectionConfig](docs/GarbageCollectionConfig.md) - - [GarbageCollectionPrepareRequest](docs/GarbageCollectionPrepareRequest.md) - - [GarbageCollectionPrepareResponse](docs/GarbageCollectionPrepareResponse.md) - - [GarbageCollectionRule](docs/GarbageCollectionRule.md) - - [GarbageCollectionRules](docs/GarbageCollectionRules.md) - - [Group](docs/Group.md) - - [GroupCreation](docs/GroupCreation.md) - - [GroupList](docs/GroupList.md) - - [HookRun](docs/HookRun.md) - - [HookRunList](docs/HookRunList.md) - - [ImportPagination](docs/ImportPagination.md) - - [IngestRangeCreationResponse](docs/IngestRangeCreationResponse.md) - - [InlineObject1](docs/InlineObject1.md) - - [LoginConfig](docs/LoginConfig.md) - - [LoginInformation](docs/LoginInformation.md) - - [Merge](docs/Merge.md) - - [MergeResult](docs/MergeResult.md) - - [MergeResultSummary](docs/MergeResultSummary.md) - - [MetaRangeCreation](docs/MetaRangeCreation.md) - - [MetaRangeCreationResponse](docs/MetaRangeCreationResponse.md) - - [NextStep](docs/NextStep.md) - - [ObjectCopyCreation](docs/ObjectCopyCreation.md) - - [ObjectError](docs/ObjectError.md) - - [ObjectErrorList](docs/ObjectErrorList.md) - - [ObjectStageCreation](docs/ObjectStageCreation.md) - - [ObjectStats](docs/ObjectStats.md) - - [ObjectStatsList](docs/ObjectStatsList.md) - - [ObjectUserMetadata](docs/ObjectUserMetadata.md) - - [OtfDiffEntry](docs/OtfDiffEntry.md) - - [OtfDiffList](docs/OtfDiffList.md) - - [Pagination](docs/Pagination.md) - - [PathList](docs/PathList.md) - - [Policy](docs/Policy.md) - - [PolicyList](docs/PolicyList.md) - - [PrepareGCUncommittedRequest](docs/PrepareGCUncommittedRequest.md) - - [PrepareGCUncommittedResponse](docs/PrepareGCUncommittedResponse.md) - - [RangeMetadata](docs/RangeMetadata.md) - - [Ref](docs/Ref.md) - - [RefList](docs/RefList.md) - - [RefsDump](docs/RefsDump.md) - - [Repository](docs/Repository.md) - - [RepositoryCreation](docs/RepositoryCreation.md) - - [RepositoryList](docs/RepositoryList.md) - - [ResetCreation](docs/ResetCreation.md) - - [RevertCreation](docs/RevertCreation.md) - - [Setup](docs/Setup.md) - - [SetupState](docs/SetupState.md) - - [StageRangeCreation](docs/StageRangeCreation.md) - - [StagingLocation](docs/StagingLocation.md) - - [StagingMetadata](docs/StagingMetadata.md) - - [Statement](docs/Statement.md) - - [StatsEvent](docs/StatsEvent.md) - - [StatsEventsList](docs/StatsEventsList.md) - - [StorageConfig](docs/StorageConfig.md) - - [StorageURI](docs/StorageURI.md) - - [TagCreation](docs/TagCreation.md) - - [UnderlyingObjectProperties](docs/UnderlyingObjectProperties.md) - - [UpdatePasswordByToken](docs/UpdatePasswordByToken.md) - - [User](docs/User.md) - - [UserCreation](docs/UserCreation.md) - - [UserList](docs/UserList.md) - - [VersionConfig](docs/VersionConfig.md) - ->>>>>>> cfd08d6a7 (cherry-pick) ## Documentation For Authorization diff --git a/clients/python/docs/BranchesApi.md b/clients/python/docs/BranchesApi.md deleted file mode 100644 index 2f2c87b3456..00000000000 --- a/clients/python/docs/BranchesApi.md +++ /dev/null @@ -1,938 +0,0 @@ -# lakefs_client.BranchesApi - -All URIs are relative to *http://localhost/api/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**cherry_pick**](BranchesApi.md#cherry_pick) | **POST** /repositories/{repository}/branches/{branch}/cherry-pick | Cherry-Pick the given reference commit into the given branch -[**create_branch**](BranchesApi.md#create_branch) | **POST** /repositories/{repository}/branches | create branch -[**delete_branch**](BranchesApi.md#delete_branch) | **DELETE** /repositories/{repository}/branches/{branch} | delete branch -[**diff_branch**](BranchesApi.md#diff_branch) | **GET** /repositories/{repository}/branches/{branch}/diff | diff branch -[**get_branch**](BranchesApi.md#get_branch) | **GET** /repositories/{repository}/branches/{branch} | get branch -[**list_branches**](BranchesApi.md#list_branches) | **GET** /repositories/{repository}/branches | list branches -[**reset_branch**](BranchesApi.md#reset_branch) | **PUT** /repositories/{repository}/branches/{branch} | reset branch -[**revert_branch**](BranchesApi.md#revert_branch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert - - -# **cherry_pick** -> cherry_pick(repository, branch, cherry_pick_creation) - -Cherry-Pick the given reference commit into the given branch - -### Example - -* Basic Authentication (basic_auth): -* Api Key Authentication (cookie_auth): -* Bearer (JWT) Authentication (jwt_token): -* Api Key Authentication (oidc_auth): -* Api Key Authentication (saml_auth): - -```python -import time -import lakefs_client -from lakefs_client.api import branches_api -from lakefs_client.model.error import Error -from lakefs_client.model.cherry_pick_creation import CherryPickCreation -from pprint import pprint -# Defining the host is optional and defaults to http://localhost/api/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = lakefs_client.Configuration( - host = "http://localhost/api/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: basic_auth -configuration = lakefs_client.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookie_auth -configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookie_auth'] = 'Bearer' - -# Configure Bearer authorization (JWT): jwt_token -configuration = lakefs_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Configure API key authorization: oidc_auth -configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['oidc_auth'] = 'Bearer' - -# Configure API key authorization: saml_auth -configuration.api_key['saml_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['saml_auth'] = 'Bearer' - -# Enter a context with an instance of the API client -with lakefs_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = branches_api.BranchesApi(api_client) - repository = "repository_example" # str | - branch = "branch_example" # str | - cherry_pick_creation = CherryPickCreation( - ref="ref_example", - parent_number=1, - ) # CherryPickCreation | - - # example passing only required values which don't have defaults set - try: - # Cherry-Pick the given reference commit into the given branch - api_instance.cherry_pick(repository, branch, cherry_pick_creation) - except lakefs_client.ApiException as e: - print("Exception when calling BranchesApi->cherry_pick: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **str**| | - **branch** | **str**| | - **cherry_pick_creation** | [**CherryPickCreation**](CherryPickCreation.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[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) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | successful cherry-pick | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**409** | Conflict Found | - | -**0** | Internal Server Error | - | - -[[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) - -# **create_branch** -> str create_branch(repository, branch_creation) - -create branch - -### Example - -* Basic Authentication (basic_auth): -* Api Key Authentication (cookie_auth): -* Bearer (JWT) Authentication (jwt_token): -* Api Key Authentication (oidc_auth): -* Api Key Authentication (saml_auth): - -```python -import time -import lakefs_client -from lakefs_client.api import branches_api -from lakefs_client.model.branch_creation import BranchCreation -from lakefs_client.model.error import Error -from pprint import pprint -# Defining the host is optional and defaults to http://localhost/api/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = lakefs_client.Configuration( - host = "http://localhost/api/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: basic_auth -configuration = lakefs_client.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookie_auth -configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookie_auth'] = 'Bearer' - -# Configure Bearer authorization (JWT): jwt_token -configuration = lakefs_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Configure API key authorization: oidc_auth -configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['oidc_auth'] = 'Bearer' - -# Configure API key authorization: saml_auth -configuration.api_key['saml_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['saml_auth'] = 'Bearer' - -# Enter a context with an instance of the API client -with lakefs_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = branches_api.BranchesApi(api_client) - repository = "repository_example" # str | - branch_creation = BranchCreation( - name="name_example", - source="source_example", - ) # BranchCreation | - - # example passing only required values which don't have defaults set - try: - # create branch - api_response = api_instance.create_branch(repository, branch_creation) - pprint(api_response) - except lakefs_client.ApiException as e: - print("Exception when calling BranchesApi->create_branch: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **str**| | - **branch_creation** | [**BranchCreation**](BranchCreation.md)| | - -### Return type - -**str** - -### Authorization - -[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) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: text/html, application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**201** | reference | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**409** | Resource Conflicts With Target | - | -**0** | Internal Server Error | - | - -[[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) - -# **delete_branch** -> delete_branch(repository, branch) - -delete branch - -### Example - -* Basic Authentication (basic_auth): -* Api Key Authentication (cookie_auth): -* Bearer (JWT) Authentication (jwt_token): -* Api Key Authentication (oidc_auth): -* Api Key Authentication (saml_auth): - -```python -import time -import lakefs_client -from lakefs_client.api import branches_api -from lakefs_client.model.error import Error -from pprint import pprint -# Defining the host is optional and defaults to http://localhost/api/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = lakefs_client.Configuration( - host = "http://localhost/api/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: basic_auth -configuration = lakefs_client.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookie_auth -configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookie_auth'] = 'Bearer' - -# Configure Bearer authorization (JWT): jwt_token -configuration = lakefs_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Configure API key authorization: oidc_auth -configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['oidc_auth'] = 'Bearer' - -# Configure API key authorization: saml_auth -configuration.api_key['saml_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['saml_auth'] = 'Bearer' - -# Enter a context with an instance of the API client -with lakefs_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = branches_api.BranchesApi(api_client) - repository = "repository_example" # str | - branch = "branch_example" # str | - - # example passing only required values which don't have defaults set - try: - # delete branch - api_instance.delete_branch(repository, branch) - except lakefs_client.ApiException as e: - print("Exception when calling BranchesApi->delete_branch: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **str**| | - **branch** | **str**| | - -### Return type - -void (empty response body) - -### Authorization - -[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) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | branch deleted successfully | - | -**401** | Unauthorized | - | -**403** | Forbidden | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | - -[[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) - -# **diff_branch** -> DiffList diff_branch(repository, branch) - -diff branch - -### Example - -* Basic Authentication (basic_auth): -* Api Key Authentication (cookie_auth): -* Bearer (JWT) Authentication (jwt_token): -* Api Key Authentication (oidc_auth): -* Api Key Authentication (saml_auth): - -```python -import time -import lakefs_client -from lakefs_client.api import branches_api -from lakefs_client.model.diff_list import DiffList -from lakefs_client.model.error import Error -from pprint import pprint -# Defining the host is optional and defaults to http://localhost/api/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = lakefs_client.Configuration( - host = "http://localhost/api/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: basic_auth -configuration = lakefs_client.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookie_auth -configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookie_auth'] = 'Bearer' - -# Configure Bearer authorization (JWT): jwt_token -configuration = lakefs_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Configure API key authorization: oidc_auth -configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['oidc_auth'] = 'Bearer' - -# Configure API key authorization: saml_auth -configuration.api_key['saml_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['saml_auth'] = 'Bearer' - -# Enter a context with an instance of the API client -with lakefs_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = branches_api.BranchesApi(api_client) - repository = "repository_example" # str | - branch = "branch_example" # str | - after = "after_example" # str | return items after this value (optional) - amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100 - prefix = "prefix_example" # str | return items prefixed with this value (optional) - delimiter = "delimiter_example" # str | delimiter used to group common prefixes by (optional) - - # example passing only required values which don't have defaults set - try: - # diff branch - api_response = api_instance.diff_branch(repository, branch) - pprint(api_response) - except lakefs_client.ApiException as e: - print("Exception when calling BranchesApi->diff_branch: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # diff branch - api_response = api_instance.diff_branch(repository, branch, after=after, amount=amount, prefix=prefix, delimiter=delimiter) - pprint(api_response) - except lakefs_client.ApiException as e: - print("Exception when calling BranchesApi->diff_branch: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **str**| | - **branch** | **str**| | - **after** | **str**| return items after this value | [optional] - **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100 - **prefix** | **str**| return items prefixed with this value | [optional] - **delimiter** | **str**| delimiter used to group common prefixes by | [optional] - -### Return type - -[**DiffList**](DiffList.md) - -### Authorization - -[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) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | diff of branch uncommitted changes | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | - -[[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) - -# **get_branch** -> Ref get_branch(repository, branch) - -get branch - -### Example - -* Basic Authentication (basic_auth): -* Api Key Authentication (cookie_auth): -* Bearer (JWT) Authentication (jwt_token): -* Api Key Authentication (oidc_auth): -* Api Key Authentication (saml_auth): - -```python -import time -import lakefs_client -from lakefs_client.api import branches_api -from lakefs_client.model.error import Error -from lakefs_client.model.ref import Ref -from pprint import pprint -# Defining the host is optional and defaults to http://localhost/api/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = lakefs_client.Configuration( - host = "http://localhost/api/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: basic_auth -configuration = lakefs_client.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookie_auth -configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookie_auth'] = 'Bearer' - -# Configure Bearer authorization (JWT): jwt_token -configuration = lakefs_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Configure API key authorization: oidc_auth -configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['oidc_auth'] = 'Bearer' - -# Configure API key authorization: saml_auth -configuration.api_key['saml_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['saml_auth'] = 'Bearer' - -# Enter a context with an instance of the API client -with lakefs_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = branches_api.BranchesApi(api_client) - repository = "repository_example" # str | - branch = "branch_example" # str | - - # example passing only required values which don't have defaults set - try: - # get branch - api_response = api_instance.get_branch(repository, branch) - pprint(api_response) - except lakefs_client.ApiException as e: - print("Exception when calling BranchesApi->get_branch: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **str**| | - **branch** | **str**| | - -### Return type - -[**Ref**](Ref.md) - -### Authorization - -[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) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | branch | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | - -[[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) - -# **list_branches** -> RefList list_branches(repository) - -list branches - -### Example - -* Basic Authentication (basic_auth): -* Api Key Authentication (cookie_auth): -* Bearer (JWT) Authentication (jwt_token): -* Api Key Authentication (oidc_auth): -* Api Key Authentication (saml_auth): - -```python -import time -import lakefs_client -from lakefs_client.api import branches_api -from lakefs_client.model.error import Error -from lakefs_client.model.ref_list import RefList -from pprint import pprint -# Defining the host is optional and defaults to http://localhost/api/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = lakefs_client.Configuration( - host = "http://localhost/api/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: basic_auth -configuration = lakefs_client.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookie_auth -configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookie_auth'] = 'Bearer' - -# Configure Bearer authorization (JWT): jwt_token -configuration = lakefs_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Configure API key authorization: oidc_auth -configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['oidc_auth'] = 'Bearer' - -# Configure API key authorization: saml_auth -configuration.api_key['saml_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['saml_auth'] = 'Bearer' - -# Enter a context with an instance of the API client -with lakefs_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = branches_api.BranchesApi(api_client) - repository = "repository_example" # str | - prefix = "prefix_example" # str | return items prefixed with this value (optional) - after = "after_example" # str | return items after this value (optional) - amount = 100 # int | how many items to return (optional) if omitted the server will use the default value of 100 - - # example passing only required values which don't have defaults set - try: - # list branches - api_response = api_instance.list_branches(repository) - pprint(api_response) - except lakefs_client.ApiException as e: - print("Exception when calling BranchesApi->list_branches: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # list branches - api_response = api_instance.list_branches(repository, prefix=prefix, after=after, amount=amount) - pprint(api_response) - except lakefs_client.ApiException as e: - print("Exception when calling BranchesApi->list_branches: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **str**| | - **prefix** | **str**| return items prefixed with this value | [optional] - **after** | **str**| return items after this value | [optional] - **amount** | **int**| how many items to return | [optional] if omitted the server will use the default value of 100 - -### Return type - -[**RefList**](RefList.md) - -### Authorization - -[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) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | branch list | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | - -[[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) - -# **reset_branch** -> reset_branch(repository, branch, reset_creation) - -reset branch - -### Example - -* Basic Authentication (basic_auth): -* Api Key Authentication (cookie_auth): -* Bearer (JWT) Authentication (jwt_token): -* Api Key Authentication (oidc_auth): -* Api Key Authentication (saml_auth): - -```python -import time -import lakefs_client -from lakefs_client.api import branches_api -from lakefs_client.model.reset_creation import ResetCreation -from lakefs_client.model.error import Error -from pprint import pprint -# Defining the host is optional and defaults to http://localhost/api/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = lakefs_client.Configuration( - host = "http://localhost/api/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: basic_auth -configuration = lakefs_client.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookie_auth -configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookie_auth'] = 'Bearer' - -# Configure Bearer authorization (JWT): jwt_token -configuration = lakefs_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Configure API key authorization: oidc_auth -configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['oidc_auth'] = 'Bearer' - -# Configure API key authorization: saml_auth -configuration.api_key['saml_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['saml_auth'] = 'Bearer' - -# Enter a context with an instance of the API client -with lakefs_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = branches_api.BranchesApi(api_client) - repository = "repository_example" # str | - branch = "branch_example" # str | - reset_creation = ResetCreation( - type="object", - path="path_example", - ) # ResetCreation | - - # example passing only required values which don't have defaults set - try: - # reset branch - api_instance.reset_branch(repository, branch, reset_creation) - except lakefs_client.ApiException as e: - print("Exception when calling BranchesApi->reset_branch: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **str**| | - **branch** | **str**| | - **reset_creation** | [**ResetCreation**](ResetCreation.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[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) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | reset successful | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | - -[[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) - -# **revert_branch** -> revert_branch(repository, branch, revert_creation) - -revert - -### Example - -* Basic Authentication (basic_auth): -* Api Key Authentication (cookie_auth): -* Bearer (JWT) Authentication (jwt_token): -* Api Key Authentication (oidc_auth): -* Api Key Authentication (saml_auth): - -```python -import time -import lakefs_client -from lakefs_client.api import branches_api -from lakefs_client.model.revert_creation import RevertCreation -from lakefs_client.model.error import Error -from pprint import pprint -# Defining the host is optional and defaults to http://localhost/api/v1 -# See configuration.py for a list of all supported configuration parameters. -configuration = lakefs_client.Configuration( - host = "http://localhost/api/v1" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure HTTP basic authorization: basic_auth -configuration = lakefs_client.Configuration( - username = 'YOUR_USERNAME', - password = 'YOUR_PASSWORD' -) - -# Configure API key authorization: cookie_auth -configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['cookie_auth'] = 'Bearer' - -# Configure Bearer authorization (JWT): jwt_token -configuration = lakefs_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Configure API key authorization: oidc_auth -configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['oidc_auth'] = 'Bearer' - -# Configure API key authorization: saml_auth -configuration.api_key['saml_auth'] = 'YOUR_API_KEY' - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['saml_auth'] = 'Bearer' - -# Enter a context with an instance of the API client -with lakefs_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = branches_api.BranchesApi(api_client) - repository = "repository_example" # str | - branch = "branch_example" # str | - revert_creation = RevertCreation( - ref="ref_example", - parent_number=1, - ) # RevertCreation | - - # example passing only required values which don't have defaults set - try: - # revert - api_instance.revert_branch(repository, branch, revert_creation) - except lakefs_client.ApiException as e: - print("Exception when calling BranchesApi->revert_branch: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **str**| | - **branch** | **str**| | - **revert_creation** | [**RevertCreation**](RevertCreation.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[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) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**204** | revert successful | - | -**400** | Validation Error | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**409** | Conflict Found | - | -**0** | Internal Server Error | - | - -[[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) - diff --git a/clients/python/docs/CherryPickCreation.md b/clients/python/docs/CherryPickCreation.md deleted file mode 100644 index e5ca3dcd1c3..00000000000 --- a/clients/python/docs/CherryPickCreation.md +++ /dev/null @@ -1,13 +0,0 @@ -# CherryPickCreation - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ref** | **str** | the commit to cherry-pick, given by a ref | -**parent_number** | **int** | when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/clients/python/docs/apis/tags/BranchesApi.md b/clients/python/docs/apis/tags/BranchesApi.md index f45f75e6845..1586bc72ddd 100644 --- a/clients/python/docs/apis/tags/BranchesApi.md +++ b/clients/python/docs/apis/tags/BranchesApi.md @@ -5,6 +5,7 @@ All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**cherry_pick**](#cherry_pick) | **post** /repositories/{repository}/branches/{branch}/cherry-pick | Cherry-Pick the given reference commit into the given branch [**create_branch**](#create_branch) | **post** /repositories/{repository}/branches | create branch [**delete_branch**](#delete_branch) | **delete** /repositories/{repository}/branches/{branch} | delete branch [**diff_branch**](#diff_branch) | **get** /repositories/{repository}/branches/{branch}/diff | diff branch @@ -13,6 +14,219 @@ Method | HTTP request | Description [**reset_branch**](#reset_branch) | **put** /repositories/{repository}/branches/{branch} | reset branch [**revert_branch**](#revert_branch) | **post** /repositories/{repository}/branches/{branch}/revert | revert +# **cherry_pick** + +> cherry_pick(repositorybranchcherry_pick_creation) + +Cherry-Pick the given reference commit into the given branch + +### Example + +* Basic Authentication (basic_auth): +* Api Key Authentication (cookie_auth): +* Api Key Authentication (oidc_auth): +* Api Key Authentication (saml_auth): +* Bearer (JWT) Authentication (jwt_token): +```python +import lakefs_client +from lakefs_client.apis.tags import branches_api +from lakefs_client.model.error import Error +from lakefs_client.model.cherry_pick_creation import CherryPickCreation +from pprint import pprint +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = lakefs_client.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basic_auth +configuration = lakefs_client.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Configure API key authorization: cookie_auth +configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['cookie_auth'] = 'Bearer' + +# Configure API key authorization: oidc_auth +configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['oidc_auth'] = 'Bearer' + +# Configure API key authorization: saml_auth +configuration.api_key['saml_auth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['saml_auth'] = 'Bearer' + +# Configure Bearer authorization (JWT): jwt_token +configuration = lakefs_client.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) +# Enter a context with an instance of the API client +with lakefs_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = branches_api.BranchesApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'repository': "repository_example", + 'branch': "branch_example", + } + body = CherryPickCreation( + ref="ref_example", + parent_number=1, + ) + try: + # Cherry-Pick the given reference commit into the given branch + api_response = api_instance.cherry_pick( + path_params=path_params, + body=body, + ) + except lakefs_client.ApiException as e: + print("Exception when calling BranchesApi->cherry_pick: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +path_params | RequestPathParams | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +# SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**CherryPickCreation**](../../models/CherryPickCreation.md) | | + + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +repository | RepositorySchema | | +branch | BranchSchema | | + +# RepositorySchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# BranchSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +204 | [ApiResponseFor204](#cherry_pick.ApiResponseFor204) | successful cherry-pick +400 | [ApiResponseFor400](#cherry_pick.ApiResponseFor400) | Validation Error +401 | [ApiResponseFor401](#cherry_pick.ApiResponseFor401) | Unauthorized +404 | [ApiResponseFor404](#cherry_pick.ApiResponseFor404) | Resource Not Found +409 | [ApiResponseFor409](#cherry_pick.ApiResponseFor409) | Conflict Found +default | [ApiResponseForDefault](#cherry_pick.ApiResponseForDefault) | Internal Server Error + +#### cherry_pick.ApiResponseFor204 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +#### cherry_pick.ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor400ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor400ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Error**](../../models/Error.md) | | + + +#### cherry_pick.ApiResponseFor401 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor401ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor401ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Error**](../../models/Error.md) | | + + +#### cherry_pick.ApiResponseFor404 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor404ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor404ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Error**](../../models/Error.md) | | + + +#### cherry_pick.ApiResponseFor409 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor409ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor409ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Error**](../../models/Error.md) | | + + +#### cherry_pick.ApiResponseForDefault +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor0ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor0ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**Error**](../../models/Error.md) | | + + +### Authorization + +[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) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + # **create_branch** > str create_branch(repositorybranch_creation) diff --git a/clients/python/docs/models/CherryPickCreation.md b/clients/python/docs/models/CherryPickCreation.md new file mode 100644 index 00000000000..405323e4d61 --- /dev/null +++ b/clients/python/docs/models/CherryPickCreation.md @@ -0,0 +1,16 @@ +# lakefs_client.model.cherry_pick_creation.CherryPickCreation + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**ref** | str, | str, | the commit to cherry-pick, given by a ref | +**parent_number** | decimal.Decimal, int, | decimal.Decimal, | when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff. | [optional] +**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/clients/python/lakefs_client/api/branches_api.py b/clients/python/lakefs_client/api/branches_api.py deleted file mode 100644 index 798c91f26fb..00000000000 --- a/clients/python/lakefs_client/api/branches_api.py +++ /dev/null @@ -1,1165 +0,0 @@ -""" - lakeFS API - - lakeFS HTTP API # noqa: E501 - - The version of the OpenAPI document: 0.1.0 - Contact: services@treeverse.io - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from lakefs_client.api_client import ApiClient, Endpoint as _Endpoint -from lakefs_client.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from lakefs_client.model.branch_creation import BranchCreation -from lakefs_client.model.cherry_pick_creation import CherryPickCreation -from lakefs_client.model.diff_list import DiffList -from lakefs_client.model.error import Error -from lakefs_client.model.ref import Ref -from lakefs_client.model.ref_list import RefList -from lakefs_client.model.reset_creation import ResetCreation -from lakefs_client.model.revert_creation import RevertCreation - - -class BranchesApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - self.cherry_pick_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/repositories/{repository}/branches/{branch}/cherry-pick', - 'operation_id': 'cherry_pick', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'repository', - 'branch', - 'cherry_pick_creation', - ], - 'required': [ - 'repository', - 'branch', - 'cherry_pick_creation', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'repository': - (str,), - 'branch': - (str,), - 'cherry_pick_creation': - (CherryPickCreation,), - }, - 'attribute_map': { - 'repository': 'repository', - 'branch': 'branch', - }, - 'location_map': { - 'repository': 'path', - 'branch': 'path', - 'cherry_pick_creation': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.create_branch_endpoint = _Endpoint( - settings={ - 'response_type': (str,), - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/repositories/{repository}/branches', - 'operation_id': 'create_branch', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'repository', - 'branch_creation', - ], - 'required': [ - 'repository', - 'branch_creation', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'repository': - (str,), - 'branch_creation': - (BranchCreation,), - }, - 'attribute_map': { - 'repository': 'repository', - }, - 'location_map': { - 'repository': 'path', - 'branch_creation': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'text/html', - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.delete_branch_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/repositories/{repository}/branches/{branch}', - 'operation_id': 'delete_branch', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'repository', - 'branch', - ], - 'required': [ - 'repository', - 'branch', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'repository': - (str,), - 'branch': - (str,), - }, - 'attribute_map': { - 'repository': 'repository', - 'branch': 'branch', - }, - 'location_map': { - 'repository': 'path', - 'branch': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.diff_branch_endpoint = _Endpoint( - settings={ - 'response_type': (DiffList,), - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/repositories/{repository}/branches/{branch}/diff', - 'operation_id': 'diff_branch', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'repository', - 'branch', - 'after', - 'amount', - 'prefix', - 'delimiter', - ], - 'required': [ - 'repository', - 'branch', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'amount', - ] - }, - root_map={ - 'validations': { - ('amount',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': -1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'repository': - (str,), - 'branch': - (str,), - 'after': - (str,), - 'amount': - (int,), - 'prefix': - (str,), - 'delimiter': - (str,), - }, - 'attribute_map': { - 'repository': 'repository', - 'branch': 'branch', - 'after': 'after', - 'amount': 'amount', - 'prefix': 'prefix', - 'delimiter': 'delimiter', - }, - 'location_map': { - 'repository': 'path', - 'branch': 'path', - 'after': 'query', - 'amount': 'query', - 'prefix': 'query', - 'delimiter': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_branch_endpoint = _Endpoint( - settings={ - 'response_type': (Ref,), - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/repositories/{repository}/branches/{branch}', - 'operation_id': 'get_branch', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'repository', - 'branch', - ], - 'required': [ - 'repository', - 'branch', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'repository': - (str,), - 'branch': - (str,), - }, - 'attribute_map': { - 'repository': 'repository', - 'branch': 'branch', - }, - 'location_map': { - 'repository': 'path', - 'branch': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.list_branches_endpoint = _Endpoint( - settings={ - 'response_type': (RefList,), - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/repositories/{repository}/branches', - 'operation_id': 'list_branches', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'repository', - 'prefix', - 'after', - 'amount', - ], - 'required': [ - 'repository', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'amount', - ] - }, - root_map={ - 'validations': { - ('amount',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': -1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'repository': - (str,), - 'prefix': - (str,), - 'after': - (str,), - 'amount': - (int,), - }, - 'attribute_map': { - 'repository': 'repository', - 'prefix': 'prefix', - 'after': 'after', - 'amount': 'amount', - }, - 'location_map': { - 'repository': 'path', - 'prefix': 'query', - 'after': 'query', - 'amount': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.reset_branch_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/repositories/{repository}/branches/{branch}', - 'operation_id': 'reset_branch', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'repository', - 'branch', - 'reset_creation', - ], - 'required': [ - 'repository', - 'branch', - 'reset_creation', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'repository': - (str,), - 'branch': - (str,), - 'reset_creation': - (ResetCreation,), - }, - 'attribute_map': { - 'repository': 'repository', - 'branch': 'branch', - }, - 'location_map': { - 'repository': 'path', - 'branch': 'path', - 'reset_creation': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.revert_branch_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/repositories/{repository}/branches/{branch}/revert', - 'operation_id': 'revert_branch', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'repository', - 'branch', - 'revert_creation', - ], - 'required': [ - 'repository', - 'branch', - 'revert_creation', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'repository': - (str,), - 'branch': - (str,), - 'revert_creation': - (RevertCreation,), - }, - 'attribute_map': { - 'repository': 'repository', - 'branch': 'branch', - }, - 'location_map': { - 'repository': 'path', - 'branch': 'path', - 'revert_creation': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - - def cherry_pick( - self, - repository, - branch, - cherry_pick_creation, - **kwargs - ): - """Cherry-Pick the given reference commit into the given branch # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.cherry_pick(repository, branch, cherry_pick_creation, async_req=True) - >>> result = thread.get() - - Args: - repository (str): - branch (str): - cherry_pick_creation (CherryPickCreation): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['repository'] = \ - repository - kwargs['branch'] = \ - branch - kwargs['cherry_pick_creation'] = \ - cherry_pick_creation - return self.cherry_pick_endpoint.call_with_http_info(**kwargs) - - def create_branch( - self, - repository, - branch_creation, - **kwargs - ): - """create branch # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_branch(repository, branch_creation, async_req=True) - >>> result = thread.get() - - Args: - repository (str): - branch_creation (BranchCreation): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['repository'] = \ - repository - kwargs['branch_creation'] = \ - branch_creation - return self.create_branch_endpoint.call_with_http_info(**kwargs) - - def delete_branch( - self, - repository, - branch, - **kwargs - ): - """delete branch # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_branch(repository, branch, async_req=True) - >>> result = thread.get() - - Args: - repository (str): - branch (str): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['repository'] = \ - repository - kwargs['branch'] = \ - branch - return self.delete_branch_endpoint.call_with_http_info(**kwargs) - - def diff_branch( - self, - repository, - branch, - **kwargs - ): - """diff branch # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.diff_branch(repository, branch, async_req=True) - >>> result = thread.get() - - Args: - repository (str): - branch (str): - - Keyword Args: - after (str): return items after this value. [optional] - amount (int): how many items to return. [optional] if omitted the server will use the default value of 100 - prefix (str): return items prefixed with this value. [optional] - delimiter (str): delimiter used to group common prefixes by. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - DiffList - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['repository'] = \ - repository - kwargs['branch'] = \ - branch - return self.diff_branch_endpoint.call_with_http_info(**kwargs) - - def get_branch( - self, - repository, - branch, - **kwargs - ): - """get branch # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_branch(repository, branch, async_req=True) - >>> result = thread.get() - - Args: - repository (str): - branch (str): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Ref - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['repository'] = \ - repository - kwargs['branch'] = \ - branch - return self.get_branch_endpoint.call_with_http_info(**kwargs) - - def list_branches( - self, - repository, - **kwargs - ): - """list branches # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_branches(repository, async_req=True) - >>> result = thread.get() - - Args: - repository (str): - - Keyword Args: - prefix (str): return items prefixed with this value. [optional] - after (str): return items after this value. [optional] - amount (int): how many items to return. [optional] if omitted the server will use the default value of 100 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - RefList - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['repository'] = \ - repository - return self.list_branches_endpoint.call_with_http_info(**kwargs) - - def reset_branch( - self, - repository, - branch, - reset_creation, - **kwargs - ): - """reset branch # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.reset_branch(repository, branch, reset_creation, async_req=True) - >>> result = thread.get() - - Args: - repository (str): - branch (str): - reset_creation (ResetCreation): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['repository'] = \ - repository - kwargs['branch'] = \ - branch - kwargs['reset_creation'] = \ - reset_creation - return self.reset_branch_endpoint.call_with_http_info(**kwargs) - - def revert_branch( - self, - repository, - branch, - revert_creation, - **kwargs - ): - """revert # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.revert_branch(repository, branch, revert_creation, async_req=True) - >>> result = thread.get() - - Args: - repository (str): - branch (str): - revert_creation (RevertCreation): - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['repository'] = \ - repository - kwargs['branch'] = \ - branch - kwargs['revert_creation'] = \ - revert_creation - return self.revert_branch_endpoint.call_with_http_info(**kwargs) - diff --git a/clients/python/lakefs_client/apis/path_to_api.py b/clients/python/lakefs_client/apis/path_to_api.py index 7257e168d32..bec468d73ef 100644 --- a/clients/python/lakefs_client/apis/path_to_api.py +++ b/clients/python/lakefs_client/apis/path_to_api.py @@ -35,6 +35,7 @@ from lakefs_client.apis.paths.repositories_repository_branches_branch_commits import RepositoriesRepositoryBranchesBranchCommits from lakefs_client.apis.paths.repositories_repository_branches_branch import RepositoriesRepositoryBranchesBranch from lakefs_client.apis.paths.repositories_repository_branches_branch_revert import RepositoriesRepositoryBranchesBranchRevert +from lakefs_client.apis.paths.repositories_repository_branches_branch_cherry_pick import RepositoriesRepositoryBranchesBranchCherryPick from lakefs_client.apis.paths.repositories_repository_refs_source_ref_merge_destination_branch import RepositoriesRepositoryRefsSourceRefMergeDestinationBranch from lakefs_client.apis.paths.repositories_repository_branches_branch_diff import RepositoriesRepositoryBranchesBranchDiff from lakefs_client.apis.paths.repositories_repository_refs_left_ref_diff_right_ref import RepositoriesRepositoryRefsLeftRefDiffRightRef @@ -104,6 +105,7 @@ PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_COMMITS: RepositoriesRepositoryBranchesBranchCommits, PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH: RepositoriesRepositoryBranchesBranch, PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_REVERT: RepositoriesRepositoryBranchesBranchRevert, + PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_CHERRYPICK: RepositoriesRepositoryBranchesBranchCherryPick, PathValues.REPOSITORIES_REPOSITORY_REFS_SOURCE_REF_MERGE_DESTINATION_BRANCH: RepositoriesRepositoryRefsSourceRefMergeDestinationBranch, PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_DIFF: RepositoriesRepositoryBranchesBranchDiff, PathValues.REPOSITORIES_REPOSITORY_REFS_LEFT_REF_DIFF_RIGHT_REF: RepositoriesRepositoryRefsLeftRefDiffRightRef, @@ -174,6 +176,7 @@ PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_COMMITS: RepositoriesRepositoryBranchesBranchCommits, PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH: RepositoriesRepositoryBranchesBranch, PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_REVERT: RepositoriesRepositoryBranchesBranchRevert, + PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_CHERRYPICK: RepositoriesRepositoryBranchesBranchCherryPick, PathValues.REPOSITORIES_REPOSITORY_REFS_SOURCE_REF_MERGE_DESTINATION_BRANCH: RepositoriesRepositoryRefsSourceRefMergeDestinationBranch, PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_DIFF: RepositoriesRepositoryBranchesBranchDiff, PathValues.REPOSITORIES_REPOSITORY_REFS_LEFT_REF_DIFF_RIGHT_REF: RepositoriesRepositoryRefsLeftRefDiffRightRef, diff --git a/clients/python/lakefs_client/apis/paths/repositories_repository_branches_branch_cherry_pick.py b/clients/python/lakefs_client/apis/paths/repositories_repository_branches_branch_cherry_pick.py new file mode 100644 index 00000000000..467da0e20ca --- /dev/null +++ b/clients/python/lakefs_client/apis/paths/repositories_repository_branches_branch_cherry_pick.py @@ -0,0 +1,7 @@ +from lakefs_client.paths.repositories_repository_branches_branch_cherry_pick.post import ApiForpost + + +class RepositoriesRepositoryBranchesBranchCherryPick( + ApiForpost, +): + pass diff --git a/clients/python/lakefs_client/apis/tags/branches_api.py b/clients/python/lakefs_client/apis/tags/branches_api.py index f010318b557..7dd0dc10d27 100644 --- a/clients/python/lakefs_client/apis/tags/branches_api.py +++ b/clients/python/lakefs_client/apis/tags/branches_api.py @@ -10,6 +10,7 @@ Generated by: https://openapi-generator.tech """ +from lakefs_client.paths.repositories_repository_branches_branch_cherry_pick.post import CherryPick from lakefs_client.paths.repositories_repository_branches.post import CreateBranch from lakefs_client.paths.repositories_repository_branches_branch.delete import DeleteBranch from lakefs_client.paths.repositories_repository_branches_branch_diff.get import DiffBranch @@ -20,6 +21,7 @@ class BranchesApi( + CherryPick, CreateBranch, DeleteBranch, DiffBranch, diff --git a/clients/python/lakefs_client/model/cherry_pick_creation.py b/clients/python/lakefs_client/model/cherry_pick_creation.py index 256f0359acc..4c0d342ba18 100644 --- a/clients/python/lakefs_client/model/cherry_pick_creation.py +++ b/clients/python/lakefs_client/model/cherry_pick_creation.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ lakeFS API @@ -8,259 +10,85 @@ Generated by: https://openapi-generator.tech """ - +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 import re # noqa: F401 -import sys # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 -from lakefs_client.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, -) -from ..model_utils import OpenApiModel -from lakefs_client.exceptions import ApiAttributeError +import frozendict # noqa: F401 +from lakefs_client import schemas # noqa: F401 -class CherryPickCreation(ModelNormal): +class CherryPickCreation( + schemas.DictSchema +): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. """ - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'ref': (str,), # noqa: E501 - 'parent_number': (int,), # noqa: E501 + class MetaOapg: + required = { + "ref", } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'ref': 'ref', # noqa: E501 - 'parent_number': 'parent_number', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, ref, *args, **kwargs): # noqa: E501 - """CherryPickCreation - a model defined in OpenAPI - - Args: - ref (str): the commit to cherry-pick, given by a ref - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - parent_number (int): when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.ref = ref - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, ref, *args, **kwargs): # noqa: E501 - """CherryPickCreation - a model defined in OpenAPI - - Args: - ref (str): the commit to cherry-pick, given by a ref - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - parent_number (int): when cherry-picking a merge commit, the parent number (starting from 1) relative to which to perform the diff.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.ref = ref - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + + class properties: + ref = schemas.StrSchema + parent_number = schemas.IntSchema + __annotations__ = { + "ref": ref, + "parent_number": parent_number, + } + + ref: MetaOapg.properties.ref + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["ref"]) -> MetaOapg.properties.ref: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["parent_number"]) -> MetaOapg.properties.parent_number: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["ref", "parent_number", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["ref"]) -> MetaOapg.properties.ref: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["parent_number"]) -> typing.Union[MetaOapg.properties.parent_number, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["ref", "parent_number", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + ref: typing.Union[MetaOapg.properties.ref, str, ], + parent_number: typing.Union[MetaOapg.properties.parent_number, decimal.Decimal, int, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'CherryPickCreation': + return super().__new__( + cls, + *_args, + ref=ref, + parent_number=parent_number, + _configuration=_configuration, + **kwargs, + ) diff --git a/clients/python/lakefs_client/model/cherry_pick_creation.pyi b/clients/python/lakefs_client/model/cherry_pick_creation.pyi new file mode 100644 index 00000000000..4c0d342ba18 --- /dev/null +++ b/clients/python/lakefs_client/model/cherry_pick_creation.pyi @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + lakeFS API + + lakeFS HTTP API # noqa: E501 + + The version of the OpenAPI document: 0.1.0 + Contact: services@treeverse.io + Generated by: https://openapi-generator.tech +""" + +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from lakefs_client import schemas # noqa: F401 + + +class CherryPickCreation( + schemas.DictSchema +): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + + class MetaOapg: + required = { + "ref", + } + + class properties: + ref = schemas.StrSchema + parent_number = schemas.IntSchema + __annotations__ = { + "ref": ref, + "parent_number": parent_number, + } + + ref: MetaOapg.properties.ref + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["ref"]) -> MetaOapg.properties.ref: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["parent_number"]) -> MetaOapg.properties.parent_number: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["ref", "parent_number", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["ref"]) -> MetaOapg.properties.ref: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["parent_number"]) -> typing.Union[MetaOapg.properties.parent_number, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... + + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["ref", "parent_number", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + ref: typing.Union[MetaOapg.properties.ref, str, ], + parent_number: typing.Union[MetaOapg.properties.parent_number, decimal.Decimal, int, schemas.Unset] = schemas.unset, + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], + ) -> 'CherryPickCreation': + return super().__new__( + cls, + *_args, + ref=ref, + parent_number=parent_number, + _configuration=_configuration, + **kwargs, + ) diff --git a/clients/python/lakefs_client/paths/__init__.py b/clients/python/lakefs_client/paths/__init__.py index cbc204d2bd7..4f3a4e327f9 100644 --- a/clients/python/lakefs_client/paths/__init__.py +++ b/clients/python/lakefs_client/paths/__init__.py @@ -40,6 +40,7 @@ class PathValues(str, enum.Enum): REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_COMMITS = "/repositories/{repository}/branches/{branch}/commits" REPOSITORIES_REPOSITORY_BRANCHES_BRANCH = "/repositories/{repository}/branches/{branch}" REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_REVERT = "/repositories/{repository}/branches/{branch}/revert" + REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_CHERRYPICK = "/repositories/{repository}/branches/{branch}/cherry-pick" REPOSITORIES_REPOSITORY_REFS_SOURCE_REF_MERGE_DESTINATION_BRANCH = "/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}" REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_DIFF = "/repositories/{repository}/branches/{branch}/diff" REPOSITORIES_REPOSITORY_REFS_LEFT_REF_DIFF_RIGHT_REF = "/repositories/{repository}/refs/{leftRef}/diff/{rightRef}" diff --git a/clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/__init__.py b/clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/__init__.py new file mode 100644 index 00000000000..8349efb7946 --- /dev/null +++ b/clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from lakefs_client.paths.repositories_repository_branches_branch_cherry_pick import Api + +from lakefs_client.paths import PathValues + +path = PathValues.REPOSITORIES_REPOSITORY_BRANCHES_BRANCH_CHERRYPICK \ No newline at end of file diff --git a/clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/post.py b/clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/post.py new file mode 100644 index 00000000000..8880c69dea1 --- /dev/null +++ b/clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/post.py @@ -0,0 +1,514 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from lakefs_client import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from lakefs_client import schemas # noqa: F401 + +from lakefs_client.model.error import Error +from lakefs_client.model.cherry_pick_creation import CherryPickCreation + +from . import path + +# Path params +RepositorySchema = schemas.StrSchema +BranchSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'repository': typing.Union[RepositorySchema, str, ], + 'branch': typing.Union[BranchSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_repository = api_client.PathParameter( + name="repository", + style=api_client.ParameterStyle.SIMPLE, + schema=RepositorySchema, + required=True, +) +request_path_branch = api_client.PathParameter( + name="branch", + style=api_client.ParameterStyle.SIMPLE, + schema=BranchSchema, + required=True, +) +# body param +SchemaForRequestBodyApplicationJson = CherryPickCreation + + +request_body_cherry_pick_creation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) +_auth = [ + 'basic_auth', + 'cookie_auth', + 'oidc_auth', + 'saml_auth', + 'jwt_token', +] + + +@dataclass +class ApiResponseFor204(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_204 = api_client.OpenApiResponse( + response_cls=ApiResponseFor204, +) +SchemaFor400ResponseBodyApplicationJson = Error + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor400ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor400ResponseBodyApplicationJson), + }, +) +SchemaFor401ResponseBodyApplicationJson = Error + + +@dataclass +class ApiResponseFor401(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor401ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_401 = api_client.OpenApiResponse( + response_cls=ApiResponseFor401, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor401ResponseBodyApplicationJson), + }, +) +SchemaFor404ResponseBodyApplicationJson = Error + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor404ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor404ResponseBodyApplicationJson), + }, +) +SchemaFor409ResponseBodyApplicationJson = Error + + +@dataclass +class ApiResponseFor409(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor409ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_409 = api_client.OpenApiResponse( + response_cls=ApiResponseFor409, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor409ResponseBodyApplicationJson), + }, +) +SchemaFor0ResponseBodyApplicationJson = Error + + +@dataclass +class ApiResponseForDefault(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor0ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_default = api_client.OpenApiResponse( + response_cls=ApiResponseForDefault, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor0ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '204': _response_for_204, + '400': _response_for_400, + '401': _response_for_401, + '404': _response_for_404, + '409': _response_for_409, + 'default': _response_for_default, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _cherry_pick_oapg( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: typing_extensions.Literal["application/json"] = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + @typing.overload + def _cherry_pick_oapg( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + + @typing.overload + def _cherry_pick_oapg( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _cherry_pick_oapg( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _cherry_pick_oapg( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = 'application/json', + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Cherry-Pick the given reference commit into the given branch + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_repository, + request_path_branch, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_cherry_pick_creation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + default_response = _status_code_to_response.get('default') + if default_response: + api_response = default_response.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class CherryPick(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def cherry_pick( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: typing_extensions.Literal["application/json"] = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + @typing.overload + def cherry_pick( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + + @typing.overload + def cherry_pick( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def cherry_pick( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def cherry_pick( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = 'application/json', + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._cherry_pick_oapg( + body=body, + path_params=path_params, + content_type=content_type, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: typing_extensions.Literal["application/json"] = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + @typing.overload + def post( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + + @typing.overload + def post( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = 'application/json', + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._cherry_pick_oapg( + body=body, + path_params=path_params, + content_type=content_type, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/post.pyi b/clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/post.pyi new file mode 100644 index 00000000000..e61ef407fca --- /dev/null +++ b/clients/python/lakefs_client/paths/repositories_repository_branches_branch_cherry_pick/post.pyi @@ -0,0 +1,497 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from lakefs_client import api_client, exceptions +from datetime import date, datetime # noqa: F401 +import decimal # noqa: F401 +import functools # noqa: F401 +import io # noqa: F401 +import re # noqa: F401 +import typing # noqa: F401 +import typing_extensions # noqa: F401 +import uuid # noqa: F401 + +import frozendict # noqa: F401 + +from lakefs_client import schemas # noqa: F401 + +from lakefs_client.model.error import Error +from lakefs_client.model.cherry_pick_creation import CherryPickCreation + +# Path params +RepositorySchema = schemas.StrSchema +BranchSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'repository': typing.Union[RepositorySchema, str, ], + 'branch': typing.Union[BranchSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_repository = api_client.PathParameter( + name="repository", + style=api_client.ParameterStyle.SIMPLE, + schema=RepositorySchema, + required=True, +) +request_path_branch = api_client.PathParameter( + name="branch", + style=api_client.ParameterStyle.SIMPLE, + schema=BranchSchema, + required=True, +) +# body param +SchemaForRequestBodyApplicationJson = CherryPickCreation + + +request_body_cherry_pick_creation = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, + required=True, +) + + +@dataclass +class ApiResponseFor204(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_204 = api_client.OpenApiResponse( + response_cls=ApiResponseFor204, +) +SchemaFor400ResponseBodyApplicationJson = Error + + +@dataclass +class ApiResponseFor400(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor400ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_400 = api_client.OpenApiResponse( + response_cls=ApiResponseFor400, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor400ResponseBodyApplicationJson), + }, +) +SchemaFor401ResponseBodyApplicationJson = Error + + +@dataclass +class ApiResponseFor401(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor401ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_401 = api_client.OpenApiResponse( + response_cls=ApiResponseFor401, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor401ResponseBodyApplicationJson), + }, +) +SchemaFor404ResponseBodyApplicationJson = Error + + +@dataclass +class ApiResponseFor404(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor404ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_404 = api_client.OpenApiResponse( + response_cls=ApiResponseFor404, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor404ResponseBodyApplicationJson), + }, +) +SchemaFor409ResponseBodyApplicationJson = Error + + +@dataclass +class ApiResponseFor409(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor409ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_409 = api_client.OpenApiResponse( + response_cls=ApiResponseFor409, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor409ResponseBodyApplicationJson), + }, +) +SchemaFor0ResponseBodyApplicationJson = Error + + +@dataclass +class ApiResponseForDefault(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor0ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_default = api_client.OpenApiResponse( + response_cls=ApiResponseForDefault, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor0ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _cherry_pick_oapg( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: typing_extensions.Literal["application/json"] = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + @typing.overload + def _cherry_pick_oapg( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + + @typing.overload + def _cherry_pick_oapg( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _cherry_pick_oapg( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _cherry_pick_oapg( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = 'application/json', + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Cherry-Pick the given reference commit into the given branch + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_repository, + request_path_branch, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + if body is schemas.unset: + raise exceptions.ApiValueError( + 'The required body parameter has an invalid value of: unset. Set a valid value instead') + _fields = None + _body = None + serialized_data = request_body_cherry_pick_creation.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + default_response = _status_code_to_response.get('default') + if default_response: + api_response = default_response.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class CherryPick(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def cherry_pick( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: typing_extensions.Literal["application/json"] = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + @typing.overload + def cherry_pick( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + + @typing.overload + def cherry_pick( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def cherry_pick( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def cherry_pick( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = 'application/json', + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._cherry_pick_oapg( + body=body, + path_params=path_params, + content_type=content_type, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: typing_extensions.Literal["application/json"] = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + @typing.overload + def post( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + ]: ... + + + @typing.overload + def post( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = ..., + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor204, + ApiResponseForDefault, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + body: typing.Union[SchemaForRequestBodyApplicationJson,], + content_type: str = 'application/json', + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._cherry_pick_oapg( + body=body, + path_params=path_params, + content_type=content_type, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + diff --git a/clients/python/test/test_branches_api.py b/clients/python/test/test_branches_api.py deleted file mode 100644 index 0a645933bbb..00000000000 --- a/clients/python/test/test_branches_api.py +++ /dev/null @@ -1,85 +0,0 @@ -""" - lakeFS API - - lakeFS HTTP API # noqa: E501 - - The version of the OpenAPI document: 0.1.0 - Contact: services@treeverse.io - Generated by: https://openapi-generator.tech -""" - - -import unittest - -import lakefs_client -from lakefs_client.api.branches_api import BranchesApi # noqa: E501 - - -class TestBranchesApi(unittest.TestCase): - """BranchesApi unit test stubs""" - - def setUp(self): - self.api = BranchesApi() # noqa: E501 - - def tearDown(self): - pass - - def test_cherry_pick(self): - """Test case for cherry_pick - - Cherry-Pick the given reference commit into the given branch # noqa: E501 - """ - pass - - def test_create_branch(self): - """Test case for create_branch - - create branch # noqa: E501 - """ - pass - - def test_delete_branch(self): - """Test case for delete_branch - - delete branch # noqa: E501 - """ - pass - - def test_diff_branch(self): - """Test case for diff_branch - - diff branch # noqa: E501 - """ - pass - - def test_get_branch(self): - """Test case for get_branch - - get branch # noqa: E501 - """ - pass - - def test_list_branches(self): - """Test case for list_branches - - list branches # noqa: E501 - """ - pass - - def test_reset_branch(self): - """Test case for reset_branch - - reset branch # noqa: E501 - """ - pass - - def test_revert_branch(self): - """Test case for revert_branch - - revert # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/clients/python/test/test_cherry_pick_creation.py b/clients/python/test/test_models/test_cherry_pick_creation.py similarity index 59% rename from clients/python/test/test_cherry_pick_creation.py rename to clients/python/test/test_models/test_cherry_pick_creation.py index a725c5e37ff..cb2aa092ef7 100644 --- a/clients/python/test/test_cherry_pick_creation.py +++ b/clients/python/test/test_models/test_cherry_pick_creation.py @@ -1,3 +1,5 @@ +# coding: utf-8 + """ lakeFS API @@ -8,28 +10,16 @@ Generated by: https://openapi-generator.tech """ - -import sys import unittest import lakefs_client from lakefs_client.model.cherry_pick_creation import CherryPickCreation +from lakefs_client import configuration class TestCherryPickCreation(unittest.TestCase): """CherryPickCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCherryPickCreation(self): - """Test CherryPickCreation""" - # FIXME: construct object with mandatory attributes with example values - # model = CherryPickCreation() # noqa: E501 - pass + _configuration = configuration.Configuration() if __name__ == '__main__': diff --git a/clients/python/test/test_paths/test_repositories_repository_branches_branch_cherry_pick/__init__.py b/clients/python/test/test_paths/test_repositories_repository_branches_branch_cherry_pick/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/clients/python/test/test_paths/test_repositories_repository_branches_branch_cherry_pick/test_post.py b/clients/python/test/test_paths/test_repositories_repository_branches_branch_cherry_pick/test_post.py new file mode 100644 index 00000000000..087ad425d3f --- /dev/null +++ b/clients/python/test/test_paths/test_repositories_repository_branches_branch_cherry_pick/test_post.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import lakefs_client +from lakefs_client.paths.repositories_repository_branches_branch_cherry_pick import post # noqa: E501 +from lakefs_client import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestRepositoriesRepositoryBranchesBranchCherryPick(ApiTestMixin, unittest.TestCase): + """ + RepositoriesRepositoryBranchesBranchCherryPick unit test stubs + Cherry-Pick the given reference commit into the given branch # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 204 + response_body = '' + + + + +if __name__ == '__main__': + unittest.main() diff --git a/cmd/lakectl/cmd/cherry_pick.go b/cmd/lakectl/cmd/cherry_pick.go index 168f69cfc23..7b24f32409f 100644 --- a/cmd/lakectl/cmd/cherry_pick.go +++ b/cmd/lakectl/cmd/cherry_pick.go @@ -15,7 +15,7 @@ const ( // lakectl cherry-pick lakefs://myrepo/main lakefs://myrepo/some-ref var cherryPick = &cobra.Command{ Use: "cherry-pick ", - Short: "cherry-pick a ref into a branch", + Short: "Cherry-Pick a ref into a branch", Long: "The commit will be applied to the branch as a new commit", Example: `lakectl cherry-pick lakefs://myrepo/main lakefs://myrepo/some-ref Cherry picks the commit represented by some-ref into the main branch diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 74ae0770a52..5fea99200c7 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -1591,7 +1591,7 @@ lakectl cat-sst [flags] ### lakectl cherry-pick -cherry-pick a ref into a branch +Cherry-Pick a ref into a branch #### Synopsis {:.no_toc} diff --git a/esti/lakectl_test.go b/esti/lakectl_test.go index 80661056582..4abe589e836 100644 --- a/esti/lakectl_test.go +++ b/esti/lakectl_test.go @@ -529,3 +529,52 @@ func TestLakectlImport(t *testing.T) { RunCmdAndVerifySuccessWithFile(t, Lakectl()+" import --no-progress --from "+from+" --to lakefs://"+repoName+"/"+mainBranch+"/too/ --message \"import too\"", false, "lakectl_import_with_message", vars) RunCmdAndVerifySuccessWithFile(t, Lakectl()+" import --no-progress --from "+from+" --to lakefs://"+repoName+"/"+mainBranch+"/another/import/ --merge", false, "lakectl_import_and_merge", vars) } + +func TestLakectlCherryPick(t *testing.T) { + SkipTestIfAskedTo(t) + repoName := generateUniqueRepositoryName() + storage := generateUniqueStorageNamespace(repoName) + vars := map[string]string{ + "REPO": repoName, + "STORAGE": storage, + "BRANCH": mainBranch, + } + RunCmdAndVerifySuccessWithFile(t, Lakectl()+" repo create lakefs://"+repoName+" "+storage, false, "lakectl_repo_create", vars) + + // upload some data + const totalObjects = 2 + for i := 0; i < totalObjects; i++ { + vars["FILE_PATH"] = fmt.Sprintf("data/ro/ro_1k.%d", i) + RunCmdAndVerifySuccessWithFile(t, Lakectl()+" fs upload -s files/ro_1k lakefs://"+repoName+"/"+mainBranch+"/"+vars["FILE_PATH"], false, "lakectl_fs_upload", vars) + } + + t.Run("default", func(t *testing.T) { + RunCmdAndVerifySuccessWithFile(t, Lakectl()+" fs stat lakefs://"+repoName+"/"+mainBranch+"/data/ro/ro_1k.0", false, "lakectl_stat_default", map[string]string{ + "REPO": repoName, + "STORAGE": storage, + "BRANCH": mainBranch, + "PATH": "data/ro", + "FILE": "ro_1k.0", + }) + }) + + t.Run("pre-sign", func(t *testing.T) { + storageResp, err := client.GetStorageConfigWithResponse(context.Background()) + if err != nil { + t.Fatalf("GetStorageConfig failed: %s", err) + } + if storageResp.JSON200 == nil { + t.Fatalf("GetStorageConfig failed with stats: %s", storageResp.Status()) + } + if !storageResp.JSON200.PreSignSupport { + t.Skip("No pre-sign support for this storage") + } + RunCmdAndVerifySuccessWithFile(t, Lakectl()+" fs stat --pre-sign lakefs://"+repoName+"/"+mainBranch+"/data/ro/ro_1k.1", false, "lakectl_stat_pre_sign", map[string]string{ + "REPO": repoName, + "STORAGE": storage, + "BRANCH": mainBranch, + "PATH": "data/ro", + "FILE": "ro_1k.1", + }) + }) +} From a37ec94fd3ae71ea0a95fadc8fa675db8ea5f84e Mon Sep 17 00:00:00 2001 From: Itai Admi Date: Thu, 16 Mar 2023 14:51:27 +0200 Subject: [PATCH 5/8] Add lakectl golden tests --- cmd/lakectl/cmd/cherry_pick.go | 10 ++-- esti/golden/lakectl_cherry_pick.golden | 8 +++ esti/lakectl_test.go | 72 +++++++++++++++++--------- pkg/api/controller_test.go | 14 +++++ 4 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 esti/golden/lakectl_cherry_pick.golden diff --git a/cmd/lakectl/cmd/cherry_pick.go b/cmd/lakectl/cmd/cherry_pick.go index 7b24f32409f..6ed36f8e24e 100644 --- a/cmd/lakectl/cmd/cherry_pick.go +++ b/cmd/lakectl/cmd/cherry_pick.go @@ -36,14 +36,18 @@ var cherryPick = &cobra.Command{ } hasParentNumber := cmd.Flags().Changed(ParentNumberFlagName) parentNumber, _ := cmd.Flags().GetInt(ParentNumberFlagName) - if hasParentNumber && parentNumber <= 0 { - Die("parent number must be non-negative, if specified", 1) + if hasParentNumber { + if parentNumber <= 0 { + Die("parent number must be non-negative, if specified", 1) + } + } else { + parentNumber = 1 } clt := getClient() resp, err := clt.CherryPickWithResponse(cmd.Context(), branch.Repository, branch.Ref, api.CherryPickJSONRequestBody{ Ref: ref.Ref, - ParentNumber: &parentNumber, // TODO: handle default value 0 + ParentNumber: &parentNumber, }) DieOnErrorOrUnexpectedStatusCode(resp, err, http.StatusNoContent) diff --git a/esti/golden/lakectl_cherry_pick.golden b/esti/golden/lakectl_cherry_pick.golden new file mode 100644 index 00000000000..283923c6d02 --- /dev/null +++ b/esti/golden/lakectl_cherry_pick.golden @@ -0,0 +1,8 @@ +Branch: lakefs://${REPO}/${BRANCH} +Commit for branch "${BRANCH}" completed. + +ID: +Message: ${MESSAGE} +Timestamp: