145 lines
4.9 KiB
Markdown
145 lines
4.9 KiB
Markdown
# openapi_client.MembershipApi
|
|
|
|
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
|
|
|
|
|
|
# **connect_post**
|
|
> [ConnectPost200ResponseInner] connect_post()
|
|
|
|
Connect target node to other Garage nodes
|
|
|
|
Instructs this Garage node to connect to other Garage nodes at specified `<node_id>@<net_address>`. `node_id` is generated automatically on node start.
|
|
|
|
### Example
|
|
|
|
|
|
```python
|
|
import time
|
|
import openapi_client
|
|
from openapi_client.api import membership_api
|
|
from openapi_client.model.connect_post200_response_inner import ConnectPost200ResponseInner
|
|
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 = openapi_client.Configuration(
|
|
host = "http://localhost:3903/v0"
|
|
)
|
|
|
|
|
|
# Enter a context with an instance of the API client
|
|
with openapi_client.ApiClient() as api_client:
|
|
# Create an instance of the API class
|
|
api_instance = membership_api.MembershipApi(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.connect_post(request_body=request_body)
|
|
pprint(api_response)
|
|
except openapi_client.ApiException as e:
|
|
print("Exception when calling MembershipApi->connect_post: %s\n" % e)
|
|
```
|
|
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**request_body** | **[str]**| | [optional]
|
|
|
|
### Return type
|
|
|
|
[**[ConnectPost200ResponseInner]**](ConnectPost200ResponseInner.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### 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)
|
|
|
|
# **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
|
|
|
|
|
|
```python
|
|
import time
|
|
import openapi_client
|
|
from openapi_client.api import membership_api
|
|
from openapi_client.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 = openapi_client.Configuration(
|
|
host = "http://localhost:3903/v0"
|
|
)
|
|
|
|
|
|
# Enter a context with an instance of the API client
|
|
with openapi_client.ApiClient() 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 openapi_client.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
|
|
|
|
No authorization required
|
|
|
|
### 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)
|
|
|