Merge pull request 'api-v1 python' (#1) from v0.9.x into main

Reviewed-on: #1
This commit is contained in:
Quentin 2023-11-28 15:36:55 +00:00
commit 90e64feb06
71 changed files with 2397 additions and 800 deletions

View file

@ -6,6 +6,7 @@ docs/AddKeyRequest.md
docs/AddNode200ResponseInner.md
docs/AllowBucketKeyRequest.md
docs/AllowBucketKeyRequestPermissions.md
docs/ApplyLayout200Response.md
docs/BucketApi.md
docs/BucketInfo.md
docs/BucketInfoQuotas.md
@ -15,6 +16,7 @@ docs/ClusterLayout.md
docs/CreateBucketRequest.md
docs/CreateBucketRequestLocalAlias.md
docs/CreateBucketRequestLocalAliasAllow.md
docs/GetHealth200Response.md
docs/GetNodes200Response.md
docs/ImportKeyRequest.md
docs/KeyApi.md
@ -29,6 +31,9 @@ docs/ListBuckets200ResponseInnerLocalAliasesInner.md
docs/ListKeys200ResponseInner.md
docs/NodeClusterInfo.md
docs/NodeNetworkInfo.md
docs/NodeRoleChange.md
docs/NodeRoleRemove.md
docs/NodeRoleUpdate.md
docs/NodesApi.md
docs/UpdateBucketRequest.md
docs/UpdateBucketRequestQuotas.md
@ -51,6 +56,7 @@ garage_admin_sdk/model/add_key_request.py
garage_admin_sdk/model/add_node200_response_inner.py
garage_admin_sdk/model/allow_bucket_key_request.py
garage_admin_sdk/model/allow_bucket_key_request_permissions.py
garage_admin_sdk/model/apply_layout200_response.py
garage_admin_sdk/model/bucket_info.py
garage_admin_sdk/model/bucket_info_quotas.py
garage_admin_sdk/model/bucket_info_website_config.py
@ -59,6 +65,7 @@ garage_admin_sdk/model/cluster_layout.py
garage_admin_sdk/model/create_bucket_request.py
garage_admin_sdk/model/create_bucket_request_local_alias.py
garage_admin_sdk/model/create_bucket_request_local_alias_allow.py
garage_admin_sdk/model/get_health200_response.py
garage_admin_sdk/model/get_nodes200_response.py
garage_admin_sdk/model/import_key_request.py
garage_admin_sdk/model/key_info.py
@ -71,6 +78,9 @@ garage_admin_sdk/model/list_buckets200_response_inner_local_aliases_inner.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/node_role_change.py
garage_admin_sdk/model/node_role_remove.py
garage_admin_sdk/model/node_role_update.py
garage_admin_sdk/model/update_bucket_request.py
garage_admin_sdk/model/update_bucket_request_quotas.py
garage_admin_sdk/model/update_bucket_request_website_access.py
@ -86,4 +96,5 @@ setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_get_health200_response.py
tox.ini

View file

@ -6,8 +6,8 @@ Administrate your Garage cluster programatically, including status, layout, keys
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: v0.8.0
- Package version: 0.8.0
- API version: v0.9.0
- Package version: 0.9.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.
@ -58,10 +58,10 @@ from garage_admin_sdk.model.bucket_info import BucketInfo
from garage_admin_sdk.model.create_bucket_request import CreateBucketRequest
from garage_admin_sdk.model.list_buckets200_response_inner import ListBuckets200ResponseInner
from garage_admin_sdk.model.update_bucket_request import UpdateBucketRequest
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -99,35 +99,34 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
## Documentation for API Endpoints
All URIs are relative to *http://localhost:3903/v0*
All URIs are relative to *http://localhost:3903/v1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BucketApi* | [**allow_bucket_key**](docs/BucketApi.md#allow_bucket_key) | **POST** /bucket/allow | Allow key
*BucketApi* | [**create_bucket**](docs/BucketApi.md#create_bucket) | **POST** /bucket | Create a bucket
*BucketApi* | [**delete_bucket**](docs/BucketApi.md#delete_bucket) | **DELETE** /bucket?id={bucket_id} | Delete a bucket
*BucketApi* | [**delete_bucket**](docs/BucketApi.md#delete_bucket) | **DELETE** /bucket | Delete a bucket
*BucketApi* | [**delete_bucket_global_alias**](docs/BucketApi.md#delete_bucket_global_alias) | **DELETE** /bucket/alias/global | Delete a global alias
*BucketApi* | [**delete_bucket_local_alias**](docs/BucketApi.md#delete_bucket_local_alias) | **DELETE** /bucket/alias/local | Delete a local alias
*BucketApi* | [**deny_bucket_key**](docs/BucketApi.md#deny_bucket_key) | **POST** /bucket/deny | Deny key
*BucketApi* | [**find_bucket_info**](docs/BucketApi.md#find_bucket_info) | **GET** /bucket?globalAlias={alias} | Find a bucket
*BucketApi* | [**get_bucket_info**](docs/BucketApi.md#get_bucket_info) | **GET** /bucket?id={bucket_id} | Get a bucket
*BucketApi* | [**list_buckets**](docs/BucketApi.md#list_buckets) | **GET** /bucket | List all buckets
*BucketApi* | [**get_bucket_info**](docs/BucketApi.md#get_bucket_info) | **GET** /bucket | Get a bucket
*BucketApi* | [**list_buckets**](docs/BucketApi.md#list_buckets) | **GET** /bucket?list | List all buckets
*BucketApi* | [**put_bucket_global_alias**](docs/BucketApi.md#put_bucket_global_alias) | **PUT** /bucket/alias/global | Add a global alias
*BucketApi* | [**put_bucket_local_alias**](docs/BucketApi.md#put_bucket_local_alias) | **PUT** /bucket/alias/local | Add a local alias
*BucketApi* | [**update_bucket**](docs/BucketApi.md#update_bucket) | **PUT** /bucket?id={bucket_id} | Update a bucket
*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
*BucketApi* | [**update_bucket**](docs/BucketApi.md#update_bucket) | **PUT** /bucket | Update a bucket
*KeyApi* | [**add_key**](docs/KeyApi.md#add_key) | **POST** /key?list | Create a new API key
*KeyApi* | [**delete_key**](docs/KeyApi.md#delete_key) | **DELETE** /key | Delete a key
*KeyApi* | [**get_key**](docs/KeyApi.md#get_key) | **GET** /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
*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
*KeyApi* | [**list_keys**](docs/KeyApi.md#list_keys) | **GET** /key?list | List all keys
*KeyApi* | [**update_key**](docs/KeyApi.md#update_key) | **POST** /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
*NodesApi* | [**add_node**](docs/NodesApi.md#add_node) | **POST** /connect | Connect a new node
*NodesApi* | [**get_health**](docs/NodesApi.md#get_health) | **GET** /health | Cluster health report
*NodesApi* | [**get_nodes**](docs/NodesApi.md#get_nodes) | **GET** /status | Describe cluster
## Documentation For Models
@ -136,6 +135,7 @@ Class | Method | HTTP request | Description
- [AddNode200ResponseInner](docs/AddNode200ResponseInner.md)
- [AllowBucketKeyRequest](docs/AllowBucketKeyRequest.md)
- [AllowBucketKeyRequestPermissions](docs/AllowBucketKeyRequestPermissions.md)
- [ApplyLayout200Response](docs/ApplyLayout200Response.md)
- [BucketInfo](docs/BucketInfo.md)
- [BucketInfoQuotas](docs/BucketInfoQuotas.md)
- [BucketInfoWebsiteConfig](docs/BucketInfoWebsiteConfig.md)
@ -144,6 +144,7 @@ Class | Method | HTTP request | Description
- [CreateBucketRequest](docs/CreateBucketRequest.md)
- [CreateBucketRequestLocalAlias](docs/CreateBucketRequestLocalAlias.md)
- [CreateBucketRequestLocalAliasAllow](docs/CreateBucketRequestLocalAliasAllow.md)
- [GetHealth200Response](docs/GetHealth200Response.md)
- [GetNodes200Response](docs/GetNodes200Response.md)
- [ImportKeyRequest](docs/ImportKeyRequest.md)
- [KeyInfo](docs/KeyInfo.md)
@ -156,6 +157,9 @@ Class | Method | HTTP request | Description
- [ListKeys200ResponseInner](docs/ListKeys200ResponseInner.md)
- [NodeClusterInfo](docs/NodeClusterInfo.md)
- [NodeNetworkInfo](docs/NodeNetworkInfo.md)
- [NodeRoleChange](docs/NodeRoleChange.md)
- [NodeRoleRemove](docs/NodeRoleRemove.md)
- [NodeRoleUpdate](docs/NodeRoleUpdate.md)
- [UpdateBucketRequest](docs/UpdateBucketRequest.md)
- [UpdateBucketRequestQuotas](docs/UpdateBucketRequestQuotas.md)
- [UpdateBucketRequestWebsiteAccess](docs/UpdateBucketRequestWebsiteAccess.md)

View file

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
**name** | **str, none_type** | | [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)

View file

@ -0,0 +1,13 @@
# ApplyLayout200Response
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**message** | **[str]** | |
**layout** | [**ClusterLayout**](ClusterLayout.md) | |
**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)

View file

@ -1,21 +1,20 @@
# garage_admin_sdk.BucketApi
All URIs are relative to *http://localhost:3903/v0*
All URIs are relative to *http://localhost:3903/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**allow_bucket_key**](BucketApi.md#allow_bucket_key) | **POST** /bucket/allow | Allow key
[**create_bucket**](BucketApi.md#create_bucket) | **POST** /bucket | Create a bucket
[**delete_bucket**](BucketApi.md#delete_bucket) | **DELETE** /bucket?id={bucket_id} | Delete a bucket
[**delete_bucket**](BucketApi.md#delete_bucket) | **DELETE** /bucket | Delete a bucket
[**delete_bucket_global_alias**](BucketApi.md#delete_bucket_global_alias) | **DELETE** /bucket/alias/global | Delete a global alias
[**delete_bucket_local_alias**](BucketApi.md#delete_bucket_local_alias) | **DELETE** /bucket/alias/local | Delete a local alias
[**deny_bucket_key**](BucketApi.md#deny_bucket_key) | **POST** /bucket/deny | Deny key
[**find_bucket_info**](BucketApi.md#find_bucket_info) | **GET** /bucket?globalAlias={alias} | Find a bucket
[**get_bucket_info**](BucketApi.md#get_bucket_info) | **GET** /bucket?id={bucket_id} | Get a bucket
[**list_buckets**](BucketApi.md#list_buckets) | **GET** /bucket | List all buckets
[**get_bucket_info**](BucketApi.md#get_bucket_info) | **GET** /bucket | Get a bucket
[**list_buckets**](BucketApi.md#list_buckets) | **GET** /bucket?list | List all buckets
[**put_bucket_global_alias**](BucketApi.md#put_bucket_global_alias) | **PUT** /bucket/alias/global | Add a global alias
[**put_bucket_local_alias**](BucketApi.md#put_bucket_local_alias) | **PUT** /bucket/alias/local | Add a local alias
[**update_bucket**](BucketApi.md#update_bucket) | **PUT** /bucket?id={bucket_id} | Update a bucket
[**update_bucket**](BucketApi.md#update_bucket) | **PUT** /bucket | Update a bucket
# **allow_bucket_key**
@ -36,10 +35,10 @@ from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.bucket_info import BucketInfo
from garage_admin_sdk.model.allow_bucket_key_request import AllowBucketKeyRequest
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -125,10 +124,10 @@ from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.bucket_info import BucketInfo
from garage_admin_sdk.model.create_bucket_request import CreateBucketRequest
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -199,7 +198,7 @@ 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)
# **delete_bucket**
> delete_bucket(bucket_id)
> delete_bucket(id)
Delete a bucket
@ -214,10 +213,10 @@ import time
import garage_admin_sdk
from garage_admin_sdk.api import bucket_api
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -234,12 +233,12 @@ configuration = garage_admin_sdk.Configuration(
with garage_admin_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = bucket_api.BucketApi(api_client)
bucket_id = "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" # str | The exact bucket identifier, a 32 bytes hexadecimal string
id = "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" # str | The exact bucket identifier, a 32 bytes hexadecimal string
# example passing only required values which don't have defaults set
try:
# Delete a bucket
api_instance.delete_bucket(bucket_id)
api_instance.delete_bucket(id)
except garage_admin_sdk.ApiException as e:
print("Exception when calling BucketApi->delete_bucket: %s\n" % e)
```
@ -249,7 +248,7 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**bucket_id** | **str**| The exact bucket identifier, a 32 bytes hexadecimal string |
**id** | **str**| The exact bucket identifier, a 32 bytes hexadecimal string |
### Return type
@ -293,10 +292,10 @@ import garage_admin_sdk
from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.bucket_info import BucketInfo
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -375,10 +374,10 @@ import garage_admin_sdk
from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.bucket_info import BucketInfo
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -460,10 +459,10 @@ from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.bucket_info import BucketInfo
from garage_admin_sdk.model.allow_bucket_key_request import AllowBucketKeyRequest
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -531,91 +530,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)
# **find_bucket_info**
> BucketInfo find_bucket_info(alias)
Find a bucket
Find a bucket by its global alias
### Example
* Bearer Authentication (bearerAuth):
```python
import time
import garage_admin_sdk
from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.bucket_info import BucketInfo
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 = bucket_api.BucketApi(api_client)
alias = "my_documents" # str | The exact global alias of one of the existing buckets
# example passing only required values which don't have defaults set
try:
# Find a bucket
api_response = api_instance.find_bucket_info(alias)
pprint(api_response)
except garage_admin_sdk.ApiException as e:
print("Exception when calling BucketApi->find_bucket_info: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**alias** | **str**| The exact global alias of one of the existing buckets |
### Return type
[**BucketInfo**](BucketInfo.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. | - |
**404** | Bucket not found | - |
**200** | Returns exhaustive information about the bucket | - |
[[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_bucket_info**
> BucketInfo get_bucket_info(bucket_id)
> BucketInfo get_bucket_info()
Get a bucket
Given a bucket identifier, get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
Given a bucket identifier (`id`) or a global alias (`alias`), get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
### Example
@ -627,10 +547,10 @@ import garage_admin_sdk
from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.bucket_info import BucketInfo
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -647,12 +567,14 @@ configuration = garage_admin_sdk.Configuration(
with garage_admin_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = bucket_api.BucketApi(api_client)
bucket_id = "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" # str | The exact bucket identifier, a 32 bytes hexadecimal string
id = "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" # str | The exact bucket identifier, a 32 bytes hexadecimal string. Incompatible with `alias`. (optional)
alias = "my_documents" # str | The exact global alias of one of the existing buckets. Incompatible with `id`. (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get a bucket
api_response = api_instance.get_bucket_info(bucket_id)
api_response = api_instance.get_bucket_info(id=id, alias=alias)
pprint(api_response)
except garage_admin_sdk.ApiException as e:
print("Exception when calling BucketApi->get_bucket_info: %s\n" % e)
@ -663,7 +585,8 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**bucket_id** | **str**| The exact bucket identifier, a 32 bytes hexadecimal string |
**id** | **str**| The exact bucket identifier, a 32 bytes hexadecimal string. Incompatible with `alias`. | [optional]
**alias** | **str**| The exact global alias of one of the existing buckets. Incompatible with `id`. | [optional]
### Return type
@ -706,10 +629,10 @@ import garage_admin_sdk
from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.list_buckets200_response_inner import ListBuckets200ResponseInner
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -780,10 +703,10 @@ import garage_admin_sdk
from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.bucket_info import BucketInfo
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -862,10 +785,10 @@ import garage_admin_sdk
from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.bucket_info import BucketInfo
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -930,11 +853,11 @@ 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)
# **update_bucket**
> BucketInfo update_bucket(bucket_id, update_bucket_request)
> BucketInfo update_bucket(id, update_bucket_request)
Update a bucket
All fields (`websiteAccess` and `quotas`) are optionnal. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In `websiteAccess`: if `enabled` is `true`, `indexDocument` must be specified. The field `errorDocument` is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if `enabled` is `false`, neither `indexDocument` nor `errorDocument` must be specified. In `quotas`: new values of `maxSize` and `maxObjects` must both be specified, or set to `null` to remove the quotas. An absent value will be considered the same as a `null`. It is not possible to change only one of the two quotas.
All fields (`websiteAccess` and `quotas`) are optional. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In `websiteAccess`: if `enabled` is `true`, `indexDocument` must be specified. The field `errorDocument` is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if `enabled` is `false`, neither `indexDocument` nor `errorDocument` must be specified. In `quotas`: new values of `maxSize` and `maxObjects` must both be specified, or set to `null` to remove the quotas. An absent value will be considered the same as a `null`. It is not possible to change only one of the two quotas.
### Example
@ -947,10 +870,10 @@ from garage_admin_sdk.api import bucket_api
from garage_admin_sdk.model.bucket_info import BucketInfo
from garage_admin_sdk.model.update_bucket_request import UpdateBucketRequest
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -967,7 +890,7 @@ configuration = garage_admin_sdk.Configuration(
with garage_admin_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = bucket_api.BucketApi(api_client)
bucket_id = "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" # str | The exact bucket identifier, a 32 bytes hexadecimal string
id = "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" # str | The exact bucket identifier, a 32 bytes hexadecimal string
update_bucket_request = UpdateBucketRequest(
website_access=UpdateBucketRequestWebsiteAccess(
enabled=True,
@ -983,7 +906,7 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
# example passing only required values which don't have defaults set
try:
# Update a bucket
api_response = api_instance.update_bucket(bucket_id, update_bucket_request)
api_response = api_instance.update_bucket(id, update_bucket_request)
pprint(api_response)
except garage_admin_sdk.ApiException as e:
print("Exception when calling BucketApi->update_bucket: %s\n" % e)
@ -994,7 +917,7 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**bucket_id** | **str**| The exact bucket identifier, a 32 bytes hexadecimal string |
**id** | **str**| The exact bucket identifier, a 32 bytes hexadecimal string |
**update_bucket_request** | [**UpdateBucketRequest**](UpdateBucketRequest.md)| Requested changes on the bucket. Both root fields are optionals. |
### Return type

View file

@ -5,8 +5,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**version** | **int** | |
**roles** | [**{str: (NodeClusterInfo,)}**](NodeClusterInfo.md) | |
**staged_role_changes** | [**{str: (NodeClusterInfo,)}**](NodeClusterInfo.md) | |
**roles** | [**[NodeClusterInfo]**](NodeClusterInfo.md) | |
**staged_role_changes** | [**[NodeRoleChange]**](NodeRoleChange.md) | |
**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)

View file

@ -0,0 +1,19 @@
# GetHealth200Response
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**status** | **str** | |
**known_nodes** | **int** | |
**connected_nodes** | **int** | |
**storage_nodes** | **int** | |
**storage_nodes_ok** | **int** | |
**partitions** | **int** | |
**partitions_quorum** | **int** | |
**partitions_all_ok** | **int** | |
**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)

View file

@ -6,7 +6,10 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**node** | **str** | |
**garage_version** | **str** | |
**known_nodes** | [**{str: (NodeNetworkInfo,)}**](NodeNetworkInfo.md) | |
**garage_features** | **[str]** | |
**rust_version** | **str** | |
**db_engine** | **str** | |
**known_nodes** | [**[NodeNetworkInfo]**](NodeNetworkInfo.md) | |
**layout** | [**ClusterLayout**](ClusterLayout.md) | |
**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]

View file

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | |
**name** | **str, none_type** | |
**access_key_id** | **str** | |
**secret_access_key** | **str** | |
**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]

View file

@ -1,16 +1,15 @@
# garage_admin_sdk.KeyApi
All URIs are relative to *http://localhost:3903/v0*
All URIs are relative to *http://localhost:3903/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**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
[**add_key**](KeyApi.md#add_key) | **POST** /key?list | Create a new API key
[**delete_key**](KeyApi.md#delete_key) | **DELETE** /key | Delete a key
[**get_key**](KeyApi.md#get_key) | **GET** /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
[**list_keys**](KeyApi.md#list_keys) | **GET** /key?list | List all keys
[**update_key**](KeyApi.md#update_key) | **POST** /key | Update a key
# **add_key**
@ -31,10 +30,10 @@ from garage_admin_sdk.api import key_api
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
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -53,7 +52,7 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
api_instance = key_api.KeyApi(api_client)
add_key_request = AddKeyRequest(
name="test-key",
) # AddKeyRequest | \"You can set a friendly name for this key, send an empty string instead\"
) # AddKeyRequest | You can set a friendly name for this key. If you don't want to, you can set the name to `null`. *Note: the secret key is returned in the response.*
# example passing only required values which don't have defaults set
try:
@ -69,7 +68,7 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**add_key_request** | [**AddKeyRequest**](AddKeyRequest.md)| \"You can set a friendly name for this key, send an empty string instead\" |
**add_key_request** | [**AddKeyRequest**](AddKeyRequest.md)| You can set a friendly name for this key. If you don't want to, you can set the name to `null`. *Note: the secret key is returned in the response.* |
### Return type
@ -96,7 +95,7 @@ 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)
# **delete_key**
> delete_key(access_key)
> delete_key(id)
Delete a key
@ -111,10 +110,10 @@ import time
import garage_admin_sdk
from garage_admin_sdk.api import key_api
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -131,12 +130,12 @@ 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
id = "GK31c2f218a2e44f485b94239e" # str | The exact API access key generated by Garage
# example passing only required values which don't have defaults set
try:
# Delete a key
api_instance.delete_key(access_key)
api_instance.delete_key(id)
except garage_admin_sdk.ApiException as e:
print("Exception when calling KeyApi->delete_key: %s\n" % e)
```
@ -146,7 +145,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 |
**id** | **str**| The exact API access key generated by Garage |
### Return type
@ -172,11 +171,11 @@ 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)
# **get_key**
> KeyInfo get_key(access_key)
> KeyInfo get_key()
Get key information
Return information about a specific key and return its information
Return information about a specific key like its identifiers, its permissions and buckets on which it has permissions. You can search by specifying the exact key identifier (`id`) or by specifying a pattern (`search`). For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
### Example
@ -188,10 +187,10 @@ 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
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -208,12 +207,15 @@ 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
id = "GK31c2f218a2e44f485b94239e" # str | The exact API access key generated by Garage. Incompatible with `search`. (optional)
search = "test-k" # str | A pattern (beginning or full string) corresponding to a key identifier or friendly name. Incompatible with `id`. (optional)
show_secret_key = "true" # str | Wether or not the secret key should be returned in the response (optional) if omitted the server will use the default value of "false"
# example passing only required values which don't have defaults set
# and optional values
try:
# Get key information
api_response = api_instance.get_key(access_key)
api_response = api_instance.get_key(id=id, search=search, show_secret_key=show_secret_key)
pprint(api_response)
except garage_admin_sdk.ApiException as e:
print("Exception when calling KeyApi->get_key: %s\n" % e)
@ -224,7 +226,9 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**access_key** | **str**| The exact API access key generated by Garage |
**id** | **str**| The exact API access key generated by Garage. Incompatible with `search`. | [optional]
**search** | **str**| A pattern (beginning or full string) corresponding to a key identifier or friendly name. Incompatible with `id`. | [optional]
**show_secret_key** | **str**| Wether or not the secret key should be returned in the response | [optional] if omitted the server will use the default value of "false"
### Return type
@ -267,10 +271,10 @@ from garage_admin_sdk.api import key_api
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
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -350,10 +354,10 @@ import garage_admin_sdk
from garage_admin_sdk.api import key_api
from garage_admin_sdk.model.list_keys200_response_inner import ListKeys200ResponseInner
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -407,90 +411,12 @@ 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_key_request)
> KeyInfo update_key(id, update_key_request)
Update a key
Updates information about the specified API access key.
Updates information about the specified API access key. *Note: the secret key is not returned in the response, `null` is sent instead.*
### Example
@ -503,10 +429,10 @@ 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
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -523,7 +449,7 @@ 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
id = "GK31c2f218a2e44f485b94239e" # str | The exact API access key generated by Garage
update_key_request = UpdateKeyRequest(
name="test-key",
allow=UpdateKeyRequestAllow(
@ -537,7 +463,7 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
# example passing only required values which don't have defaults set
try:
# Update a key
api_response = api_instance.update_key(access_key, update_key_request)
api_response = api_instance.update_key(id, update_key_request)
pprint(api_response)
except garage_admin_sdk.ApiException as e:
print("Exception when calling KeyApi->update_key: %s\n" % e)
@ -548,7 +474,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 |
**id** | **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 |
### Return type

View file

@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional]
**access_key_id** | **str** | | [optional]
**secret_access_key** | **str** | | [optional]
**secret_access_key** | **str, none_type** | | [optional]
**permissions** | [**KeyInfoPermissions**](KeyInfoPermissions.md) | | [optional]
**buckets** | [**[KeyInfoBucketsInner]**](KeyInfoBucketsInner.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]

View file

@ -1,6 +1,6 @@
# garage_admin_sdk.LayoutApi
All URIs are relative to *http://localhost:3903/v0*
All URIs are relative to *http://localhost:3903/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
@ -11,11 +11,11 @@ Method | HTTP request | Description
# **add_layout**
> add_layout(request_body)
> ClusterLayout add_layout(node_role_change)
Send modifications to the cluster layout
Send modifications to the cluster layout. These modifications will be included in the staged role changes, visible in subsequent calls of `GET /layout`. Once the set of staged changes is satisfactory, the user may call `POST /layout/apply` to apply the changed changes, or `POST /layout/revert` to clear all of the staged changes in the layout. Note that setting the capacity to `null` will configure the node as a gateway.
Send modifications to the cluster layout. These modifications will be included in the staged role changes, visible in subsequent calls of `GET /layout`. Once the set of staged changes is satisfactory, the user may call `POST /layout/apply` to apply the changed changes, or `POST /layout/revert` to clear all of the staged changes in the layout. Setting the capacity to `null` will configure the node as a gateway. Otherwise, capacity must be now set in bytes (before Garage 0.9 it was arbitrary weights). For example to declare 100GB, you must set `capacity: 100000000000`. Garage uses internally the International System of Units (SI), it assumes that 1kB = 1000 bytes, and displays storage as kB, MB, GB (and not KiB, MiB, GiB that assume 1KiB = 1024 bytes).
### Example
@ -25,12 +25,13 @@ Send modifications to the cluster layout. These modifications will be included i
import time
import garage_admin_sdk
from garage_admin_sdk.api import layout_api
from garage_admin_sdk.model.node_cluster_info import NodeClusterInfo
from garage_admin_sdk.model.cluster_layout import ClusterLayout
from garage_admin_sdk.model.node_role_change import NodeRoleChange
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -47,18 +48,15 @@ configuration = garage_admin_sdk.Configuration(
with garage_admin_sdk.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = layout_api.LayoutApi(api_client)
request_body = {
"key": NodeClusterInfo(
zone="dc1",
capacity=4,
tags=["gateway","fast"],
),
} # {str: (NodeClusterInfo,)} | To add a new node to the layout or to change the configuration of an existing node, simply set the values you want. To remove a node, set it to `null` instead of passing a configuration object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified.
node_role_change = [
NodeRoleChange(None),
] # [NodeRoleChange] | To add a new node to the layout or to change the configuration of an existing node, simply set the values you want (`zone`, `capacity`, and `tags`). To remove a node, simply pass the `remove: true` field. This logic is represented in OpenAPI with a \"One Of\" object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified.
# example passing only required values which don't have defaults set
try:
# Send modifications to the cluster layout
api_instance.add_layout(request_body)
api_response = api_instance.add_layout(node_role_change)
pprint(api_response)
except garage_admin_sdk.ApiException as e:
print("Exception when calling LayoutApi->add_layout: %s\n" % e)
```
@ -68,11 +66,11 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**request_body** | [**{str: (NodeClusterInfo,)}**](NodeClusterInfo.md)| To add a new node to the layout or to change the configuration of an existing node, simply set the values you want. To remove a node, set it to `null` instead of passing a configuration object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified. |
**node_role_change** | [**[NodeRoleChange]**](NodeRoleChange.md)| To add a new node to the layout or to change the configuration of an existing node, simply set the values you want (`zone`, `capacity`, and `tags`). To remove a node, simply pass the `remove: true` field. This logic is represented in OpenAPI with a \"One Of\" object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified. |
### Return type
void (empty response body)
[**ClusterLayout**](ClusterLayout.md)
### Authorization
@ -81,7 +79,7 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
- **Accept**: application/json
### HTTP response details
@ -95,11 +93,11 @@ 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)
# **apply_layout**
> apply_layout(layout_version)
> ApplyLayout200Response apply_layout(layout_version)
Apply staged layout
Applies to the cluster the layout changes currently registered as staged layout changes.
Applies to the cluster the layout changes currently registered as staged layout changes. *Note: do not try to parse the `message` field of the response, it is given as an array of string specifically because its format is not stable.*
### Example
@ -110,11 +108,12 @@ import time
import garage_admin_sdk
from garage_admin_sdk.api import layout_api
from garage_admin_sdk.model.layout_version import LayoutVersion
from garage_admin_sdk.model.apply_layout200_response import ApplyLayout200Response
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -138,7 +137,8 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
# example passing only required values which don't have defaults set
try:
# Apply staged layout
api_instance.apply_layout(layout_version)
api_response = api_instance.apply_layout(layout_version)
pprint(api_response)
except garage_admin_sdk.ApiException as e:
print("Exception when calling LayoutApi->apply_layout: %s\n" % e)
```
@ -152,7 +152,7 @@ Name | Type | Description | Notes
### Return type
void (empty response body)
[**ApplyLayout200Response**](ApplyLayout200Response.md)
### Authorization
@ -161,7 +161,7 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
- **Accept**: application/json
### HTTP response details
@ -179,7 +179,7 @@ void (empty response body)
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`.*
Returns the cluster's current layout, including: - Currently configured cluster layout - Staged changes to the cluster layout *Capacity is given in bytes* *The info returned by this endpoint is a subset of the info returned by `GET /status`.*
### Example
@ -191,10 +191,10 @@ 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
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -265,10 +265,10 @@ 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
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters

View file

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**version** | **int** | | [optional]
**version** | **int** | |
**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)

View file

@ -5,8 +5,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**zone** | **str** | |
**capacity** | **int, none_type** | |
**tags** | **[str]** | User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage |
**capacity** | **int, none_type** | | [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)

View file

@ -8,6 +8,7 @@ Name | Type | Description | Notes
**is_up** | **bool** | |
**last_seen_secs_ago** | **int, none_type** | |
**hostname** | **str** | |
**id** | **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)

16
docs/NodeRoleChange.md Normal file
View file

@ -0,0 +1,16 @@
# NodeRoleChange
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | | [optional]
**remove** | **bool** | | [optional]
**zone** | **str** | | [optional]
**capacity** | **int, none_type** | | [optional]
**tags** | **[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)

13
docs/NodeRoleRemove.md Normal file
View file

@ -0,0 +1,13 @@
# NodeRoleRemove
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | |
**remove** | **bool** | |
**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)

15
docs/NodeRoleUpdate.md Normal file
View file

@ -0,0 +1,15 @@
# NodeRoleUpdate
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | |
**zone** | **str** | |
**capacity** | **int, none_type** | |
**tags** | **[str]** | |
**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)

View file

@ -1,17 +1,18 @@
# garage_admin_sdk.NodesApi
All URIs are relative to *http://localhost:3903/v0*
All URIs are relative to *http://localhost:3903/v1*
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**](NodesApi.md#add_node) | **POST** /connect | Connect a new node
[**get_health**](NodesApi.md#get_health) | **GET** /health | Cluster health report
[**get_nodes**](NodesApi.md#get_nodes) | **GET** /status | Describe cluster
# **add_node**
> [AddNode200ResponseInner] add_node(request_body)
Connect target node to other Garage nodes
Connect a new node
Instructs this Garage node to connect to other Garage nodes at specified `<node_id>@<net_address>`. `node_id` is generated automatically on node start.
@ -25,10 +26,10 @@ 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
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -49,7 +50,7 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
# example passing only required values which don't have defaults set
try:
# Connect target node to other Garage nodes
# Connect a new node
api_response = api_instance.add_node(request_body)
pprint(api_response)
except garage_admin_sdk.ApiException as e:
@ -87,12 +88,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)
# **get_nodes**
> GetNodes200Response get_nodes()
# **get_health**
> GetHealth200Response get_health()
Status of this node and other nodes in the cluster
Cluster health report
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
Returns the global status of the cluster, the number of connected nodes (over the number of known ones), the number of healthy storage nodes (over the declared ones), and the number of healthy partitions (over the total).
### Example
@ -102,12 +103,12 @@ Returns the cluster's current status, including: - ID of the node being queried
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 garage_admin_sdk.model.get_health200_response import GetHealth200Response
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3903/v0
# Defining the host is optional and defaults to http://localhost:3903/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0"
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
@ -127,7 +128,81 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
# example, this endpoint has no required or optional parameters
try:
# Status of this node and other nodes in the cluster
# Cluster health report
api_response = api_instance.get_health()
pprint(api_response)
except garage_admin_sdk.ApiException as e:
print("Exception when calling NodesApi->get_health: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**GetHealth200Response**](GetHealth200Response.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)
# **get_nodes**
> GetNodes200Response get_nodes()
Describe 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 *Capacity is given in bytes*
### 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/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure 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:
# Describe cluster
api_response = api_instance.get_nodes()
pprint(api_response)
except garage_admin_sdk.ApiException as e:

View file

@ -1,16 +1,16 @@
# flake8: noqa
"""
Garage Administration API v0+garage-v0.8.0
Garage Administration API v0+garage-v0.9.0
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.8.0
The version of the OpenAPI document: v0.9.0
Generated by: https://openapi-generator.tech
"""
__version__ = "0.8.0"
__version__ = "0.9.0"
# import ApiClient
from garage_admin_sdk.api_client import ApiClient

View file

@ -1,9 +1,9 @@
"""
Garage Administration API v0+garage-v0.8.0
Garage Administration API v0+garage-v0.9.0
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.8.0
The version of the OpenAPI document: v0.9.0
Generated by: https://openapi-generator.tech
"""
@ -149,17 +149,17 @@ class BucketApi(object):
'auth': [
'bearerAuth'
],
'endpoint_path': '/bucket?id={bucket_id}',
'endpoint_path': '/bucket',
'operation_id': 'delete_bucket',
'http_method': 'DELETE',
'servers': None,
},
params_map=