From 90ce3c65e62238ea4ee15c99d956ed54da8c493d Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Wed, 28 Oct 2020 15:42:57 -0700 Subject: [PATCH 1/6] feat: added login --- README.md | 8 +- docs/AuthServiceApi.md | 76 ++++++++++ docs/LabelServiceApi.md | 82 +++++++++++ onepanel/core/api/__init__.py | 6 +- onepanel/core/api/api/auth_service_api.py | 118 +++++++++++++++- onepanel/core/api/api/config_service_api.py | 2 +- .../core/api/api/cron_workflow_service_api.py | 2 +- onepanel/core/api/api/label_service_api.py | 133 +++++++++++++++++- .../core/api/api/namespace_service_api.py | 2 +- onepanel/core/api/api/secret_service_api.py | 2 +- onepanel/core/api/api/service_service_api.py | 2 +- onepanel/core/api/api/workflow_service_api.py | 2 +- .../api/api/workflow_template_service_api.py | 2 +- .../core/api/api/workspace_service_api.py | 2 +- .../api/api/workspace_template_service_api.py | 2 +- onepanel/core/api/api_client.py | 4 +- onepanel/core/api/configuration.py | 6 +- onepanel/core/api/exceptions.py | 2 +- onepanel/core/api/models/__init__.py | 4 +- .../models/add_secret_key_value_response.py | 2 +- .../archive_workflow_template_response.py | 2 +- onepanel/core/api/models/artifact_response.py | 2 +- .../models/create_workflow_execution_body.py | 2 +- .../core/api/models/create_workspace_body.py | 2 +- onepanel/core/api/models/cron_workflow.py | 2 +- .../models/cron_workflow_statistics_report.py | 2 +- .../api/models/delete_secret_key_response.py | 2 +- .../core/api/models/delete_secret_response.py | 2 +- onepanel/core/api/models/file.py | 2 +- .../core/api/models/get_config_response.py | 2 +- .../core/api/models/get_labels_response.py | 2 +- ...get_workflow_execution_metrics_response.py | 2 +- ...ution_statistics_for_namespace_response.py | 2 +- ...space_statistics_for_namespace_response.py | 2 +- .../core/api/models/google_protobuf_any.py | 2 +- .../api/models/grpc_gateway_runtime_error.py | 2 +- .../grpc_gateway_runtime_stream_error.py | 2 +- onepanel/core/api/models/is_authorized.py | 2 +- .../core/api/models/is_authorized_response.py | 2 +- .../core/api/models/is_valid_token_request.py | 2 +- .../api/models/is_valid_token_response.py | 2 +- onepanel/core/api/models/key_value.py | 2 +- onepanel/core/api/models/labels.py | 2 +- .../models/list_cron_workflows_response.py | 2 +- .../core/api/models/list_files_response.py | 2 +- .../api/models/list_namespaces_response.py | 2 +- .../core/api/models/list_secrets_response.py | 2 +- .../core/api/models/list_services_response.py | 2 +- .../list_workflow_executions_response.py | 2 +- ...ist_workflow_template_versions_response.py | 2 +- .../list_workflow_templates_response.py | 2 +- .../api/models/list_workspace_response.py | 2 +- ...st_workspace_template_versions_response.py | 2 +- .../list_workspace_templates_response.py | 2 +- onepanel/core/api/models/log_entry.py | 2 +- onepanel/core/api/models/metric.py | 2 +- onepanel/core/api/models/namespace.py | 2 +- onepanel/core/api/models/node_pool.py | 2 +- onepanel/core/api/models/node_pool_option.py | 2 +- onepanel/core/api/models/parameter.py | 2 +- onepanel/core/api/models/parameter_option.py | 2 +- onepanel/core/api/models/secret.py | 2 +- .../core/api/models/secret_exists_response.py | 2 +- onepanel/core/api/models/service.py | 2 +- onepanel/core/api/models/statistics.py | 2 +- .../api/models/stream_result_of_log_entry.py | 2 +- .../stream_result_of_workflow_execution.py | 2 +- .../update_secret_key_value_response.py | 2 +- .../core/api/models/update_workspace_body.py | 2 +- .../core/api/models/workflow_execution.py | 2 +- .../api/models/workflow_execution_metadata.py | 2 +- .../workflow_execution_statistic_report.py | 2 +- .../api/models/workflow_execution_status.py | 2 +- onepanel/core/api/models/workflow_template.py | 2 +- onepanel/core/api/models/workspace.py | 2 +- .../api/models/workspace_statistic_report.py | 2 +- onepanel/core/api/models/workspace_status.py | 2 +- .../core/api/models/workspace_template.py | 2 +- onepanel/core/api/rest.py | 2 +- setup.py | 4 +- 80 files changed, 497 insertions(+), 84 deletions(-) diff --git a/README.md b/README.md index 77e5cd6..53ae401 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ Onepanel API This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 0.14.1 -- Package version: v0.14.1 +- API version: 0.15.0 +- Package version: v0.15.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://github.com/onepanelio/core](https://github.com/onepanelio/core) @@ -97,6 +97,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AuthServiceApi* | [**is_authorized**](docs/AuthServiceApi.md#is_authorized) | **POST** /apis/v1beta1/auth | *AuthServiceApi* | [**is_valid_token**](docs/AuthServiceApi.md#is_valid_token) | **POST** /apis/v1beta1/auth/token | +*AuthServiceApi* | [**log_in**](docs/AuthServiceApi.md#log_in) | **POST** /apis/v1beta1/auth/login | *ConfigServiceApi* | [**get_config**](docs/ConfigServiceApi.md#get_config) | **GET** /apis/v1beta1/config | *CronWorkflowServiceApi* | [**create_cron_workflow**](docs/CronWorkflowServiceApi.md#create_cron_workflow) | **POST** /apis/v1beta1/{namespace}/cron_workflow | *CronWorkflowServiceApi* | [**delete_cron_workflow**](docs/CronWorkflowServiceApi.md#delete_cron_workflow) | **DELETE** /apis/v1beta1/{namespace}/cron_workflows/{uid} | @@ -106,6 +107,7 @@ Class | Method | HTTP request | Description *CronWorkflowServiceApi* | [**update_cron_workflow**](docs/CronWorkflowServiceApi.md#update_cron_workflow) | **PUT** /apis/v1beta1/{namespace}/cron_workflow/{uid} | *LabelServiceApi* | [**add_labels**](docs/LabelServiceApi.md#add_labels) | **POST** /apis/v1beta1/{namespace}/{resource}/{uid}/labels | *LabelServiceApi* | [**delete_label**](docs/LabelServiceApi.md#delete_label) | **DELETE** /apis/v1beta1/{namespace}/{resource}/{uid}/labels/{key} | +*LabelServiceApi* | [**get_available_labels**](docs/LabelServiceApi.md#get_available_labels) | **GET** /apis/v1beta1/labels/{namespace}/{resource}/labels | *LabelServiceApi* | [**get_labels**](docs/LabelServiceApi.md#get_labels) | **GET** /apis/v1beta1/{namespace}/{resource}/{uid}/labels | *LabelServiceApi* | [**replace_labels**](docs/LabelServiceApi.md#replace_labels) | **PUT** /apis/v1beta1/{namespace}/{resource}/{uid}/labels | *NamespaceServiceApi* | [**create_namespace**](docs/NamespaceServiceApi.md#create_namespace) | **POST** /apis/v1beta1/namespaces | @@ -201,6 +203,8 @@ Class | Method | HTTP request | Description - [ListWorkspaceTemplateVersionsResponse](docs/ListWorkspaceTemplateVersionsResponse.md) - [ListWorkspaceTemplatesResponse](docs/ListWorkspaceTemplatesResponse.md) - [LogEntry](docs/LogEntry.md) + - [LogInRequest](docs/LogInRequest.md) + - [LogInResponse](docs/LogInResponse.md) - [Metric](docs/Metric.md) - [Namespace](docs/Namespace.md) - [NodePool](docs/NodePool.md) diff --git a/docs/AuthServiceApi.md b/docs/AuthServiceApi.md index a650835..0f33832 100644 --- a/docs/AuthServiceApi.md +++ b/docs/AuthServiceApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**is_authorized**](AuthServiceApi.md#is_authorized) | **POST** /apis/v1beta1/auth | [**is_valid_token**](AuthServiceApi.md#is_valid_token) | **POST** /apis/v1beta1/auth/token | +[**log_in**](AuthServiceApi.md#log_in) | **POST** /apis/v1beta1/auth/login | # **is_authorized** @@ -158,3 +159,78 @@ Name | Type | Description | Notes [[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) +# **log_in** +> LogInResponse log_in(body) + + + +### Example + +* Api Key Authentication (Bearer): +```python +from __future__ import print_function +import time +import onepanel.core.api +from onepanel.core.api.rest import ApiException +from pprint import pprint +# Defining the host is optional and defaults to http://localhost:8888 +# See configuration.py for a list of all supported configuration parameters. +configuration = onepanel.core.api.Configuration( + host = "http://localhost:8888" +) + +# 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 API key authorization: Bearer +configuration = onepanel.core.api.Configuration( + host = "http://localhost:8888", + api_key = { + 'authorization': 'YOUR_API_KEY' + } +) +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['authorization'] = 'Bearer' + +# Enter a context with an instance of the API client +with onepanel.core.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = onepanel.core.api.AuthServiceApi(api_client) + body = onepanel.core.api.LogInRequest() # LogInRequest | + + try: + api_response = api_instance.log_in(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling AuthServiceApi->log_in: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**LogInRequest**](LogInRequest.md)| | + +### Return type + +[**LogInResponse**](LogInResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/octet-stream + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**0** | An unexpected error response | - | + +[[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/docs/LabelServiceApi.md b/docs/LabelServiceApi.md index 43c2227..7d01a0a 100644 --- a/docs/LabelServiceApi.md +++ b/docs/LabelServiceApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**add_labels**](LabelServiceApi.md#add_labels) | **POST** /apis/v1beta1/{namespace}/{resource}/{uid}/labels | [**delete_label**](LabelServiceApi.md#delete_label) | **DELETE** /apis/v1beta1/{namespace}/{resource}/{uid}/labels/{key} | +[**get_available_labels**](LabelServiceApi.md#get_available_labels) | **GET** /apis/v1beta1/labels/{namespace}/{resource}/labels | [**get_labels**](LabelServiceApi.md#get_labels) | **GET** /apis/v1beta1/{namespace}/{resource}/{uid}/labels | [**replace_labels**](LabelServiceApi.md#replace_labels) | **PUT** /apis/v1beta1/{namespace}/{resource}/{uid}/labels | @@ -172,6 +173,87 @@ Name | Type | Description | Notes [[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_available_labels** +> GetLabelsResponse get_available_labels(namespace, resource, key_like=key_like, skip_keys=skip_keys) + + + +### Example + +* Api Key Authentication (Bearer): +```python +from __future__ import print_function +import time +import onepanel.core.api +from onepanel.core.api.rest import ApiException +from pprint import pprint +# Defining the host is optional and defaults to http://localhost:8888 +# See configuration.py for a list of all supported configuration parameters. +configuration = onepanel.core.api.Configuration( + host = "http://localhost:8888" +) + +# 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 API key authorization: Bearer +configuration = onepanel.core.api.Configuration( + host = "http://localhost:8888", + api_key = { + 'authorization': 'YOUR_API_KEY' + } +) +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['authorization'] = 'Bearer' + +# Enter a context with an instance of the API client +with onepanel.core.api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = onepanel.core.api.LabelServiceApi(api_client) + namespace = 'namespace_example' # str | +resource = 'resource_example' # str | +key_like = 'key_like_example' # str | (optional) +skip_keys = 'skip_keys_example' # str | (optional) + + try: + api_response = api_instance.get_available_labels(namespace, resource, key_like=key_like, skip_keys=skip_keys) + pprint(api_response) + except ApiException as e: + print("Exception when calling LabelServiceApi->get_available_labels: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **namespace** | **str**| | + **resource** | **str**| | + **key_like** | **str**| | [optional] + **skip_keys** | **str**| | [optional] + +### Return type + +[**GetLabelsResponse**](GetLabelsResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/octet-stream + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**0** | An unexpected error response | - | + +[[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_labels** > GetLabelsResponse get_labels(namespace, resource, uid) diff --git a/onepanel/core/api/__init__.py b/onepanel/core/api/__init__.py index 4d37dc8..7fd69cd 100644 --- a/onepanel/core/api/__init__.py +++ b/onepanel/core/api/__init__.py @@ -7,14 +7,14 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import -__version__ = "v0.14.1" +__version__ = "v0.15.0" # import apis into sdk package from onepanel.core.api.api.auth_service_api import AuthServiceApi @@ -74,6 +74,8 @@ from onepanel.core.api.models.list_workspace_template_versions_response import ListWorkspaceTemplateVersionsResponse from onepanel.core.api.models.list_workspace_templates_response import ListWorkspaceTemplatesResponse from onepanel.core.api.models.log_entry import LogEntry +from onepanel.core.api.models.log_in_request import LogInRequest +from onepanel.core.api.models.log_in_response import LogInResponse from onepanel.core.api.models.metric import Metric from onepanel.core.api.models.namespace import Namespace from onepanel.core.api.models.node_pool import NodePool diff --git a/onepanel/core/api/api/auth_service_api.py b/onepanel/core/api/api/auth_service_api.py index 1829508..5d371f7 100644 --- a/onepanel/core/api/api/auth_service_api.py +++ b/onepanel/core/api/api/auth_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ @@ -267,3 +267,119 @@ def is_valid_token_with_http_info(self, body, **kwargs): # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + + def log_in(self, body, **kwargs): # noqa: E501 + """log_in # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.log_in(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param LogInRequest body: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: 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. + :return: LogInResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.log_in_with_http_info(body, **kwargs) # noqa: E501 + + def log_in_with_http_info(self, body, **kwargs): # noqa: E501 + """log_in # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.log_in_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param LogInRequest body: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: 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. + :return: tuple(LogInResponse, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method log_in" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `log_in`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in local_var_params: + body_params = local_var_params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/octet-stream']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Bearer'] # noqa: E501 + + return self.api_client.call_api( + '/apis/v1beta1/auth/login', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='LogInResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/onepanel/core/api/api/config_service_api.py b/onepanel/core/api/api/config_service_api.py index 4c61169..db6dc48 100644 --- a/onepanel/core/api/api/config_service_api.py +++ b/onepanel/core/api/api/config_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/api/cron_workflow_service_api.py b/onepanel/core/api/api/cron_workflow_service_api.py index af94fd5..673f91c 100644 --- a/onepanel/core/api/api/cron_workflow_service_api.py +++ b/onepanel/core/api/api/cron_workflow_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/api/label_service_api.py b/onepanel/core/api/api/label_service_api.py index 42edcfd..36946f3 100644 --- a/onepanel/core/api/api/label_service_api.py +++ b/onepanel/core/api/api/label_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ @@ -318,6 +318,137 @@ def delete_label_with_http_info(self, namespace, resource, uid, key, **kwargs): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + def get_available_labels(self, namespace, resource, **kwargs): # noqa: E501 + """get_available_labels # 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_available_labels(namespace, resource, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str namespace: (required) + :param str resource: (required) + :param str key_like: + :param str skip_keys: + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: 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. + :return: GetLabelsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_available_labels_with_http_info(namespace, resource, **kwargs) # noqa: E501 + + def get_available_labels_with_http_info(self, namespace, resource, **kwargs): # noqa: E501 + """get_available_labels # 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_available_labels_with_http_info(namespace, resource, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param str namespace: (required) + :param str resource: (required) + :param str key_like: + :param str skip_keys: + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: 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. + :return: tuple(GetLabelsResponse, status_code(int), headers(HTTPHeaderDict)) + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'resource', + 'key_like', + 'skip_keys' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_available_labels" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and ('namespace' not in local_var_params or # noqa: E501 + local_var_params['namespace'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `get_available_labels`") # noqa: E501 + # verify the required parameter 'resource' is set + if self.api_client.client_side_validation and ('resource' not in local_var_params or # noqa: E501 + local_var_params['resource'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `resource` when calling `get_available_labels`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'resource' in local_var_params: + path_params['resource'] = local_var_params['resource'] # noqa: E501 + + query_params = [] + if 'key_like' in local_var_params and local_var_params['key_like'] is not None: # noqa: E501 + query_params.append(('keyLike', local_var_params['key_like'])) # noqa: E501 + if 'skip_keys' in local_var_params and local_var_params['skip_keys'] is not None: # noqa: E501 + query_params.append(('skipKeys', local_var_params['skip_keys'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/octet-stream']) # noqa: E501 + + # Authentication setting + auth_settings = ['Bearer'] # noqa: E501 + + return self.api_client.call_api( + '/apis/v1beta1/labels/{namespace}/{resource}/labels', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetLabelsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + def get_labels(self, namespace, resource, uid, **kwargs): # noqa: E501 """get_labels # noqa: E501 diff --git a/onepanel/core/api/api/namespace_service_api.py b/onepanel/core/api/api/namespace_service_api.py index 0617cad..4e27f0d 100644 --- a/onepanel/core/api/api/namespace_service_api.py +++ b/onepanel/core/api/api/namespace_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/api/secret_service_api.py b/onepanel/core/api/api/secret_service_api.py index 63f3330..b6d0e94 100644 --- a/onepanel/core/api/api/secret_service_api.py +++ b/onepanel/core/api/api/secret_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/api/service_service_api.py b/onepanel/core/api/api/service_service_api.py index 0f88437..a9ebf59 100644 --- a/onepanel/core/api/api/service_service_api.py +++ b/onepanel/core/api/api/service_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/api/workflow_service_api.py b/onepanel/core/api/api/workflow_service_api.py index 81a7f46..a25ec94 100644 --- a/onepanel/core/api/api/workflow_service_api.py +++ b/onepanel/core/api/api/workflow_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/api/workflow_template_service_api.py b/onepanel/core/api/api/workflow_template_service_api.py index 89c62e0..fd3bb1a 100644 --- a/onepanel/core/api/api/workflow_template_service_api.py +++ b/onepanel/core/api/api/workflow_template_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/api/workspace_service_api.py b/onepanel/core/api/api/workspace_service_api.py index 7e8d20a..7b6f196 100644 --- a/onepanel/core/api/api/workspace_service_api.py +++ b/onepanel/core/api/api/workspace_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/api/workspace_template_service_api.py b/onepanel/core/api/api/workspace_template_service_api.py index efc191a..e0a36cd 100644 --- a/onepanel/core/api/api/workspace_template_service_api.py +++ b/onepanel/core/api/api/workspace_template_service_api.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/api_client.py b/onepanel/core/api/api_client.py index b1bb807..7720846 100644 --- a/onepanel/core/api/api_client.py +++ b/onepanel/core/api/api_client.py @@ -4,7 +4,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ @@ -78,7 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/v0.14.1/python' + self.user_agent = 'OpenAPI-Generator/v0.15.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/onepanel/core/api/configuration.py b/onepanel/core/api/configuration.py index 5c4dbe2..eaf1551 100644 --- a/onepanel/core/api/configuration.py +++ b/onepanel/core/api/configuration.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ @@ -351,8 +351,8 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 0.14.1\n"\ - "SDK Package Version: v0.14.1".\ + "Version of the API: 0.15.0\n"\ + "SDK Package Version: v0.15.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/onepanel/core/api/exceptions.py b/onepanel/core/api/exceptions.py index 7ccbdda..004041a 100644 --- a/onepanel/core/api/exceptions.py +++ b/onepanel/core/api/exceptions.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/__init__.py b/onepanel/core/api/models/__init__.py index e132ac0..3d69c2f 100644 --- a/onepanel/core/api/models/__init__.py +++ b/onepanel/core/api/models/__init__.py @@ -6,7 +6,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ @@ -50,6 +50,8 @@ from onepanel.core.api.models.list_workspace_template_versions_response import ListWorkspaceTemplateVersionsResponse from onepanel.core.api.models.list_workspace_templates_response import ListWorkspaceTemplatesResponse from onepanel.core.api.models.log_entry import LogEntry +from onepanel.core.api.models.log_in_request import LogInRequest +from onepanel.core.api.models.log_in_response import LogInResponse from onepanel.core.api.models.metric import Metric from onepanel.core.api.models.namespace import Namespace from onepanel.core.api.models.node_pool import NodePool diff --git a/onepanel/core/api/models/add_secret_key_value_response.py b/onepanel/core/api/models/add_secret_key_value_response.py index 2061817..c1c70cd 100644 --- a/onepanel/core/api/models/add_secret_key_value_response.py +++ b/onepanel/core/api/models/add_secret_key_value_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/archive_workflow_template_response.py b/onepanel/core/api/models/archive_workflow_template_response.py index 61f85a3..ade8971 100644 --- a/onepanel/core/api/models/archive_workflow_template_response.py +++ b/onepanel/core/api/models/archive_workflow_template_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/artifact_response.py b/onepanel/core/api/models/artifact_response.py index f6a8a81..682ec18 100644 --- a/onepanel/core/api/models/artifact_response.py +++ b/onepanel/core/api/models/artifact_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/create_workflow_execution_body.py b/onepanel/core/api/models/create_workflow_execution_body.py index c8d00ed..d5ef396 100644 --- a/onepanel/core/api/models/create_workflow_execution_body.py +++ b/onepanel/core/api/models/create_workflow_execution_body.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/create_workspace_body.py b/onepanel/core/api/models/create_workspace_body.py index 0d4b6f2..9c2941c 100644 --- a/onepanel/core/api/models/create_workspace_body.py +++ b/onepanel/core/api/models/create_workspace_body.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/cron_workflow.py b/onepanel/core/api/models/cron_workflow.py index 4684eb2..6b57b0c 100644 --- a/onepanel/core/api/models/cron_workflow.py +++ b/onepanel/core/api/models/cron_workflow.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/cron_workflow_statistics_report.py b/onepanel/core/api/models/cron_workflow_statistics_report.py index 6156c36..6c422e8 100644 --- a/onepanel/core/api/models/cron_workflow_statistics_report.py +++ b/onepanel/core/api/models/cron_workflow_statistics_report.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/delete_secret_key_response.py b/onepanel/core/api/models/delete_secret_key_response.py index 20dbcca..ecf6df3 100644 --- a/onepanel/core/api/models/delete_secret_key_response.py +++ b/onepanel/core/api/models/delete_secret_key_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/delete_secret_response.py b/onepanel/core/api/models/delete_secret_response.py index bdd3cd5..9a7ba1d 100644 --- a/onepanel/core/api/models/delete_secret_response.py +++ b/onepanel/core/api/models/delete_secret_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/file.py b/onepanel/core/api/models/file.py index bd939f2..70b166e 100644 --- a/onepanel/core/api/models/file.py +++ b/onepanel/core/api/models/file.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/get_config_response.py b/onepanel/core/api/models/get_config_response.py index b357078..0794df8 100644 --- a/onepanel/core/api/models/get_config_response.py +++ b/onepanel/core/api/models/get_config_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/get_labels_response.py b/onepanel/core/api/models/get_labels_response.py index 7d1ab00..57ed837 100644 --- a/onepanel/core/api/models/get_labels_response.py +++ b/onepanel/core/api/models/get_labels_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/get_workflow_execution_metrics_response.py b/onepanel/core/api/models/get_workflow_execution_metrics_response.py index 0db533a..0abded8 100644 --- a/onepanel/core/api/models/get_workflow_execution_metrics_response.py +++ b/onepanel/core/api/models/get_workflow_execution_metrics_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/get_workflow_execution_statistics_for_namespace_response.py b/onepanel/core/api/models/get_workflow_execution_statistics_for_namespace_response.py index 3bc9c63..f0a95e4 100644 --- a/onepanel/core/api/models/get_workflow_execution_statistics_for_namespace_response.py +++ b/onepanel/core/api/models/get_workflow_execution_statistics_for_namespace_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/get_workspace_statistics_for_namespace_response.py b/onepanel/core/api/models/get_workspace_statistics_for_namespace_response.py index aa7e44f..742f950 100644 --- a/onepanel/core/api/models/get_workspace_statistics_for_namespace_response.py +++ b/onepanel/core/api/models/get_workspace_statistics_for_namespace_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/google_protobuf_any.py b/onepanel/core/api/models/google_protobuf_any.py index d0da4e8..79a64d8 100644 --- a/onepanel/core/api/models/google_protobuf_any.py +++ b/onepanel/core/api/models/google_protobuf_any.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/grpc_gateway_runtime_error.py b/onepanel/core/api/models/grpc_gateway_runtime_error.py index 3d7f4b4..b2b435e 100644 --- a/onepanel/core/api/models/grpc_gateway_runtime_error.py +++ b/onepanel/core/api/models/grpc_gateway_runtime_error.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/grpc_gateway_runtime_stream_error.py b/onepanel/core/api/models/grpc_gateway_runtime_stream_error.py index 0cb513b..1d7a59d 100644 --- a/onepanel/core/api/models/grpc_gateway_runtime_stream_error.py +++ b/onepanel/core/api/models/grpc_gateway_runtime_stream_error.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/is_authorized.py b/onepanel/core/api/models/is_authorized.py index 73b1eb8..c9776c2 100644 --- a/onepanel/core/api/models/is_authorized.py +++ b/onepanel/core/api/models/is_authorized.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/is_authorized_response.py b/onepanel/core/api/models/is_authorized_response.py index 803ac10..39b2436 100644 --- a/onepanel/core/api/models/is_authorized_response.py +++ b/onepanel/core/api/models/is_authorized_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/is_valid_token_request.py b/onepanel/core/api/models/is_valid_token_request.py index 0386b04..3df985c 100644 --- a/onepanel/core/api/models/is_valid_token_request.py +++ b/onepanel/core/api/models/is_valid_token_request.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/is_valid_token_response.py b/onepanel/core/api/models/is_valid_token_response.py index a2a3ca4..43ef9a1 100644 --- a/onepanel/core/api/models/is_valid_token_response.py +++ b/onepanel/core/api/models/is_valid_token_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/key_value.py b/onepanel/core/api/models/key_value.py index 7e70c62..73d7649 100644 --- a/onepanel/core/api/models/key_value.py +++ b/onepanel/core/api/models/key_value.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/labels.py b/onepanel/core/api/models/labels.py index 50ce03f..e3e0e71 100644 --- a/onepanel/core/api/models/labels.py +++ b/onepanel/core/api/models/labels.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_cron_workflows_response.py b/onepanel/core/api/models/list_cron_workflows_response.py index d82d75a..8518447 100644 --- a/onepanel/core/api/models/list_cron_workflows_response.py +++ b/onepanel/core/api/models/list_cron_workflows_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_files_response.py b/onepanel/core/api/models/list_files_response.py index c593b5c..b4b372e 100644 --- a/onepanel/core/api/models/list_files_response.py +++ b/onepanel/core/api/models/list_files_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_namespaces_response.py b/onepanel/core/api/models/list_namespaces_response.py index 2c438c3..dcfb0c3 100644 --- a/onepanel/core/api/models/list_namespaces_response.py +++ b/onepanel/core/api/models/list_namespaces_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_secrets_response.py b/onepanel/core/api/models/list_secrets_response.py index 05b4cce..c999d24 100644 --- a/onepanel/core/api/models/list_secrets_response.py +++ b/onepanel/core/api/models/list_secrets_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_services_response.py b/onepanel/core/api/models/list_services_response.py index 2afe972..954460e 100644 --- a/onepanel/core/api/models/list_services_response.py +++ b/onepanel/core/api/models/list_services_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_workflow_executions_response.py b/onepanel/core/api/models/list_workflow_executions_response.py index 96117bb..3b92294 100644 --- a/onepanel/core/api/models/list_workflow_executions_response.py +++ b/onepanel/core/api/models/list_workflow_executions_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_workflow_template_versions_response.py b/onepanel/core/api/models/list_workflow_template_versions_response.py index 752ab63..5d12b83 100644 --- a/onepanel/core/api/models/list_workflow_template_versions_response.py +++ b/onepanel/core/api/models/list_workflow_template_versions_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_workflow_templates_response.py b/onepanel/core/api/models/list_workflow_templates_response.py index 101fd55..2f52325 100644 --- a/onepanel/core/api/models/list_workflow_templates_response.py +++ b/onepanel/core/api/models/list_workflow_templates_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_workspace_response.py b/onepanel/core/api/models/list_workspace_response.py index 49e4337..18fb642 100644 --- a/onepanel/core/api/models/list_workspace_response.py +++ b/onepanel/core/api/models/list_workspace_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_workspace_template_versions_response.py b/onepanel/core/api/models/list_workspace_template_versions_response.py index 1488269..efcd4d2 100644 --- a/onepanel/core/api/models/list_workspace_template_versions_response.py +++ b/onepanel/core/api/models/list_workspace_template_versions_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/list_workspace_templates_response.py b/onepanel/core/api/models/list_workspace_templates_response.py index a994357..359ed0f 100644 --- a/onepanel/core/api/models/list_workspace_templates_response.py +++ b/onepanel/core/api/models/list_workspace_templates_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/log_entry.py b/onepanel/core/api/models/log_entry.py index 5cdc694..14a83ed 100644 --- a/onepanel/core/api/models/log_entry.py +++ b/onepanel/core/api/models/log_entry.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/metric.py b/onepanel/core/api/models/metric.py index ac9a8d1..e4381e1 100644 --- a/onepanel/core/api/models/metric.py +++ b/onepanel/core/api/models/metric.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/namespace.py b/onepanel/core/api/models/namespace.py index f87555b..dc58658 100644 --- a/onepanel/core/api/models/namespace.py +++ b/onepanel/core/api/models/namespace.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/node_pool.py b/onepanel/core/api/models/node_pool.py index 97651fd..6eebfc7 100644 --- a/onepanel/core/api/models/node_pool.py +++ b/onepanel/core/api/models/node_pool.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/node_pool_option.py b/onepanel/core/api/models/node_pool_option.py index 5d981cf..5e12628 100644 --- a/onepanel/core/api/models/node_pool_option.py +++ b/onepanel/core/api/models/node_pool_option.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/parameter.py b/onepanel/core/api/models/parameter.py index 4edcb6a..e5b1d21 100644 --- a/onepanel/core/api/models/parameter.py +++ b/onepanel/core/api/models/parameter.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/parameter_option.py b/onepanel/core/api/models/parameter_option.py index 12d6126..93122de 100644 --- a/onepanel/core/api/models/parameter_option.py +++ b/onepanel/core/api/models/parameter_option.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/secret.py b/onepanel/core/api/models/secret.py index e81a593..e4d67b8 100644 --- a/onepanel/core/api/models/secret.py +++ b/onepanel/core/api/models/secret.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/secret_exists_response.py b/onepanel/core/api/models/secret_exists_response.py index 9f698c0..233a0ce 100644 --- a/onepanel/core/api/models/secret_exists_response.py +++ b/onepanel/core/api/models/secret_exists_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/service.py b/onepanel/core/api/models/service.py index 1663271..4263e8c 100644 --- a/onepanel/core/api/models/service.py +++ b/onepanel/core/api/models/service.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/statistics.py b/onepanel/core/api/models/statistics.py index e5413ba..5580416 100644 --- a/onepanel/core/api/models/statistics.py +++ b/onepanel/core/api/models/statistics.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/stream_result_of_log_entry.py b/onepanel/core/api/models/stream_result_of_log_entry.py index 491e994..3d05c47 100644 --- a/onepanel/core/api/models/stream_result_of_log_entry.py +++ b/onepanel/core/api/models/stream_result_of_log_entry.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/stream_result_of_workflow_execution.py b/onepanel/core/api/models/stream_result_of_workflow_execution.py index 3c19f76..53e1d5f 100644 --- a/onepanel/core/api/models/stream_result_of_workflow_execution.py +++ b/onepanel/core/api/models/stream_result_of_workflow_execution.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/update_secret_key_value_response.py b/onepanel/core/api/models/update_secret_key_value_response.py index d5339b2..881950e 100644 --- a/onepanel/core/api/models/update_secret_key_value_response.py +++ b/onepanel/core/api/models/update_secret_key_value_response.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/update_workspace_body.py b/onepanel/core/api/models/update_workspace_body.py index b50f02c..7ae92c1 100644 --- a/onepanel/core/api/models/update_workspace_body.py +++ b/onepanel/core/api/models/update_workspace_body.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/workflow_execution.py b/onepanel/core/api/models/workflow_execution.py index 04ab5fd..c70a9a7 100644 --- a/onepanel/core/api/models/workflow_execution.py +++ b/onepanel/core/api/models/workflow_execution.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/workflow_execution_metadata.py b/onepanel/core/api/models/workflow_execution_metadata.py index 6094099..058f25d 100644 --- a/onepanel/core/api/models/workflow_execution_metadata.py +++ b/onepanel/core/api/models/workflow_execution_metadata.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/workflow_execution_statistic_report.py b/onepanel/core/api/models/workflow_execution_statistic_report.py index 6be7e40..9cf0f94 100644 --- a/onepanel/core/api/models/workflow_execution_statistic_report.py +++ b/onepanel/core/api/models/workflow_execution_statistic_report.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/workflow_execution_status.py b/onepanel/core/api/models/workflow_execution_status.py index 297524a..9a4f19e 100644 --- a/onepanel/core/api/models/workflow_execution_status.py +++ b/onepanel/core/api/models/workflow_execution_status.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/workflow_template.py b/onepanel/core/api/models/workflow_template.py index 8848b9b..6bb9825 100644 --- a/onepanel/core/api/models/workflow_template.py +++ b/onepanel/core/api/models/workflow_template.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/workspace.py b/onepanel/core/api/models/workspace.py index 3d3b2f9..9144d2c 100644 --- a/onepanel/core/api/models/workspace.py +++ b/onepanel/core/api/models/workspace.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/workspace_statistic_report.py b/onepanel/core/api/models/workspace_statistic_report.py index 8d8fe9a..e184c7b 100644 --- a/onepanel/core/api/models/workspace_statistic_report.py +++ b/onepanel/core/api/models/workspace_statistic_report.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/workspace_status.py b/onepanel/core/api/models/workspace_status.py index 35363ea..65b36e8 100644 --- a/onepanel/core/api/models/workspace_status.py +++ b/onepanel/core/api/models/workspace_status.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/models/workspace_template.py b/onepanel/core/api/models/workspace_template.py index 98156d6..4128642 100644 --- a/onepanel/core/api/models/workspace_template.py +++ b/onepanel/core/api/models/workspace_template.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/onepanel/core/api/rest.py b/onepanel/core/api/rest.py index 4f8bc8b..bbf05a5 100644 --- a/onepanel/core/api/rest.py +++ b/onepanel/core/api/rest.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ diff --git a/setup.py b/setup.py index 033a597..b5934e3 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ Onepanel API # noqa: E501 - The version of the OpenAPI document: 0.14.1 + The version of the OpenAPI document: 0.15.0 Generated by: https://openapi-generator.tech """ @@ -13,7 +13,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "onepanel-sdk" -VERSION = "v0.14.1" +VERSION = "v0.15.0" # To install the library, run the following # # python setup.py install From 0b481e2a80f6be3d2a5dcc4bdc7aa03ea48b7440 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Thu, 29 Oct 2020 12:12:47 -0700 Subject: [PATCH 2/6] fix: added missing files for log in --- docs/LogInRequest.md | 11 ++ docs/LogInResponse.md | 12 ++ onepanel/core/api/models/log_in_request.py | 146 +++++++++++++++++ onepanel/core/api/models/log_in_response.py | 172 ++++++++++++++++++++ test/test_log_in_request.py | 53 ++++++ test/test_log_in_response.py | 54 ++++++ 6 files changed, 448 insertions(+) create mode 100644 docs/LogInRequest.md create mode 100644 docs/LogInResponse.md create mode 100644 onepanel/core/api/models/log_in_request.py create mode 100644 onepanel/core/api/models/log_in_response.py create mode 100644 test/test_log_in_request.py create mode 100644 test/test_log_in_response.py diff --git a/docs/LogInRequest.md b/docs/LogInRequest.md new file mode 100644 index 0000000..c497885 --- /dev/null +++ b/docs/LogInRequest.md @@ -0,0 +1,11 @@ +# LogInRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | | [optional] +**token_hash** | **str** | | [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/docs/LogInResponse.md b/docs/LogInResponse.md new file mode 100644 index 0000000..bd00508 --- /dev/null +++ b/docs/LogInResponse.md @@ -0,0 +1,12 @@ +# LogInResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain** | **str** | | [optional] +**token** | **str** | | [optional] +**username** | **str** | | [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/onepanel/core/api/models/log_in_request.py b/onepanel/core/api/models/log_in_request.py new file mode 100644 index 0000000..ac9b6b7 --- /dev/null +++ b/onepanel/core/api/models/log_in_request.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Onepanel + + Onepanel API # noqa: E501 + + The version of the OpenAPI document: 0.15.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from onepanel.core.api.configuration import Configuration + + +class LogInRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'username': 'str', + 'token_hash': 'str' + } + + attribute_map = { + 'username': 'username', + 'token_hash': 'tokenHash' + } + + def __init__(self, username=None, token_hash=None, local_vars_configuration=None): # noqa: E501 + """LogInRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._username = None + self._token_hash = None + self.discriminator = None + + if username is not None: + self.username = username + if token_hash is not None: + self.token_hash = token_hash + + @property + def username(self): + """Gets the username of this LogInRequest. # noqa: E501 + + + :return: The username of this LogInRequest. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this LogInRequest. + + + :param username: The username of this LogInRequest. # noqa: E501 + :type: str + """ + + self._username = username + + @property + def token_hash(self): + """Gets the token_hash of this LogInRequest. # noqa: E501 + + + :return: The token_hash of this LogInRequest. # noqa: E501 + :rtype: str + """ + return self._token_hash + + @token_hash.setter + def token_hash(self, token_hash): + """Sets the token_hash of this LogInRequest. + + + :param token_hash: The token_hash of this LogInRequest. # noqa: E501 + :type: str + """ + + self._token_hash = token_hash + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LogInRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, LogInRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/onepanel/core/api/models/log_in_response.py b/onepanel/core/api/models/log_in_response.py new file mode 100644 index 0000000..678bc14 --- /dev/null +++ b/onepanel/core/api/models/log_in_response.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Onepanel + + Onepanel API # noqa: E501 + + The version of the OpenAPI document: 0.15.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from onepanel.core.api.configuration import Configuration + + +class LogInResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'domain': 'str', + 'token': 'str', + 'username': 'str' + } + + attribute_map = { + 'domain': 'domain', + 'token': 'token', + 'username': 'username' + } + + def __init__(self, domain=None, token=None, username=None, local_vars_configuration=None): # noqa: E501 + """LogInResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._domain = None + self._token = None + self._username = None + self.discriminator = None + + if domain is not None: + self.domain = domain + if token is not None: + self.token = token + if username is not None: + self.username = username + + @property + def domain(self): + """Gets the domain of this LogInResponse. # noqa: E501 + + + :return: The domain of this LogInResponse. # noqa: E501 + :rtype: str + """ + return self._domain + + @domain.setter + def domain(self, domain): + """Sets the domain of this LogInResponse. + + + :param domain: The domain of this LogInResponse. # noqa: E501 + :type: str + """ + + self._domain = domain + + @property + def token(self): + """Gets the token of this LogInResponse. # noqa: E501 + + + :return: The token of this LogInResponse. # noqa: E501 + :rtype: str + """ + return self._token + + @token.setter + def token(self, token): + """Sets the token of this LogInResponse. + + + :param token: The token of this LogInResponse. # noqa: E501 + :type: str + """ + + self._token = token + + @property + def username(self): + """Gets the username of this LogInResponse. # noqa: E501 + + + :return: The username of this LogInResponse. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this LogInResponse. + + + :param username: The username of this LogInResponse. # noqa: E501 + :type: str + """ + + self._username = username + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LogInResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, LogInResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/test/test_log_in_request.py b/test/test_log_in_request.py new file mode 100644 index 0000000..5fa1f50 --- /dev/null +++ b/test/test_log_in_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Onepanel + + Onepanel API # noqa: E501 + + The version of the OpenAPI document: 0.15.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import onepanel.core.api +from onepanel.core.api.models.log_in_request import LogInRequest # noqa: E501 +from onepanel.core.api.rest import ApiException + +class TestLogInRequest(unittest.TestCase): + """LogInRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test LogInRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = onepanel.core.api.models.log_in_request.LogInRequest() # noqa: E501 + if include_optional : + return LogInRequest( + username = '0', + token_hash = '0' + ) + else : + return LogInRequest( + ) + + def testLogInRequest(self): + """Test LogInRequest""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_log_in_response.py b/test/test_log_in_response.py new file mode 100644 index 0000000..6499106 --- /dev/null +++ b/test/test_log_in_response.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Onepanel + + Onepanel API # noqa: E501 + + The version of the OpenAPI document: 0.15.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import onepanel.core.api +from onepanel.core.api.models.log_in_response import LogInResponse # noqa: E501 +from onepanel.core.api.rest import ApiException + +class TestLogInResponse(unittest.TestCase): + """LogInResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test LogInResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = onepanel.core.api.models.log_in_response.LogInResponse() # noqa: E501 + if include_optional : + return LogInResponse( + domain = '0', + token = '0', + username = '0' + ) + else : + return LogInResponse( + ) + + def testLogInResponse(self): + """Test LogInResponse""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() From 6cd60f9c721d8169ec794d535a3136a9910f9f2a Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Thu, 29 Oct 2020 13:37:04 -0700 Subject: [PATCH 3/6] feat: added is_system parameter to workflow templates --- docs/WorkflowTemplate.md | 1 + onepanel/core/api/models/workflow_template.py | 32 +++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/docs/WorkflowTemplate.md b/docs/WorkflowTemplate.md index b4ebd0f..10caf8d 100644 --- a/docs/WorkflowTemplate.md +++ b/docs/WorkflowTemplate.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **stats** | [**WorkflowExecutionStatisticReport**](WorkflowExecutionStatisticReport.md) | | [optional] **cron_stats** | [**CronWorkflowStatisticsReport**](CronWorkflowStatisticsReport.md) | | [optional] **parameters** | [**list[Parameter]**](Parameter.md) | | [optional] +**is_system** | **bool** | | [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/onepanel/core/api/models/workflow_template.py b/onepanel/core/api/models/workflow_template.py index 6bb9825..ee6cb11 100644 --- a/onepanel/core/api/models/workflow_template.py +++ b/onepanel/core/api/models/workflow_template.py @@ -45,7 +45,8 @@ class WorkflowTemplate(object): 'labels': 'list[KeyValue]', 'stats': 'WorkflowExecutionStatisticReport', 'cron_stats': 'CronWorkflowStatisticsReport', - 'parameters': 'list[Parameter]' + 'parameters': 'list[Parameter]', + 'is_system': 'bool' } attribute_map = { @@ -61,10 +62,11 @@ class WorkflowTemplate(object): 'labels': 'labels', 'stats': 'stats', 'cron_stats': 'cronStats', - 'parameters': 'parameters' + 'parameters': 'parameters', + 'is_system': 'isSystem' } - def __init__(self, created_at=None, modified_at=None, uid=None, name=None, version=None, versions=None, manifest=None, is_latest=None, is_archived=None, labels=None, stats=None, cron_stats=None, parameters=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, created_at=None, modified_at=None, uid=None, name=None, version=None, versions=None, manifest=None, is_latest=None, is_archived=None, labels=None, stats=None, cron_stats=None, parameters=None, is_system=None, local_vars_configuration=None): # noqa: E501 """WorkflowTemplate - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -83,6 +85,7 @@ def __init__(self, created_at=None, modified_at=None, uid=None, name=None, versi self._stats = None self._cron_stats = None self._parameters = None + self._is_system = None self.discriminator = None if created_at is not None: @@ -111,6 +114,8 @@ def __init__(self, created_at=None, modified_at=None, uid=None, name=None, versi self.cron_stats = cron_stats if parameters is not None: self.parameters = parameters + if is_system is not None: + self.is_system = is_system @property def created_at(self): @@ -385,6 +390,27 @@ def parameters(self, parameters): self._parameters = parameters + @property + def is_system(self): + """Gets the is_system of this WorkflowTemplate. # noqa: E501 + + + :return: The is_system of this WorkflowTemplate. # noqa: E501 + :rtype: bool + """ + return self._is_system + + @is_system.setter + def is_system(self, is_system): + """Sets the is_system of this WorkflowTemplate. + + + :param is_system: The is_system of this WorkflowTemplate. # noqa: E501 + :type: bool + """ + + self._is_system = is_system + def to_dict(self): """Returns the model properties as a dict""" result = {} From f389f35872ceae49a36387d70e02ae7463a9dac2 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Tue, 3 Nov 2020 10:31:37 -0800 Subject: [PATCH 4/6] feat: update api to change LogIn to GetAccessToken --- README.md | 14 +- docs/AuthServiceApi.md | 44 ++--- docs/GetAccessTokenRequest.md | 11 ++ docs/GetAccessTokenResponse.md | 12 ++ docs/WorkflowTemplate.md | 1 - onepanel/core/api/__init__.py | 6 +- onepanel/core/api/api/auth_service_api.py | 90 ++++----- onepanel/core/api/api_client.py | 2 +- onepanel/core/api/configuration.py | 2 +- onepanel/core/api/models/__init__.py | 4 +- .../api/models/get_access_token_request.py | 146 +++++++++++++++ .../api/models/get_access_token_response.py | 172 ++++++++++++++++++ onepanel/core/api/models/workflow_template.py | 32 +--- setup.py | 2 +- test/test_get_access_token_request.py | 53 ++++++ test/test_get_access_token_response.py | 54 ++++++ 16 files changed, 533 insertions(+), 112 deletions(-) create mode 100644 docs/GetAccessTokenRequest.md create mode 100644 docs/GetAccessTokenResponse.md create mode 100644 onepanel/core/api/models/get_access_token_request.py create mode 100644 onepanel/core/api/models/get_access_token_response.py create mode 100644 test/test_get_access_token_request.py create mode 100644 test/test_get_access_token_response.py diff --git a/README.md b/README.md index 53ae401..56cb55d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Onepanel API This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 0.15.0 -- Package version: v0.15.0 +- Package version: 0.15.0b2 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://github.com/onepanelio/core](https://github.com/onepanelio/core) @@ -79,13 +79,13 @@ configuration = onepanel.core.api.Configuration( with onepanel.core.api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = onepanel.core.api.AuthServiceApi(api_client) - body = onepanel.core.api.IsAuthorized() # IsAuthorized | + body = onepanel.core.api.GetAccessTokenRequest() # GetAccessTokenRequest | try: - api_response = api_instance.is_authorized(body) + api_response = api_instance.get_access_token(body) pprint(api_response) except ApiException as e: - print("Exception when calling AuthServiceApi->is_authorized: %s\n" % e) + print("Exception when calling AuthServiceApi->get_access_token: %s\n" % e) ``` @@ -95,9 +95,9 @@ All URIs are relative to *http://localhost:8888* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AuthServiceApi* | [**get_access_token**](docs/AuthServiceApi.md#get_access_token) | **POST** /apis/v1beta1/auth/get_access_token | *AuthServiceApi* | [**is_authorized**](docs/AuthServiceApi.md#is_authorized) | **POST** /apis/v1beta1/auth | *AuthServiceApi* | [**is_valid_token**](docs/AuthServiceApi.md#is_valid_token) | **POST** /apis/v1beta1/auth/token | -*AuthServiceApi* | [**log_in**](docs/AuthServiceApi.md#log_in) | **POST** /apis/v1beta1/auth/login | *ConfigServiceApi* | [**get_config**](docs/ConfigServiceApi.md#get_config) | **GET** /apis/v1beta1/config | *CronWorkflowServiceApi* | [**create_cron_workflow**](docs/CronWorkflowServiceApi.md#create_cron_workflow) | **POST** /apis/v1beta1/{namespace}/cron_workflow | *CronWorkflowServiceApi* | [**delete_cron_workflow**](docs/CronWorkflowServiceApi.md#delete_cron_workflow) | **DELETE** /apis/v1beta1/{namespace}/cron_workflows/{uid} | @@ -177,6 +177,8 @@ Class | Method | HTTP request | Description - [DeleteSecretKeyResponse](docs/DeleteSecretKeyResponse.md) - [DeleteSecretResponse](docs/DeleteSecretResponse.md) - [File](docs/File.md) + - [GetAccessTokenRequest](docs/GetAccessTokenRequest.md) + - [GetAccessTokenResponse](docs/GetAccessTokenResponse.md) - [GetConfigResponse](docs/GetConfigResponse.md) - [GetLabelsResponse](docs/GetLabelsResponse.md) - [GetWorkflowExecutionMetricsResponse](docs/GetWorkflowExecutionMetricsResponse.md) @@ -203,8 +205,6 @@ Class | Method | HTTP request | Description - [ListWorkspaceTemplateVersionsResponse](docs/ListWorkspaceTemplateVersionsResponse.md) - [ListWorkspaceTemplatesResponse](docs/ListWorkspaceTemplatesResponse.md) - [LogEntry](docs/LogEntry.md) - - [LogInRequest](docs/LogInRequest.md) - - [LogInResponse](docs/LogInResponse.md) - [Metric](docs/Metric.md) - [Namespace](docs/Namespace.md) - [NodePool](docs/NodePool.md) diff --git a/docs/AuthServiceApi.md b/docs/AuthServiceApi.md index 0f33832..44ab97c 100644 --- a/docs/AuthServiceApi.md +++ b/docs/AuthServiceApi.md @@ -4,13 +4,13 @@ All URIs are relative to *http://localhost:8888* Method | HTTP request | Description ------------- | ------------- | ------------- +[**get_access_token**](AuthServiceApi.md#get_access_token) | **POST** /apis/v1beta1/auth/get_access_token | [**is_authorized**](AuthServiceApi.md#is_authorized) | **POST** /apis/v1beta1/auth | [**is_valid_token**](AuthServiceApi.md#is_valid_token) | **POST** /apis/v1beta1/auth/token | -[**log_in**](AuthServiceApi.md#log_in) | **POST** /apis/v1beta1/auth/login | -# **is_authorized** -> IsAuthorizedResponse is_authorized(body) +# **get_access_token** +> GetAccessTokenResponse get_access_token(body) @@ -48,24 +48,24 @@ configuration = onepanel.core.api.Configuration( with onepanel.core.api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = onepanel.core.api.AuthServiceApi(api_client) - body = onepanel.core.api.IsAuthorized() # IsAuthorized | + body = onepanel.core.api.GetAccessTokenRequest() # GetAccessTokenRequest | try: - api_response = api_instance.is_authorized(body) + api_response = api_instance.get_access_token(body) pprint(api_response) except ApiException as e: - print("Exception when calling AuthServiceApi->is_authorized: %s\n" % e) + print("Exception when calling AuthServiceApi->get_access_token: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**IsAuthorized**](IsAuthorized.md)| | + **body** | [**GetAccessTokenRequest**](GetAccessTokenRequest.md)| | ### Return type -[**IsAuthorizedResponse**](IsAuthorizedResponse.md) +[**GetAccessTokenResponse**](GetAccessTokenResponse.md) ### Authorization @@ -84,8 +84,8 @@ Name | Type | Description | Notes [[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) -# **is_valid_token** -> IsValidTokenResponse is_valid_token(body) +# **is_authorized** +> IsAuthorizedResponse is_authorized(body) @@ -123,24 +123,24 @@ configuration = onepanel.core.api.Configuration( with onepanel.core.api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = onepanel.core.api.AuthServiceApi(api_client) - body = onepanel.core.api.IsValidTokenRequest() # IsValidTokenRequest | + body = onepanel.core.api.IsAuthorized() # IsAuthorized | try: - api_response = api_instance.is_valid_token(body) + api_response = api_instance.is_authorized(body) pprint(api_response) except ApiException as e: - print("Exception when calling AuthServiceApi->is_valid_token: %s\n" % e) + print("Exception when calling AuthServiceApi->is_authorized: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**IsValidTokenRequest**](IsValidTokenRequest.md)| | + **body** | [**IsAuthorized**](IsAuthorized.md)| | ### Return type -[**IsValidTokenResponse**](IsValidTokenResponse.md) +[**IsAuthorizedResponse**](IsAuthorizedResponse.md) ### Authorization @@ -159,8 +159,8 @@ Name | Type | Description | Notes [[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) -# **log_in** -> LogInResponse log_in(body) +# **is_valid_token** +> IsValidTokenResponse is_valid_token(body) @@ -198,24 +198,24 @@ configuration = onepanel.core.api.Configuration( with onepanel.core.api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = onepanel.core.api.AuthServiceApi(api_client) - body = onepanel.core.api.LogInRequest() # LogInRequest | + body = onepanel.core.api.IsValidTokenRequest() # IsValidTokenRequest | try: - api_response = api_instance.log_in(body) + api_response = api_instance.is_valid_token(body) pprint(api_response) except ApiException as e: - print("Exception when calling AuthServiceApi->log_in: %s\n" % e) + print("Exception when calling AuthServiceApi->is_valid_token: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**LogInRequest**](LogInRequest.md)| | + **body** | [**IsValidTokenRequest**](IsValidTokenRequest.md)| | ### Return type -[**LogInResponse**](LogInResponse.md) +[**IsValidTokenResponse**](IsValidTokenResponse.md) ### Authorization diff --git a/docs/GetAccessTokenRequest.md b/docs/GetAccessTokenRequest.md new file mode 100644 index 0000000..46e3431 --- /dev/null +++ b/docs/GetAccessTokenRequest.md @@ -0,0 +1,11 @@ +# GetAccessTokenRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | | [optional] +**token_hash** | **str** | | [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/docs/GetAccessTokenResponse.md b/docs/GetAccessTokenResponse.md new file mode 100644 index 0000000..de754a6 --- /dev/null +++ b/docs/GetAccessTokenResponse.md @@ -0,0 +1,12 @@ +# GetAccessTokenResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain** | **str** | | [optional] +**token** | **str** | | [optional] +**username** | **str** | | [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/docs/WorkflowTemplate.md b/docs/WorkflowTemplate.md index 10caf8d..b4ebd0f 100644 --- a/docs/WorkflowTemplate.md +++ b/docs/WorkflowTemplate.md @@ -16,7 +16,6 @@ Name | Type | Description | Notes **stats** | [**WorkflowExecutionStatisticReport**](WorkflowExecutionStatisticReport.md) | | [optional] **cron_stats** | [**CronWorkflowStatisticsReport**](CronWorkflowStatisticsReport.md) | | [optional] **parameters** | [**list[Parameter]**](Parameter.md) | | [optional] -**is_system** | **bool** | | [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/onepanel/core/api/__init__.py b/onepanel/core/api/__init__.py index 7fd69cd..ba632c9 100644 --- a/onepanel/core/api/__init__.py +++ b/onepanel/core/api/__init__.py @@ -14,7 +14,7 @@ from __future__ import absolute_import -__version__ = "v0.15.0" +__version__ = "0.15.0b2" # import apis into sdk package from onepanel.core.api.api.auth_service_api import AuthServiceApi @@ -48,6 +48,8 @@ from onepanel.core.api.models.delete_secret_key_response import DeleteSecretKeyResponse from onepanel.core.api.models.delete_secret_response import DeleteSecretResponse from onepanel.core.api.models.file import File +from onepanel.core.api.models.get_access_token_request import GetAccessTokenRequest +from onepanel.core.api.models.get_access_token_response import GetAccessTokenResponse from onepanel.core.api.models.get_config_response import GetConfigResponse from onepanel.core.api.models.get_labels_response import GetLabelsResponse from onepanel.core.api.models.get_workflow_execution_metrics_response import GetWorkflowExecutionMetricsResponse @@ -74,8 +76,6 @@ from onepanel.core.api.models.list_workspace_template_versions_response import ListWorkspaceTemplateVersionsResponse from onepanel.core.api.models.list_workspace_templates_response import ListWorkspaceTemplatesResponse from onepanel.core.api.models.log_entry import LogEntry -from onepanel.core.api.models.log_in_request import LogInRequest -from onepanel.core.api.models.log_in_response import LogInResponse from onepanel.core.api.models.metric import Metric from onepanel.core.api.models.namespace import Namespace from onepanel.core.api.models.node_pool import NodePool diff --git a/onepanel/core/api/api/auth_service_api.py b/onepanel/core/api/api/auth_service_api.py index 5d371f7..3628a8b 100644 --- a/onepanel/core/api/api/auth_service_api.py +++ b/onepanel/core/api/api/auth_service_api.py @@ -36,16 +36,16 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def is_authorized(self, body, **kwargs): # noqa: E501 - """is_authorized # noqa: E501 + def get_access_token(self, body, **kwargs): # noqa: E501 + """get_access_token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.is_authorized(body, async_req=True) + >>> thread = api.get_access_token(body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously - :param IsAuthorized body: (required) + :param GetAccessTokenRequest body: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -53,23 +53,23 @@ def is_authorized(self, body, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :return: IsAuthorizedResponse + :return: GetAccessTokenResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.is_authorized_with_http_info(body, **kwargs) # noqa: E501 + return self.get_access_token_with_http_info(body, **kwargs) # noqa: E501 - def is_authorized_with_http_info(self, body, **kwargs): # noqa: E501 - """is_authorized # noqa: E501 + def get_access_token_with_http_info(self, body, **kwargs): # noqa: E501 + """get_access_token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.is_authorized_with_http_info(body, async_req=True) + >>> thread = api.get_access_token_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously - :param IsAuthorized body: (required) + :param GetAccessTokenRequest body: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -79,7 +79,7 @@ def is_authorized_with_http_info(self, body, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :return: tuple(IsAuthorizedResponse, status_code(int), headers(HTTPHeaderDict)) + :return: tuple(GetAccessTokenResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ @@ -102,14 +102,14 @@ def is_authorized_with_http_info(self, body, **kwargs): # noqa: E501 if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method is_authorized" % key + " to method get_access_token" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 local_var_params['body'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `is_authorized`") # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `get_access_token`") # noqa: E501 collection_formats = {} @@ -137,14 +137,14 @@ def is_authorized_with_http_info(self, body, **kwargs): # noqa: E501 auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( - '/apis/v1beta1/auth', 'POST', + '/apis/v1beta1/auth/get_access_token', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='IsAuthorizedResponse', # noqa: E501 + response_type='GetAccessTokenResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -152,16 +152,16 @@ def is_authorized_with_http_info(self, body, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def is_valid_token(self, body, **kwargs): # noqa: E501 - """is_valid_token # noqa: E501 + def is_authorized(self, body, **kwargs): # noqa: E501 + """is_authorized # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.is_valid_token(body, async_req=True) + >>> thread = api.is_authorized(body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously - :param IsValidTokenRequest body: (required) + :param IsAuthorized body: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -169,23 +169,23 @@ def is_valid_token(self, body, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :return: IsValidTokenResponse + :return: IsAuthorizedResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.is_valid_token_with_http_info(body, **kwargs) # noqa: E501 + return self.is_authorized_with_http_info(body, **kwargs) # noqa: E501 - def is_valid_token_with_http_info(self, body, **kwargs): # noqa: E501 - """is_valid_token # noqa: E501 + def is_authorized_with_http_info(self, body, **kwargs): # noqa: E501 + """is_authorized # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.is_valid_token_with_http_info(body, async_req=True) + >>> thread = api.is_authorized_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously - :param IsValidTokenRequest body: (required) + :param IsAuthorized body: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -195,7 +195,7 @@ def is_valid_token_with_http_info(self, body, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :return: tuple(IsValidTokenResponse, status_code(int), headers(HTTPHeaderDict)) + :return: tuple(IsAuthorizedResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ @@ -218,14 +218,14 @@ def is_valid_token_with_http_info(self, body, **kwargs): # noqa: E501 if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method is_valid_token" % key + " to method is_authorized" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 local_var_params['body'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `is_valid_token`") # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `is_authorized`") # noqa: E501 collection_formats = {} @@ -253,14 +253,14 @@ def is_valid_token_with_http_info(self, body, **kwargs): # noqa: E501 auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( - '/apis/v1beta1/auth/token', 'POST', + '/apis/v1beta1/auth', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='IsValidTokenResponse', # noqa: E501 + response_type='IsAuthorizedResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 @@ -268,16 +268,16 @@ def is_valid_token_with_http_info(self, body, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def log_in(self, body, **kwargs): # noqa: E501 - """log_in # noqa: E501 + def is_valid_token(self, body, **kwargs): # noqa: E501 + """is_valid_token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.log_in(body, async_req=True) + >>> thread = api.is_valid_token(body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously - :param LogInRequest body: (required) + :param IsValidTokenRequest body: (required) :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. @@ -285,23 +285,23 @@ def log_in(self, body, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :return: LogInResponse + :return: IsValidTokenResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True - return self.log_in_with_http_info(body, **kwargs) # noqa: E501 + return self.is_valid_token_with_http_info(body, **kwargs) # noqa: E501 - def log_in_with_http_info(self, body, **kwargs): # noqa: E501 - """log_in # noqa: E501 + def is_valid_token_with_http_info(self, body, **kwargs): # noqa: E501 + """is_valid_token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.log_in_with_http_info(body, async_req=True) + >>> thread = api.is_valid_token_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously - :param LogInRequest body: (required) + :param IsValidTokenRequest body: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will @@ -311,7 +311,7 @@ def log_in_with_http_info(self, body, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :return: tuple(LogInResponse, status_code(int), headers(HTTPHeaderDict)) + :return: tuple(IsValidTokenResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ @@ -334,14 +334,14 @@ def log_in_with_http_info(self, body, **kwargs): # noqa: E501 if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" - " to method log_in" % key + " to method is_valid_token" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 local_var_params['body'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `log_in`") # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `is_valid_token`") # noqa: E501 collection_formats = {} @@ -369,14 +369,14 @@ def log_in_with_http_info(self, body, **kwargs): # noqa: E501 auth_settings = ['Bearer'] # noqa: E501 return self.api_client.call_api( - '/apis/v1beta1/auth/login', 'POST', + '/apis/v1beta1/auth/token', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='LogInResponse', # noqa: E501 + response_type='IsValidTokenResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 diff --git a/onepanel/core/api/api_client.py b/onepanel/core/api/api_client.py index 7720846..61c95c3 100644 --- a/onepanel/core/api/api_client.py +++ b/onepanel/core/api/api_client.py @@ -78,7 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/v0.15.0/python' + self.user_agent = 'OpenAPI-Generator/0.15.0b2/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/onepanel/core/api/configuration.py b/onepanel/core/api/configuration.py index eaf1551..8ee2d2a 100644 --- a/onepanel/core/api/configuration.py +++ b/onepanel/core/api/configuration.py @@ -352,7 +352,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 0.15.0\n"\ - "SDK Package Version: v0.15.0".\ + "SDK Package Version: 0.15.0b2".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/onepanel/core/api/models/__init__.py b/onepanel/core/api/models/__init__.py index 3d69c2f..c570ca9 100644 --- a/onepanel/core/api/models/__init__.py +++ b/onepanel/core/api/models/__init__.py @@ -24,6 +24,8 @@ from onepanel.core.api.models.delete_secret_key_response import DeleteSecretKeyResponse from onepanel.core.api.models.delete_secret_response import DeleteSecretResponse from onepanel.core.api.models.file import File +from onepanel.core.api.models.get_access_token_request import GetAccessTokenRequest +from onepanel.core.api.models.get_access_token_response import GetAccessTokenResponse from onepanel.core.api.models.get_config_response import GetConfigResponse from onepanel.core.api.models.get_labels_response import GetLabelsResponse from onepanel.core.api.models.get_workflow_execution_metrics_response import GetWorkflowExecutionMetricsResponse @@ -50,8 +52,6 @@ from onepanel.core.api.models.list_workspace_template_versions_response import ListWorkspaceTemplateVersionsResponse from onepanel.core.api.models.list_workspace_templates_response import ListWorkspaceTemplatesResponse from onepanel.core.api.models.log_entry import LogEntry -from onepanel.core.api.models.log_in_request import LogInRequest -from onepanel.core.api.models.log_in_response import LogInResponse from onepanel.core.api.models.metric import Metric from onepanel.core.api.models.namespace import Namespace from onepanel.core.api.models.node_pool import NodePool diff --git a/onepanel/core/api/models/get_access_token_request.py b/onepanel/core/api/models/get_access_token_request.py new file mode 100644 index 0000000..17ff47a --- /dev/null +++ b/onepanel/core/api/models/get_access_token_request.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Onepanel + + Onepanel API # noqa: E501 + + The version of the OpenAPI document: 0.15.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from onepanel.core.api.configuration import Configuration + + +class GetAccessTokenRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'username': 'str', + 'token_hash': 'str' + } + + attribute_map = { + 'username': 'username', + 'token_hash': 'tokenHash' + } + + def __init__(self, username=None, token_hash=None, local_vars_configuration=None): # noqa: E501 + """GetAccessTokenRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._username = None + self._token_hash = None + self.discriminator = None + + if username is not None: + self.username = username + if token_hash is not None: + self.token_hash = token_hash + + @property + def username(self): + """Gets the username of this GetAccessTokenRequest. # noqa: E501 + + + :return: The username of this GetAccessTokenRequest. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this GetAccessTokenRequest. + + + :param username: The username of this GetAccessTokenRequest. # noqa: E501 + :type: str + """ + + self._username = username + + @property + def token_hash(self): + """Gets the token_hash of this GetAccessTokenRequest. # noqa: E501 + + + :return: The token_hash of this GetAccessTokenRequest. # noqa: E501 + :rtype: str + """ + return self._token_hash + + @token_hash.setter + def token_hash(self, token_hash): + """Sets the token_hash of this GetAccessTokenRequest. + + + :param token_hash: The token_hash of this GetAccessTokenRequest. # noqa: E501 + :type: str + """ + + self._token_hash = token_hash + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetAccessTokenRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetAccessTokenRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/onepanel/core/api/models/get_access_token_response.py b/onepanel/core/api/models/get_access_token_response.py new file mode 100644 index 0000000..ec438b8 --- /dev/null +++ b/onepanel/core/api/models/get_access_token_response.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Onepanel + + Onepanel API # noqa: E501 + + The version of the OpenAPI document: 0.15.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from onepanel.core.api.configuration import Configuration + + +class GetAccessTokenResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'domain': 'str', + 'token': 'str', + 'username': 'str' + } + + attribute_map = { + 'domain': 'domain', + 'token': 'token', + 'username': 'username' + } + + def __init__(self, domain=None, token=None, username=None, local_vars_configuration=None): # noqa: E501 + """GetAccessTokenResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._domain = None + self._token = None + self._username = None + self.discriminator = None + + if domain is not None: + self.domain = domain + if token is not None: + self.token = token + if username is not None: + self.username = username + + @property + def domain(self): + """Gets the domain of this GetAccessTokenResponse. # noqa: E501 + + + :return: The domain of this GetAccessTokenResponse. # noqa: E501 + :rtype: str + """ + return self._domain + + @domain.setter + def domain(self, domain): + """Sets the domain of this GetAccessTokenResponse. + + + :param domain: The domain of this GetAccessTokenResponse. # noqa: E501 + :type: str + """ + + self._domain = domain + + @property + def token(self): + """Gets the token of this GetAccessTokenResponse. # noqa: E501 + + + :return: The token of this GetAccessTokenResponse. # noqa: E501 + :rtype: str + """ + return self._token + + @token.setter + def token(self, token): + """Sets the token of this GetAccessTokenResponse. + + + :param token: The token of this GetAccessTokenResponse. # noqa: E501 + :type: str + """ + + self._token = token + + @property + def username(self): + """Gets the username of this GetAccessTokenResponse. # noqa: E501 + + + :return: The username of this GetAccessTokenResponse. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this GetAccessTokenResponse. + + + :param username: The username of this GetAccessTokenResponse. # noqa: E501 + :type: str + """ + + self._username = username + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetAccessTokenResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetAccessTokenResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/onepanel/core/api/models/workflow_template.py b/onepanel/core/api/models/workflow_template.py index ee6cb11..6bb9825 100644 --- a/onepanel/core/api/models/workflow_template.py +++ b/onepanel/core/api/models/workflow_template.py @@ -45,8 +45,7 @@ class WorkflowTemplate(object): 'labels': 'list[KeyValue]', 'stats': 'WorkflowExecutionStatisticReport', 'cron_stats': 'CronWorkflowStatisticsReport', - 'parameters': 'list[Parameter]', - 'is_system': 'bool' + 'parameters': 'list[Parameter]' } attribute_map = { @@ -62,11 +61,10 @@ class WorkflowTemplate(object): 'labels': 'labels', 'stats': 'stats', 'cron_stats': 'cronStats', - 'parameters': 'parameters', - 'is_system': 'isSystem' + 'parameters': 'parameters' } - def __init__(self, created_at=None, modified_at=None, uid=None, name=None, version=None, versions=None, manifest=None, is_latest=None, is_archived=None, labels=None, stats=None, cron_stats=None, parameters=None, is_system=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, created_at=None, modified_at=None, uid=None, name=None, version=None, versions=None, manifest=None, is_latest=None, is_archived=None, labels=None, stats=None, cron_stats=None, parameters=None, local_vars_configuration=None): # noqa: E501 """WorkflowTemplate - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -85,7 +83,6 @@ def __init__(self, created_at=None, modified_at=None, uid=None, name=None, versi self._stats = None self._cron_stats = None self._parameters = None - self._is_system = None self.discriminator = None if created_at is not None: @@ -114,8 +111,6 @@ def __init__(self, created_at=None, modified_at=None, uid=None, name=None, versi self.cron_stats = cron_stats if parameters is not None: self.parameters = parameters - if is_system is not None: - self.is_system = is_system @property def created_at(self): @@ -390,27 +385,6 @@ def parameters(self, parameters): self._parameters = parameters - @property - def is_system(self): - """Gets the is_system of this WorkflowTemplate. # noqa: E501 - - - :return: The is_system of this WorkflowTemplate. # noqa: E501 - :rtype: bool - """ - return self._is_system - - @is_system.setter - def is_system(self, is_system): - """Sets the is_system of this WorkflowTemplate. - - - :param is_system: The is_system of this WorkflowTemplate. # noqa: E501 - :type: bool - """ - - self._is_system = is_system - def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/setup.py b/setup.py index b5934e3..85d068f 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "onepanel-sdk" -VERSION = "v0.15.0" +VERSION = "0.15.0b2" # To install the library, run the following # # python setup.py install diff --git a/test/test_get_access_token_request.py b/test/test_get_access_token_request.py new file mode 100644 index 0000000..72a836c --- /dev/null +++ b/test/test_get_access_token_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Onepanel + + Onepanel API # noqa: E501 + + The version of the OpenAPI document: 0.15.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import onepanel.core.api +from onepanel.core.api.models.get_access_token_request import GetAccessTokenRequest # noqa: E501 +from onepanel.core.api.rest import ApiException + +class TestGetAccessTokenRequest(unittest.TestCase): + """GetAccessTokenRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test GetAccessTokenRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = onepanel.core.api.models.get_access_token_request.GetAccessTokenRequest() # noqa: E501 + if include_optional : + return GetAccessTokenRequest( + username = '0', + token_hash = '0' + ) + else : + return GetAccessTokenRequest( + ) + + def testGetAccessTokenRequest(self): + """Test GetAccessTokenRequest""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_access_token_response.py b/test/test_get_access_token_response.py new file mode 100644 index 0000000..5bb4de5 --- /dev/null +++ b/test/test_get_access_token_response.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Onepanel + + Onepanel API # noqa: E501 + + The version of the OpenAPI document: 0.15.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import onepanel.core.api +from onepanel.core.api.models.get_access_token_response import GetAccessTokenResponse # noqa: E501 +from onepanel.core.api.rest import ApiException + +class TestGetAccessTokenResponse(unittest.TestCase): + """GetAccessTokenResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test GetAccessTokenResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = onepanel.core.api.models.get_access_token_response.GetAccessTokenResponse() # noqa: E501 + if include_optional : + return GetAccessTokenResponse( + domain = '0', + token = '0', + username = '0' + ) + else : + return GetAccessTokenResponse( + ) + + def testGetAccessTokenResponse(self): + """Test GetAccessTokenResponse""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + + +if __name__ == '__main__': + unittest.main() From aaf0a6c9820bbdc6de0f539ec11efeb259c4bb72 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Tue, 3 Nov 2020 13:38:10 -0800 Subject: [PATCH 5/6] feat: update api to use new access token --- README.md | 3 - docs/AuthServiceApi.md | 76 ------------ docs/GetAccessTokenRequest.md | 2 +- docs/GetAccessTokenResponse.md | 2 +- onepanel/core/api/__init__.py | 2 - onepanel/core/api/api/auth_service_api.py | 116 ------------------ onepanel/core/api/models/__init__.py | 2 - .../api/models/get_access_token_request.py | 30 ++--- .../api/models/get_access_token_response.py | 30 ++--- 9 files changed, 32 insertions(+), 231 deletions(-) diff --git a/README.md b/README.md index 56cb55d..bf49611 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,6 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AuthServiceApi* | [**get_access_token**](docs/AuthServiceApi.md#get_access_token) | **POST** /apis/v1beta1/auth/get_access_token | *AuthServiceApi* | [**is_authorized**](docs/AuthServiceApi.md#is_authorized) | **POST** /apis/v1beta1/auth | -*AuthServiceApi* | [**is_valid_token**](docs/AuthServiceApi.md#is_valid_token) | **POST** /apis/v1beta1/auth/token | *ConfigServiceApi* | [**get_config**](docs/ConfigServiceApi.md#get_config) | **GET** /apis/v1beta1/config | *CronWorkflowServiceApi* | [**create_cron_workflow**](docs/CronWorkflowServiceApi.md#create_cron_workflow) | **POST** /apis/v1beta1/{namespace}/cron_workflow | *CronWorkflowServiceApi* | [**delete_cron_workflow**](docs/CronWorkflowServiceApi.md#delete_cron_workflow) | **DELETE** /apis/v1beta1/{namespace}/cron_workflows/{uid} | @@ -189,8 +188,6 @@ Class | Method | HTTP request | Description - [GrpcGatewayRuntimeStreamError](docs/GrpcGatewayRuntimeStreamError.md) - [IsAuthorized](docs/IsAuthorized.md) - [IsAuthorizedResponse](docs/IsAuthorizedResponse.md) - - [IsValidTokenRequest](docs/IsValidTokenRequest.md) - - [IsValidTokenResponse](docs/IsValidTokenResponse.md) - [KeyValue](docs/KeyValue.md) - [Labels](docs/Labels.md) - [ListCronWorkflowsResponse](docs/ListCronWorkflowsResponse.md) diff --git a/docs/AuthServiceApi.md b/docs/AuthServiceApi.md index 44ab97c..dbe2dbc 100644 --- a/docs/AuthServiceApi.md +++ b/docs/AuthServiceApi.md @@ -6,7 +6,6 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**get_access_token**](AuthServiceApi.md#get_access_token) | **POST** /apis/v1beta1/auth/get_access_token | [**is_authorized**](AuthServiceApi.md#is_authorized) | **POST** /apis/v1beta1/auth | -[**is_valid_token**](AuthServiceApi.md#is_valid_token) | **POST** /apis/v1beta1/auth/token | # **get_access_token** @@ -159,78 +158,3 @@ Name | Type | Description | Notes [[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) -# **is_valid_token** -> IsValidTokenResponse is_valid_token(body) - - - -### Example - -* Api Key Authentication (Bearer): -```python -from __future__ import print_function -import time -import onepanel.core.api -from onepanel.core.api.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to http://localhost:8888 -# See configuration.py for a list of all supported configuration parameters. -configuration = onepanel.core.api.Configuration( - host = "http://localhost:8888" -) - -# 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 API key authorization: Bearer -configuration = onepanel.core.api.Configuration( - host = "http://localhost:8888", - api_key = { - 'authorization': 'YOUR_API_KEY' - } -) -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['authorization'] = 'Bearer' - -# Enter a context with an instance of the API client -with onepanel.core.api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = onepanel.core.api.AuthServiceApi(api_client) - body = onepanel.core.api.IsValidTokenRequest() # IsValidTokenRequest | - - try: - api_response = api_instance.is_valid_token(body) - pprint(api_response) - except ApiException as e: - print("Exception when calling AuthServiceApi->is_valid_token: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**IsValidTokenRequest**](IsValidTokenRequest.md)| | - -### Return type - -[**IsValidTokenResponse**](IsValidTokenResponse.md) - -### Authorization - -[Bearer](../README.md#Bearer) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/octet-stream - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**0** | An unexpected error response | - | - -[[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/docs/GetAccessTokenRequest.md b/docs/GetAccessTokenRequest.md index 46e3431..410e32d 100644 --- a/docs/GetAccessTokenRequest.md +++ b/docs/GetAccessTokenRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **username** | **str** | | [optional] -**token_hash** | **str** | | [optional] +**token** | **str** | | [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/docs/GetAccessTokenResponse.md b/docs/GetAccessTokenResponse.md index de754a6..66656b4 100644 --- a/docs/GetAccessTokenResponse.md +++ b/docs/GetAccessTokenResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **domain** | **str** | | [optional] -**token** | **str** | | [optional] +**access_token** | **str** | | [optional] **username** | **str** | | [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/onepanel/core/api/__init__.py b/onepanel/core/api/__init__.py index ba632c9..c7cc092 100644 --- a/onepanel/core/api/__init__.py +++ b/onepanel/core/api/__init__.py @@ -60,8 +60,6 @@ from onepanel.core.api.models.grpc_gateway_runtime_stream_error import GrpcGatewayRuntimeStreamError from onepanel.core.api.models.is_authorized import IsAuthorized from onepanel.core.api.models.is_authorized_response import IsAuthorizedResponse -from onepanel.core.api.models.is_valid_token_request import IsValidTokenRequest -from onepanel.core.api.models.is_valid_token_response import IsValidTokenResponse from onepanel.core.api.models.key_value import KeyValue from onepanel.core.api.models.labels import Labels from onepanel.core.api.models.list_cron_workflows_response import ListCronWorkflowsResponse diff --git a/onepanel/core/api/api/auth_service_api.py b/onepanel/core/api/api/auth_service_api.py index 3628a8b..e420b15 100644 --- a/onepanel/core/api/api/auth_service_api.py +++ b/onepanel/core/api/api/auth_service_api.py @@ -267,119 +267,3 @@ def is_authorized_with_http_info(self, body, **kwargs): # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - - def is_valid_token(self, body, **kwargs): # noqa: E501 - """is_valid_token # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.is_valid_token(body, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param IsValidTokenRequest body: (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: 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. - :return: IsValidTokenResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - return self.is_valid_token_with_http_info(body, **kwargs) # noqa: E501 - - def is_valid_token_with_http_info(self, body, **kwargs): # noqa: E501 - """is_valid_token # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.is_valid_token_with_http_info(body, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param IsValidTokenRequest body: (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: 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. - :return: tuple(IsValidTokenResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = [ - 'body' - ] - all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout' - ] - ) - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method is_valid_token" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 - raise ApiValueError("Missing the required parameter `body` when calling `is_valid_token`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/octet-stream']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['Bearer'] # noqa: E501 - - return self.api_client.call_api( - '/apis/v1beta1/auth/token', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='IsValidTokenResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/onepanel/core/api/models/__init__.py b/onepanel/core/api/models/__init__.py index c570ca9..52fff02 100644 --- a/onepanel/core/api/models/__init__.py +++ b/onepanel/core/api/models/__init__.py @@ -36,8 +36,6 @@ from onepanel.core.api.models.grpc_gateway_runtime_stream_error import GrpcGatewayRuntimeStreamError from onepanel.core.api.models.is_authorized import IsAuthorized from onepanel.core.api.models.is_authorized_response import IsAuthorizedResponse -from onepanel.core.api.models.is_valid_token_request import IsValidTokenRequest -from onepanel.core.api.models.is_valid_token_response import IsValidTokenResponse from onepanel.core.api.models.key_value import KeyValue from onepanel.core.api.models.labels import Labels from onepanel.core.api.models.list_cron_workflows_response import ListCronWorkflowsResponse diff --git a/onepanel/core/api/models/get_access_token_request.py b/onepanel/core/api/models/get_access_token_request.py index 17ff47a..206dc6b 100644 --- a/onepanel/core/api/models/get_access_token_request.py +++ b/onepanel/core/api/models/get_access_token_request.py @@ -34,28 +34,28 @@ class GetAccessTokenRequest(object): """ openapi_types = { 'username': 'str', - 'token_hash': 'str' + 'token': 'str' } attribute_map = { 'username': 'username', - 'token_hash': 'tokenHash' + 'token': 'token' } - def __init__(self, username=None, token_hash=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, username=None, token=None, local_vars_configuration=None): # noqa: E501 """GetAccessTokenRequest - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._username = None - self._token_hash = None + self._token = None self.discriminator = None if username is not None: self.username = username - if token_hash is not None: - self.token_hash = token_hash + if token is not None: + self.token = token @property def username(self): @@ -79,25 +79,25 @@ def username(self, username): self._username = username @property - def token_hash(self): - """Gets the token_hash of this GetAccessTokenRequest. # noqa: E501 + def token(self): + """Gets the token of this GetAccessTokenRequest. # noqa: E501 - :return: The token_hash of this GetAccessTokenRequest. # noqa: E501 + :return: The token of this GetAccessTokenRequest. # noqa: E501 :rtype: str """ - return self._token_hash + return self._token - @token_hash.setter - def token_hash(self, token_hash): - """Sets the token_hash of this GetAccessTokenRequest. + @token.setter + def token(self, token): + """Sets the token of this GetAccessTokenRequest. - :param token_hash: The token_hash of this GetAccessTokenRequest. # noqa: E501 + :param token: The token of this GetAccessTokenRequest. # noqa: E501 :type: str """ - self._token_hash = token_hash + self._token = token def to_dict(self): """Returns the model properties as a dict""" diff --git a/onepanel/core/api/models/get_access_token_response.py b/onepanel/core/api/models/get_access_token_response.py index ec438b8..587cbc1 100644 --- a/onepanel/core/api/models/get_access_token_response.py +++ b/onepanel/core/api/models/get_access_token_response.py @@ -34,31 +34,31 @@ class GetAccessTokenResponse(object): """ openapi_types = { 'domain': 'str', - 'token': 'str', + 'access_token': 'str', 'username': 'str' } attribute_map = { 'domain': 'domain', - 'token': 'token', + 'access_token': 'accessToken', 'username': 'username' } - def __init__(self, domain=None, token=None, username=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, domain=None, access_token=None, username=None, local_vars_configuration=None): # noqa: E501 """GetAccessTokenResponse - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._domain = None - self._token = None + self._access_token = None self._username = None self.discriminator = None if domain is not None: self.domain = domain - if token is not None: - self.token = token + if access_token is not None: + self.access_token = access_token if username is not None: self.username = username @@ -84,25 +84,25 @@ def domain(self, domain): self._domain = domain @property - def token(self): - """Gets the token of this GetAccessTokenResponse. # noqa: E501 + def access_token(self): + """Gets the access_token of this GetAccessTokenResponse. # noqa: E501 - :return: The token of this GetAccessTokenResponse. # noqa: E501 + :return: The access_token of this GetAccessTokenResponse. # noqa: E501 :rtype: str """ - return self._token + return self._access_token - @token.setter - def token(self, token): - """Sets the token of this GetAccessTokenResponse. + @access_token.setter + def access_token(self, access_token): + """Sets the access_token of this GetAccessTokenResponse. - :param token: The token of this GetAccessTokenResponse. # noqa: E501 + :param access_token: The access_token of this GetAccessTokenResponse. # noqa: E501 :type: str """ - self._token = token + self._access_token = access_token @property def username(self): From b8fd4aeccbff7e2075ca151dbd168bf9756aa690 Mon Sep 17 00:00:00 2001 From: Andrey Melnikov Date: Mon, 9 Nov 2020 10:08:14 -0800 Subject: [PATCH 6/6] update: api version to 0.15.0 --- README.md | 2 +- onepanel/core/api/__init__.py | 2 +- onepanel/core/api/api_client.py | 2 +- onepanel/core/api/configuration.py | 2 +- setup.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bf49611..9a4d802 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Onepanel API This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 0.15.0 -- Package version: 0.15.0b2 +- Package version: 0.15.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://github.com/onepanelio/core](https://github.com/onepanelio/core) diff --git a/onepanel/core/api/__init__.py b/onepanel/core/api/__init__.py index c7cc092..5cf8d30 100644 --- a/onepanel/core/api/__init__.py +++ b/onepanel/core/api/__init__.py @@ -14,7 +14,7 @@ from __future__ import absolute_import -__version__ = "0.15.0b2" +__version__ = "0.15.0" # import apis into sdk package from onepanel.core.api.api.auth_service_api import AuthServiceApi diff --git a/onepanel/core/api/api_client.py b/onepanel/core/api/api_client.py index 61c95c3..2aef58a 100644 --- a/onepanel/core/api/api_client.py +++ b/onepanel/core/api/api_client.py @@ -78,7 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/0.15.0b2/python' + self.user_agent = 'OpenAPI-Generator/0.15.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/onepanel/core/api/configuration.py b/onepanel/core/api/configuration.py index 8ee2d2a..2c6b458 100644 --- a/onepanel/core/api/configuration.py +++ b/onepanel/core/api/configuration.py @@ -352,7 +352,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 0.15.0\n"\ - "SDK Package Version: 0.15.0b2".\ + "SDK Package Version: 0.15.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/setup.py b/setup.py index 85d068f..09bcaf2 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "onepanel-sdk" -VERSION = "0.15.0b2" +VERSION = "0.15.0" # To install the library, run the following # # python setup.py install