diff --git a/api/swagger.yml b/api/swagger.yml index 3b9ebba8be6..291499d100d 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -3810,7 +3810,7 @@ paths: description: path to the table data post: tags: - - metadata + - internal operationId: createSymlinkFile summary: creates symlink files corresponding to the given directory diff --git a/clients/java/README.md b/clients/java/README.md index 441a6dcf064..b2ca82ec224 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -190,6 +190,7 @@ Class | Method | HTTP request | Description *ImportApi* | [**importStart**](docs/ImportApi.md#importStart) | **POST** /repositories/{repository}/branches/{branch}/import | import data from object store *ImportApi* | [**importStatus**](docs/ImportApi.md#importStatus) | **GET** /repositories/{repository}/branches/{branch}/import | get import status *InternalApi* | [**createBranchProtectionRulePreflight**](docs/InternalApi.md#createBranchProtectionRulePreflight) | **GET** /repositories/{repository}/branch_protection/set_allowed | +*InternalApi* | [**createSymlinkFile**](docs/InternalApi.md#createSymlinkFile) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory *InternalApi* | [**getAuthCapabilities**](docs/InternalApi.md#getAuthCapabilities) | **GET** /auth/capabilities | list authentication capabilities supported *InternalApi* | [**getSetupState**](docs/InternalApi.md#getSetupState) | **GET** /setup_lakefs | check if the lakeFS installation is already set up *InternalApi* | [**postStatsEvents**](docs/InternalApi.md#postStatsEvents) | **POST** /statistics | post stats events, this endpoint is meant for internal use only @@ -197,7 +198,6 @@ Class | Method | HTTP request | Description *InternalApi* | [**setup**](docs/InternalApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user *InternalApi* | [**setupCommPrefs**](docs/InternalApi.md#setupCommPrefs) | **POST** /setup_comm_prefs | setup communications preferences *InternalApi* | [**uploadObjectPreflight**](docs/InternalApi.md#uploadObjectPreflight) | **GET** /repositories/{repository}/branches/{branch}/objects/stage_allowed | -*MetadataApi* | [**createSymlinkFile**](docs/MetadataApi.md#createSymlinkFile) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory *MetadataApi* | [**getMetaRange**](docs/MetadataApi.md#getMetaRange) | **GET** /repositories/{repository}/metadata/meta_range/{meta_range} | return URI to a meta-range file *MetadataApi* | [**getRange**](docs/MetadataApi.md#getRange) | **GET** /repositories/{repository}/metadata/range/{range} | return URI to a range file *ObjectsApi* | [**copyObject**](docs/ObjectsApi.md#copyObject) | **POST** /repositories/{repository}/branches/{branch}/objects/copy | create a copy of an object diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index 1c53abe4a5d..939d4d31d5f 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -4418,7 +4418,7 @@ paths: description: Internal Server Error summary: creates symlink files corresponding to the given directory tags: - - metadata + - internal x-accepts: application/json /repositories/{repository}/actions/runs: get: diff --git a/clients/java/docs/InternalApi.md b/clients/java/docs/InternalApi.md index 9471c000d80..3e631593959 100644 --- a/clients/java/docs/InternalApi.md +++ b/clients/java/docs/InternalApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- [**createBranchProtectionRulePreflight**](InternalApi.md#createBranchProtectionRulePreflight) | **GET** /repositories/{repository}/branch_protection/set_allowed | +[**createSymlinkFile**](InternalApi.md#createSymlinkFile) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory [**getAuthCapabilities**](InternalApi.md#getAuthCapabilities) | **GET** /auth/capabilities | list authentication capabilities supported [**getSetupState**](InternalApi.md#getSetupState) | **GET** /setup_lakefs | check if the lakeFS installation is already set up [**postStatsEvents**](InternalApi.md#postStatsEvents) | **POST** /statistics | post stats events, this endpoint is meant for internal use only @@ -105,6 +106,101 @@ null (empty response body) **409** | Resource Conflicts With Target | - | **0** | Internal Server Error | - | + +# **createSymlinkFile** +> StorageURI createSymlinkFile(repository, branch, location) + +creates symlink files corresponding to the given directory + +### 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.InternalApi; + +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"); + + InternalApi apiInstance = new InternalApi(defaultClient); + String repository = "repository_example"; // String | + String branch = "branch_example"; // String | + String location = "location_example"; // String | path to the table data + try { + StorageURI result = apiInstance.createSymlinkFile(repository, branch, location); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#createSymlinkFile"); + 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**| | + **location** | **String**| path to the table data | [optional] + +### Return type + +[**StorageURI**](StorageURI.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 | +|-------------|-------------|------------------| +**201** | location created | - | +**401** | Unauthorized | - | +**404** | Resource Not Found | - | +**0** | Internal Server Error | - | + # **getAuthCapabilities** > AuthCapabilities getAuthCapabilities() diff --git a/clients/java/docs/MetadataApi.md b/clients/java/docs/MetadataApi.md index d9f666f7c27..f4d70ba1d10 100644 --- a/clients/java/docs/MetadataApi.md +++ b/clients/java/docs/MetadataApi.md @@ -4,106 +4,10 @@ All URIs are relative to *http://localhost/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createSymlinkFile**](MetadataApi.md#createSymlinkFile) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory [**getMetaRange**](MetadataApi.md#getMetaRange) | **GET** /repositories/{repository}/metadata/meta_range/{meta_range} | return URI to a meta-range file [**getRange**](MetadataApi.md#getRange) | **GET** /repositories/{repository}/metadata/range/{range} | return URI to a range file - -# **createSymlinkFile** -> StorageURI createSymlinkFile(repository, branch, location) - -creates symlink files corresponding to the given directory - -### 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.MetadataApi; - -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"); - - MetadataApi apiInstance = new MetadataApi(defaultClient); - String repository = "repository_example"; // String | - String branch = "branch_example"; // String | - String location = "location_example"; // String | path to the table data - try { - StorageURI result = apiInstance.createSymlinkFile(repository, branch, location); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling MetadataApi#createSymlinkFile"); - 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**| | - **location** | **String**| path to the table data | [optional] - -### Return type - -[**StorageURI**](StorageURI.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 | -|-------------|-------------|------------------| -**201** | location created | - | -**401** | Unauthorized | - | -**404** | Resource Not Found | - | -**0** | Internal Server Error | - | - # **getMetaRange** > StorageURI getMetaRange(repository, metaRange) diff --git a/clients/java/src/main/java/io/lakefs/clients/api/InternalApi.java b/clients/java/src/main/java/io/lakefs/clients/api/InternalApi.java index 554c1b6479a..90f2d882d65 100644 --- a/clients/java/src/main/java/io/lakefs/clients/api/InternalApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/api/InternalApi.java @@ -34,6 +34,7 @@ import io.lakefs.clients.api.model.Setup; import io.lakefs.clients.api.model.SetupState; import io.lakefs.clients.api.model.StatsEventsList; +import io.lakefs.clients.api.model.StorageURI; import java.lang.reflect.Type; import java.util.ArrayList; @@ -184,6 +185,148 @@ public okhttp3.Call createBranchProtectionRulePreflightAsync(String repository, localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for createSymlinkFile + * @param repository (required) + * @param branch (required) + * @param location path to the table data (optional) + * @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
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call createSymlinkFileCall(String repository, String branch, String location, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repositories/{repository}/refs/{branch}/symlink" + .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(); + + if (location != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("location", location)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + 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 createSymlinkFileValidateBeforeCall(String repository, String branch, String location, 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 createSymlinkFile(Async)"); + } + + // verify the required parameter 'branch' is set + if (branch == null) { + throw new ApiException("Missing the required parameter 'branch' when calling createSymlinkFile(Async)"); + } + + + okhttp3.Call localVarCall = createSymlinkFileCall(repository, branch, location, _callback); + return localVarCall; + + } + + /** + * creates symlink files corresponding to the given directory + * + * @param repository (required) + * @param branch (required) + * @param location path to the table data (optional) + * @return StorageURI + * @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
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public StorageURI createSymlinkFile(String repository, String branch, String location) throws ApiException { + ApiResponse localVarResp = createSymlinkFileWithHttpInfo(repository, branch, location); + return localVarResp.getData(); + } + + /** + * creates symlink files corresponding to the given directory + * + * @param repository (required) + * @param branch (required) + * @param location path to the table data (optional) + * @return ApiResponse<StorageURI> + * @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
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public ApiResponse createSymlinkFileWithHttpInfo(String repository, String branch, String location) throws ApiException { + okhttp3.Call localVarCall = createSymlinkFileValidateBeforeCall(repository, branch, location, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * creates symlink files corresponding to the given directory (asynchronously) + * + * @param repository (required) + * @param branch (required) + * @param location path to the table data (optional) + * @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
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
+ */ + public okhttp3.Call createSymlinkFileAsync(String repository, String branch, String location, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createSymlinkFileValidateBeforeCall(repository, branch, location, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getAuthCapabilities * @param _callback Callback for upload/download progress diff --git a/clients/java/src/main/java/io/lakefs/clients/api/MetadataApi.java b/clients/java/src/main/java/io/lakefs/clients/api/MetadataApi.java index 0985c15a17b..44607fa80ac 100644 --- a/clients/java/src/main/java/io/lakefs/clients/api/MetadataApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/api/MetadataApi.java @@ -55,148 +55,6 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } - /** - * Build call for createSymlinkFile - * @param repository (required) - * @param branch (required) - * @param location path to the table data (optional) - * @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
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
- */ - public okhttp3.Call createSymlinkFileCall(String repository, String branch, String location, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/repositories/{repository}/refs/{branch}/symlink" - .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(); - - if (location != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("location", location)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - 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 createSymlinkFileValidateBeforeCall(String repository, String branch, String location, 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 createSymlinkFile(Async)"); - } - - // verify the required parameter 'branch' is set - if (branch == null) { - throw new ApiException("Missing the required parameter 'branch' when calling createSymlinkFile(Async)"); - } - - - okhttp3.Call localVarCall = createSymlinkFileCall(repository, branch, location, _callback); - return localVarCall; - - } - - /** - * creates symlink files corresponding to the given directory - * - * @param repository (required) - * @param branch (required) - * @param location path to the table data (optional) - * @return StorageURI - * @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
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
- */ - public StorageURI createSymlinkFile(String repository, String branch, String location) throws ApiException { - ApiResponse localVarResp = createSymlinkFileWithHttpInfo(repository, branch, location); - return localVarResp.getData(); - } - - /** - * creates symlink files corresponding to the given directory - * - * @param repository (required) - * @param branch (required) - * @param location path to the table data (optional) - * @return ApiResponse<StorageURI> - * @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
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
- */ - public ApiResponse createSymlinkFileWithHttpInfo(String repository, String branch, String location) throws ApiException { - okhttp3.Call localVarCall = createSymlinkFileValidateBeforeCall(repository, branch, location, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * creates symlink files corresponding to the given directory (asynchronously) - * - * @param repository (required) - * @param branch (required) - * @param location path to the table data (optional) - * @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
201 location created -
401 Unauthorized -
404 Resource Not Found -
0 Internal Server Error -
- */ - public okhttp3.Call createSymlinkFileAsync(String repository, String branch, String location, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = createSymlinkFileValidateBeforeCall(repository, branch, location, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for getMetaRange * @param repository (required) diff --git a/clients/java/src/test/java/io/lakefs/clients/api/InternalApiTest.java b/clients/java/src/test/java/io/lakefs/clients/api/InternalApiTest.java index 44dff9228e2..805eb7a0b64 100644 --- a/clients/java/src/test/java/io/lakefs/clients/api/InternalApiTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/api/InternalApiTest.java @@ -21,6 +21,7 @@ import io.lakefs.clients.api.model.Setup; import io.lakefs.clients.api.model.SetupState; import io.lakefs.clients.api.model.StatsEventsList; +import io.lakefs.clients.api.model.StorageURI; import org.junit.Test; import org.junit.Ignore; @@ -53,6 +54,23 @@ public void createBranchProtectionRulePreflightTest() throws ApiException { // TODO: test validations } + /** + * creates symlink files corresponding to the given directory + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createSymlinkFileTest() throws ApiException { + String repository = null; + String branch = null; + String location = null; + StorageURI response = api.createSymlinkFile(repository, branch, location); + // TODO: test validations + } + /** * list authentication capabilities supported * diff --git a/clients/java/src/test/java/io/lakefs/clients/api/MetadataApiTest.java b/clients/java/src/test/java/io/lakefs/clients/api/MetadataApiTest.java index 56fcddc7aa7..b90cd6e4115 100644 --- a/clients/java/src/test/java/io/lakefs/clients/api/MetadataApiTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/api/MetadataApiTest.java @@ -33,23 +33,6 @@ public class MetadataApiTest { private final MetadataApi api = new MetadataApi(); - /** - * creates symlink files corresponding to the given directory - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createSymlinkFileTest() throws ApiException { - String repository = null; - String branch = null; - String location = null; - StorageURI response = api.createSymlinkFile(repository, branch, location); - // TODO: test validations - } - /** * return URI to a meta-range file * diff --git a/clients/python/README.md b/clients/python/README.md index f3f42893be4..faeb5656224 100644 --- a/clients/python/README.md +++ b/clients/python/README.md @@ -171,6 +171,7 @@ Class | Method | HTTP request | Description *ImportApi* | [**import_start**](docs/ImportApi.md#import_start) | **POST** /repositories/{repository}/branches/{branch}/import | import data from object store *ImportApi* | [**import_status**](docs/ImportApi.md#import_status) | **GET** /repositories/{repository}/branches/{branch}/import | get import status *InternalApi* | [**create_branch_protection_rule_preflight**](docs/InternalApi.md#create_branch_protection_rule_preflight) | **GET** /repositories/{repository}/branch_protection/set_allowed | +*InternalApi* | [**create_symlink_file**](docs/InternalApi.md#create_symlink_file) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory *InternalApi* | [**get_auth_capabilities**](docs/InternalApi.md#get_auth_capabilities) | **GET** /auth/capabilities | list authentication capabilities supported *InternalApi* | [**get_setup_state**](docs/InternalApi.md#get_setup_state) | **GET** /setup_lakefs | check if the lakeFS installation is already set up *InternalApi* | [**post_stats_events**](docs/InternalApi.md#post_stats_events) | **POST** /statistics | post stats events, this endpoint is meant for internal use only @@ -178,7 +179,6 @@ Class | Method | HTTP request | Description *InternalApi* | [**setup**](docs/InternalApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user *InternalApi* | [**setup_comm_prefs**](docs/InternalApi.md#setup_comm_prefs) | **POST** /setup_comm_prefs | setup communications preferences *InternalApi* | [**upload_object_preflight**](docs/InternalApi.md#upload_object_preflight) | **GET** /repositories/{repository}/branches/{branch}/objects/stage_allowed | -*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 diff --git a/clients/python/docs/InternalApi.md b/clients/python/docs/InternalApi.md index fd40783290c..ae6f8b321c5 100644 --- a/clients/python/docs/InternalApi.md +++ b/clients/python/docs/InternalApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- [**create_branch_protection_rule_preflight**](InternalApi.md#create_branch_protection_rule_preflight) | **GET** /repositories/{repository}/branch_protection/set_allowed | +[**create_symlink_file**](InternalApi.md#create_symlink_file) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory [**get_auth_capabilities**](InternalApi.md#get_auth_capabilities) | **GET** /auth/capabilities | list authentication capabilities supported [**get_setup_state**](InternalApi.md#get_setup_state) | **GET** /setup_lakefs | check if the lakeFS installation is already set up [**post_stats_events**](InternalApi.md#post_stats_events) | **POST** /statistics | post stats events, this endpoint is meant for internal use only @@ -119,6 +120,126 @@ void (empty response body) [[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_symlink_file** +> StorageURI create_symlink_file(repository, branch) + +creates symlink files corresponding to the given directory + +### 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 internal_api +from lakefs_client.model.error import Error +from lakefs_client.model.storage_uri import StorageURI +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 = internal_api.InternalApi(api_client) + repository = "repository_example" # str | + branch = "branch_example" # str | + location = "location_example" # str | path to the table data (optional) + + # example passing only required values which don't have defaults set + try: + # creates symlink files corresponding to the given directory + api_response = api_instance.create_symlink_file(repository, branch) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling InternalApi->create_symlink_file: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # creates symlink files corresponding to the given directory + api_response = api_instance.create_symlink_file(repository, branch, location=location) + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling InternalApi->create_symlink_file: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **repository** | **str**| | + **branch** | **str**| | + **location** | **str**| path to the table data | [optional] + +### Return type + +[**StorageURI**](StorageURI.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 | +|-------------|-------------|------------------| +**201** | location created | - | +**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_auth_capabilities** > AuthCapabilities get_auth_capabilities() diff --git a/clients/python/docs/MetadataApi.md b/clients/python/docs/MetadataApi.md index 46180afdd82..f95a2aa2c03 100644 --- a/clients/python/docs/MetadataApi.md +++ b/clients/python/docs/MetadataApi.md @@ -4,131 +4,10 @@ All URIs are relative to *http://localhost/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_symlink_file**](MetadataApi.md#create_symlink_file) | **POST** /repositories/{repository}/refs/{branch}/symlink | creates symlink files corresponding to the given directory [**get_meta_range**](MetadataApi.md#get_meta_range) | **GET** /repositories/{repository}/metadata/meta_range/{meta_range} | return URI to a meta-range file [**get_range**](MetadataApi.md#get_range) | **GET** /repositories/{repository}/metadata/range/{range} | return URI to a range file -# **create_symlink_file** -> StorageURI create_symlink_file(repository, branch) - -creates symlink files corresponding to the given directory - -### 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 metadata_api -from lakefs_client.model.error import Error -from lakefs_client.model.storage_uri import StorageURI -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 = metadata_api.MetadataApi(api_client) - repository = "repository_example" # str | - branch = "branch_example" # str | - location = "location_example" # str | path to the table data (optional) - - # example passing only required values which don't have defaults set - try: - # creates symlink files corresponding to the given directory - api_response = api_instance.create_symlink_file(repository, branch) - pprint(api_response) - except lakefs_client.ApiException as e: - print("Exception when calling MetadataApi->create_symlink_file: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values - try: - # creates symlink files corresponding to the given directory - api_response = api_instance.create_symlink_file(repository, branch, location=location) - pprint(api_response) - except lakefs_client.ApiException as e: - print("Exception when calling MetadataApi->create_symlink_file: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **repository** | **str**| | - **branch** | **str**| | - **location** | **str**| path to the table data | [optional] - -### Return type - -[**StorageURI**](StorageURI.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 | -|-------------|-------------|------------------| -**201** | location created | - | -**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_meta_range** > StorageURI get_meta_range(repository, meta_range) diff --git a/clients/python/lakefs_client/api/internal_api.py b/clients/python/lakefs_client/api/internal_api.py index 6f4238cd944..19ea97f55af 100644 --- a/clients/python/lakefs_client/api/internal_api.py +++ b/clients/python/lakefs_client/api/internal_api.py @@ -29,6 +29,7 @@ from lakefs_client.model.setup import Setup from lakefs_client.model.setup_state import SetupState from lakefs_client.model.stats_events_list import StatsEventsList +from lakefs_client.model.storage_uri import StorageURI class InternalApi(object): @@ -97,6 +98,72 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.create_symlink_file_endpoint = _Endpoint( + settings={ + 'response_type': (StorageURI,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/repositories/{repository}/refs/{branch}/symlink', + 'operation_id': 'create_symlink_file', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'repository', + 'branch', + 'location', + ], + 'required': [ + 'repository', + 'branch', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'repository': + (str,), + 'branch': + (str,), + 'location': + (str,), + }, + 'attribute_map': { + 'repository': 'repository', + 'branch': 'branch', + 'location': 'location', + }, + 'location_map': { + 'repository': 'path', + 'branch': 'path', + 'location': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.get_auth_capabilities_endpoint = _Endpoint( settings={ 'response_type': (AuthCapabilities,), @@ -525,6 +592,76 @@ def create_branch_protection_rule_preflight( repository return self.create_branch_protection_rule_preflight_endpoint.call_with_http_info(**kwargs) + def create_symlink_file( + self, + repository, + branch, + **kwargs + ): + """creates symlink files corresponding to the given directory # 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_symlink_file(repository, branch, async_req=True) + >>> result = thread.get() + + Args: + repository (str): + branch (str): + + Keyword Args: + location (str): path to the table data. [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: + StorageURI + 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.create_symlink_file_endpoint.call_with_http_info(**kwargs) + def get_auth_capabilities( self, **kwargs diff --git a/clients/python/lakefs_client/api/metadata_api.py b/clients/python/lakefs_client/api/metadata_api.py index e81d3b25b41..7e58219d1e9 100644 --- a/clients/python/lakefs_client/api/metadata_api.py +++ b/clients/python/lakefs_client/api/metadata_api.py @@ -37,72 +37,6 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.create_symlink_file_endpoint = _Endpoint( - settings={ - 'response_type': (StorageURI,), - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/repositories/{repository}/refs/{branch}/symlink', - 'operation_id': 'create_symlink_file', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'repository', - 'branch', - 'location', - ], - 'required': [ - 'repository', - 'branch', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'repository': - (str,), - 'branch': - (str,), - 'location': - (str,), - }, - 'attribute_map': { - 'repository': 'repository', - 'branch': 'branch', - 'location': 'location', - }, - 'location_map': { - 'repository': 'path', - 'branch': 'path', - 'location': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) self.get_meta_range_endpoint = _Endpoint( settings={ 'response_type': (StorageURI,), @@ -226,76 +160,6 @@ def __init__(self, api_client=None): api_client=api_client ) - def create_symlink_file( - self, - repository, - branch, - **kwargs - ): - """creates symlink files corresponding to the given directory # 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_symlink_file(repository, branch, async_req=True) - >>> result = thread.get() - - Args: - repository (str): - branch (str): - - Keyword Args: - location (str): path to the table data. [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: - StorageURI - 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.create_symlink_file_endpoint.call_with_http_info(**kwargs) - def get_meta_range( self, repository, diff --git a/clients/python/test/test_internal_api.py b/clients/python/test/test_internal_api.py index 96637ea841f..70a356f9016 100644 --- a/clients/python/test/test_internal_api.py +++ b/clients/python/test/test_internal_api.py @@ -30,6 +30,13 @@ def test_create_branch_protection_rule_preflight(self): """ pass + def test_create_symlink_file(self): + """Test case for create_symlink_file + + creates symlink files corresponding to the given directory # noqa: E501 + """ + pass + def test_get_auth_capabilities(self): """Test case for get_auth_capabilities diff --git a/clients/python/test/test_metadata_api.py b/clients/python/test/test_metadata_api.py index a4f276d8574..7ffc345a98a 100644 --- a/clients/python/test/test_metadata_api.py +++ b/clients/python/test/test_metadata_api.py @@ -24,13 +24,6 @@ def setUp(self): def tearDown(self): pass - def test_create_symlink_file(self): - """Test case for create_symlink_file - - creates symlink files corresponding to the given directory # noqa: E501 - """ - pass - def test_get_meta_range(self): """Test case for get_meta_range diff --git a/docs/assets/js/swagger.yml b/docs/assets/js/swagger.yml index 3b9ebba8be6..291499d100d 100644 --- a/docs/assets/js/swagger.yml +++ b/docs/assets/js/swagger.yml @@ -3810,7 +3810,7 @@ paths: description: path to the table data post: tags: - - metadata + - internal operationId: createSymlinkFile summary: creates symlink files corresponding to the given directory