garage-admin-sdk-generator/python/docs/MembershipApi.md

90 lines
3.2 KiB
Markdown
Raw Normal View History

2022-09-13 14:00:03 +00:00
# garage_admin_sdk.MembershipApi
2022-09-12 15:02:35 +00:00
All URIs are relative to *http://localhost:3903/v0*
Method | HTTP request | Description
------------- | ------------- | -------------
[**add_node**](MembershipApi.md#add_node) | **POST** /connect | Connect target node to other Garage nodes
2022-09-12 15:02:35 +00:00
# **add_node**
> [AddNode200ResponseInner] add_node()
2022-09-12 15:02:35 +00:00
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
2022-09-12 15:13:43 +00:00
* Bearer Authentication (bearerAuth):
2022-09-12 15:02:35 +00:00
```python
import time
2022-09-13 14:00:03 +00:00
import garage_admin_sdk
from garage_admin_sdk.api import membership_api
from garage_admin_sdk.model.add_node200_response_inner import AddNode200ResponseInner
2022-09-12 15:02:35 +00:00
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.
2022-09-13 14:00:03 +00:00
configuration = garage_admin_sdk.Configuration(
2022-09-12 15:02:35 +00:00
host = "http://localhost:3903/v0"
)
2022-09-12 15:13:43 +00:00
# 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
2022-09-13 14:00:03 +00:00
configuration = garage_admin_sdk.Configuration(
2022-09-12 15:13:43 +00:00
access_token = 'YOUR_BEARER_TOKEN'
)
2022-09-12 15:02:35 +00:00
# Enter a context with an instance of the API client
2022-09-13 14:00:03 +00:00
with garage_admin_sdk.ApiClient(configuration) as api_client:
2022-09-12 15:02:35 +00:00
# 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.add_node(request_body=request_body)
2022-09-12 15:02:35 +00:00
pprint(api_response)
2022-09-13 14:00:03 +00:00
except garage_admin_sdk.ApiException as e:
print("Exception when calling MembershipApi->add_node: %s\n" % e)
2022-09-12 15:02:35 +00:00
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**request_body** | **[str]**| | [optional]
### Return type
[**[AddNode200ResponseInner]**](AddNode200ResponseInner.md)
2022-09-12 15:02:35 +00:00
### Authorization
2022-09-12 15:13:43 +00:00
[bearerAuth](../README.md#bearerAuth)
2022-09-12 15:02:35 +00:00
### 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)