All URIs are relative to https://api.timeweb.cloud
| Method | HTTP request | Description |
|---|---|---|
| add_ips_to_balancer | POST /api/v1/balancers/{balancer_id}/ips | Добавление IP-адресов к балансировщику |
| create_balancer | POST /api/v1/balancers | Создание бaлансировщика |
| create_balancer_rule | POST /api/v1/balancers/{balancer_id}/rules | Создание правила для балансировщика |
| delete_balancer | DELETE /api/v1/balancers/{balancer_id} | Удаление балансировщика |
| delete_balancer_rule | DELETE /api/v1/balancers/{balancer_id}/rules/{rule_id} | Удаление правила для балансировщика |
| delete_ips_from_balancer | DELETE /api/v1/balancers/{balancer_id}/ips | Удаление IP-адресов из балансировщика |
| get_balancer | GET /api/v1/balancers/{balancer_id} | Получение бaлансировщика |
| get_balancer_ips | GET /api/v1/balancers/{balancer_id}/ips | Получение списка IP-адресов балансировщика |
| get_balancer_rules | GET /api/v1/balancers/{balancer_id}/rules | Получение правил балансировщика |
| get_balancers | GET /api/v1/balancers | Получение списка всех бaлансировщиков |
| get_balancers_presets | GET /api/v1/presets/balancers | Получение списка тарифов для балансировщика |
| update_balancer | PATCH /api/v1/balancers/{balancer_id} | Обновление балансировщика |
| update_balancer_rule | PATCH /api/v1/balancers/{balancer_id}/rules/{rule_id} | Обновление правила для балансировщика |
add_ips_to_balancer(balancer_id, add_ips_to_balancer_request)
Добавление IP-адресов к балансировщику
Чтобы добавить IP-адреса к балансировщику, отправьте запрос POST в api/v1/balancers/{balancer_id}/ips.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.add_ips_to_balancer_request import AddIPsToBalancerRequest
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
balancer_id = None # object | ID балансировщика
add_ips_to_balancer_request = timeweb_cloud_api.AddIPsToBalancerRequest() # AddIPsToBalancerRequest |
try:
# Добавление IP-адресов к балансировщику
api_instance.add_ips_to_balancer(balancer_id, add_ips_to_balancer_request)
except Exception as e:
print("Exception when calling BalancersApi->add_ips_to_balancer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| balancer_id | object | ID балансировщика | |
| add_ips_to_balancer_request | AddIPsToBalancerRequest |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | `Ip` адреса добавлены к балансировщику | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateBalancer200Response create_balancer(create_balancer)
Создание бaлансировщика
Чтобы создать бaлансировщик на вашем аккаунте, отправьте POST-запрос на /api/v1/balancers, задав необходимые атрибуты. Балансировщик будет создан с использованием предоставленной информации. Тело ответа будет содержать объект JSON с информацией о созданном балансировщике.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_balancer import CreateBalancer
from timeweb_cloud_api.models.create_balancer200_response import CreateBalancer200Response
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
create_balancer = timeweb_cloud_api.CreateBalancer() # CreateBalancer |
try:
# Создание бaлансировщика
api_response = api_instance.create_balancer(create_balancer)
print("The response of BalancersApi->create_balancer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BalancersApi->create_balancer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| create_balancer | CreateBalancer |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `balancer`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateBalancerRule200Response create_balancer_rule(balancer_id, create_rule)
Создание правила для балансировщика
Чтобы создать правило для балансировщика, отправьте запрос POST в api/v1/balancers/{balancer_id}/rules.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_balancer_rule200_response import CreateBalancerRule200Response
from timeweb_cloud_api.models.create_rule import CreateRule
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
balancer_id = None # object | ID балансировщика
create_rule = timeweb_cloud_api.CreateRule() # CreateRule |
try:
# Создание правила для балансировщика
api_response = api_instance.create_balancer_rule(balancer_id, create_rule)
print("The response of BalancersApi->create_balancer_rule:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BalancersApi->create_balancer_rule: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| balancer_id | object | ID балансировщика | |
| create_rule | CreateRule |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `rule`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteBalancer200Response delete_balancer(balancer_id, hash=hash, code=code)
Удаление балансировщика
Чтобы удалить балансировщик, отправьте запрос DELETE в api/v1/balancers/{balancer_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.delete_balancer200_response import DeleteBalancer200Response
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
balancer_id = None # object | ID балансировщика
hash = 15095f25-aac3-4d60-a788-96cb5136f186 # object | Хеш, который совместно с кодом авторизации надо отправить для удаления, если включено подтверждение удаления сервисов через Телеграм. (optional)
code = 0000 # object | Код подтверждения, который придет к вам в Телеграм, после запроса удаления, если включено подтверждение удаления сервисов. При помощи API токена сервисы можно удалять без подтверждения, если параметр токена `is_able_to_delete` установлен в значение `true` (optional)
try:
# Удаление балансировщика
api_response = api_instance.delete_balancer(balancer_id, hash=hash, code=code)
print("The response of BalancersApi->delete_balancer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BalancersApi->delete_balancer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| balancer_id | object | ID балансировщика | |
| hash | object | Хеш, который совместно с кодом авторизации надо отправить для удаления, если включено подтверждение удаления сервисов через Телеграм. | [optional] |
| code | object | Код подтверждения, который придет к вам в Телеграм, после запроса удаления, если включено подтверждение удаления сервисов. При помощи API токена сервисы можно удалять без подтверждения, если параметр токена `is_able_to_delete` установлен в значение `true` | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Объект JSON c ключом `balancer_delete` | - |
| 204 | Балансировщик успешно удален. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_balancer_rule(balancer_id, rule_id)
Удаление правила для балансировщика
Чтобы удалить правило для балансировщика, отправьте запрос DELETE в api/v1/balancers/{balancer_id}/rules/{rule_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
balancer_id = None # object | ID балансировщика
rule_id = None # object | ID правила для балансировщика
try:
# Удаление правила для балансировщика
api_instance.delete_balancer_rule(balancer_id, rule_id)
except Exception as e:
print("Exception when calling BalancersApi->delete_balancer_rule: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| balancer_id | object | ID балансировщика | |
| rule_id | object | ID правила для балансировщика |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Правило удалено из балансировщика | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_ips_from_balancer(balancer_id, add_ips_to_balancer_request)
Удаление IP-адресов из балансировщика
Чтобы удалить IP-адреса из балансировщика, отправьте запрос DELETE в api/v1/balancers/{balancer_id}/ips.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.add_ips_to_balancer_request import AddIPsToBalancerRequest
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
balancer_id = None # object | ID балансировщика
add_ips_to_balancer_request = timeweb_cloud_api.AddIPsToBalancerRequest() # AddIPsToBalancerRequest |
try:
# Удаление IP-адресов из балансировщика
api_instance.delete_ips_from_balancer(balancer_id, add_ips_to_balancer_request)
except Exception as e:
print("Exception when calling BalancersApi->delete_ips_from_balancer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| balancer_id | object | ID балансировщика | |
| add_ips_to_balancer_request | AddIPsToBalancerRequest |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | `Ip` адрес удален из балансировщика | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateBalancer200Response get_balancer(balancer_id)
Получение бaлансировщика
Чтобы отобразить информацию об отдельном балансировщике, отправьте запрос GET на api/v1/balancers/{balancer_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_balancer200_response import CreateBalancer200Response
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
balancer_id = None # object | ID балансировщика
try:
# Получение бaлансировщика
api_response = api_instance.get_balancer(balancer_id)
print("The response of BalancersApi->get_balancer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BalancersApi->get_balancer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| balancer_id | object | ID балансировщика |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON с ключом `balancer`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetBalancerIPs200Response get_balancer_ips(balancer_id)
Получение списка IP-адресов балансировщика
Чтобы добавить IP-адреса к балансировщику, отправьте запрос GET в api/v1/balancers/{balancer_id}/ips.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_balancer_ips200_response import GetBalancerIPs200Response
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
balancer_id = None # object | ID балансировщика
try:
# Получение списка IP-адресов балансировщика
api_response = api_instance.get_balancer_ips(balancer_id)
print("The response of BalancersApi->get_balancer_ips:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BalancersApi->get_balancer_ips: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| balancer_id | object | ID балансировщика |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `ips`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetBalancerRules200Response get_balancer_rules(balancer_id)
Получение правил балансировщика
Чтобы получить правила балансировщика, отправьте запрос GET в api/v1/balancers/{balancer_id}/rules.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_balancer_rules200_response import GetBalancerRules200Response
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
balancer_id = None # object | ID балансировщика
try:
# Получение правил балансировщика
api_response = api_instance.get_balancer_rules(balancer_id)
print("The response of BalancersApi->get_balancer_rules:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BalancersApi->get_balancer_rules: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| balancer_id | object | ID балансировщика |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `rules`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetBalancers200Response get_balancers(limit=limit, offset=offset)
Получение списка всех бaлансировщиков
Чтобы получить список всех бaлансировщиков на вашем аккаунте, отправьте GET-запрос на /api/v1/balancers. Тело ответа будет представлять собой объект JSON с ключом balancers.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_balancers200_response import GetBalancers200Response
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
limit = None # object | Обозначает количество записей, которое необходимо вернуть. (optional)
offset = None # object | Указывает на смещение относительно начала списка. (optional)
try:
# Получение списка всех бaлансировщиков
api_response = api_instance.get_balancers(limit=limit, offset=offset)
print("The response of BalancersApi->get_balancers:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BalancersApi->get_balancers: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | object | Обозначает количество записей, которое необходимо вернуть. | [optional] |
| offset | object | Указывает на смещение относительно начала списка. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `balancers`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetBalancersPresets200Response get_balancers_presets()
Получение списка тарифов для балансировщика
Чтобы получить список тарифов для балансировщика, отправьте GET-запрос на /api/v1/presets/balancers. Тело ответа будет представлять собой объект JSON с ключом balancers_presets.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_balancers_presets200_response import GetBalancersPresets200Response
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
try:
# Получение списка тарифов для балансировщика
api_response = api_instance.get_balancers_presets()
print("The response of BalancersApi->get_balancers_presets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BalancersApi->get_balancers_presets: %s\n" % e)This endpoint does not need any parameter.
GetBalancersPresets200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Тарифы успешно получены | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateBalancer200Response update_balancer(balancer_id, update_balancer)
Обновление балансировщика
Чтобы обновить только определенные атрибуты балансировщика, отправьте запрос PATCH в api/v1/balancers/{balancer_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_balancer200_response import CreateBalancer200Response
from timeweb_cloud_api.models.update_balancer import UpdateBalancer
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
balancer_id = None # object | ID балансировщика
update_balancer = timeweb_cloud_api.UpdateBalancer() # UpdateBalancer |
try:
# Обновление балансировщика
api_response = api_instance.update_balancer(balancer_id, update_balancer)
print("The response of BalancersApi->update_balancer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BalancersApi->update_balancer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| balancer_id | object | ID балансировщика | |
| update_balancer | UpdateBalancer |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON с ключом `balancer`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateBalancerRule200Response update_balancer_rule(balancer_id, rule_id, update_rule)
Обновление правила для балансировщика
Чтобы обновить правило для балансировщика, отправьте запрос PATCH в api/v1/balancers/{balancer_id}/rules/{rule_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_balancer_rule200_response import CreateBalancerRule200Response
from timeweb_cloud_api.models.update_rule import UpdateRule
from timeweb_cloud_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.timeweb.cloud
# See configuration.py for a list of all supported configuration parameters.
configuration = timeweb_cloud_api.Configuration(
host = "https://api.timeweb.cloud"
)
# 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 (JWT): Bearer
configuration = timeweb_cloud_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with timeweb_cloud_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = timeweb_cloud_api.BalancersApi(api_client)
balancer_id = None # object | ID балансировщика
rule_id = None # object | ID правила для балансировщика
update_rule = timeweb_cloud_api.UpdateRule() # UpdateRule |
try:
# Обновление правила для балансировщика
api_response = api_instance.update_balancer_rule(balancer_id, rule_id, update_rule)
print("The response of BalancersApi->update_balancer_rule:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BalancersApi->update_balancer_rule: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| balancer_id | object | ID балансировщика | |
| rule_id | object | ID правила для балансировщика | |
| update_rule | UpdateRule |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `rule`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]