diff --git a/garage b/garage index a628359..37005e1 160000 --- a/garage +++ b/garage @@ -1 +1 @@ -Subproject commit a628359122cd6204118e6238a65859d50e4cd472 +Subproject commit 37005e198cadd4e1bbb795b4fcfd64b49a51eb23 diff --git a/python/.openapi-generator/FILES b/python/.openapi-generator/FILES index f89861c..87b63b6 100644 --- a/python/.openapi-generator/FILES +++ b/python/.openapi-generator/FILES @@ -1,16 +1,13 @@ .gitignore .gitlab-ci.yml -.openapi-generator-ignore .travis.yml README.md +docs/AddKeyRequest.md +docs/AddNode200ResponseInner.md docs/ClusterLayout.md -docs/ConnectPost200ResponseInner.md +docs/GetNodes200Response.md +docs/ImportKeyRequest.md docs/KeyApi.md -docs/KeyGetRequest.md -docs/KeyIdAccessKeyDeleteRequest.md -docs/KeyIdAccessKeyDeleteRequestAllow.md -docs/KeyIdAccessKeyDeleteRequestDeny.md -docs/KeyImportPostRequest.md docs/KeyInfo.md docs/KeyInfoBucketsInner.md docs/KeyInfoBucketsInnerPermissions.md @@ -18,27 +15,27 @@ docs/KeyInfoPermissions.md docs/LayoutApi.md docs/LayoutVersion.md docs/ListKeys200ResponseInner.md -docs/MembershipApi.md docs/NodeClusterInfo.md docs/NodeNetworkInfo.md -docs/StatusGet200Response.md +docs/NodesApi.md +docs/UpdateKeyRequest.md +docs/UpdateKeyRequestAllow.md +docs/UpdateKeyRequestDeny.md garage_admin_sdk/__init__.py garage_admin_sdk/api/__init__.py garage_admin_sdk/api/key_api.py garage_admin_sdk/api/layout_api.py -garage_admin_sdk/api/membership_api.py +garage_admin_sdk/api/nodes_api.py garage_admin_sdk/api_client.py garage_admin_sdk/apis/__init__.py garage_admin_sdk/configuration.py garage_admin_sdk/exceptions.py garage_admin_sdk/model/__init__.py +garage_admin_sdk/model/add_key_request.py +garage_admin_sdk/model/add_node200_response_inner.py garage_admin_sdk/model/cluster_layout.py -garage_admin_sdk/model/connect_post200_response_inner.py -garage_admin_sdk/model/key_get_request.py -garage_admin_sdk/model/key_id_access_key_delete_request.py -garage_admin_sdk/model/key_id_access_key_delete_request_allow.py -garage_admin_sdk/model/key_id_access_key_delete_request_deny.py -garage_admin_sdk/model/key_import_post_request.py +garage_admin_sdk/model/get_nodes200_response.py +garage_admin_sdk/model/import_key_request.py garage_admin_sdk/model/key_info.py garage_admin_sdk/model/key_info_buckets_inner.py garage_admin_sdk/model/key_info_buckets_inner_permissions.py @@ -47,7 +44,9 @@ garage_admin_sdk/model/layout_version.py garage_admin_sdk/model/list_keys200_response_inner.py garage_admin_sdk/model/node_cluster_info.py garage_admin_sdk/model/node_network_info.py -garage_admin_sdk/model/status_get200_response.py +garage_admin_sdk/model/update_key_request.py +garage_admin_sdk/model/update_key_request_allow.py +garage_admin_sdk/model/update_key_request_deny.py garage_admin_sdk/model_utils.py garage_admin_sdk/models/__init__.py garage_admin_sdk/rest.py @@ -57,23 +56,4 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_cluster_layout.py -test/test_connect_post200_response_inner.py -test/test_key_api.py -test/test_key_get_request.py -test/test_key_id_access_key_delete_request.py -test/test_key_id_access_key_delete_request_allow.py -test/test_key_id_access_key_delete_request_deny.py -test/test_key_import_post_request.py -test/test_key_info.py -test/test_key_info_buckets_inner.py -test/test_key_info_buckets_inner_permissions.py -test/test_key_info_permissions.py -test/test_layout_api.py -test/test_layout_version.py -test/test_list_keys200_response_inner.py -test/test_membership_api.py -test/test_node_cluster_info.py -test/test_node_network_info.py -test/test_status_get200_response.py tox.ini diff --git a/python/README.md b/python/README.md index 39e439b..c5492c6 100644 --- a/python/README.md +++ b/python/README.md @@ -53,11 +53,11 @@ import time import garage_admin_sdk from pprint import pprint from garage_admin_sdk.api import key_api -from garage_admin_sdk.model.key_get_request import KeyGetRequest -from garage_admin_sdk.model.key_id_access_key_delete_request import KeyIdAccessKeyDeleteRequest -from garage_admin_sdk.model.key_import_post_request import KeyImportPostRequest +from garage_admin_sdk.model.add_key_request import AddKeyRequest +from garage_admin_sdk.model.import_key_request import ImportKeyRequest from garage_admin_sdk.model.key_info import KeyInfo from garage_admin_sdk.model.list_keys200_response_inner import ListKeys200ResponseInner +from garage_admin_sdk.model.update_key_request import UpdateKeyRequest # Defining the host is optional and defaults to http://localhost:3903/v0 # See configuration.py for a list of all supported configuration parameters. configuration = garage_admin_sdk.Configuration( @@ -79,18 +79,16 @@ configuration = garage_admin_sdk.Configuration( with garage_admin_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = key_api.KeyApi(api_client) - key_import_post_request = KeyImportPostRequest( + add_key_request = AddKeyRequest( name="test-key", - access_key_id="GK31c2f218a2e44f485b94239e", - secret_access_key="b892c0665f0ada8a4755dae98baa3b133590e11dae3bcc1f9d769d67f16c3835", - ) # KeyImportPostRequest | Information on the key to import (optional) + ) # AddKeyRequest | \"You can optionnaly set a friendly name for this key\" (optional) try: - # Import an existing key - api_response = api_instance.key_import_post(key_import_post_request=key_import_post_request) + # Create a new API key + api_response = api_instance.add_key(add_key_request=add_key_request) pprint(api_response) except garage_admin_sdk.ApiException as e: - print("Exception when calling KeyApi->key_import_post: %s\n" % e) + print("Exception when calling KeyApi->add_key: %s\n" % e) ``` ## Documentation for API Endpoints @@ -99,30 +97,28 @@ All URIs are relative to *http://localhost:3903/v0* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*KeyApi* | [**key_import_post**](docs/KeyApi.md#key_import_post) | **POST** /key/import | Import an existing key -*KeyApi* | [**key_post**](docs/KeyApi.md#key_post) | **POST** /key | Create a new API key -*KeyApi* | [**keyidaccess_key_delete**](docs/KeyApi.md#keyidaccess_key_delete) | **DELETE** /key?id={access_key} | Delete a key -*KeyApi* | [**keyidaccess_key_get**](docs/KeyApi.md#keyidaccess_key_get) | **GET** /key?id={access_key} | Get key information -*KeyApi* | [**keyidaccess_key_post**](docs/KeyApi.md#keyidaccess_key_post) | **POST** /key?id={access_key} | Update a key -*KeyApi* | [**keysearchpattern_get**](docs/KeyApi.md#keysearchpattern_get) | **GET** /key?search={pattern} | Select key by pattern +*KeyApi* | [**add_key**](docs/KeyApi.md#add_key) | **POST** /key | Create a new API key +*KeyApi* | [**delete_key**](docs/KeyApi.md#delete_key) | **DELETE** /key?id={access_key} | Delete a key +*KeyApi* | [**get_key**](docs/KeyApi.md#get_key) | **GET** /key?id={access_key} | Get key information +*KeyApi* | [**import_key**](docs/KeyApi.md#import_key) | **POST** /key/import | Import an existing key *KeyApi* | [**list_keys**](docs/KeyApi.md#list_keys) | **GET** /key | List all keys -*LayoutApi* | [**layout_apply_post**](docs/LayoutApi.md#layout_apply_post) | **POST** /layout/apply | Apply staged layout -*LayoutApi* | [**layout_get**](docs/LayoutApi.md#layout_get) | **GET** /layout | Details on the current and staged layout -*LayoutApi* | [**layout_post**](docs/LayoutApi.md#layout_post) | **POST** /layout | Send modifications to the cluster layout -*LayoutApi* | [**layout_revert_post**](docs/LayoutApi.md#layout_revert_post) | **POST** /layout/revert | Clear staged layout -*MembershipApi* | [**connect_post**](docs/MembershipApi.md#connect_post) | **POST** /connect | Connect target node to other Garage nodes -*MembershipApi* | [**status_get**](docs/MembershipApi.md#status_get) | **GET** /status | Status of this node and other nodes in the cluster +*KeyApi* | [**search_key**](docs/KeyApi.md#search_key) | **GET** /key?search={pattern} | Select key by pattern +*KeyApi* | [**update_key**](docs/KeyApi.md#update_key) | **POST** /key?id={access_key} | Update a key +*LayoutApi* | [**add_layout**](docs/LayoutApi.md#add_layout) | **POST** /layout | Send modifications to the cluster layout +*LayoutApi* | [**apply_layout**](docs/LayoutApi.md#apply_layout) | **POST** /layout/apply | Apply staged layout +*LayoutApi* | [**get_layout**](docs/LayoutApi.md#get_layout) | **GET** /layout | Details on the current and staged layout +*LayoutApi* | [**revert_layout**](docs/LayoutApi.md#revert_layout) | **POST** /layout/revert | Clear staged layout +*NodesApi* | [**add_node**](docs/NodesApi.md#add_node) | **POST** /connect | Connect target node to other Garage nodes +*NodesApi* | [**get_nodes**](docs/NodesApi.md#get_nodes) | **GET** /status | Status of this node and other nodes in the cluster ## Documentation For Models + - [AddKeyRequest](docs/AddKeyRequest.md) + - [AddNode200ResponseInner](docs/AddNode200ResponseInner.md) - [ClusterLayout](docs/ClusterLayout.md) - - [ConnectPost200ResponseInner](docs/ConnectPost200ResponseInner.md) - - [KeyGetRequest](docs/KeyGetRequest.md) - - [KeyIdAccessKeyDeleteRequest](docs/KeyIdAccessKeyDeleteRequest.md) - - [KeyIdAccessKeyDeleteRequestAllow](docs/KeyIdAccessKeyDeleteRequestAllow.md) - - [KeyIdAccessKeyDeleteRequestDeny](docs/KeyIdAccessKeyDeleteRequestDeny.md) - - [KeyImportPostRequest](docs/KeyImportPostRequest.md) + - [GetNodes200Response](docs/GetNodes200Response.md) + - [ImportKeyRequest](docs/ImportKeyRequest.md) - [KeyInfo](docs/KeyInfo.md) - [KeyInfoBucketsInner](docs/KeyInfoBucketsInner.md) - [KeyInfoBucketsInnerPermissions](docs/KeyInfoBucketsInnerPermissions.md) @@ -131,7 +127,9 @@ Class | Method | HTTP request | Description - [ListKeys200ResponseInner](docs/ListKeys200ResponseInner.md) - [NodeClusterInfo](docs/NodeClusterInfo.md) - [NodeNetworkInfo](docs/NodeNetworkInfo.md) - - [StatusGet200Response](docs/StatusGet200Response.md) + - [UpdateKeyRequest](docs/UpdateKeyRequest.md) + - [UpdateKeyRequestAllow](docs/UpdateKeyRequestAllow.md) + - [UpdateKeyRequestDeny](docs/UpdateKeyRequestDeny.md) ## Documentation For Authorization diff --git a/python/docs/AddKeyRequest.md b/python/docs/AddKeyRequest.md new file mode 100644 index 0000000..b69f01e --- /dev/null +++ b/python/docs/AddKeyRequest.md @@ -0,0 +1,12 @@ +# AddKeyRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/docs/AddNode200ResponseInner.md b/python/docs/AddNode200ResponseInner.md new file mode 100644 index 0000000..71366d5 --- /dev/null +++ b/python/docs/AddNode200ResponseInner.md @@ -0,0 +1,13 @@ +# AddNode200ResponseInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | | [optional] +**error** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/docs/GetNodes200Response.md b/python/docs/GetNodes200Response.md new file mode 100644 index 0000000..1d8261e --- /dev/null +++ b/python/docs/GetNodes200Response.md @@ -0,0 +1,15 @@ +# GetNodes200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**node** | **str** | | [optional] +**garage_version** | **str** | | [optional] +**known_nodes** | [**{str: (NodeNetworkInfo,)}**](NodeNetworkInfo.md) | | [optional] +**layout** | [**ClusterLayout**](ClusterLayout.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/docs/ImportKeyRequest.md b/python/docs/ImportKeyRequest.md new file mode 100644 index 0000000..3ff1d0c --- /dev/null +++ b/python/docs/ImportKeyRequest.md @@ -0,0 +1,14 @@ +# ImportKeyRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**access_key_id** | **str** | | [optional] +**secret_access_key** | **str** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/docs/KeyApi.md b/python/docs/KeyApi.md index 566ca2f..a994f1e 100644 --- a/python/docs/KeyApi.md +++ b/python/docs/KeyApi.md @@ -4,102 +4,17 @@ All URIs are relative to *http://localhost:3903/v0* Method | HTTP request | Description ------------- | ------------- | ------------- -[**key_import_post**](KeyApi.md#key_import_post) | **POST** /key/import | Import an existing key -[**key_post**](KeyApi.md#key_post) | **POST** /key | Create a new API key -[**keyidaccess_key_delete**](KeyApi.md#keyidaccess_key_delete) | **DELETE** /key?id={access_key} | Delete a key -[**keyidaccess_key_get**](KeyApi.md#keyidaccess_key_get) | **GET** /key?id={access_key} | Get key information -[**keyidaccess_key_post**](KeyApi.md#keyidaccess_key_post) | **POST** /key?id={access_key} | Update a key -[**keysearchpattern_get**](KeyApi.md#keysearchpattern_get) | **GET** /key?search={pattern} | Select key by pattern +[**add_key**](KeyApi.md#add_key) | **POST** /key | Create a new API key +[**delete_key**](KeyApi.md#delete_key) | **DELETE** /key?id={access_key} | Delete a key +[**get_key**](KeyApi.md#get_key) | **GET** /key?id={access_key} | Get key information +[**import_key**](KeyApi.md#import_key) | **POST** /key/import | Import an existing key [**list_keys**](KeyApi.md#list_keys) | **GET** /key | List all keys +[**search_key**](KeyApi.md#search_key) | **GET** /key?search={pattern} | Select key by pattern +[**update_key**](KeyApi.md#update_key) | **POST** /key?id={access_key} | Update a key -# **key_import_post** -> KeyInfo key_import_post() - -Import an existing key - -Imports an existing API key. This feature must only be used for migrations and backup restore. **Do not use it to generate custom key identifiers or you will break your Garage cluster.** - -### Example - -* Bearer Authentication (bearerAuth): - -```python -import time -import garage_admin_sdk -from garage_admin_sdk.api import key_api -from garage_admin_sdk.model.key_import_post_request import KeyImportPostRequest -from garage_admin_sdk.model.key_info import KeyInfo -from pprint import pprint -# Defining the host is optional and defaults to http://localhost:3903/v0 -# See configuration.py for a list of all supported configuration parameters. -configuration = garage_admin_sdk.Configuration( - host = "http://localhost:3903/v0" -) - -# 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 Bearer authorization: bearerAuth -configuration = garage_admin_sdk.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Enter a context with an instance of the API client -with garage_admin_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = key_api.KeyApi(api_client) - key_import_post_request = KeyImportPostRequest( - name="test-key", - access_key_id="GK31c2f218a2e44f485b94239e", - secret_access_key="b892c0665f0ada8a4755dae98baa3b133590e11dae3bcc1f9d769d67f16c3835", - ) # KeyImportPostRequest | Information on the key to import (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Import an existing key - api_response = api_instance.key_import_post(key_import_post_request=key_import_post_request) - pprint(api_response) - except garage_admin_sdk.ApiException as e: - print("Exception when calling KeyApi->key_import_post: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **key_import_post_request** | [**KeyImportPostRequest**](KeyImportPostRequest.md)| Information on the key to import | [optional] - -### Return type - -[**KeyInfo**](KeyInfo.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**500** | The server can not handle your request. Check your connectivity with the rest of the cluster. | - | -**400** | Invalid syntax or requested change | - | -**200** | The key has been imported into the system | - | - -[[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) - -# **key_post** -> KeyInfo key_post() +# **add_key** +> KeyInfo add_key() Create a new API key @@ -113,8 +28,8 @@ Creates a new API access key. import time import garage_admin_sdk from garage_admin_sdk.api import key_api -from garage_admin_sdk.model.key_get_request import KeyGetRequest from garage_admin_sdk.model.key_info import KeyInfo +from garage_admin_sdk.model.add_key_request import AddKeyRequest from pprint import pprint # Defining the host is optional and defaults to http://localhost:3903/v0 # See configuration.py for a list of all supported configuration parameters. @@ -136,18 +51,18 @@ configuration = garage_admin_sdk.Configuration( with garage_admin_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = key_api.KeyApi(api_client) - key_get_request = KeyGetRequest( + add_key_request = AddKeyRequest( name="test-key", - ) # KeyGetRequest | \"You can optionnaly set a friendly name for this key\" (optional) + ) # AddKeyRequest | \"You can optionnaly set a friendly name for this key\" (optional) # example passing only required values which don't have defaults set # and optional values try: # Create a new API key - api_response = api_instance.key_post(key_get_request=key_get_request) + api_response = api_instance.add_key(add_key_request=add_key_request) pprint(api_response) except garage_admin_sdk.ApiException as e: - print("Exception when calling KeyApi->key_post: %s\n" % e) + print("Exception when calling KeyApi->add_key: %s\n" % e) ``` @@ -155,7 +70,7 @@ with garage_admin_sdk.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **key_get_request** | [**KeyGetRequest**](KeyGetRequest.md)| \"You can optionnaly set a friendly name for this key\" | [optional] + **add_key_request** | [**AddKeyRequest**](AddKeyRequest.md)| \"You can optionnaly set a friendly name for this key\" | [optional] ### Return type @@ -181,11 +96,13 @@ 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) -# **keyidaccess_key_delete** -> keyidaccess_key_delete(access_key) +# **delete_key** +> delete_key(access_key) Delete a key +Delete a key from the cluster. Its access will be removed from all the buckets. Buckets are not automatically deleted and can be dangling. You should manually delete them before. + ### Example * Bearer Authentication (bearerAuth): @@ -220,9 +137,9 @@ with garage_admin_sdk.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set try: # Delete a key - api_instance.keyidaccess_key_delete(access_key) + api_instance.delete_key(access_key) except garage_admin_sdk.ApiException as e: - print("Exception when calling KeyApi->keyidaccess_key_delete: %s\n" % e) + print("Exception when calling KeyApi->delete_key: %s\n" % e) ``` @@ -255,8 +172,8 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **keyidaccess_key_get** -> KeyInfo keyidaccess_key_get(access_key) +# **get_key** +> KeyInfo get_key(access_key) Get key information @@ -297,10 +214,10 @@ with garage_admin_sdk.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set try: # Get key information - api_response = api_instance.keyidaccess_key_get(access_key) + api_response = api_instance.get_key(access_key) pprint(api_response) except garage_admin_sdk.ApiException as e: - print("Exception when calling KeyApi->keyidaccess_key_get: %s\n" % e) + print("Exception when calling KeyApi->get_key: %s\n" % e) ``` @@ -333,12 +250,12 @@ 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) -# **keyidaccess_key_post** -> KeyInfo keyidaccess_key_post(access_key) +# **import_key** +> KeyInfo import_key() -Update a key +Import an existing key -Updates information about the specified API access key. +Imports an existing API key. This feature must only be used for migrations and backup restore. **Do not use it to generate custom key identifiers or you will break your Garage cluster.** ### Example @@ -348,7 +265,7 @@ Updates information about the specified API access key. import time import garage_admin_sdk from garage_admin_sdk.api import key_api -from garage_admin_sdk.model.key_id_access_key_delete_request import KeyIdAccessKeyDeleteRequest +from garage_admin_sdk.model.import_key_request import ImportKeyRequest from garage_admin_sdk.model.key_info import KeyInfo from pprint import pprint # Defining the host is optional and defaults to http://localhost:3903/v0 @@ -371,33 +288,20 @@ configuration = garage_admin_sdk.Configuration( with garage_admin_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = key_api.KeyApi(api_client) - access_key = "GK31c2f218a2e44f485b94239e" # str | The exact API access key generated by Garage - key_id_access_key_delete_request = KeyIdAccessKeyDeleteRequest( + import_key_request = ImportKeyRequest( name="test-key", - allow=KeyIdAccessKeyDeleteRequestAllow( - create_bucket=True, - ), - deny=KeyIdAccessKeyDeleteRequestDeny( - create_bucket=True, - ), - ) # KeyIdAccessKeyDeleteRequest | For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove (optional) - - # example passing only required values which don't have defaults set - try: - # Update a key - api_response = api_instance.keyidaccess_key_post(access_key) - pprint(api_response) - except garage_admin_sdk.ApiException as e: - print("Exception when calling KeyApi->keyidaccess_key_post: %s\n" % e) + access_key_id="GK31c2f218a2e44f485b94239e", + secret_access_key="b892c0665f0ada8a4755dae98baa3b133590e11dae3bcc1f9d769d67f16c3835", + ) # ImportKeyRequest | Information on the key to import (optional) # example passing only required values which don't have defaults set # and optional values try: - # Update a key - api_response = api_instance.keyidaccess_key_post(access_key, key_id_access_key_delete_request=key_id_access_key_delete_request) + # Import an existing key + api_response = api_instance.import_key(import_key_request=import_key_request) pprint(api_response) except garage_admin_sdk.ApiException as e: - print("Exception when calling KeyApi->keyidaccess_key_post: %s\n" % e) + print("Exception when calling KeyApi->import_key: %s\n" % e) ``` @@ -405,8 +309,7 @@ with garage_admin_sdk.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **access_key** | **str**| The exact API access key generated by Garage | - **key_id_access_key_delete_request** | [**KeyIdAccessKeyDeleteRequest**](KeyIdAccessKeyDeleteRequest.md)| For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove | [optional] + **import_key_request** | [**ImportKeyRequest**](ImportKeyRequest.md)| Information on the key to import | [optional] ### Return type @@ -428,85 +331,7 @@ Name | Type | Description | Notes |-------------|-------------|------------------| **500** | The server can not handle your request. Check your connectivity with the rest of the cluster. | - | **400** | Invalid syntax or requested change | - | -**200** | Returns information about the key | - | - -[[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) - -# **keysearchpattern_get** -> KeyInfo keysearchpattern_get(pattern) - -Select key by pattern - -Find the first key matching the given pattern based on its identifier aor friendly name and return its information. - -### Example - -* Bearer Authentication (bearerAuth): - -```python -import time -import garage_admin_sdk -from garage_admin_sdk.api import key_api -from garage_admin_sdk.model.key_info import KeyInfo -from pprint import pprint -# Defining the host is optional and defaults to http://localhost:3903/v0 -# See configuration.py for a list of all supported configuration parameters. -configuration = garage_admin_sdk.Configuration( - host = "http://localhost:3903/v0" -) - -# 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 Bearer authorization: bearerAuth -configuration = garage_admin_sdk.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Enter a context with an instance of the API client -with garage_admin_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = key_api.KeyApi(api_client) - pattern = "test-k" # str | A pattern (beginning or full string) corresponding to a key identifier or friendly name - - # example passing only required values which don't have defaults set - try: - # Select key by pattern - api_response = api_instance.keysearchpattern_get(pattern) - pprint(api_response) - except garage_admin_sdk.ApiException as e: - print("Exception when calling KeyApi->keysearchpattern_get: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pattern** | **str**| A pattern (beginning or full string) corresponding to a key identifier or friendly name | - -### Return type - -[**KeyInfo**](KeyInfo.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**500** | The server can not handle your request. Check your connectivity with the rest of the cluster. | - | -**200** | Returns information about the key | - | +**200** | The key has been imported into the system | - | [[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) @@ -584,3 +409,180 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **search_key** +> KeyInfo search_key(pattern) + +Select key by pattern + +Find the first key matching the given pattern based on its identifier aor friendly name and return its information. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import time +import garage_admin_sdk +from garage_admin_sdk.api import key_api +from garage_admin_sdk.model.key_info import KeyInfo +from pprint import pprint +# Defining the host is optional and defaults to http://localhost:3903/v0 +# See configuration.py for a list of all supported configuration parameters. +configuration = garage_admin_sdk.Configuration( + host = "http://localhost:3903/v0" +) + +# 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 Bearer authorization: bearerAuth +configuration = garage_admin_sdk.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with garage_admin_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = key_api.KeyApi(api_client) + pattern = "test-k" # str | A pattern (beginning or full string) corresponding to a key identifier or friendly name + + # example passing only required values which don't have defaults set + try: + # Select key by pattern + api_response = api_instance.search_key(pattern) + pprint(api_response) + except garage_admin_sdk.ApiException as e: + print("Exception when calling KeyApi->search_key: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pattern** | **str**| A pattern (beginning or full string) corresponding to a key identifier or friendly name | + +### Return type + +[**KeyInfo**](KeyInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**500** | The server can not handle your request. Check your connectivity with the rest of the cluster. | - | +**200** | Returns information about the key | - | + +[[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) + +# **update_key** +> KeyInfo update_key(access_key) + +Update a key + +Updates information about the specified API access key. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import time +import garage_admin_sdk +from garage_admin_sdk.api import key_api +from garage_admin_sdk.model.update_key_request import UpdateKeyRequest +from garage_admin_sdk.model.key_info import KeyInfo +from pprint import pprint +# Defining the host is optional and defaults to http://localhost:3903/v0 +# See configuration.py for a list of all supported configuration parameters. +configuration = garage_admin_sdk.Configuration( + host = "http://localhost:3903/v0" +) + +# 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 Bearer authorization: bearerAuth +configuration = garage_admin_sdk.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with garage_admin_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = key_api.KeyApi(api_client) + access_key = "GK31c2f218a2e44f485b94239e" # str | The exact API access key generated by Garage + update_key_request = UpdateKeyRequest( + name="test-key", + allow=UpdateKeyRequestAllow( + create_bucket=True, + ), + deny=UpdateKeyRequestDeny( + create_bucket=True, + ), + ) # UpdateKeyRequest | For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove (optional) + + # example passing only required values which don't have defaults set + try: + # Update a key + api_response = api_instance.update_key(access_key) + pprint(api_response) + except garage_admin_sdk.ApiException as e: + print("Exception when calling KeyApi->update_key: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Update a key + api_response = api_instance.update_key(access_key, update_key_request=update_key_request) + pprint(api_response) + except garage_admin_sdk.ApiException as e: + print("Exception when calling KeyApi->update_key: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **access_key** | **str**| The exact API access key generated by Garage | + **update_key_request** | [**UpdateKeyRequest**](UpdateKeyRequest.md)| For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove | [optional] + +### Return type + +[**KeyInfo**](KeyInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**500** | The server can not handle your request. Check your connectivity with the rest of the cluster. | - | +**400** | Invalid syntax or requested change | - | +**200** | Returns information about the key | - | + +[[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/python/docs/LayoutApi.md b/python/docs/LayoutApi.md index 5460eae..f76901d 100644 --- a/python/docs/LayoutApi.md +++ b/python/docs/LayoutApi.md @@ -4,169 +4,14 @@ All URIs are relative to *http://localhost:3903/v0* Method | HTTP request | Description ------------- | ------------- | ------------- -[**layout_apply_post**](LayoutApi.md#layout_apply_post) | **POST** /layout/apply | Apply staged layout -[**layout_get**](LayoutApi.md#layout_get) | **GET** /layout | Details on the current and staged layout -[**layout_post**](LayoutApi.md#layout_post) | **POST** /layout | Send modifications to the cluster layout -[**layout_revert_post**](LayoutApi.md#layout_revert_post) | **POST** /layout/revert | Clear staged layout +[**add_layout**](LayoutApi.md#add_layout) | **POST** /layout | Send modifications to the cluster layout +[**apply_layout**](LayoutApi.md#apply_layout) | **POST** /layout/apply | Apply staged layout +[**get_layout**](LayoutApi.md#get_layout) | **GET** /layout | Details on the current and staged layout +[**revert_layout**](LayoutApi.md#revert_layout) | **POST** /layout/revert | Clear staged layout -# **layout_apply_post** -> layout_apply_post() - -Apply staged layout - -Applies to the cluster the layout changes currently registered as staged layout changes. - -### Example - -* Bearer Authentication (bearerAuth): - -```python -import time -import garage_admin_sdk -from garage_admin_sdk.api import layout_api -from garage_admin_sdk.model.layout_version import LayoutVersion -from pprint import pprint -# Defining the host is optional and defaults to http://localhost:3903/v0 -# See configuration.py for a list of all supported configuration parameters. -configuration = garage_admin_sdk.Configuration( - host = "http://localhost:3903/v0" -) - -# 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 Bearer authorization: bearerAuth -configuration = garage_admin_sdk.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Enter a context with an instance of the API client -with garage_admin_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = layout_api.LayoutApi(api_client) - layout_version = LayoutVersion( - version=13, - ) # LayoutVersion | Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. (optional) - - # example passing only required values which don't have defaults set - # and optional values - try: - # Apply staged layout - api_instance.layout_apply_post(layout_version=layout_version) - except garage_admin_sdk.ApiException as e: - print("Exception when calling LayoutApi->layout_apply_post: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **layout_version** | [**LayoutVersion**](LayoutVersion.md)| Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**500** | The server can not handle your request. Check your connectivity with the rest of the cluster. | - | -**400** | Invalid syntax or requested change | - | -**200** | The staged layout has been applied as the new layout of the cluster, a rebalance has been triggered. | - | - -[[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) - -# **layout_get** -> ClusterLayout layout_get() - -Details on the current and staged layout - -Returns the cluster's current layout, including: - Currently configured cluster layout - Staged changes to the cluster layout *The info returned by this endpoint is a subset of the info returned by `GET /status`.* - -### Example - -* Bearer Authentication (bearerAuth): - -```python -import time -import garage_admin_sdk -from garage_admin_sdk.api import layout_api -from garage_admin_sdk.model.cluster_layout import ClusterLayout -from pprint import pprint -# Defining the host is optional and defaults to http://localhost:3903/v0 -# See configuration.py for a list of all supported configuration parameters. -configuration = garage_admin_sdk.Configuration( - host = "http://localhost:3903/v0" -) - -# 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 Bearer authorization: bearerAuth -configuration = garage_admin_sdk.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Enter a context with an instance of the API client -with garage_admin_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = layout_api.LayoutApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Details on the current and staged layout - api_response = api_instance.layout_get() - pprint(api_response) - except garage_admin_sdk.ApiException as e: - print("Exception when calling LayoutApi->layout_get: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**ClusterLayout**](ClusterLayout.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**500** | The server can not answer your request because it is in a bad state | - | -**200** | Returns the cluster's current cluster layout: - Currently configured cluster layout - Staged changes to the cluster layout | - | - -[[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) - -# **layout_post** -> layout_post() +# **add_layout** +> add_layout() Send modifications to the cluster layout @@ -210,9 +55,9 @@ with garage_admin_sdk.ApiClient(configuration) as api_client: # and optional values try: # Send modifications to the cluster layout - api_instance.layout_post(request_body=request_body) + api_instance.add_layout(request_body=request_body) except garage_admin_sdk.ApiException as e: - print("Exception when calling LayoutApi->layout_post: %s\n" % e) + print("Exception when calling LayoutApi->add_layout: %s\n" % e) ``` @@ -246,8 +91,163 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **layout_revert_post** -> layout_revert_post() +# **apply_layout** +> apply_layout() + +Apply staged layout + +Applies to the cluster the layout changes currently registered as staged layout changes. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import time +import garage_admin_sdk +from garage_admin_sdk.api import layout_api +from garage_admin_sdk.model.layout_version import LayoutVersion +from pprint import pprint +# Defining the host is optional and defaults to http://localhost:3903/v0 +# See configuration.py for a list of all supported configuration parameters. +configuration = garage_admin_sdk.Configuration( + host = "http://localhost:3903/v0" +) + +# 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 Bearer authorization: bearerAuth +configuration = garage_admin_sdk.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with garage_admin_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = layout_api.LayoutApi(api_client) + layout_version = LayoutVersion( + version=13, + ) # LayoutVersion | Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Apply staged layout + api_instance.apply_layout(layout_version=layout_version) + except garage_admin_sdk.ApiException as e: + print("Exception when calling LayoutApi->apply_layout: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **layout_version** | [**LayoutVersion**](LayoutVersion.md)| Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**500** | The server can not handle your request. Check your connectivity with the rest of the cluster. | - | +**400** | Invalid syntax or requested change | - | +**200** | The staged layout has been applied as the new layout of the cluster, a rebalance has been triggered. | - | + +[[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_layout** +> ClusterLayout get_layout() + +Details on the current and staged layout + +Returns the cluster's current layout, including: - Currently configured cluster layout - Staged changes to the cluster layout *The info returned by this endpoint is a subset of the info returned by `GET /status`.* + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import time +import garage_admin_sdk +from garage_admin_sdk.api import layout_api +from garage_admin_sdk.model.cluster_layout import ClusterLayout +from pprint import pprint +# Defining the host is optional and defaults to http://localhost:3903/v0 +# See configuration.py for a list of all supported configuration parameters. +configuration = garage_admin_sdk.Configuration( + host = "http://localhost:3903/v0" +) + +# 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 Bearer authorization: bearerAuth +configuration = garage_admin_sdk.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with garage_admin_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = layout_api.LayoutApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Details on the current and staged layout + api_response = api_instance.get_layout() + pprint(api_response) + except garage_admin_sdk.ApiException as e: + print("Exception when calling LayoutApi->get_layout: %s\n" % e) +``` + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ClusterLayout**](ClusterLayout.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**500** | The server can not answer your request because it is in a bad state | - | +**200** | Returns the cluster's current cluster layout: - Currently configured cluster layout - Staged changes to the cluster layout | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **revert_layout** +> revert_layout() Clear staged layout @@ -291,9 +291,9 @@ with garage_admin_sdk.ApiClient(configuration) as api_client: # and optional values try: # Clear staged layout - api_instance.layout_revert_post(layout_version=layout_version) + api_instance.revert_layout(layout_version=layout_version) except garage_admin_sdk.ApiException as e: - print("Exception when calling LayoutApi->layout_revert_post: %s\n" % e) + print("Exception when calling LayoutApi->revert_layout: %s\n" % e) ``` diff --git a/python/docs/MembershipApi.md b/python/docs/MembershipApi.md index 3aaed05..7480f1b 100644 --- a/python/docs/MembershipApi.md +++ b/python/docs/MembershipApi.md @@ -4,12 +4,11 @@ All URIs are relative to *http://localhost:3903/v0* Method | HTTP request | Description ------------- | ------------- | ------------- -[**connect_post**](MembershipApi.md#connect_post) | **POST** /connect | Connect target node to other Garage nodes -[**status_get**](MembershipApi.md#status_get) | **GET** /status | Status of this node and other nodes in the cluster +[**add_node**](MembershipApi.md#add_node) | **POST** /connect | Connect target node to other Garage nodes -# **connect_post** -> [ConnectPost200ResponseInner] connect_post() +# **add_node** +> [AddNode200ResponseInner] add_node() Connect target node to other Garage nodes @@ -23,7 +22,7 @@ Instructs this Garage node to connect to other Garage nodes at specified `connect_post: %s\n" % e) + print("Exception when calling MembershipApi->add_node: %s\n" % e) ``` @@ -66,7 +65,7 @@ Name | Type | Description | Notes ### Return type -[**[ConnectPost200ResponseInner]**](ConnectPost200ResponseInner.md) +[**[AddNode200ResponseInner]**](AddNode200ResponseInner.md) ### Authorization @@ -88,77 +87,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) -# **status_get** -> StatusGet200Response status_get() - -Status of this node and other nodes in the cluster - -Returns the cluster's current status, including: - ID of the node being queried and its version of the Garage daemon - Live nodes - Currently configured cluster layout - Staged changes to the cluster layout - -### Example - -* Bearer Authentication (bearerAuth): - -```python -import time -import garage_admin_sdk -from garage_admin_sdk.api import membership_api -from garage_admin_sdk.model.status_get200_response import StatusGet200Response -from pprint import pprint -# Defining the host is optional and defaults to http://localhost:3903/v0 -# See configuration.py for a list of all supported configuration parameters. -configuration = garage_admin_sdk.Configuration( - host = "http://localhost:3903/v0" -) - -# 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 Bearer authorization: bearerAuth -configuration = garage_admin_sdk.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) - -# Enter a context with an instance of the API client -with garage_admin_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = membership_api.MembershipApi(api_client) - - # example, this endpoint has no required or optional parameters - try: - # Status of this node and other nodes in the cluster - api_response = api_instance.status_get() - pprint(api_response) - except garage_admin_sdk.ApiException as e: - print("Exception when calling MembershipApi->status_get: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**StatusGet200Response**](StatusGet200Response.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**500** | The server can not answer your request because it is in a bad state | - | -**200** | Information about the queried node, its environment and the current layout | - | - -[[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/python/docs/NodesApi.md b/python/docs/NodesApi.md new file mode 100644 index 0000000..e652ebd --- /dev/null +++ b/python/docs/NodesApi.md @@ -0,0 +1,164 @@ +# garage_admin_sdk.NodesApi + +All URIs are relative to *http://localhost:3903/v0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_node**](NodesApi.md#add_node) | **POST** /connect | Connect target node to other Garage nodes +[**get_nodes**](NodesApi.md#get_nodes) | **GET** /status | Status of this node and other nodes in the cluster + + +# **add_node** +> [AddNode200ResponseInner] add_node() + +Connect target node to other Garage nodes + +Instructs this Garage node to connect to other Garage nodes at specified `@`. `node_id` is generated automatically on node start. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import time +import garage_admin_sdk +from garage_admin_sdk.api import nodes_api +from garage_admin_sdk.model.add_node200_response_inner import AddNode200ResponseInner +from pprint import pprint +# Defining the host is optional and defaults to http://localhost:3903/v0 +# See configuration.py for a list of all supported configuration parameters. +configuration = garage_admin_sdk.Configuration( + host = "http://localhost:3903/v0" +) + +# 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 Bearer authorization: bearerAuth +configuration = garage_admin_sdk.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with garage_admin_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = nodes_api.NodesApi(api_client) + request_body = ["ec79480e0ce52ae26fd00c9da684e4fa56658d9c64cdcecb094e936de0bfe71f@10.0.0.11:3901","4a6ae5a1d0d33bf895f5bb4f0a418b7dc94c47c0dd2eb108d1158f3c8f60b0ff@10.0.0.12:3901"] # [str] | (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Connect target node to other Garage nodes + api_response = api_instance.add_node(request_body=request_body) + pprint(api_response) + except garage_admin_sdk.ApiException as e: + print("Exception when calling NodesApi->add_node: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | **[str]**| | [optional] + +### Return type + +[**[AddNode200ResponseInner]**](AddNode200ResponseInner.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**500** | The server can not answer your request because it is in a bad state | - | +**400** | Your request is malformed, check your JSON | - | +**200** | The request has been handled correctly but it does not mean that all connection requests succeeded; some might have fail, you need to check the body! | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_nodes** +> GetNodes200Response get_nodes() + +Status of this node and other nodes in the cluster + +Returns the cluster's current status, including: - ID of the node being queried and its version of the Garage daemon - Live nodes - Currently configured cluster layout - Staged changes to the cluster layout + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import time +import garage_admin_sdk +from garage_admin_sdk.api import nodes_api +from garage_admin_sdk.model.get_nodes200_response import GetNodes200Response +from pprint import pprint +# Defining the host is optional and defaults to http://localhost:3903/v0 +# See configuration.py for a list of all supported configuration parameters. +configuration = garage_admin_sdk.Configuration( + host = "http://localhost:3903/v0" +) + +# 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 Bearer authorization: bearerAuth +configuration = garage_admin_sdk.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with garage_admin_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = nodes_api.NodesApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Status of this node and other nodes in the cluster + api_response = api_instance.get_nodes() + pprint(api_response) + except garage_admin_sdk.ApiException as e: + print("Exception when calling NodesApi->get_nodes: %s\n" % e) +``` + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**GetNodes200Response**](GetNodes200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**500** | The server can not answer your request because it is in a bad state | - | +**200** | Information about the queried node, its environment and the current layout | - | + +[[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/python/docs/UpdateKeyRequest.md b/python/docs/UpdateKeyRequest.md new file mode 100644 index 0000000..c03e50c --- /dev/null +++ b/python/docs/UpdateKeyRequest.md @@ -0,0 +1,14 @@ +# UpdateKeyRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**allow** | [**UpdateKeyRequestAllow**](UpdateKeyRequestAllow.md) | | [optional] +**deny** | [**UpdateKeyRequestDeny**](UpdateKeyRequestDeny.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/docs/UpdateKeyRequestAllow.md b/python/docs/UpdateKeyRequestAllow.md new file mode 100644 index 0000000..df55f72 --- /dev/null +++ b/python/docs/UpdateKeyRequestAllow.md @@ -0,0 +1,12 @@ +# UpdateKeyRequestAllow + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**create_bucket** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/docs/UpdateKeyRequestDeny.md b/python/docs/UpdateKeyRequestDeny.md new file mode 100644 index 0000000..be757e4 --- /dev/null +++ b/python/docs/UpdateKeyRequestDeny.md @@ -0,0 +1,12 @@ +# UpdateKeyRequestDeny + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**create_bucket** | **bool** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/garage_admin_sdk/api/key_api.py b/python/garage_admin_sdk/api/key_api.py index 16a48c8..3b10830 100644 --- a/python/garage_admin_sdk/api/key_api.py +++ b/python/garage_admin_sdk/api/key_api.py @@ -21,11 +21,11 @@ from garage_admin_sdk.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from garage_admin_sdk.model.key_get_request import KeyGetRequest -from garage_admin_sdk.model.key_id_access_key_delete_request import KeyIdAccessKeyDeleteRequest -from garage_admin_sdk.model.key_import_post_request import KeyImportPostRequest +from garage_admin_sdk.model.add_key_request import AddKeyRequest +from garage_admin_sdk.model.import_key_request import ImportKeyRequest from garage_admin_sdk.model.key_info import KeyInfo from garage_admin_sdk.model.list_keys200_response_inner import ListKeys200ResponseInner +from garage_admin_sdk.model.update_key_request import UpdateKeyRequest class KeyApi(object): @@ -39,70 +39,20 @@ class KeyApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.key_import_post_endpoint = _Endpoint( - settings={ - 'response_type': (KeyInfo,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/key/import', - 'operation_id': 'key_import_post', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'key_import_post_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'key_import_post_request': - (KeyImportPostRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'key_import_post_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.key_post_endpoint = _Endpoint( + self.add_key_endpoint = _Endpoint( settings={ 'response_type': (KeyInfo,), 'auth': [ 'bearerAuth' ], 'endpoint_path': '/key', - 'operation_id': 'key_post', + 'operation_id': 'add_key', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ - 'key_get_request', + 'add_key_request', ], 'required': [], 'nullable': [ @@ -118,13 +68,13 @@ class KeyApi(object): 'allowed_values': { }, 'openapi_types': { - 'key_get_request': - (KeyGetRequest,), + 'add_key_request': + (AddKeyRequest,), }, 'attribute_map': { }, 'location_map': { - 'key_get_request': 'body', + 'add_key_request': 'body', }, 'collection_format_map': { } @@ -139,14 +89,14 @@ class KeyApi(object): }, api_client=api_client ) - self.keyidaccess_key_delete_endpoint = _Endpoint( + self.delete_key_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ 'bearerAuth' ], 'endpoint_path': '/key?id={access_key}', - 'operation_id': 'keyidaccess_key_delete', + 'operation_id': 'delete_key', 'http_method': 'DELETE', 'servers': None, }, @@ -188,14 +138,14 @@ class KeyApi(object): }, api_client=api_client ) - self.keyidaccess_key_get_endpoint = _Endpoint( + self.get_key_endpoint = _Endpoint( settings={ 'response_type': (KeyInfo,), 'auth': [ 'bearerAuth' ], 'endpoint_path': '/key?id={access_key}', - 'operation_id': 'keyidaccess_key_get', + 'operation_id': 'get_key', 'http_method': 'GET', 'servers': None, }, @@ -239,25 +189,22 @@ class KeyApi(object): }, api_client=api_client ) - self.keyidaccess_key_post_endpoint = _Endpoint( + self.import_key_endpoint = _Endpoint( settings={ 'response_type': (KeyInfo,), 'auth': [ 'bearerAuth' ], - 'endpoint_path': '/key?id={access_key}', - 'operation_id': 'keyidaccess_key_post', + 'endpoint_path': '/key/import', + 'operation_id': 'import_key', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ - 'access_key', - 'key_id_access_key_delete_request', - ], - 'required': [ - 'access_key', + 'import_key_request', ], + 'required': [], 'nullable': [ ], 'enum': [ @@ -271,17 +218,13 @@ class KeyApi(object): 'allowed_values': { }, 'openapi_types': { - 'access_key': - (str,), - 'key_id_access_key_delete_request': - (KeyIdAccessKeyDeleteRequest,), + 'import_key_request': + (ImportKeyRequest,), }, 'attribute_map': { - 'access_key': 'access_key', }, 'location_map': { - 'access_key': 'path', - 'key_id_access_key_delete_request': 'body', + 'import_key_request': 'body', }, 'collection_format_map': { } @@ -296,57 +239,6 @@ class KeyApi(object): }, api_client=api_client ) - self.keysearchpattern_get_endpoint = _Endpoint( - settings={ - 'response_type': (KeyInfo,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/key?search={pattern}', - 'operation_id': 'keysearchpattern_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pattern', - ], - 'required': [ - 'pattern', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pattern': - (str,), - }, - 'attribute_map': { - 'pattern': 'pattern', - }, - 'location_map': { - 'pattern': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) self.list_keys_endpoint = _Endpoint( settings={ 'response_type': ([ListKeys200ResponseInner],), @@ -391,87 +283,116 @@ class KeyApi(object): }, api_client=api_client ) - - def key_import_post( - self, - **kwargs - ): - """Import an existing key # noqa: E501 - - Imports an existing API key. This feature must only be used for migrations and backup restore. **Do not use it to generate custom key identifiers or you will break your Garage cluster.** # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.key_import_post(async_req=True) - >>> result = thread.get() - - - Keyword Args: - key_import_post_request (KeyImportPostRequest): Information on the key to import . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - KeyInfo - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + self.search_key_endpoint = _Endpoint( + settings={ + 'response_type': (KeyInfo,), + 'auth': [ + 'bearerAuth' + ], + 'endpoint_path': '/key?search={pattern}', + 'operation_id': 'search_key', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'pattern', + ], + 'required': [ + 'pattern', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pattern': + (str,), + }, + 'attribute_map': { + 'pattern': 'pattern', + }, + 'location_map': { + 'pattern': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + self.update_key_endpoint = _Endpoint( + settings={ + 'response_type': (KeyInfo,), + 'auth': [ + 'bearerAuth' + ], + 'endpoint_path': '/key?id={access_key}', + 'operation_id': 'update_key', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'access_key', + 'update_key_request', + ], + 'required': [ + 'access_key', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'access_key': + (str,), + 'update_key_request': + (UpdateKeyRequest,), + }, + 'attribute_map': { + 'access_key': 'access_key', + }, + 'location_map': { + 'access_key': 'path', + 'update_key_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.key_import_post_endpoint.call_with_http_info(**kwargs) - def key_post( + def add_key( self, **kwargs ): @@ -481,12 +402,12 @@ class KeyApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.key_post(async_req=True) + >>> thread = api.add_key(async_req=True) >>> result = thread.get() Keyword Args: - key_get_request (KeyGetRequest): \"You can optionnaly set a friendly name for this key\" . [optional] + add_key_request (AddKeyRequest): \"You can optionnaly set a friendly name for this key\" . [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -548,19 +469,20 @@ class KeyApi(object): '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.key_post_endpoint.call_with_http_info(**kwargs) + return self.add_key_endpoint.call_with_http_info(**kwargs) - def keyidaccess_key_delete( + def delete_key( self, access_key, **kwargs ): """Delete a key # noqa: E501 + Delete a key from the cluster. Its access will be removed from all the buckets. Buckets are not automatically deleted and can be dangling. You should manually delete them before. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.keyidaccess_key_delete(access_key, async_req=True) + >>> thread = api.delete_key(access_key, async_req=True) >>> result = thread.get() Args: @@ -630,9 +552,9 @@ class KeyApi(object): kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['access_key'] = \ access_key - return self.keyidaccess_key_delete_endpoint.call_with_http_info(**kwargs) + return self.delete_key_endpoint.call_with_http_info(**kwargs) - def keyidaccess_key_get( + def get_key( self, access_key, **kwargs @@ -643,7 +565,7 @@ class KeyApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.keyidaccess_key_get(access_key, async_req=True) + >>> thread = api.get_key(access_key, async_req=True) >>> result = thread.get() Args: @@ -713,27 +635,24 @@ class KeyApi(object): kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['access_key'] = \ access_key - return self.keyidaccess_key_get_endpoint.call_with_http_info(**kwargs) + return self.get_key_endpoint.call_with_http_info(**kwargs) - def keyidaccess_key_post( + def import_key( self, - access_key, **kwargs ): - """Update a key # noqa: E501 + """Import an existing key # noqa: E501 - Updates information about the specified API access key. # noqa: E501 + Imports an existing API key. This feature must only be used for migrations and backup restore. **Do not use it to generate custom key identifiers or you will break your Garage cluster.** # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.keyidaccess_key_post(access_key, async_req=True) + >>> thread = api.import_key(async_req=True) >>> result = thread.get() - Args: - access_key (str): The exact API access key generated by Garage Keyword Args: - key_id_access_key_delete_request (KeyIdAccessKeyDeleteRequest): For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove . [optional] + import_key_request (ImportKeyRequest): Information on the key to import . [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -795,92 +714,7 @@ class KeyApi(object): '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['access_key'] = \ - access_key - return self.keyidaccess_key_post_endpoint.call_with_http_info(**kwargs) - - def keysearchpattern_get( - self, - pattern, - **kwargs - ): - """Select key by pattern # noqa: E501 - - Find the first key matching the given pattern based on its identifier aor friendly name and return its information. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.keysearchpattern_get(pattern, async_req=True) - >>> result = thread.get() - - Args: - pattern (str): A pattern (beginning or full string) corresponding to a key identifier or friendly name - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - KeyInfo - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pattern'] = \ - pattern - return self.keysearchpattern_get_endpoint.call_with_http_info(**kwargs) + return self.import_key_endpoint.call_with_http_info(**kwargs) def list_keys( self, @@ -960,3 +794,170 @@ class KeyApi(object): kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.list_keys_endpoint.call_with_http_info(**kwargs) + def search_key( + self, + pattern, + **kwargs + ): + """Select key by pattern # noqa: E501 + + Find the first key matching the given pattern based on its identifier aor friendly name and return its information. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.search_key(pattern, async_req=True) + >>> result = thread.get() + + Args: + pattern (str): A pattern (beginning or full string) corresponding to a key identifier or friendly name + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + KeyInfo + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['pattern'] = \ + pattern + return self.search_key_endpoint.call_with_http_info(**kwargs) + + def update_key( + self, + access_key, + **kwargs + ): + """Update a key # noqa: E501 + + Updates information about the specified API access key. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_key(access_key, async_req=True) + >>> result = thread.get() + + Args: + access_key (str): The exact API access key generated by Garage + + Keyword Args: + update_key_request (UpdateKeyRequest): For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove . [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + KeyInfo + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['access_key'] = \ + access_key + return self.update_key_endpoint.call_with_http_info(**kwargs) + diff --git a/python/garage_admin_sdk/api/layout_api.py b/python/garage_admin_sdk/api/layout_api.py index 9e62403..a3d3594 100644 --- a/python/garage_admin_sdk/api/layout_api.py +++ b/python/garage_admin_sdk/api/layout_api.py @@ -37,106 +37,14 @@ class LayoutApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.layout_apply_post_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/layout/apply', - 'operation_id': 'layout_apply_post', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'layout_version', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'layout_version': - (LayoutVersion,), - }, - 'attribute_map': { - }, - 'location_map': { - 'layout_version': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.layout_get_endpoint = _Endpoint( - settings={ - 'response_type': (ClusterLayout,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/layout', - 'operation_id': 'layout_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.layout_post_endpoint = _Endpoint( + self.add_layout_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ 'bearerAuth' ], 'endpoint_path': '/layout', - 'operation_id': 'layout_post', + 'operation_id': 'add_layout', 'http_method': 'POST', 'servers': None, }, @@ -177,14 +85,106 @@ class LayoutApi(object): }, api_client=api_client ) - self.layout_revert_post_endpoint = _Endpoint( + self.apply_layout_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'bearerAuth' + ], + 'endpoint_path': '/layout/apply', + 'operation_id': 'apply_layout', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'layout_version', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'layout_version': + (LayoutVersion,), + }, + 'attribute_map': { + }, + 'location_map': { + 'layout_version': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.get_layout_endpoint = _Endpoint( + settings={ + 'response_type': (ClusterLayout,), + 'auth': [ + 'bearerAuth' + ], + 'endpoint_path': '/layout', + 'operation_id': 'get_layout', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.revert_layout_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ 'bearerAuth' ], 'endpoint_path': '/layout/revert', - 'operation_id': 'layout_revert_post', + 'operation_id': 'revert_layout', 'http_method': 'POST', 'servers': None, }, @@ -226,164 +226,7 @@ class LayoutApi(object): api_client=api_client ) - def layout_apply_post( - self, - **kwargs - ): - """Apply staged layout # noqa: E501 - - Applies to the cluster the layout changes currently registered as staged layout changes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.layout_apply_post(async_req=True) - >>> result = thread.get() - - - Keyword Args: - layout_version (LayoutVersion): Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.layout_apply_post_endpoint.call_with_http_info(**kwargs) - - def layout_get( - self, - **kwargs - ): - """Details on the current and staged layout # noqa: E501 - - Returns the cluster's current layout, including: - Currently configured cluster layout - Staged changes to the cluster layout *The info returned by this endpoint is a subset of the info returned by `GET /status`.* # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.layout_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ClusterLayout - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.layout_get_endpoint.call_with_http_info(**kwargs) - - def layout_post( + def add_layout( self, **kwargs ): @@ -393,7 +236,7 @@ class LayoutApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.layout_post(async_req=True) + >>> thread = api.add_layout(async_req=True) >>> result = thread.get() @@ -460,9 +303,166 @@ class LayoutApi(object): '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.layout_post_endpoint.call_with_http_info(**kwargs) + return self.add_layout_endpoint.call_with_http_info(**kwargs) - def layout_revert_post( + def apply_layout( + self, + **kwargs + ): + """Apply staged layout # noqa: E501 + + Applies to the cluster the layout changes currently registered as staged layout changes. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.apply_layout(async_req=True) + >>> result = thread.get() + + + Keyword Args: + layout_version (LayoutVersion): Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. . [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.apply_layout_endpoint.call_with_http_info(**kwargs) + + def get_layout( + self, + **kwargs + ): + """Details on the current and staged layout # noqa: E501 + + Returns the cluster's current layout, including: - Currently configured cluster layout - Staged changes to the cluster layout *The info returned by this endpoint is a subset of the info returned by `GET /status`.* # 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_layout(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + ClusterLayout + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.get_layout_endpoint.call_with_http_info(**kwargs) + + def revert_layout( self, **kwargs ): @@ -472,7 +472,7 @@ class LayoutApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.layout_revert_post(async_req=True) + >>> thread = api.revert_layout(async_req=True) >>> result = thread.get() @@ -539,5 +539,5 @@ class LayoutApi(object): '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.layout_revert_post_endpoint.call_with_http_info(**kwargs) + return self.revert_layout_endpoint.call_with_http_info(**kwargs) diff --git a/python/garage_admin_sdk/api/membership_api.py b/python/garage_admin_sdk/api/membership_api.py index f0ad18e..761c6d8 100644 --- a/python/garage_admin_sdk/api/membership_api.py +++ b/python/garage_admin_sdk/api/membership_api.py @@ -21,8 +21,7 @@ from garage_admin_sdk.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from garage_admin_sdk.model.connect_post200_response_inner import ConnectPost200ResponseInner -from garage_admin_sdk.model.status_get200_response import StatusGet200Response +from garage_admin_sdk.model.add_node200_response_inner import AddNode200ResponseInner class MembershipApi(object): @@ -36,14 +35,14 @@ class MembershipApi(object): if api_client is None: api_client = ApiClient() self.api_client = api_client - self.connect_post_endpoint = _Endpoint( + self.add_node_endpoint = _Endpoint( settings={ - 'response_type': ([ConnectPost200ResponseInner],), + 'response_type': ([AddNode200ResponseInner],), 'auth': [ 'bearerAuth' ], 'endpoint_path': '/connect', - 'operation_id': 'connect_post', + 'operation_id': 'add_node', 'http_method': 'POST', 'servers': None, }, @@ -86,52 +85,8 @@ class MembershipApi(object): }, api_client=api_client ) - self.status_get_endpoint = _Endpoint( - settings={ - 'response_type': (StatusGet200Response,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/status', - 'operation_id': 'status_get', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - def connect_post( + def add_node( self, **kwargs ): @@ -141,7 +96,7 @@ class MembershipApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.connect_post(async_req=True) + >>> thread = api.add_node(async_req=True) >>> result = thread.get() @@ -179,7 +134,7 @@ class MembershipApi(object): async_req (bool): execute request asynchronously Returns: - [ConnectPost200ResponseInner] + [AddNode200ResponseInner] If the method is called asynchronously, returns the request thread. """ @@ -208,83 +163,5 @@ class MembershipApi(object): '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.connect_post_endpoint.call_with_http_info(**kwargs) - - def status_get( - self, - **kwargs - ): - """Status of this node and other nodes in the cluster # noqa: E501 - - Returns the cluster's current status, including: - ID of the node being queried and its version of the Garage daemon - Live nodes - Currently configured cluster layout - Staged changes to the cluster layout # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.status_get(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - StatusGet200Response - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.status_get_endpoint.call_with_http_info(**kwargs) + return self.add_node_endpoint.call_with_http_info(**kwargs) diff --git a/python/garage_admin_sdk/api/nodes_api.py b/python/garage_admin_sdk/api/nodes_api.py new file mode 100644 index 0000000..e6bb1bd --- /dev/null +++ b/python/garage_admin_sdk/api/nodes_api.py @@ -0,0 +1,290 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from garage_admin_sdk.api_client import ApiClient, Endpoint as _Endpoint +from garage_admin_sdk.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from garage_admin_sdk.model.add_node200_response_inner import AddNode200ResponseInner +from garage_admin_sdk.model.get_nodes200_response import GetNodes200Response + + +class NodesApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.add_node_endpoint = _Endpoint( + settings={ + 'response_type': ([AddNode200ResponseInner],), + 'auth': [ + 'bearerAuth' + ], + 'endpoint_path': '/connect', + 'operation_id': 'add_node', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'request_body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'request_body': + ([str],), + }, + 'attribute_map': { + }, + 'location_map': { + 'request_body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.get_nodes_endpoint = _Endpoint( + settings={ + 'response_type': (GetNodes200Response,), + 'auth': [ + 'bearerAuth' + ], + 'endpoint_path': '/status', + 'operation_id': 'get_nodes', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def add_node( + self, + **kwargs + ): + """Connect target node to other Garage nodes # noqa: E501 + + Instructs this Garage node to connect to other Garage nodes at specified `@`. `node_id` is generated automatically on node start. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_node(async_req=True) + >>> result = thread.get() + + + Keyword Args: + request_body ([str]): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + [AddNode200ResponseInner] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.add_node_endpoint.call_with_http_info(**kwargs) + + def get_nodes( + self, + **kwargs + ): + """Status of this node and other nodes in the cluster # noqa: E501 + + Returns the cluster's current status, including: - ID of the node being queried and its version of the Garage daemon - Live nodes - Currently configured cluster layout - Staged changes to the cluster layout # 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_nodes(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + GetNodes200Response + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.get_nodes_endpoint.call_with_http_info(**kwargs) + diff --git a/python/garage_admin_sdk/api_client.py b/python/garage_admin_sdk/api_client.py index 0bf4c71..0e6c7b5 100644 --- a/python/garage_admin_sdk/api_client.py +++ b/python/garage_admin_sdk/api_client.py @@ -802,10 +802,10 @@ class Endpoint(object): Example: api_instance = KeyApi() - api_instance.key_import_post # this is an instance of the class Endpoint - api_instance.key_import_post() # this invokes api_instance.key_import_post.__call__() + api_instance.add_key # this is an instance of the class Endpoint + api_instance.add_key() # this invokes api_instance.add_key.__call__() which then invokes the callable functions stored in that endpoint at - api_instance.key_import_post.callable or self.callable in this class + api_instance.add_key.callable or self.callable in this class """ return self.callable(self, *args, **kwargs) diff --git a/python/garage_admin_sdk/apis/__init__.py b/python/garage_admin_sdk/apis/__init__.py index faf42e3..55eba06 100644 --- a/python/garage_admin_sdk/apis/__init__.py +++ b/python/garage_admin_sdk/apis/__init__.py @@ -16,4 +16,4 @@ # Import APIs into API package: from garage_admin_sdk.api.key_api import KeyApi from garage_admin_sdk.api.layout_api import LayoutApi -from garage_admin_sdk.api.membership_api import MembershipApi +from garage_admin_sdk.api.nodes_api import NodesApi diff --git a/python/garage_admin_sdk/model/add_key_request.py b/python/garage_admin_sdk/model/add_key_request.py new file mode 100644 index 0000000..25917e3 --- /dev/null +++ b/python/garage_admin_sdk/model/add_key_request.py @@ -0,0 +1,263 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from garage_admin_sdk.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from garage_admin_sdk.exceptions import ApiAttributeError + + + +class AddKeyRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AddKeyRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AddKeyRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/python/garage_admin_sdk/model/add_node200_response_inner.py b/python/garage_admin_sdk/model/add_node200_response_inner.py new file mode 100644 index 0000000..fea53c7 --- /dev/null +++ b/python/garage_admin_sdk/model/add_node200_response_inner.py @@ -0,0 +1,267 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from garage_admin_sdk.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from garage_admin_sdk.exceptions import ApiAttributeError + + + +class AddNode200ResponseInner(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'success': (bool,), # noqa: E501 + 'error': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'success': 'success', # noqa: E501 + 'error': 'error', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AddNode200ResponseInner - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success (bool): [optional] # noqa: E501 + error (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AddNode200ResponseInner - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success (bool): [optional] # noqa: E501 + error (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/python/garage_admin_sdk/model/get_nodes200_response.py b/python/garage_admin_sdk/model/get_nodes200_response.py new file mode 100644 index 0000000..25188e9 --- /dev/null +++ b/python/garage_admin_sdk/model/get_nodes200_response.py @@ -0,0 +1,283 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from garage_admin_sdk.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from garage_admin_sdk.exceptions import ApiAttributeError + + +def lazy_import(): + from garage_admin_sdk.model.cluster_layout import ClusterLayout + from garage_admin_sdk.model.node_network_info import NodeNetworkInfo + globals()['ClusterLayout'] = ClusterLayout + globals()['NodeNetworkInfo'] = NodeNetworkInfo + + +class GetNodes200Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'node': (str,), # noqa: E501 + 'garage_version': (str,), # noqa: E501 + 'known_nodes': ({str: (NodeNetworkInfo,)},), # noqa: E501 + 'layout': (ClusterLayout,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'node': 'node', # noqa: E501 + 'garage_version': 'garage_version', # noqa: E501 + 'known_nodes': 'knownNodes', # noqa: E501 + 'layout': 'layout', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GetNodes200Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + node (str): [optional] # noqa: E501 + garage_version (str): [optional] # noqa: E501 + known_nodes ({str: (NodeNetworkInfo,)}): [optional] # noqa: E501 + layout (ClusterLayout): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """GetNodes200Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + node (str): [optional] # noqa: E501 + garage_version (str): [optional] # noqa: E501 + known_nodes ({str: (NodeNetworkInfo,)}): [optional] # noqa: E501 + layout (ClusterLayout): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/python/garage_admin_sdk/model/import_key_request.py b/python/garage_admin_sdk/model/import_key_request.py new file mode 100644 index 0000000..3359eb0 --- /dev/null +++ b/python/garage_admin_sdk/model/import_key_request.py @@ -0,0 +1,271 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from garage_admin_sdk.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from garage_admin_sdk.exceptions import ApiAttributeError + + + +class ImportKeyRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'access_key_id': (str,), # noqa: E501 + 'secret_access_key': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'access_key_id': 'accessKeyId', # noqa: E501 + 'secret_access_key': 'secretAccessKey', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ImportKeyRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + access_key_id (str): [optional] # noqa: E501 + secret_access_key (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ImportKeyRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + access_key_id (str): [optional] # noqa: E501 + secret_access_key (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/python/garage_admin_sdk/model/update_key_request.py b/python/garage_admin_sdk/model/update_key_request.py new file mode 100644 index 0000000..6df5930 --- /dev/null +++ b/python/garage_admin_sdk/model/update_key_request.py @@ -0,0 +1,279 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from garage_admin_sdk.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from garage_admin_sdk.exceptions import ApiAttributeError + + +def lazy_import(): + from garage_admin_sdk.model.update_key_request_allow import UpdateKeyRequestAllow + from garage_admin_sdk.model.update_key_request_deny import UpdateKeyRequestDeny + globals()['UpdateKeyRequestAllow'] = UpdateKeyRequestAllow + globals()['UpdateKeyRequestDeny'] = UpdateKeyRequestDeny + + +class UpdateKeyRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'name': (str,), # noqa: E501 + 'allow': (UpdateKeyRequestAllow,), # noqa: E501 + 'deny': (UpdateKeyRequestDeny,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'allow': 'allow', # noqa: E501 + 'deny': 'deny', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UpdateKeyRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + allow (UpdateKeyRequestAllow): [optional] # noqa: E501 + deny (UpdateKeyRequestDeny): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """UpdateKeyRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): [optional] # noqa: E501 + allow (UpdateKeyRequestAllow): [optional] # noqa: E501 + deny (UpdateKeyRequestDeny): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/python/garage_admin_sdk/model/update_key_request_allow.py b/python/garage_admin_sdk/model/update_key_request_allow.py new file mode 100644 index 0000000..90bee7d --- /dev/null +++ b/python/garage_admin_sdk/model/update_key_request_allow.py @@ -0,0 +1,263 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from garage_admin_sdk.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from garage_admin_sdk.exceptions import ApiAttributeError + + + +class UpdateKeyRequestAllow(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'create_bucket': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'create_bucket': 'createBucket', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UpdateKeyRequestAllow - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + create_bucket (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """UpdateKeyRequestAllow - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + create_bucket (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/python/garage_admin_sdk/model/update_key_request_deny.py b/python/garage_admin_sdk/model/update_key_request_deny.py new file mode 100644 index 0000000..55db81c --- /dev/null +++ b/python/garage_admin_sdk/model/update_key_request_deny.py @@ -0,0 +1,263 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from garage_admin_sdk.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from garage_admin_sdk.exceptions import ApiAttributeError + + + +class UpdateKeyRequestDeny(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'create_bucket': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'create_bucket': 'createBucket', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UpdateKeyRequestDeny - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + create_bucket (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """UpdateKeyRequestDeny - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + create_bucket (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/python/garage_admin_sdk/models/__init__.py b/python/garage_admin_sdk/models/__init__.py index d6b923c..16f229f 100644 --- a/python/garage_admin_sdk/models/__init__.py +++ b/python/garage_admin_sdk/models/__init__.py @@ -9,13 +9,11 @@ # import sys # sys.setrecursionlimit(n) +from garage_admin_sdk.model.add_key_request import AddKeyRequest +from garage_admin_sdk.model.add_node200_response_inner import AddNode200ResponseInner from garage_admin_sdk.model.cluster_layout import ClusterLayout -from garage_admin_sdk.model.connect_post200_response_inner import ConnectPost200ResponseInner -from garage_admin_sdk.model.key_get_request import KeyGetRequest -from garage_admin_sdk.model.key_id_access_key_delete_request import KeyIdAccessKeyDeleteRequest -from garage_admin_sdk.model.key_id_access_key_delete_request_allow import KeyIdAccessKeyDeleteRequestAllow -from garage_admin_sdk.model.key_id_access_key_delete_request_deny import KeyIdAccessKeyDeleteRequestDeny -from garage_admin_sdk.model.key_import_post_request import KeyImportPostRequest +from garage_admin_sdk.model.get_nodes200_response import GetNodes200Response +from garage_admin_sdk.model.import_key_request import ImportKeyRequest from garage_admin_sdk.model.key_info import KeyInfo from garage_admin_sdk.model.key_info_buckets_inner import KeyInfoBucketsInner from garage_admin_sdk.model.key_info_buckets_inner_permissions import KeyInfoBucketsInnerPermissions @@ -24,4 +22,6 @@ from garage_admin_sdk.model.layout_version import LayoutVersion from garage_admin_sdk.model.list_keys200_response_inner import ListKeys200ResponseInner from garage_admin_sdk.model.node_cluster_info import NodeClusterInfo from garage_admin_sdk.model.node_network_info import NodeNetworkInfo -from garage_admin_sdk.model.status_get200_response import StatusGet200Response +from garage_admin_sdk.model.update_key_request import UpdateKeyRequest +from garage_admin_sdk.model.update_key_request_allow import UpdateKeyRequestAllow +from garage_admin_sdk.model.update_key_request_deny import UpdateKeyRequestDeny diff --git a/python/test/test_add_key_request.py b/python/test/test_add_key_request.py new file mode 100644 index 0000000..b35c02a --- /dev/null +++ b/python/test/test_add_key_request.py @@ -0,0 +1,35 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import garage_admin_sdk +from garage_admin_sdk.model.add_key_request import AddKeyRequest + + +class TestAddKeyRequest(unittest.TestCase): + """AddKeyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAddKeyRequest(self): + """Test AddKeyRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = AddKeyRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_add_node200_response_inner.py b/python/test/test_add_node200_response_inner.py new file mode 100644 index 0000000..d53cfe0 --- /dev/null +++ b/python/test/test_add_node200_response_inner.py @@ -0,0 +1,35 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import garage_admin_sdk +from garage_admin_sdk.model.add_node200_response_inner import AddNode200ResponseInner + + +class TestAddNode200ResponseInner(unittest.TestCase): + """AddNode200ResponseInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAddNode200ResponseInner(self): + """Test AddNode200ResponseInner""" + # FIXME: construct object with mandatory attributes with example values + # model = AddNode200ResponseInner() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_get_nodes200_response.py b/python/test/test_get_nodes200_response.py new file mode 100644 index 0000000..fed05a8 --- /dev/null +++ b/python/test/test_get_nodes200_response.py @@ -0,0 +1,39 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import garage_admin_sdk +from garage_admin_sdk.model.cluster_layout import ClusterLayout +from garage_admin_sdk.model.node_network_info import NodeNetworkInfo +globals()['ClusterLayout'] = ClusterLayout +globals()['NodeNetworkInfo'] = NodeNetworkInfo +from garage_admin_sdk.model.get_nodes200_response import GetNodes200Response + + +class TestGetNodes200Response(unittest.TestCase): + """GetNodes200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGetNodes200Response(self): + """Test GetNodes200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = GetNodes200Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_import_key_request.py b/python/test/test_import_key_request.py new file mode 100644 index 0000000..ea7968a --- /dev/null +++ b/python/test/test_import_key_request.py @@ -0,0 +1,35 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import garage_admin_sdk +from garage_admin_sdk.model.import_key_request import ImportKeyRequest + + +class TestImportKeyRequest(unittest.TestCase): + """ImportKeyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testImportKeyRequest(self): + """Test ImportKeyRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = ImportKeyRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_nodes_api.py b/python/test/test_nodes_api.py new file mode 100644 index 0000000..3e00480 --- /dev/null +++ b/python/test/test_nodes_api.py @@ -0,0 +1,35 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import unittest + +import garage_admin_sdk +from garage_admin_sdk.api.nodes_api import NodesApi # noqa: E501 + + +class TestNodesApi(unittest.TestCase): + """NodesApi unit test stubs""" + + def setUp(self): + self.api = NodesApi() # noqa: E501 + + def tearDown(self): + pass + + def test_get_nodes(self): + """Test case for get_nodes + + Status of this node and other nodes in the cluster # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_update_key_request.py b/python/test/test_update_key_request.py new file mode 100644 index 0000000..43dffae --- /dev/null +++ b/python/test/test_update_key_request.py @@ -0,0 +1,39 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import garage_admin_sdk +from garage_admin_sdk.model.update_key_request_allow import UpdateKeyRequestAllow +from garage_admin_sdk.model.update_key_request_deny import UpdateKeyRequestDeny +globals()['UpdateKeyRequestAllow'] = UpdateKeyRequestAllow +globals()['UpdateKeyRequestDeny'] = UpdateKeyRequestDeny +from garage_admin_sdk.model.update_key_request import UpdateKeyRequest + + +class TestUpdateKeyRequest(unittest.TestCase): + """UpdateKeyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateKeyRequest(self): + """Test UpdateKeyRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateKeyRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_update_key_request_allow.py b/python/test/test_update_key_request_allow.py new file mode 100644 index 0000000..ba0bbb2 --- /dev/null +++ b/python/test/test_update_key_request_allow.py @@ -0,0 +1,35 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import garage_admin_sdk +from garage_admin_sdk.model.update_key_request_allow import UpdateKeyRequestAllow + + +class TestUpdateKeyRequestAllow(unittest.TestCase): + """UpdateKeyRequestAllow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateKeyRequestAllow(self): + """Test UpdateKeyRequestAllow""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateKeyRequestAllow() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_update_key_request_deny.py b/python/test/test_update_key_request_deny.py new file mode 100644 index 0000000..72b61f6 --- /dev/null +++ b/python/test/test_update_key_request_deny.py @@ -0,0 +1,35 @@ +""" + Garage Administration API v0+garage-v0.7.3 + + Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* # noqa: E501 + + The version of the OpenAPI document: v0.7.3 + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import garage_admin_sdk +from garage_admin_sdk.model.update_key_request_deny import UpdateKeyRequestDeny + + +class TestUpdateKeyRequestDeny(unittest.TestCase): + """UpdateKeyRequestDeny unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateKeyRequestDeny(self): + """Test UpdateKeyRequestDeny""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateKeyRequestDeny() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()