Skip to content

Commit

Permalink
Merge pull request #18 from onepanelio/feat/onepanelio.core.688-login
Browse files Browse the repository at this point in the history
feat: added login api
  • Loading branch information
Vafilor authored Nov 9, 2020
2 parents 1bafd51 + b8fd4ae commit 0e70591
Show file tree
Hide file tree
Showing 92 changed files with 1,249 additions and 139 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: 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)

Expand Down Expand Up @@ -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)

```

Expand All @@ -95,8 +95,8 @@ 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 |
*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} |
Expand All @@ -106,6 +106,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 |
Expand Down Expand Up @@ -175,6 +176,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)
Expand All @@ -185,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)
Expand Down
30 changes: 15 additions & 15 deletions docs/AuthServiceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ 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 |


# **is_authorized**
> IsAuthorizedResponse is_authorized(body)
# **get_access_token**
> GetAccessTokenResponse get_access_token(body)


Expand Down Expand Up @@ -47,24 +47,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

Expand All @@ -83,8 +83,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)


Expand Down Expand Up @@ -122,24 +122,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

Expand Down
11 changes: 11 additions & 0 deletions docs/GetAccessTokenRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# GetAccessTokenRequest

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**username** | **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)


12 changes: 12 additions & 0 deletions docs/GetAccessTokenResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# GetAccessTokenResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**domain** | **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)


82 changes: 82 additions & 0 deletions docs/LabelServiceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions docs/LogInRequest.md
Original file line number Diff line number Diff line change
@@ -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)


12 changes: 12 additions & 0 deletions docs/LogInResponse.md
Original file line number Diff line number Diff line change
@@ -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)


8 changes: 4 additions & 4 deletions onepanel/core/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = "0.15.0"

# import apis into sdk package
from onepanel.core.api.api.auth_service_api import AuthServiceApi
Expand Down Expand Up @@ -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
Expand All @@ -58,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
Expand Down
Loading

0 comments on commit 0e70591

Please sign in to comment.