From f686a0350f174fc9d9349eaed97c22714ccb4e1b Mon Sep 17 00:00:00 2001 From: guyhardonag Date: Tue, 26 Sep 2023 13:53:34 +0300 Subject: [PATCH 1/6] Conslidate configuration API calls --- api/swagger.yml | 25 +++- clients/java/README.md | 2 + clients/java/api/openapi.yaml | 44 ++++++ clients/java/docs/ConfigApi.md | 88 ++++++++++++ .../java/io/lakefs/clients/api/ConfigApi.java | 125 ++++++++++++++++++ .../io/lakefs/clients/api/ConfigApiTest.java | 15 +++ clients/python/.openapi-generator/FILES | 3 + clients/python/README.md | 2 + clients/python/docs/ConfigApi.md | 103 +++++++++++++++ .../python/lakefs_client/api/config_api.py | 110 +++++++++++++++ .../python/lakefs_client/models/__init__.py | 1 + clients/python/test/test_config_api.py | 6 + docs/assets/js/swagger.yml | 25 +++- pkg/api/controller.go | 50 ++++++- 14 files changed, 591 insertions(+), 8 deletions(-) diff --git a/api/swagger.yml b/api/swagger.yml index c3bcccb5d9d..e06ea133cfd 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -1001,7 +1001,13 @@ components: type: boolean import_validity_regex: type: string - + Config: + type: object + properties: + version_config: + $ref: "#/components/schemas/VersionConfig" + storage_config: + $ref: "#/components/schemas/StorageConfig" VersionConfig: type: object properties: @@ -4271,12 +4277,28 @@ paths: responses: 204: description: NoContent + /config: + get: + tags: + - config + operationId: getConfig + description: retrieve lakeFS configuration + responses: + 200: + description: lakeFS configuration + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + 401: + $ref: "#/components/responses/Unauthorized" /config/version: get: tags: - config operationId: getLakeFSVersion description: get version of lakeFS server + deprecated: true responses: 200: description: lakeFS version @@ -4292,6 +4314,7 @@ paths: - config operationId: getStorageConfig description: retrieve lakeFS storage configuration + deprecated: true responses: 200: description: lakeFS storage configuration diff --git a/clients/java/README.md b/clients/java/README.md index 1de03ea9ebe..647f7604bed 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -180,6 +180,7 @@ Class | Method | HTTP request | Description *BranchesApi* | [**revertBranch**](docs/BranchesApi.md#revertBranch) | **POST** /repositories/{repository}/branches/{branch}/revert | revert *CommitsApi* | [**commit**](docs/CommitsApi.md#commit) | **POST** /repositories/{repository}/branches/{branch}/commits | create commit *CommitsApi* | [**getCommit**](docs/CommitsApi.md#getCommit) | **GET** /repositories/{repository}/commits/{commitId} | get commit +*ConfigApi* | [**getConfig**](docs/ConfigApi.md#getConfig) | **GET** /config | *ConfigApi* | [**getGarbageCollectionConfig**](docs/ConfigApi.md#getGarbageCollectionConfig) | **GET** /config/garbage-collection | *ConfigApi* | [**getLakeFSVersion**](docs/ConfigApi.md#getLakeFSVersion) | **GET** /config/version | *ConfigApi* | [**getStorageConfig**](docs/ConfigApi.md#getStorageConfig) | **GET** /config/storage | @@ -252,6 +253,7 @@ Class | Method | HTTP request | Description - [Commit](docs/Commit.md) - [CommitCreation](docs/CommitCreation.md) - [CommitList](docs/CommitList.md) + - [Config](docs/Config.md) - [Credentials](docs/Credentials.md) - [CredentialsList](docs/CredentialsList.md) - [CredentialsWithSecret](docs/CredentialsWithSecret.md) diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index d9e2a76e6c2..f1c6259be45 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -5194,8 +5194,29 @@ paths: tags: - healthCheck x-accepts: application/json + /config: + get: + description: retrieve lakeFS configuration + operationId: getConfig + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Config' + description: lakeFS configuration + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized + tags: + - config + x-accepts: application/json /config/version: get: + deprecated: true description: get version of lakeFS server operationId: getLakeFSVersion responses: @@ -5216,6 +5237,7 @@ paths: x-accepts: application/json /config/storage: get: + deprecated: true description: retrieve lakeFS storage configuration operationId: getStorageConfig responses: @@ -6648,6 +6670,28 @@ components: - pre_sign_support - pre_sign_support_ui type: object + Config: + example: + storage_config: + blockstore_namespace_example: blockstore_namespace_example + blockstore_namespace_ValidityRegex: blockstore_namespace_ValidityRegex + blockstore_type: blockstore_type + pre_sign_support_ui: true + import_support: true + import_validity_regex: import_validity_regex + default_namespace_prefix: default_namespace_prefix + pre_sign_support: true + version_config: + latest_version: latest_version + version: version + upgrade_recommended: true + upgrade_url: upgrade_url + properties: + version_config: + $ref: '#/components/schemas/VersionConfig' + storage_config: + $ref: '#/components/schemas/StorageConfig' + type: object VersionConfig: example: latest_version: latest_version diff --git a/clients/java/docs/ConfigApi.md b/clients/java/docs/ConfigApi.md index db0d43749a8..e389ba5658f 100644 --- a/clients/java/docs/ConfigApi.md +++ b/clients/java/docs/ConfigApi.md @@ -4,11 +4,99 @@ All URIs are relative to *http://localhost/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**getConfig**](ConfigApi.md#getConfig) | **GET** /config | [**getGarbageCollectionConfig**](ConfigApi.md#getGarbageCollectionConfig) | **GET** /config/garbage-collection | [**getLakeFSVersion**](ConfigApi.md#getLakeFSVersion) | **GET** /config/version | [**getStorageConfig**](ConfigApi.md#getStorageConfig) | **GET** /config/storage | + +# **getConfig** +> Config getConfig() + + + +retrieve lakeFS configuration + +### 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.ConfigApi; + +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"); + + ConfigApi apiInstance = new ConfigApi(defaultClient); + try { + Config result = apiInstance.getConfig(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ConfigApi#getConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Config**](Config.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** | lakeFS configuration | - | +**401** | Unauthorized | - | + # **getGarbageCollectionConfig** > GarbageCollectionConfig getGarbageCollectionConfig() diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ConfigApi.java b/clients/java/src/main/java/io/lakefs/clients/api/ConfigApi.java index 01425b8eaa9..f02c0d79ee2 100644 --- a/clients/java/src/main/java/io/lakefs/clients/api/ConfigApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/api/ConfigApi.java @@ -27,6 +27,7 @@ import java.io.IOException; +import io.lakefs.clients.api.model.Config; import io.lakefs.clients.api.model.Error; import io.lakefs.clients.api.model.GarbageCollectionConfig; import io.lakefs.clients.api.model.StorageConfig; @@ -57,6 +58,112 @@ public void setApiClient(ApiClient apiClient) { this.localVarApiClient = apiClient; } + /** + * Build call for getConfig + * @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
200 lakeFS configuration -
401 Unauthorized -
+ */ + public okhttp3.Call getConfigCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/config"; + + 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 = { + + }; + 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getConfigValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getConfigCall(_callback); + return localVarCall; + + } + + /** + * + * retrieve lakeFS configuration + * @return Config + * @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
200 lakeFS configuration -
401 Unauthorized -
+ */ + public Config getConfig() throws ApiException { + ApiResponse localVarResp = getConfigWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * retrieve lakeFS configuration + * @return ApiResponse<Config> + * @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
200 lakeFS configuration -
401 Unauthorized -
+ */ + public ApiResponse getConfigWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getConfigValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * retrieve lakeFS configuration + * @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
200 lakeFS configuration -
401 Unauthorized -
+ */ + public okhttp3.Call getConfigAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getConfigValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getGarbageCollectionConfig * @param _callback Callback for upload/download progress @@ -174,7 +281,9 @@ public okhttp3.Call getGarbageCollectionConfigAsync(final ApiCallback 200 lakeFS version - 401 Unauthorized - + * @deprecated */ + @Deprecated public okhttp3.Call getLakeFSVersionCall(final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; @@ -205,6 +314,7 @@ public okhttp3.Call getLakeFSVersionCall(final ApiCallback _callback) throws Api return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call getLakeFSVersionValidateBeforeCall(final ApiCallback _callback) throws ApiException { @@ -225,7 +335,9 @@ private okhttp3.Call getLakeFSVersionValidateBeforeCall(final ApiCallback _callb 200 lakeFS version - 401 Unauthorized - + * @deprecated */ + @Deprecated public VersionConfig getLakeFSVersion() throws ApiException { ApiResponse localVarResp = getLakeFSVersionWithHttpInfo(); return localVarResp.getData(); @@ -242,7 +354,9 @@ public VersionConfig getLakeFSVersion() throws ApiException { 200 lakeFS version - 401 Unauthorized - + * @deprecated */ + @Deprecated public ApiResponse getLakeFSVersionWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getLakeFSVersionValidateBeforeCall(null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -261,7 +375,9 @@ public ApiResponse getLakeFSVersionWithHttpInfo() throws ApiExcep 200 lakeFS version - 401 Unauthorized - + * @deprecated */ + @Deprecated public okhttp3.Call getLakeFSVersionAsync(final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getLakeFSVersionValidateBeforeCall(_callback); @@ -280,7 +396,9 @@ public okhttp3.Call getLakeFSVersionAsync(final ApiCallback _call 200 lakeFS storage configuration - 401 Unauthorized - + * @deprecated */ + @Deprecated public okhttp3.Call getStorageConfigCall(final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; @@ -311,6 +429,7 @@ public okhttp3.Call getStorageConfigCall(final ApiCallback _callback) throws Api return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } + @Deprecated @SuppressWarnings("rawtypes") private okhttp3.Call getStorageConfigValidateBeforeCall(final ApiCallback _callback) throws ApiException { @@ -331,7 +450,9 @@ private okhttp3.Call getStorageConfigValidateBeforeCall(final ApiCallback _callb 200 lakeFS storage configuration - 401 Unauthorized - + * @deprecated */ + @Deprecated public StorageConfig getStorageConfig() throws ApiException { ApiResponse localVarResp = getStorageConfigWithHttpInfo(); return localVarResp.getData(); @@ -348,7 +469,9 @@ public StorageConfig getStorageConfig() throws ApiException { 200 lakeFS storage configuration - 401 Unauthorized - + * @deprecated */ + @Deprecated public ApiResponse getStorageConfigWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getStorageConfigValidateBeforeCall(null); Type localVarReturnType = new TypeToken(){}.getType(); @@ -367,7 +490,9 @@ public ApiResponse getStorageConfigWithHttpInfo() throws ApiExcep 200 lakeFS storage configuration - 401 Unauthorized - + * @deprecated */ + @Deprecated public okhttp3.Call getStorageConfigAsync(final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getStorageConfigValidateBeforeCall(_callback); diff --git a/clients/java/src/test/java/io/lakefs/clients/api/ConfigApiTest.java b/clients/java/src/test/java/io/lakefs/clients/api/ConfigApiTest.java index 2700dd5bdc3..792bc8c6250 100644 --- a/clients/java/src/test/java/io/lakefs/clients/api/ConfigApiTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/api/ConfigApiTest.java @@ -14,6 +14,7 @@ package io.lakefs.clients.api; import io.lakefs.clients.api.ApiException; +import io.lakefs.clients.api.model.Config; import io.lakefs.clients.api.model.Error; import io.lakefs.clients.api.model.GarbageCollectionConfig; import io.lakefs.clients.api.model.StorageConfig; @@ -35,6 +36,20 @@ public class ConfigApiTest { private final ConfigApi api = new ConfigApi(); + /** + * + * + * retrieve lakeFS configuration + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getConfigTest() throws ApiException { + Config response = api.getConfig(); + // TODO: test validations + } + /** * * diff --git a/clients/python/.openapi-generator/FILES b/clients/python/.openapi-generator/FILES index e9c9a5b4646..077ea2a26a2 100644 --- a/clients/python/.openapi-generator/FILES +++ b/clients/python/.openapi-generator/FILES @@ -18,6 +18,7 @@ docs/Commit.md docs/CommitCreation.md docs/CommitList.md docs/CommitsApi.md +docs/Config.md docs/ConfigApi.md docs/Credentials.md docs/CredentialsList.md @@ -140,6 +141,7 @@ lakefs_client/model/comm_prefs_input.py lakefs_client/model/commit.py lakefs_client/model/commit_creation.py lakefs_client/model/commit_list.py +lakefs_client/model/config.py lakefs_client/model/credentials.py lakefs_client/model/credentials_list.py lakefs_client/model/credentials_with_secret.py @@ -238,6 +240,7 @@ test/test_commit.py test/test_commit_creation.py test/test_commit_list.py test/test_commits_api.py +test/test_config.py test/test_config_api.py test/test_credentials.py test/test_credentials_list.py diff --git a/clients/python/README.md b/clients/python/README.md index 729fd343963..2e3625e6df0 100644 --- a/clients/python/README.md +++ b/clients/python/README.md @@ -161,6 +161,7 @@ Class | Method | HTTP request | Description *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 +*ConfigApi* | [**get_config**](docs/ConfigApi.md#get_config) | **GET** /config | *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_storage_config**](docs/ConfigApi.md#get_storage_config) | **GET** /config/storage | @@ -233,6 +234,7 @@ Class | Method | HTTP request | Description - [Commit](docs/Commit.md) - [CommitCreation](docs/CommitCreation.md) - [CommitList](docs/CommitList.md) + - [Config](docs/Config.md) - [Credentials](docs/Credentials.md) - [CredentialsList](docs/CredentialsList.md) - [CredentialsWithSecret](docs/CredentialsWithSecret.md) diff --git a/clients/python/docs/ConfigApi.md b/clients/python/docs/ConfigApi.md index 77ccd7d2f58..bb87742ce4e 100644 --- a/clients/python/docs/ConfigApi.md +++ b/clients/python/docs/ConfigApi.md @@ -4,11 +4,114 @@ All URIs are relative to *http://localhost/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**get_config**](ConfigApi.md#get_config) | **GET** /config | [**get_garbage_collection_config**](ConfigApi.md#get_garbage_collection_config) | **GET** /config/garbage-collection | [**get_lake_fs_version**](ConfigApi.md#get_lake_fs_version) | **GET** /config/version | [**get_storage_config**](ConfigApi.md#get_storage_config) | **GET** /config/storage | +# **get_config** +> Config get_config() + + + +retrieve lakeFS configuration + +### 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 config_api +from lakefs_client.model.config import Config +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 = config_api.ConfigApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.get_config() + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling ConfigApi->get_config: %s\n" % e) +``` + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**Config**](Config.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** | lakeFS configuration | - | +**401** | Unauthorized | - | + +[[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_garbage_collection_config** > GarbageCollectionConfig get_garbage_collection_config() diff --git a/clients/python/lakefs_client/api/config_api.py b/clients/python/lakefs_client/api/config_api.py index 61317431a92..4ffa1600086 100644 --- a/clients/python/lakefs_client/api/config_api.py +++ b/clients/python/lakefs_client/api/config_api.py @@ -22,6 +22,7 @@ none_type, validate_and_convert_types ) +from lakefs_client.model.config import Config from lakefs_client.model.error import Error from lakefs_client.model.garbage_collection_config import GarbageCollectionConfig from lakefs_client.model.storage_config import StorageConfig @@ -39,6 +40,54 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client + self.get_config_endpoint = _Endpoint( + settings={ + 'response_type': (Config,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/config', + 'operation_id': 'get_config', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.get_garbage_collection_config_endpoint = _Endpoint( settings={ 'response_type': (GarbageCollectionConfig,), @@ -184,6 +233,67 @@ def __init__(self, api_client=None): api_client=api_client ) + def get_config( + self, + **kwargs + ): + """get_config # noqa: E501 + + retrieve lakeFS configuration # 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_config(async_req=True) + >>> result = thread.get() + + + 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: + Config + 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') + return self.get_config_endpoint.call_with_http_info(**kwargs) + def get_garbage_collection_config( self, **kwargs diff --git a/clients/python/lakefs_client/models/__init__.py b/clients/python/lakefs_client/models/__init__.py index f3277f71aae..7198c6b3504 100644 --- a/clients/python/lakefs_client/models/__init__.py +++ b/clients/python/lakefs_client/models/__init__.py @@ -22,6 +22,7 @@ from lakefs_client.model.commit import Commit from lakefs_client.model.commit_creation import CommitCreation from lakefs_client.model.commit_list import CommitList +from lakefs_client.model.config import Config from lakefs_client.model.credentials import Credentials from lakefs_client.model.credentials_list import CredentialsList from lakefs_client.model.credentials_with_secret import CredentialsWithSecret diff --git a/clients/python/test/test_config_api.py b/clients/python/test/test_config_api.py index 2d7e1c50aac..69a297133ba 100644 --- a/clients/python/test/test_config_api.py +++ b/clients/python/test/test_config_api.py @@ -24,6 +24,12 @@ def setUp(self): def tearDown(self): pass + def test_get_config(self): + """Test case for get_config + + """ + pass + def test_get_garbage_collection_config(self): """Test case for get_garbage_collection_config diff --git a/docs/assets/js/swagger.yml b/docs/assets/js/swagger.yml index c3bcccb5d9d..e06ea133cfd 100644 --- a/docs/assets/js/swagger.yml +++ b/docs/assets/js/swagger.yml @@ -1001,7 +1001,13 @@ components: type: boolean import_validity_regex: type: string - + Config: + type: object + properties: + version_config: + $ref: "#/components/schemas/VersionConfig" + storage_config: + $ref: "#/components/schemas/StorageConfig" VersionConfig: type: object properties: @@ -4271,12 +4277,28 @@ paths: responses: 204: description: NoContent + /config: + get: + tags: + - config + operationId: getConfig + description: retrieve lakeFS configuration + responses: + 200: + description: lakeFS configuration + content: + application/json: + schema: + $ref: "#/components/schemas/Config" + 401: + $ref: "#/components/responses/Unauthorized" /config/version: get: tags: - config operationId: getLakeFSVersion description: get version of lakeFS server + deprecated: true responses: 200: description: lakeFS version @@ -4292,6 +4314,7 @@ paths: - config operationId: getStorageConfig description: retrieve lakeFS storage configuration + deprecated: true responses: 200: description: lakeFS storage configuration diff --git a/pkg/api/controller.go b/pkg/api/controller.go index ee6b13cdaeb..1df6cb5cc27 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -1415,6 +1415,39 @@ func (c *Controller) AttachPolicyToUser(w http.ResponseWriter, r *http.Request, writeResponse(w, r, http.StatusCreated, nil) } +func (c *Controller) GetConfig(w http.ResponseWriter, r *http.Request) { + _, err := auth.GetUser(r.Context()) + if err != nil { + writeError(w, r, http.StatusUnauthorized, ErrAuthenticatingRequest) + return + } + var storageCfg apigen.StorageConfig + internalError := false + if !c.authorizeCallback(w, r, permissions.Node{ + Permission: permissions.Permission{ + Action: permissions.ReadConfigAction, + Resource: permissions.All, + }, + }, func(_ http.ResponseWriter, _ *http.Request, code int, v interface{}) { + switch code { + case http.StatusInternalServerError: + writeError(w, r, code, v) + internalError = true + case http.StatusUnauthorized: + c.Logger.Debug("Unauthorized request to get storage config, returning partial config") + } + }) { + if internalError { + return + } + } else { + storageCfg = c.GetStorageCfg() + } + + versionConfig := c.getVersionConfig() + writeResponse(w, r, http.StatusOK, apigen.Config{StorageConfig: &storageCfg, VersionConfig: &versionConfig}) +} + func (c *Controller) GetStorageConfig(w http.ResponseWriter, r *http.Request) { if !c.authorize(w, r, permissions.Node{ Permission: permissions.Permission{ @@ -1424,12 +1457,16 @@ func (c *Controller) GetStorageConfig(w http.ResponseWriter, r *http.Request) { }) { return } + + writeResponse(w, r, http.StatusOK, c.GetStorageCfg()) +} +func (c *Controller) GetStorageCfg() apigen.StorageConfig { info := c.BlockAdapter.GetStorageNamespaceInfo() defaultNamespacePrefix := swag.String(info.DefaultNamespacePrefix) if c.Config.Blockstore.DefaultNamespacePrefix != nil { defaultNamespacePrefix = c.Config.Blockstore.DefaultNamespacePrefix } - response := apigen.StorageConfig{ + return apigen.StorageConfig{ BlockstoreType: c.Config.Blockstore.Type, BlockstoreNamespaceValidityRegex: info.ValidityRegex, BlockstoreNamespaceExample: info.Example, @@ -1439,9 +1476,7 @@ func (c *Controller) GetStorageConfig(w http.ResponseWriter, r *http.Request) { ImportSupport: info.ImportSupport, ImportValidityRegex: info.ImportValidityRegex, } - writeResponse(w, r, http.StatusOK, response) } - func (c *Controller) HealthCheck(w http.ResponseWriter, r *http.Request) { writeResponse(w, r, http.StatusNoContent, nil) } @@ -4124,7 +4159,10 @@ func (c *Controller) GetLakeFSVersion(w http.ResponseWriter, r *http.Request) { writeError(w, r, http.StatusUnauthorized, ErrAuthenticatingRequest) return } + writeResponse(w, r, http.StatusOK, c.getVersionConfig()) +} +func (c *Controller) getVersionConfig() apigen.VersionConfig { // set upgrade recommended based on last security audit check var ( upgradeRecommended *bool @@ -4154,14 +4192,14 @@ func (c *Controller) GetLakeFSVersion(w http.ResponseWriter, r *http.Request) { } } - writeResponse(w, r, http.StatusOK, apigen.VersionConfig{ + return apigen.VersionConfig{ UpgradeRecommended: upgradeRecommended, UpgradeUrl: upgradeURL, Version: swag.String(version.Version), LatestVersion: latestVersion, - }) -} + } +} func (c *Controller) GetGarbageCollectionConfig(w http.ResponseWriter, r *http.Request) { ctx := r.Context() _, err := auth.GetUser(ctx) From 90c4fbd835003ca3abf7ae266077254a16dc7ee4 Mon Sep 17 00:00:00 2001 From: guyhardonag Date: Tue, 26 Sep 2023 14:22:14 +0300 Subject: [PATCH 2/6] Use consolidated config in webui --- webui/src/lib/api/index.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/webui/src/lib/api/index.js b/webui/src/lib/api/index.js index d2959788319..44e71975a18 100644 --- a/webui/src/lib/api/index.js +++ b/webui/src/lib/api/index.js @@ -946,18 +946,19 @@ class Setup { class Config { async getStorageConfig() { - const response = await apiRequest('/config/storage', { + const response = await apiRequest('/config', { method: 'GET', }); - let cfg; + let cfg, storageCfg; switch (response.status) { case 200: cfg = await response.json(); - cfg.warnings = [] - if (cfg.blockstore_type === 'mem') { - cfg.warnings.push(`Block adapter ${cfg.blockstore_type} not usable in production`) + storageCfg = cfg.storage_config + storageCfg.warnings = [] + if (storageCfg.blockstore_type === 'mem') { + storageCfg.warnings.push(`Block adapter ${storageCfg.blockstore_type} not usable in production`) } - return cfg; + return storageCfg; case 409: throw new Error('Conflict'); default: @@ -966,12 +967,14 @@ class Config { } async getLakeFSVersion() { - const response = await apiRequest('/config/version', { + const response = await apiRequest('/config', { method: 'GET', }); + let cfg; switch (response.status) { case 200: - return await response.json(); + cfg = await response.json(); + return cfg.version_config default: throw new Error('Unknown'); } From 851519936ddc4568fb509b263ffca706d256b7e2 Mon Sep 17 00:00:00 2001 From: guyhardonag Date: Tue, 26 Sep 2023 14:40:55 +0300 Subject: [PATCH 3/6] Use consolidated config in lakectl --- cmd/lakectl/cmd/import.go | 6 +++--- cmd/lakectl/cmd/local.go | 4 ++-- cmd/lakectl/cmd/root.go | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/lakectl/cmd/import.go b/cmd/lakectl/cmd/import.go index b5a5b10b7ae..e80942bd6ec 100644 --- a/cmd/lakectl/cmd/import.go +++ b/cmd/lakectl/cmd/import.go @@ -164,9 +164,9 @@ func newImportProgressBar(visible bool) *progressbar.ProgressBar { } func verifySourceMatchConfiguredStorage(ctx context.Context, client *apigen.ClientWithResponses, source string) { - storageConfResp, err := client.GetStorageConfigWithResponse(ctx) - DieOnErrorOrUnexpectedStatusCode(storageConfResp, err, http.StatusOK) - storageConfig := storageConfResp.JSON200 + confResp, err := client.GetConfigWithResponse(ctx) + DieOnErrorOrUnexpectedStatusCode(confResp, err, http.StatusOK) + storageConfig := confResp.JSON200.StorageConfig if storageConfig == nil { Die("Bad response from server", 1) } diff --git a/cmd/lakectl/cmd/local.go b/cmd/lakectl/cmd/local.go index c96372faa3c..dba1c53e27f 100644 --- a/cmd/lakectl/cmd/local.go +++ b/cmd/lakectl/cmd/local.go @@ -86,12 +86,12 @@ func getLocalSyncFlags(cmd *cobra.Command, client *apigen.ClientWithResponses) s presign := Must(cmd.Flags().GetBool(localPresignFlagName)) presignFlag := cmd.Flags().Lookup(localPresignFlagName) if !presignFlag.Changed { - resp, err := client.GetStorageConfigWithResponse(cmd.Context()) + resp, err := client.GetConfigWithResponse(cmd.Context()) DieOnErrorOrUnexpectedStatusCode(resp, err, http.StatusOK) if resp.JSON200 == nil { Die("Bad response from server", 1) } - presign = resp.JSON200.PreSignSupport + presign = resp.JSON200.StorageConfig.PreSignSupport } parallelism := Must(cmd.Flags().GetInt(localParallelismFlagName)) diff --git a/cmd/lakectl/cmd/root.go b/cmd/lakectl/cmd/root.go index 46b2e1dd809..0718cf26462 100644 --- a/cmd/lakectl/cmd/root.go +++ b/cmd/lakectl/cmd/root.go @@ -184,18 +184,18 @@ var rootCmd = &cobra.Command{ client := getClient() - resp, err := client.GetLakeFSVersionWithResponse(cmd.Context()) + resp, err := client.GetConfigWithResponse(cmd.Context()) if err != nil { WriteIfVerbose(getLakeFSVersionErrorTemplate, err) } else if resp.JSON200 == nil { WriteIfVerbose(getLakeFSVersionErrorTemplate, resp.Status()) } else { lakefsVersion := resp.JSON200 - info.LakeFSVersion = swag.StringValue(lakefsVersion.Version) - if swag.BoolValue(lakefsVersion.UpgradeRecommended) { - info.LakeFSLatestVersion = swag.StringValue(lakefsVersion.LatestVersion) + info.LakeFSVersion = swag.StringValue(lakefsVersion.VersionConfig.Version) + if swag.BoolValue(lakefsVersion.VersionConfig.UpgradeRecommended) { + info.LakeFSLatestVersion = swag.StringValue(lakefsVersion.VersionConfig.LatestVersion) } - upgradeURL := swag.StringValue(lakefsVersion.UpgradeUrl) + upgradeURL := swag.StringValue(lakefsVersion.VersionConfig.UpgradeUrl) if upgradeURL != "" { info.UpgradeURL = upgradeURL } From 8e3da8164c4e2f3cd7c4ecdec3c5f474c6d61ae7 Mon Sep 17 00:00:00 2001 From: guyhardonag Date: Thu, 28 Sep 2023 10:42:35 +0300 Subject: [PATCH 4/6] Code review changes --- api/swagger.yml | 4 ++-- pkg/api/controller.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/swagger.yml b/api/swagger.yml index e06ea133cfd..0008e1d4794 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -4295,7 +4295,7 @@ paths: /config/version: get: tags: - - config + - internal operationId: getLakeFSVersion description: get version of lakeFS server deprecated: true @@ -4311,7 +4311,7 @@ paths: /config/storage: get: tags: - - config + - internal operationId: getStorageConfig description: retrieve lakeFS storage configuration deprecated: true diff --git a/pkg/api/controller.go b/pkg/api/controller.go index 1df6cb5cc27..174c14eec53 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -1441,7 +1441,7 @@ func (c *Controller) GetConfig(w http.ResponseWriter, r *http.Request) { return } } else { - storageCfg = c.GetStorageCfg() + storageCfg = c.getStorageConfig() } versionConfig := c.getVersionConfig() @@ -1458,9 +1458,9 @@ func (c *Controller) GetStorageConfig(w http.ResponseWriter, r *http.Request) { return } - writeResponse(w, r, http.StatusOK, c.GetStorageCfg()) + writeResponse(w, r, http.StatusOK, c.getStorageConfig()) } -func (c *Controller) GetStorageCfg() apigen.StorageConfig { +func (c *Controller) getStorageConfig() apigen.StorageConfig { info := c.BlockAdapter.GetStorageNamespaceInfo() defaultNamespacePrefix := swag.String(info.DefaultNamespacePrefix) if c.Config.Blockstore.DefaultNamespacePrefix != nil { From cee6f682749d58d3e70b3f0d1f40438460d0824a Mon Sep 17 00:00:00 2001 From: guyhardonag Date: Sun, 1 Oct 2023 10:26:42 +0300 Subject: [PATCH 5/6] remove line --- pkg/api/controller.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/api/controller.go b/pkg/api/controller.go index 174c14eec53..7c2f92865e4 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -4198,7 +4198,6 @@ func (c *Controller) getVersionConfig() apigen.VersionConfig { Version: swag.String(version.Version), LatestVersion: latestVersion, } - } func (c *Controller) GetGarbageCollectionConfig(w http.ResponseWriter, r *http.Request) { ctx := r.Context() From 0eb4a74740b44827fbd89e1e13c2022598c734c0 Mon Sep 17 00:00:00 2001 From: guyhardonag Date: Sun, 1 Oct 2023 10:42:34 +0300 Subject: [PATCH 6/6] clients build --- clients/java/README.md | 4 +- clients/java/api/openapi.yaml | 4 +- clients/java/docs/Config.md | 14 + clients/java/docs/ConfigApi.md | 176 ------------ clients/java/docs/InternalApi.md | 176 ++++++++++++ .../java/io/lakefs/clients/api/ConfigApi.java | 232 --------------- .../io/lakefs/clients/api/InternalApi.java | 232 +++++++++++++++ .../io/lakefs/clients/api/model/Config.java | 129 +++++++++ .../io/lakefs/clients/api/ConfigApiTest.java | 30 -- .../lakefs/clients/api/InternalApiTest.java | 30 ++ .../lakefs/clients/api/model/ConfigTest.java | 61 ++++ clients/python/README.md | 4 +- clients/python/docs/Config.md | 13 + clients/python/docs/ConfigApi.md | 206 -------------- clients/python/docs/InternalApi.md | 206 ++++++++++++++ .../python/lakefs_client/api/config_api.py | 220 -------------- .../python/lakefs_client/api/internal_api.py | 220 ++++++++++++++ clients/python/lakefs_client/model/config.py | 268 ++++++++++++++++++ clients/python/test/test_config.py | 40 +++ clients/python/test/test_config_api.py | 12 - clients/python/test/test_internal_api.py | 12 + 21 files changed, 1407 insertions(+), 882 deletions(-) create mode 100644 clients/java/docs/Config.md create mode 100644 clients/java/src/main/java/io/lakefs/clients/api/model/Config.java create mode 100644 clients/java/src/test/java/io/lakefs/clients/api/model/ConfigTest.java create mode 100644 clients/python/docs/Config.md create mode 100644 clients/python/lakefs_client/model/config.py create mode 100644 clients/python/test/test_config.py diff --git a/clients/java/README.md b/clients/java/README.md index 647f7604bed..867ffa2d2bb 100644 --- a/clients/java/README.md +++ b/clients/java/README.md @@ -182,8 +182,6 @@ Class | Method | HTTP request | Description *CommitsApi* | [**getCommit**](docs/CommitsApi.md#getCommit) | **GET** /repositories/{repository}/commits/{commitId} | get commit *ConfigApi* | [**getConfig**](docs/ConfigApi.md#getConfig) | **GET** /config | *ConfigApi* | [**getGarbageCollectionConfig**](docs/ConfigApi.md#getGarbageCollectionConfig) | **GET** /config/garbage-collection | -*ConfigApi* | [**getLakeFSVersion**](docs/ConfigApi.md#getLakeFSVersion) | **GET** /config/version | -*ConfigApi* | [**getStorageConfig**](docs/ConfigApi.md#getStorageConfig) | **GET** /config/storage | *ExperimentalApi* | [**getOtfDiffs**](docs/ExperimentalApi.md#getOtfDiffs) | **GET** /otf/diffs | get the available Open Table Format diffs *ExperimentalApi* | [**otfDiff**](docs/ExperimentalApi.md#otfDiff) | **GET** /repositories/{repository}/otf/refs/{left_ref}/diff/{right_ref} | perform otf diff *HealthCheckApi* | [**healthCheck**](docs/HealthCheckApi.md#healthCheck) | **GET** /healthcheck | @@ -193,7 +191,9 @@ Class | Method | HTTP request | Description *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* | [**getLakeFSVersion**](docs/InternalApi.md#getLakeFSVersion) | **GET** /config/version | *InternalApi* | [**getSetupState**](docs/InternalApi.md#getSetupState) | **GET** /setup_lakefs | check if the lakeFS installation is already set up +*InternalApi* | [**getStorageConfig**](docs/InternalApi.md#getStorageConfig) | **GET** /config/storage | *InternalApi* | [**postStatsEvents**](docs/InternalApi.md#postStatsEvents) | **POST** /statistics | post stats events, this endpoint is meant for internal use only *InternalApi* | [**setGarbageCollectionRulesPreflight**](docs/InternalApi.md#setGarbageCollectionRulesPreflight) | **GET** /repositories/{repository}/gc/rules/set_allowed | *InternalApi* | [**setup**](docs/InternalApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user diff --git a/clients/java/api/openapi.yaml b/clients/java/api/openapi.yaml index f1c6259be45..1e94faab685 100644 --- a/clients/java/api/openapi.yaml +++ b/clients/java/api/openapi.yaml @@ -5233,7 +5233,7 @@ paths: $ref: '#/components/schemas/Error' description: Unauthorized tags: - - config + - internal x-accepts: application/json /config/storage: get: @@ -5254,7 +5254,7 @@ paths: $ref: '#/components/schemas/Error' description: Unauthorized tags: - - config + - internal x-accepts: application/json /config/garbage-collection: get: diff --git a/clients/java/docs/Config.md b/clients/java/docs/Config.md new file mode 100644 index 00000000000..823d18cd2f7 --- /dev/null +++ b/clients/java/docs/Config.md @@ -0,0 +1,14 @@ + + +# Config + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**versionConfig** | [**VersionConfig**](VersionConfig.md) | | [optional] +**storageConfig** | [**StorageConfig**](StorageConfig.md) | | [optional] + + + diff --git a/clients/java/docs/ConfigApi.md b/clients/java/docs/ConfigApi.md index e389ba5658f..358be7be0ae 100644 --- a/clients/java/docs/ConfigApi.md +++ b/clients/java/docs/ConfigApi.md @@ -6,8 +6,6 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**getConfig**](ConfigApi.md#getConfig) | **GET** /config | [**getGarbageCollectionConfig**](ConfigApi.md#getGarbageCollectionConfig) | **GET** /config/garbage-collection | -[**getLakeFSVersion**](ConfigApi.md#getLakeFSVersion) | **GET** /config/version | -[**getStorageConfig**](ConfigApi.md#getStorageConfig) | **GET** /config/storage | @@ -184,177 +182,3 @@ This endpoint does not need any parameter. **200** | lakeFS garbage collection config | - | **401** | Unauthorized | - | - -# **getLakeFSVersion** -> VersionConfig getLakeFSVersion() - - - -get version of lakeFS server - -### 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.ConfigApi; - -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"); - - ConfigApi apiInstance = new ConfigApi(defaultClient); - try { - VersionConfig result = apiInstance.getLakeFSVersion(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ConfigApi#getLakeFSVersion"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**VersionConfig**](VersionConfig.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** | lakeFS version | - | -**401** | Unauthorized | - | - - -# **getStorageConfig** -> StorageConfig getStorageConfig() - - - -retrieve lakeFS storage configuration - -### 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.ConfigApi; - -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"); - - ConfigApi apiInstance = new ConfigApi(defaultClient); - try { - StorageConfig result = apiInstance.getStorageConfig(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ConfigApi#getStorageConfig"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**StorageConfig**](StorageConfig.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** | lakeFS storage configuration | - | -**401** | Unauthorized | - | - diff --git a/clients/java/docs/InternalApi.md b/clients/java/docs/InternalApi.md index 3e631593959..2e885d47dca 100644 --- a/clients/java/docs/InternalApi.md +++ b/clients/java/docs/InternalApi.md @@ -7,7 +7,9 @@ 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 +[**getLakeFSVersion**](InternalApi.md#getLakeFSVersion) | **GET** /config/version | [**getSetupState**](InternalApi.md#getSetupState) | **GET** /setup_lakefs | check if the lakeFS installation is already set up +[**getStorageConfig**](InternalApi.md#getStorageConfig) | **GET** /config/storage | [**postStatsEvents**](InternalApi.md#postStatsEvents) | **POST** /statistics | post stats events, this endpoint is meant for internal use only [**setGarbageCollectionRulesPreflight**](InternalApi.md#setGarbageCollectionRulesPreflight) | **GET** /repositories/{repository}/gc/rules/set_allowed | [**setup**](InternalApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user @@ -258,6 +260,93 @@ No authorization required **200** | auth capabilities | - | **0** | Internal Server Error | - | + +# **getLakeFSVersion** +> VersionConfig getLakeFSVersion() + + + +get version of lakeFS server + +### 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); + try { + VersionConfig result = apiInstance.getLakeFSVersion(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#getLakeFSVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**VersionConfig**](VersionConfig.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** | lakeFS version | - | +**401** | Unauthorized | - | + # **getSetupState** > SetupState getSetupState() @@ -315,6 +404,93 @@ No authorization required **200** | lakeFS setup state | - | **0** | Internal Server Error | - | + +# **getStorageConfig** +> StorageConfig getStorageConfig() + + + +retrieve lakeFS storage configuration + +### 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); + try { + StorageConfig result = apiInstance.getStorageConfig(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InternalApi#getStorageConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**StorageConfig**](StorageConfig.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** | lakeFS storage configuration | - | +**401** | Unauthorized | - | + # **postStatsEvents** > postStatsEvents(statsEventsList) diff --git a/clients/java/src/main/java/io/lakefs/clients/api/ConfigApi.java b/clients/java/src/main/java/io/lakefs/clients/api/ConfigApi.java index f02c0d79ee2..a764d8489d5 100644 --- a/clients/java/src/main/java/io/lakefs/clients/api/ConfigApi.java +++ b/clients/java/src/main/java/io/lakefs/clients/api/ConfigApi.java @@ -30,8 +30,6 @@ import io.lakefs.clients.api.model.Config; import io.lakefs.clients.api.model.Error; import io.lakefs.clients.api.model.GarbageCollectionConfig; -import io.lakefs.clients.api.model.StorageConfig; -import io.lakefs.clients.api.model.VersionConfig; import java.lang.reflect.Type; import java.util.ArrayList; @@ -270,234 +268,4 @@ public okhttp3.Call getGarbageCollectionConfigAsync(final ApiCallback - Status Code Description Response Headers - 200 lakeFS version - - 401 Unauthorized - - - * @deprecated - */ - @Deprecated - public okhttp3.Call getLakeFSVersionCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/config/version"; - - 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 = { - - }; - 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getLakeFSVersionValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getLakeFSVersionCall(_callback); - return localVarCall; - - } - - /** - * - * get version of lakeFS server - * @return VersionConfig - * @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
200 lakeFS version -
401 Unauthorized -
- * @deprecated - */ - @Deprecated - public VersionConfig getLakeFSVersion() throws ApiException { - ApiResponse localVarResp = getLakeFSVersionWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * - * get version of lakeFS server - * @return ApiResponse<VersionConfig> - * @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
200 lakeFS version -
401 Unauthorized -
- * @deprecated - */ - @Deprecated - public ApiResponse getLakeFSVersionWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getLakeFSVersionValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * get version of lakeFS server - * @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
200 lakeFS version -
401 Unauthorized -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getLakeFSVersionAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getLakeFSVersionValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for getStorageConfig - * @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
200 lakeFS storage configuration -
401 Unauthorized -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getStorageConfigCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/config/storage"; - - 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 = { - - }; - 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call getStorageConfigValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getStorageConfigCall(_callback); - return localVarCall; - - } - - /** - * - * retrieve lakeFS storage configuration - * @return StorageConfig - * @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
200 lakeFS storage configuration -
401 Unauthorized -
- * @deprecated - */ - @Deprecated - public StorageConfig getStorageConfig() throws ApiException { - ApiResponse localVarResp = getStorageConfigWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * - * retrieve lakeFS storage configuration - * @return ApiResponse<StorageConfig> - * @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
200 lakeFS storage configuration -
401 Unauthorized -
- * @deprecated - */ - @Deprecated - public ApiResponse getStorageConfigWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getStorageConfigValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * (asynchronously) - * retrieve lakeFS storage configuration - * @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
200 lakeFS storage configuration -
401 Unauthorized -
- * @deprecated - */ - @Deprecated - public okhttp3.Call getStorageConfigAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getStorageConfigValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } } 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 90f2d882d65..1646b8d2cb0 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,7 +34,9 @@ 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.StorageConfig; import io.lakefs.clients.api.model.StorageURI; +import io.lakefs.clients.api.model.VersionConfig; import java.lang.reflect.Type; import java.util.ArrayList; @@ -433,6 +435,121 @@ public okhttp3.Call getAuthCapabilitiesAsync(final ApiCallback localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getLakeFSVersion + * @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
200 lakeFS version -
401 Unauthorized -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call getLakeFSVersionCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/config/version"; + + 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 = { + + }; + 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private okhttp3.Call getLakeFSVersionValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getLakeFSVersionCall(_callback); + return localVarCall; + + } + + /** + * + * get version of lakeFS server + * @return VersionConfig + * @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
200 lakeFS version -
401 Unauthorized -
+ * @deprecated + */ + @Deprecated + public VersionConfig getLakeFSVersion() throws ApiException { + ApiResponse localVarResp = getLakeFSVersionWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * get version of lakeFS server + * @return ApiResponse<VersionConfig> + * @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
200 lakeFS version -
401 Unauthorized -
+ * @deprecated + */ + @Deprecated + public ApiResponse getLakeFSVersionWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getLakeFSVersionValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * get version of lakeFS server + * @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
200 lakeFS version -
401 Unauthorized -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call getLakeFSVersionAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getLakeFSVersionValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for getSetupState * @param _callback Callback for upload/download progress @@ -539,6 +656,121 @@ public okhttp3.Call getSetupStateAsync(final ApiCallback _callback) localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } + /** + * Build call for getStorageConfig + * @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
200 lakeFS storage configuration -
401 Unauthorized -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call getStorageConfigCall(final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/config/storage"; + + 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 = { + + }; + 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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @Deprecated + @SuppressWarnings("rawtypes") + private okhttp3.Call getStorageConfigValidateBeforeCall(final ApiCallback _callback) throws ApiException { + + + okhttp3.Call localVarCall = getStorageConfigCall(_callback); + return localVarCall; + + } + + /** + * + * retrieve lakeFS storage configuration + * @return StorageConfig + * @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
200 lakeFS storage configuration -
401 Unauthorized -
+ * @deprecated + */ + @Deprecated + public StorageConfig getStorageConfig() throws ApiException { + ApiResponse localVarResp = getStorageConfigWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * retrieve lakeFS storage configuration + * @return ApiResponse<StorageConfig> + * @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
200 lakeFS storage configuration -
401 Unauthorized -
+ * @deprecated + */ + @Deprecated + public ApiResponse getStorageConfigWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getStorageConfigValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * retrieve lakeFS storage configuration + * @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
200 lakeFS storage configuration -
401 Unauthorized -
+ * @deprecated + */ + @Deprecated + public okhttp3.Call getStorageConfigAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getStorageConfigValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for postStatsEvents * @param statsEventsList (required) diff --git a/clients/java/src/main/java/io/lakefs/clients/api/model/Config.java b/clients/java/src/main/java/io/lakefs/clients/api/model/Config.java new file mode 100644 index 00000000000..b3dabd72d86 --- /dev/null +++ b/clients/java/src/main/java/io/lakefs/clients/api/model/Config.java @@ -0,0 +1,129 @@ +/* + * 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.lakefs.clients.api.model.StorageConfig; +import io.lakefs.clients.api.model.VersionConfig; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Config + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Config { + public static final String SERIALIZED_NAME_VERSION_CONFIG = "version_config"; + @SerializedName(SERIALIZED_NAME_VERSION_CONFIG) + private VersionConfig versionConfig; + + public static final String SERIALIZED_NAME_STORAGE_CONFIG = "storage_config"; + @SerializedName(SERIALIZED_NAME_STORAGE_CONFIG) + private StorageConfig storageConfig; + + + public Config versionConfig(VersionConfig versionConfig) { + + this.versionConfig = versionConfig; + return this; + } + + /** + * Get versionConfig + * @return versionConfig + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public VersionConfig getVersionConfig() { + return versionConfig; + } + + + public void setVersionConfig(VersionConfig versionConfig) { + this.versionConfig = versionConfig; + } + + + public Config storageConfig(StorageConfig storageConfig) { + + this.storageConfig = storageConfig; + return this; + } + + /** + * Get storageConfig + * @return storageConfig + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public StorageConfig getStorageConfig() { + return storageConfig; + } + + + public void setStorageConfig(StorageConfig storageConfig) { + this.storageConfig = storageConfig; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Config config = (Config) o; + return Objects.equals(this.versionConfig, config.versionConfig) && + Objects.equals(this.storageConfig, config.storageConfig); + } + + @Override + public int hashCode() { + return Objects.hash(versionConfig, storageConfig); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Config {\n"); + sb.append(" versionConfig: ").append(toIndentedString(versionConfig)).append("\n"); + sb.append(" storageConfig: ").append(toIndentedString(storageConfig)).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/ConfigApiTest.java b/clients/java/src/test/java/io/lakefs/clients/api/ConfigApiTest.java index 792bc8c6250..1b48f59cceb 100644 --- a/clients/java/src/test/java/io/lakefs/clients/api/ConfigApiTest.java +++ b/clients/java/src/test/java/io/lakefs/clients/api/ConfigApiTest.java @@ -17,8 +17,6 @@ import io.lakefs.clients.api.model.Config; import io.lakefs.clients.api.model.Error; import io.lakefs.clients.api.model.GarbageCollectionConfig; -import io.lakefs.clients.api.model.StorageConfig; -import io.lakefs.clients.api.model.VersionConfig; import org.junit.Test; import org.junit.Ignore; @@ -64,32 +62,4 @@ public void getGarbageCollectionConfigTest() throws ApiException { // TODO: test validations } - /** - * - * - * get version of lakeFS server - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getLakeFSVersionTest() throws ApiException { - VersionConfig response = api.getLakeFSVersion(); - // TODO: test validations - } - - /** - * - * - * retrieve lakeFS storage configuration - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getStorageConfigTest() throws ApiException { - StorageConfig response = api.getStorageConfig(); - // TODO: test validations - } - } 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 805eb7a0b64..7a36f1a46e9 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,7 +21,9 @@ 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.StorageConfig; import io.lakefs.clients.api.model.StorageURI; +import io.lakefs.clients.api.model.VersionConfig; import org.junit.Test; import org.junit.Ignore; @@ -85,6 +87,20 @@ public void getAuthCapabilitiesTest() throws ApiException { // TODO: test validations } + /** + * + * + * get version of lakeFS server + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getLakeFSVersionTest() throws ApiException { + VersionConfig response = api.getLakeFSVersion(); + // TODO: test validations + } + /** * check if the lakeFS installation is already set up * @@ -99,6 +115,20 @@ public void getSetupStateTest() throws ApiException { // TODO: test validations } + /** + * + * + * retrieve lakeFS storage configuration + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getStorageConfigTest() throws ApiException { + StorageConfig response = api.getStorageConfig(); + // TODO: test validations + } + /** * post stats events, this endpoint is meant for internal use only * diff --git a/clients/java/src/test/java/io/lakefs/clients/api/model/ConfigTest.java b/clients/java/src/test/java/io/lakefs/clients/api/model/ConfigTest.java new file mode 100644 index 00000000000..8fc7dc747b9 --- /dev/null +++ b/clients/java/src/test/java/io/lakefs/clients/api/model/ConfigTest.java @@ -0,0 +1,61 @@ +/* + * 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.lakefs.clients.api.model.StorageConfig; +import io.lakefs.clients.api.model.VersionConfig; +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 Config + */ +public class ConfigTest { + private final Config model = new Config(); + + /** + * Model tests for Config + */ + @Test + public void testConfig() { + // TODO: test Config + } + + /** + * Test the property 'versionConfig' + */ + @Test + public void versionConfigTest() { + // TODO: test versionConfig + } + + /** + * Test the property 'storageConfig' + */ + @Test + public void storageConfigTest() { + // TODO: test storageConfig + } + +} diff --git a/clients/python/README.md b/clients/python/README.md index 2e3625e6df0..6e9325fe835 100644 --- a/clients/python/README.md +++ b/clients/python/README.md @@ -163,8 +163,6 @@ Class | Method | HTTP request | Description *CommitsApi* | [**get_commit**](docs/CommitsApi.md#get_commit) | **GET** /repositories/{repository}/commits/{commitId} | get commit *ConfigApi* | [**get_config**](docs/ConfigApi.md#get_config) | **GET** /config | *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_storage_config**](docs/ConfigApi.md#get_storage_config) | **GET** /config/storage | *ExperimentalApi* | [**get_otf_diffs**](docs/ExperimentalApi.md#get_otf_diffs) | **GET** /otf/diffs | get the available Open Table Format diffs *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 | @@ -174,7 +172,9 @@ Class | Method | HTTP request | Description *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_lake_fs_version**](docs/InternalApi.md#get_lake_fs_version) | **GET** /config/version | *InternalApi* | [**get_setup_state**](docs/InternalApi.md#get_setup_state) | **GET** /setup_lakefs | check if the lakeFS installation is already set up +*InternalApi* | [**get_storage_config**](docs/InternalApi.md#get_storage_config) | **GET** /config/storage | *InternalApi* | [**post_stats_events**](docs/InternalApi.md#post_stats_events) | **POST** /statistics | post stats events, this endpoint is meant for internal use only *InternalApi* | [**set_garbage_collection_rules_preflight**](docs/InternalApi.md#set_garbage_collection_rules_preflight) | **GET** /repositories/{repository}/gc/rules/set_allowed | *InternalApi* | [**setup**](docs/InternalApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user diff --git a/clients/python/docs/Config.md b/clients/python/docs/Config.md new file mode 100644 index 00000000000..fcf2ff181a3 --- /dev/null +++ b/clients/python/docs/Config.md @@ -0,0 +1,13 @@ +# Config + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version_config** | [**VersionConfig**](VersionConfig.md) | | [optional] +**storage_config** | [**StorageConfig**](StorageConfig.md) | | [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/ConfigApi.md b/clients/python/docs/ConfigApi.md index bb87742ce4e..d5beb61edfb 100644 --- a/clients/python/docs/ConfigApi.md +++ b/clients/python/docs/ConfigApi.md @@ -6,8 +6,6 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**get_config**](ConfigApi.md#get_config) | **GET** /config | [**get_garbage_collection_config**](ConfigApi.md#get_garbage_collection_config) | **GET** /config/garbage-collection | -[**get_lake_fs_version**](ConfigApi.md#get_lake_fs_version) | **GET** /config/version | -[**get_storage_config**](ConfigApi.md#get_storage_config) | **GET** /config/storage | # **get_config** @@ -214,207 +212,3 @@ This endpoint does not need any parameter. [[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_lake_fs_version** -> VersionConfig get_lake_fs_version() - - - -get version of lakeFS server - -### 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 config_api -from lakefs_client.model.version_config import VersionConfig -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 = config_api.ConfigApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.get_lake_fs_version() - pprint(api_response) - except lakefs_client.ApiException as e: - print("Exception when calling ConfigApi->get_lake_fs_version: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**VersionConfig**](VersionConfig.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** | lakeFS version | - | -**401** | Unauthorized | - | - -[[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_storage_config** -> StorageConfig get_storage_config() - - - -retrieve lakeFS storage configuration - -### 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 config_api -from lakefs_client.model.error import Error -from lakefs_client.model.storage_config import StorageConfig -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 = config_api.ConfigApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - api_response = api_instance.get_storage_config() - pprint(api_response) - except lakefs_client.ApiException as e: - print("Exception when calling ConfigApi->get_storage_config: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**StorageConfig**](StorageConfig.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** | lakeFS storage configuration | - | -**401** | Unauthorized | - | - -[[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/InternalApi.md b/clients/python/docs/InternalApi.md index ae6f8b321c5..0eed8790827 100644 --- a/clients/python/docs/InternalApi.md +++ b/clients/python/docs/InternalApi.md @@ -7,7 +7,9 @@ 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_lake_fs_version**](InternalApi.md#get_lake_fs_version) | **GET** /config/version | [**get_setup_state**](InternalApi.md#get_setup_state) | **GET** /setup_lakefs | check if the lakeFS installation is already set up +[**get_storage_config**](InternalApi.md#get_storage_config) | **GET** /config/storage | [**post_stats_events**](InternalApi.md#post_stats_events) | **POST** /statistics | post stats events, this endpoint is meant for internal use only [**set_garbage_collection_rules_preflight**](InternalApi.md#set_garbage_collection_rules_preflight) | **GET** /repositories/{repository}/gc/rules/set_allowed | [**setup**](InternalApi.md#setup) | **POST** /setup_lakefs | setup lakeFS and create a first user @@ -303,6 +305,108 @@ No authorization required [[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_lake_fs_version** +> VersionConfig get_lake_fs_version() + + + +get version of lakeFS server + +### 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.version_config import VersionConfig +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 = internal_api.InternalApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.get_lake_fs_version() + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling InternalApi->get_lake_fs_version: %s\n" % e) +``` + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**VersionConfig**](VersionConfig.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** | lakeFS version | - | +**401** | Unauthorized | - | + +[[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_setup_state** > SetupState get_setup_state() @@ -366,6 +470,108 @@ No authorization required [[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_storage_config** +> StorageConfig get_storage_config() + + + +retrieve lakeFS storage configuration + +### 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_config import StorageConfig +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) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.get_storage_config() + pprint(api_response) + except lakefs_client.ApiException as e: + print("Exception when calling InternalApi->get_storage_config: %s\n" % e) +``` + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**StorageConfig**](StorageConfig.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** | lakeFS storage configuration | - | +**401** | Unauthorized | - | + +[[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) + # **post_stats_events** > post_stats_events(stats_events_list) diff --git a/clients/python/lakefs_client/api/config_api.py b/clients/python/lakefs_client/api/config_api.py index 4ffa1600086..cb6591f1b65 100644 --- a/clients/python/lakefs_client/api/config_api.py +++ b/clients/python/lakefs_client/api/config_api.py @@ -25,8 +25,6 @@ from lakefs_client.model.config import Config from lakefs_client.model.error import Error from lakefs_client.model.garbage_collection_config import GarbageCollectionConfig -from lakefs_client.model.storage_config import StorageConfig -from lakefs_client.model.version_config import VersionConfig class ConfigApi(object): @@ -136,102 +134,6 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.get_lake_fs_version_endpoint = _Endpoint( - settings={ - 'response_type': (VersionConfig,), - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/config/version', - 'operation_id': 'get_lake_fs_version', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_storage_config_endpoint = _Endpoint( - settings={ - 'response_type': (StorageConfig,), - 'auth': [ - 'basic_auth', - 'cookie_auth', - 'jwt_token', - 'oidc_auth', - 'saml_auth' - ], - 'endpoint_path': '/config/storage', - 'operation_id': 'get_storage_config', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) def get_config( self, @@ -355,125 +257,3 @@ def get_garbage_collection_config( kwargs['_host_index'] = kwargs.get('_host_index') return self.get_garbage_collection_config_endpoint.call_with_http_info(**kwargs) - def get_lake_fs_version( - self, - **kwargs - ): - """get_lake_fs_version # noqa: E501 - - get version of lakeFS server # 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_lake_fs_version(async_req=True) - >>> result = thread.get() - - - 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: - VersionConfig - 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') - return self.get_lake_fs_version_endpoint.call_with_http_info(**kwargs) - - def get_storage_config( - self, - **kwargs - ): - """get_storage_config # noqa: E501 - - retrieve lakeFS storage configuration # 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_storage_config(async_req=True) - >>> result = thread.get() - - - 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: - StorageConfig - 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') - return self.get_storage_config_endpoint.call_with_http_info(**kwargs) - diff --git a/clients/python/lakefs_client/api/internal_api.py b/clients/python/lakefs_client/api/internal_api.py index 19ea97f55af..5e4f9cf677f 100644 --- a/clients/python/lakefs_client/api/internal_api.py +++ b/clients/python/lakefs_client/api/internal_api.py @@ -29,7 +29,9 @@ 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_config import StorageConfig from lakefs_client.model.storage_uri import StorageURI +from lakefs_client.model.version_config import VersionConfig class InternalApi(object): @@ -206,6 +208,54 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.get_lake_fs_version_endpoint = _Endpoint( + settings={ + 'response_type': (VersionConfig,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/config/version', + 'operation_id': 'get_lake_fs_version', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.get_setup_state_endpoint = _Endpoint( settings={ 'response_type': (SetupState,), @@ -248,6 +298,54 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.get_storage_config_endpoint = _Endpoint( + settings={ + 'response_type': (StorageConfig,), + 'auth': [ + 'basic_auth', + 'cookie_auth', + 'jwt_token', + 'oidc_auth', + 'saml_auth' + ], + 'endpoint_path': '/config/storage', + 'operation_id': 'get_storage_config', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.post_stats_events_endpoint = _Endpoint( settings={ 'response_type': None, @@ -722,6 +820,67 @@ def get_auth_capabilities( kwargs['_host_index'] = kwargs.get('_host_index') return self.get_auth_capabilities_endpoint.call_with_http_info(**kwargs) + def get_lake_fs_version( + self, + **kwargs + ): + """get_lake_fs_version # noqa: E501 + + get version of lakeFS server # 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_lake_fs_version(async_req=True) + >>> result = thread.get() + + + 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: + VersionConfig + 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') + return self.get_lake_fs_version_endpoint.call_with_http_info(**kwargs) + def get_setup_state( self, **kwargs @@ -782,6 +941,67 @@ def get_setup_state( kwargs['_host_index'] = kwargs.get('_host_index') return self.get_setup_state_endpoint.call_with_http_info(**kwargs) + def get_storage_config( + self, + **kwargs + ): + """get_storage_config # noqa: E501 + + retrieve lakeFS storage configuration # 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_storage_config(async_req=True) + >>> result = thread.get() + + + 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: + StorageConfig + 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') + return self.get_storage_config_endpoint.call_with_http_info(**kwargs) + def post_stats_events( self, stats_events_list, diff --git a/clients/python/lakefs_client/model/config.py b/clients/python/lakefs_client/model/config.py new file mode 100644 index 00000000000..442520c4eee --- /dev/null +++ b/clients/python/lakefs_client/model/config.py @@ -0,0 +1,268 @@ +""" + 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 + + +def lazy_import(): + from lakefs_client.model.storage_config import StorageConfig + from lakefs_client.model.version_config import VersionConfig + globals()['StorageConfig'] = StorageConfig + globals()['VersionConfig'] = VersionConfig + + +class Config(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 + """ + lazy_import() + 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. + """ + lazy_import() + return { + 'version_config': (VersionConfig,), # noqa: E501 + 'storage_config': (StorageConfig,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'version_config': 'version_config', # noqa: E501 + 'storage_config': 'storage_config', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Config - a model defined in OpenAPI + + 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,) + version_config (VersionConfig): [optional] # noqa: E501 + storage_config (StorageConfig): [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__,) + + 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, *args, **kwargs): # noqa: E501 + """Config - a model defined in OpenAPI + + 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,) + version_config (VersionConfig): [optional] # noqa: E501 + storage_config (StorageConfig): [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__,) + + 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/test/test_config.py b/clients/python/test/test_config.py new file mode 100644 index 00000000000..a002d6e42d1 --- /dev/null +++ b/clients/python/test/test_config.py @@ -0,0 +1,40 @@ +""" + 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.storage_config import StorageConfig +from lakefs_client.model.version_config import VersionConfig +globals()['StorageConfig'] = StorageConfig +globals()['VersionConfig'] = VersionConfig +from lakefs_client.model.config import Config + + +class TestConfig(unittest.TestCase): + """Config unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testConfig(self): + """Test Config""" + # FIXME: construct object with mandatory attributes with example values + # model = Config() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/clients/python/test/test_config_api.py b/clients/python/test/test_config_api.py index 69a297133ba..cb1cac81ed4 100644 --- a/clients/python/test/test_config_api.py +++ b/clients/python/test/test_config_api.py @@ -36,18 +36,6 @@ def test_get_garbage_collection_config(self): """ pass - def test_get_lake_fs_version(self): - """Test case for get_lake_fs_version - - """ - pass - - def test_get_storage_config(self): - """Test case for get_storage_config - - """ - pass - if __name__ == '__main__': unittest.main() diff --git a/clients/python/test/test_internal_api.py b/clients/python/test/test_internal_api.py index 70a356f9016..95053a99dfe 100644 --- a/clients/python/test/test_internal_api.py +++ b/clients/python/test/test_internal_api.py @@ -44,6 +44,12 @@ def test_get_auth_capabilities(self): """ pass + def test_get_lake_fs_version(self): + """Test case for get_lake_fs_version + + """ + pass + def test_get_setup_state(self): """Test case for get_setup_state @@ -51,6 +57,12 @@ def test_get_setup_state(self): """ pass + def test_get_storage_config(self): + """Test case for get_storage_config + + """ + pass + def test_post_stats_events(self): """Test case for post_stats_events