All URIs are relative to https://api.timeweb.cloud
| Method | HTTP request | Description |
|---|---|---|
| create_database | POST /api/v1/dbs | Создание базы данных |
| create_database_backup | POST /api/v1/dbs/{db_id}/backups | Создание бэкапа базы данных |
| create_database_cluster | POST /api/v1/databases | Создание кластера базы данных |
| create_database_instance | POST /api/v1/databases/{db_cluster_id}/instances | Создание инстанса базы данных |
| create_database_user | POST /api/v1/databases/{db_cluster_id}/admins | Создание пользователя базы данных |
| delete_database | DELETE /api/v1/dbs/{db_id} | Удаление базы данных |
| delete_database_backup | DELETE /api/v1/dbs/{db_id}/backups/{backup_id} | Удаление бэкапа базы данных |
| delete_database_cluster | DELETE /api/v1/databases/{db_cluster_id} | Удаление кластера базы данных |
| delete_database_instance | DELETE /api/v1/databases/{db_cluster_id}/instances/{instance_id} | Удаление инстанса базы данных |
| delete_database_user | DELETE /api/v1/databases/{db_cluster_id}/admins/{admin_id} | Удаление пользователя базы данных |
| get_database | GET /api/v1/dbs/{db_id} | Получение базы данных |
| get_database_auto_backups_settings | GET /api/v1/dbs/{db_id}/auto-backups | Получение настроек автобэкапов базы данных |
| get_database_backup | GET /api/v1/dbs/{db_id}/backups/{backup_id} | Получение бэкапа базы данных |
| get_database_backups | GET /api/v1/dbs/{db_id}/backups | Список бэкапов базы данных |
| get_database_cluster | GET /api/v1/databases/{db_cluster_id} | Получение кластера базы данных |
| get_database_cluster_types | GET /api/v1/database-types | Получение списка типов кластеров баз данных |
| get_database_clusters | GET /api/v1/databases | Получение списка кластеров баз данных |
| get_database_instance | GET /api/v1/databases/{db_cluster_id}/instances/{instance_id} | Получение инстанса базы данных |
| get_database_instances | GET /api/v1/databases/{db_cluster_id}/instances | Получение списка инстансов баз данных |
| get_database_parameters | GET /api/v1/dbs/parameters | Получение списка параметров баз данных |
| get_database_user | GET /api/v1/databases/{db_cluster_id}/admins/{admin_id} | Получение пользователя базы данных |
| get_database_users | GET /api/v1/databases/{db_cluster_id}/admins | Получение списка пользователей базы данных |
| get_databases | GET /api/v1/dbs | Получение списка всех баз данных |
| get_databases_presets | GET /api/v2/presets/dbs | Получение списка тарифов для баз данных |
| restore_database_from_backup | PUT /api/v1/dbs/{db_id}/backups/{backup_id} | Восстановление базы данных из бэкапа |
| update_database | PATCH /api/v1/dbs/{db_id} | Обновление базы данных |
| update_database_auto_backups_settings | PATCH /api/v1/dbs/{db_id}/auto-backups | Изменение настроек автобэкапов базы данных |
| update_database_cluster | PATCH /api/v1/databases/{db_cluster_id} | Изменение кластера базы данных |
| update_database_instance | PATCH /api/v1/databases/{db_cluster_id}/instances/{instance_id} | Изменение инстанса базы данных |
| update_database_user | PATCH /api/v1/databases/{db_cluster_id}/admins/{admin_id} | Изменение пользователя базы данных |
CreateDatabase201Response create_database(create_db)
Создание базы данных
Чтобы создать базу данных на вашем аккаунте, отправьте POST-запрос на /api/v1/dbs, задав необходимые атрибуты. База данных будет создана с использованием предоставленной информации. Тело ответа будет содержать объект JSON с информацией о созданной базе данных.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database201_response import CreateDatabase201Response
from timeweb_cloud_api.models.create_db import CreateDb
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.DatabasesApi(api_client)
create_db = timeweb_cloud_api.CreateDb() # CreateDb |
try:
# Создание базы данных
api_response = api_instance.create_database(create_db)
print("The response of DatabasesApi->create_database:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->create_database: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| create_db | CreateDb |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Ответ будет представлять собой объект JSON c ключом `db`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseBackup201Response create_database_backup(db_id, comment=comment)
Создание бэкапа базы данных
Чтобы создать бэкап базы данных, отправьте запрос POST в api/v1/dbs/{db_id}/backups.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database_backup201_response import CreateDatabaseBackup201Response
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.DatabasesApi(api_client)
db_id = None # object | ID базы данных
comment = None # object | Описание бэкапа (optional)
try:
# Создание бэкапа базы данных
api_response = api_instance.create_database_backup(db_id, comment=comment)
print("The response of DatabasesApi->create_database_backup:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->create_database_backup: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | object | ID базы данных | |
| comment | object | Описание бэкапа | [optional] |
CreateDatabaseBackup201Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Ответ будет представлять собой объект JSON с ключом `backup`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 409 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseCluster201Response create_database_cluster(create_cluster)
Создание кластера базы данных
Чтобы создать кластер базы данных на вашем аккаунте, отправьте POST-запрос на /api/v1/databases. Вместе с кластером будет создан один инстанс базы данных и один пользователь.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_cluster import CreateCluster
from timeweb_cloud_api.models.create_database_cluster201_response import CreateDatabaseCluster201Response
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.DatabasesApi(api_client)
create_cluster = timeweb_cloud_api.CreateCluster() # CreateCluster |
try:
# Создание кластера базы данных
api_response = api_instance.create_database_cluster(create_cluster)
print("The response of DatabasesApi->create_database_cluster:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->create_database_cluster: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| create_cluster | CreateCluster |
CreateDatabaseCluster201Response
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Ответ будет представлять собой объект JSON c ключом `db`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseInstance201Response create_database_instance(db_cluster_id, create_instance)
Создание инстанса базы данных
Чтобы создать инстанс базы данных, отправьте POST-запрос на /api/v1/databases/{db_cluster_id}/instances.\ Существующие пользователи не будут иметь доступа к новой базе данных после создания. Вы можете изменить привилегии для пользователя через метод изменения пользователя
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database_instance201_response import CreateDatabaseInstance201Response
from timeweb_cloud_api.models.create_instance import CreateInstance
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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
create_instance = timeweb_cloud_api.CreateInstance() # CreateInstance |
try:
# Создание инстанса базы данных
api_response = api_instance.create_database_instance(db_cluster_id, create_instance)
print("The response of DatabasesApi->create_database_instance:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->create_database_instance: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных | |
| create_instance | CreateInstance |
CreateDatabaseInstance201Response
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Ответ будет представлять собой объект JSON c ключом `instance`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseUser201Response create_database_user(db_cluster_id, create_admin)
Создание пользователя базы данных
Чтобы создать пользователя базы данных, отправьте POST-запрос на /api/v1/databases/{db_cluster_id}/admins.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_admin import CreateAdmin
from timeweb_cloud_api.models.create_database_user201_response import CreateDatabaseUser201Response
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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
create_admin = timeweb_cloud_api.CreateAdmin() # CreateAdmin |
try:
# Создание пользователя базы данных
api_response = api_instance.create_database_user(db_cluster_id, create_admin)
print("The response of DatabasesApi->create_database_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->create_database_user: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных | |
| create_admin | CreateAdmin |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Ответ будет представлять собой объект JSON c ключом `admin`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteDatabase200Response delete_database(db_id, hash=hash, code=code)
Удаление базы данных
Чтобы удалить базу данных, отправьте запрос DELETE в api/v1/dbs/{db_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.delete_database200_response import DeleteDatabase200Response
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.DatabasesApi(api_client)
db_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_database(db_id, hash=hash, code=code)
print("The response of DatabasesApi->delete_database:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->delete_database: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_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 ключом `database_delete` | - |
| 204 | База данных успешно удалена. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_database_backup(db_id, backup_id)
Удаление бэкапа базы данных
Чтобы удалить бэкап базы данных, отправьте запрос DELETE в api/v1/dbs/{db_id}/backups/{backup_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.DatabasesApi(api_client)
db_id = None # object | ID базы данных
backup_id = None # object | ID резервной копии
try:
# Удаление бэкапа базы данных
api_instance.delete_database_backup(db_id, backup_id)
except Exception as e:
print("Exception when calling DatabasesApi->delete_database_backup: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | object | ID базы данных | |
| backup_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]
DeleteDatabaseCluster200Response delete_database_cluster(db_cluster_id, hash=hash, code=code)
Удаление кластера базы данных
Чтобы удалить кластер базы данных, отправьте DELETE-запрос на /api/v1/databases/{db_cluster_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.delete_database_cluster200_response import DeleteDatabaseCluster200Response
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.DatabasesApi(api_client)
db_cluster_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_database_cluster(db_cluster_id, hash=hash, code=code)
print("The response of DatabasesApi->delete_database_cluster:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->delete_database_cluster: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных | |
| hash | object | Хеш, который совместно с кодом авторизации надо отправить для удаления, если включено подтверждение удаления сервисов через Телеграм. | [optional] |
| code | object | Код подтверждения, который придет к вам в Телеграм, после запроса удаления, если включено подтверждение удаления сервисов. При помощи API токена сервисы можно удалять без подтверждения, если параметр токена `is_able_to_delete` установлен в значение `true` | [optional] |
DeleteDatabaseCluster200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Объект JSON c ключом `hash` | - |
| 204 | Кластер базы данных удален. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_database_instance(db_cluster_id, instance_id)
Удаление инстанса базы данных
Чтобы удалить инстанс базы данных, отправьте DELETE-запрос на /api/v1/databases/{db_cluster_id}/instances/{instance_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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
instance_id = None # object | ID инстанса базы данных
try:
# Удаление инстанса базы данных
api_instance.delete_database_instance(db_cluster_id, instance_id)
except Exception as e:
print("Exception when calling DatabasesApi->delete_database_instance: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных | |
| instance_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_database_user(db_cluster_id, admin_id)
Удаление пользователя базы данных
Чтобы удалить пользователя базы данных на вашем аккаунте, отправьте DELETE-запрос на /api/v1/databases/{db_cluster_id}/admins/{admin_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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
admin_id = None # object | ID пользователя базы данных
try:
# Удаление пользователя базы данных
api_instance.delete_database_user(db_cluster_id, admin_id)
except Exception as e:
print("Exception when calling DatabasesApi->delete_database_user: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных | |
| admin_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]
CreateDatabase201Response get_database(db_id)
Получение базы данных
Чтобы отобразить информацию об отдельной базе данных, отправьте запрос GET на api/v1/dbs/{db_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database201_response import CreateDatabase201Response
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.DatabasesApi(api_client)
db_id = None # object | ID базы данных
try:
# Получение базы данных
api_response = api_instance.get_database(db_id)
print("The response of DatabasesApi->get_database:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | object | ID базы данных |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON с ключом `db`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDatabaseAutoBackupsSettings200Response get_database_auto_backups_settings(db_id)
Получение настроек автобэкапов базы данных
Чтобы получить список настроек автобэкапов базы данных, отправьте запрос GET в api/v1/dbs/{db_id}/auto-backups
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_database_auto_backups_settings200_response import GetDatabaseAutoBackupsSettings200Response
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.DatabasesApi(api_client)
db_id = None # object | ID базы данных
try:
# Получение настроек автобэкапов базы данных
api_response = api_instance.get_database_auto_backups_settings(db_id)
print("The response of DatabasesApi->get_database_auto_backups_settings:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_auto_backups_settings: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | object | ID базы данных |
GetDatabaseAutoBackupsSettings200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON с ключом `auto_backups_settings`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseBackup201Response get_database_backup(db_id, backup_id)
Получение бэкапа базы данных
Чтобы получить бэкап базы данных, отправьте запрос GET в api/v1/dbs/{db_id}/backups/{backup_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database_backup201_response import CreateDatabaseBackup201Response
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.DatabasesApi(api_client)
db_id = None # object | ID базы данных
backup_id = None # object | ID резервной копии
try:
# Получение бэкапа базы данных
api_response = api_instance.get_database_backup(db_id, backup_id)
print("The response of DatabasesApi->get_database_backup:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_backup: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | object | ID базы данных | |
| backup_id | object | ID резервной копии |
CreateDatabaseBackup201Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON с ключом `backup`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDatabaseBackups200Response get_database_backups(db_id, limit=limit, offset=offset)
Список бэкапов базы данных
Чтобы получить список бэкапов базы данных, отправьте запрос GET в api/v1/dbs/{db_id}/backups.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_database_backups200_response import GetDatabaseBackups200Response
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.DatabasesApi(api_client)
db_id = None # object | ID базы данных
limit = None # object | Обозначает количество записей, которое необходимо вернуть. (optional)
offset = None # object | Указывает на смещение относительно начала списка. (optional)
try:
# Список бэкапов базы данных
api_response = api_instance.get_database_backups(db_id, limit=limit, offset=offset)
print("The response of DatabasesApi->get_database_backups:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_backups: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | object | ID базы данных | |
| limit | object | Обозначает количество записей, которое необходимо вернуть. | [optional] |
| offset | object | Указывает на смещение относительно начала списка. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON с ключом `backups`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseCluster201Response get_database_cluster(db_cluster_id)
Получение кластера базы данных
Чтобы получить кластер базы данных на вашем аккаунте, отправьте GET-запрос на /api/v1/databases/{db_cluster_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database_cluster201_response import CreateDatabaseCluster201Response
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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
try:
# Получение кластера базы данных
api_response = api_instance.get_database_cluster(db_cluster_id)
print("The response of DatabasesApi->get_database_cluster:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_cluster: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных |
CreateDatabaseCluster201Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Ответ будет представлять собой объект JSON c ключом `db`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDatabaseClusterTypes200Response get_database_cluster_types()
Получение списка типов кластеров баз данных
Чтобы получить список типов баз данных на вашем аккаунте, отправьте GET-запрос на /api/v1/database-types.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_database_cluster_types200_response import GetDatabaseClusterTypes200Response
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.DatabasesApi(api_client)
try:
# Получение списка типов кластеров баз данных
api_response = api_instance.get_database_cluster_types()
print("The response of DatabasesApi->get_database_cluster_types:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_cluster_types: %s\n" % e)This endpoint does not need any parameter.
GetDatabaseClusterTypes200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `types`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDatabaseClusters200Response get_database_clusters(limit=limit, offset=offset)
Получение списка кластеров баз данных
Чтобы получить список кластеров баз данных, отправьте GET-запрос на /api/v1/databases. Тело ответа будет представлять собой объект JSON с ключом dbs.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_database_clusters200_response import GetDatabaseClusters200Response
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.DatabasesApi(api_client)
limit = None # object | Обозначает количество записей, которое необходимо вернуть. (optional)
offset = None # object | Указывает на смещение относительно начала списка. (optional)
try:
# Получение списка кластеров баз данных
api_response = api_instance.get_database_clusters(limit=limit, offset=offset)
print("The response of DatabasesApi->get_database_clusters:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_clusters: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | object | Обозначает количество записей, которое необходимо вернуть. | [optional] |
| offset | object | Указывает на смещение относительно начала списка. | [optional] |
GetDatabaseClusters200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `dbs`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseInstance201Response get_database_instance(db_cluster_id, instance_id)
Получение инстанса базы данных
Чтобы получить инстанс базы данных, отправьте GET-запрос на /api/v1/databases/{db_cluster_id}/instances/{instance_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database_instance201_response import CreateDatabaseInstance201Response
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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
instance_id = None # object | ID инстанса базы данных
try:
# Получение инстанса базы данных
api_response = api_instance.get_database_instance(db_cluster_id, instance_id)
print("The response of DatabasesApi->get_database_instance:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_instance: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных | |
| instance_id | object | ID инстанса базы данных |
CreateDatabaseInstance201Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `instance`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDatabaseInstances200Response get_database_instances(db_cluster_id)
Получение списка инстансов баз данных
Чтобы получить список баз данных на вашем аккаунте, отправьте GET-запрос на /api/v1/databases/{db_cluster_id}/instances.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_database_instances200_response import GetDatabaseInstances200Response
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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
try:
# Получение списка инстансов баз данных
api_response = api_instance.get_database_instances(db_cluster_id)
print("The response of DatabasesApi->get_database_instances:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_instances: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных |
GetDatabaseInstances200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `instances`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Dict[str, object] get_database_parameters()
Получение списка параметров баз данных
Чтобы получить список параметров баз данных, отправьте GET-запрос на /api/v1/dbs/parameters.
- 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.DatabasesApi(api_client)
try:
# Получение списка параметров баз данных
api_response = api_instance.get_database_parameters()
print("The response of DatabasesApi->get_database_parameters:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_parameters: %s\n" % e)This endpoint does not need any parameter.
Dict[str, object]
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c типами баз данных и их параметров. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseUser201Response get_database_user(db_cluster_id, admin_id)
Получение пользователя базы данных
Чтобы получить пользователя базы данных на вашем аккаунте, отправьте GET-запрос на /api/v1/databases/{db_cluster_id}/admins/{admin_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database_user201_response import CreateDatabaseUser201Response
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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
admin_id = None # object | ID пользователя базы данных
try:
# Получение пользователя базы данных
api_response = api_instance.get_database_user(db_cluster_id, admin_id)
print("The response of DatabasesApi->get_database_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_user: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных | |
| admin_id | object | ID пользователя базы данных |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `admin`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDatabaseUsers200Response get_database_users(db_cluster_id)
Получение списка пользователей базы данных
Чтобы получить список пользователей базы данных на вашем аккаунте, отправьте GET-запрос на /api/v1/databases/{db_cluster_id}/admins.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_database_users200_response import GetDatabaseUsers200Response
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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
try:
# Получение списка пользователей базы данных
api_response = api_instance.get_database_users(db_cluster_id)
print("The response of DatabasesApi->get_database_users:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_database_users: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `admins`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDatabases200Response get_databases(limit=limit, offset=offset)
Получение списка всех баз данных
Чтобы получить список всех баз данных на вашем аккаунте, отправьте GET-запрос на /api/v1/dbs. Тело ответа будет представлять собой объект JSON с ключом dbs.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_databases200_response import GetDatabases200Response
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.DatabasesApi(api_client)
limit = None # object | Обозначает количество записей, которое необходимо вернуть. (optional)
offset = None # object | Указывает на смещение относительно начала списка. (optional)
try:
# Получение списка всех баз данных
api_response = api_instance.get_databases(limit=limit, offset=offset)
print("The response of DatabasesApi->get_databases:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_databases: %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 ключом `dbs`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDatabasesPresets200Response get_databases_presets(db_id=db_id)
Получение списка тарифов для баз данных
Чтобы получить список тарифов для баз данных, отправьте GET-запрос на /api/v2/presets/dbs. Тело ответа будет представлять собой объект JSON с ключом databases_presets.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.get_databases_presets200_response import GetDatabasesPresets200Response
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.DatabasesApi(api_client)
db_id = None # object | ID базы данных (optional)
try:
# Получение списка тарифов для баз данных
api_response = api_instance.get_databases_presets(db_id=db_id)
print("The response of DatabasesApi->get_databases_presets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->get_databases_presets: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | object | ID базы данных | [optional] |
GetDatabasesPresets200Response
- 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]
restore_database_from_backup(db_id, backup_id)
Восстановление базы данных из бэкапа
Чтобы восстановить базу данных из бэкапа, отправьте запрос PUT в api/v1/dbs/{db_id}/backups/{backup_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.DatabasesApi(api_client)
db_id = None # object | ID базы данных
backup_id = None # object | ID резервной копии
try:
# Восстановление базы данных из бэкапа
api_instance.restore_database_from_backup(db_id, backup_id)
except Exception as e:
print("Exception when calling DatabasesApi->restore_database_from_backup: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | object | ID базы данных | |
| backup_id | object | ID резервной копии |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 204 | База данных из бэкапа успешно восстановлена. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 409 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabase201Response update_database(db_id, update_db)
Обновление базы данных
Чтобы обновить только определенные атрибуты базы данных, отправьте запрос PATCH в api/v1/dbs/{db_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database201_response import CreateDatabase201Response
from timeweb_cloud_api.models.update_db import UpdateDb
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.DatabasesApi(api_client)
db_id = None # object | ID базы данных
update_db = timeweb_cloud_api.UpdateDb() # UpdateDb |
try:
# Обновление базы данных
api_response = api_instance.update_database(db_id, update_db)
print("The response of DatabasesApi->update_database:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->update_database: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | object | ID базы данных | |
| update_db | UpdateDb |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON с ключом `db`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetDatabaseAutoBackupsSettings200Response update_database_auto_backups_settings(db_id, auto_backup=auto_backup)
Изменение настроек автобэкапов базы данных
Чтобы изменить список настроек автобэкапов базы данных, отправьте запрос PATCH в api/v1/dbs/{db_id}/auto-backups
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.auto_backup import AutoBackup
from timeweb_cloud_api.models.get_database_auto_backups_settings200_response import GetDatabaseAutoBackupsSettings200Response
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.DatabasesApi(api_client)
db_id = None # object | ID базы данных
auto_backup = timeweb_cloud_api.AutoBackup() # AutoBackup | При значении `is_enabled`: `true`, поля `copy_count`, `creation_start_at`, `interval` являются обязательными (optional)
try:
# Изменение настроек автобэкапов базы данных
api_response = api_instance.update_database_auto_backups_settings(db_id, auto_backup=auto_backup)
print("The response of DatabasesApi->update_database_auto_backups_settings:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->update_database_auto_backups_settings: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | object | ID базы данных | |
| auto_backup | AutoBackup | При значении `is_enabled`: `true`, поля `copy_count`, `creation_start_at`, `interval` являются обязательными | [optional] |
GetDatabaseAutoBackupsSettings200Response
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON с ключом `auto_backups_settings`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseCluster201Response update_database_cluster(db_cluster_id, update_cluster)
Изменение кластера базы данных
Чтобы изменить кластер базы данных на вашем аккаунте, отправьте PATCH-запрос на /api/v1/databases/{db_cluster_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database_cluster201_response import CreateDatabaseCluster201Response
from timeweb_cloud_api.models.update_cluster import UpdateCluster
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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
update_cluster = timeweb_cloud_api.UpdateCluster() # UpdateCluster |
try:
# Изменение кластера базы данных
api_response = api_instance.update_database_cluster(db_cluster_id, update_cluster)
print("The response of DatabasesApi->update_database_cluster:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->update_database_cluster: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных | |
| update_cluster | UpdateCluster |
CreateDatabaseCluster201Response
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `db`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseInstance201Response update_database_instance(db_cluster_id, update_instance)
Изменение инстанса базы данных
Чтобы изменить инстанс базы данных, отправьте PATCH-запрос на /api/v1/databases/{db_cluster_id}/instances/{instance_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database_instance201_response import CreateDatabaseInstance201Response
from timeweb_cloud_api.models.update_instance import UpdateInstance
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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
update_instance = timeweb_cloud_api.UpdateInstance() # UpdateInstance |
try:
# Изменение инстанса базы данных
api_response = api_instance.update_database_instance(db_cluster_id, update_instance)
print("The response of DatabasesApi->update_database_instance:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->update_database_instance: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных | |
| update_instance | UpdateInstance |
CreateDatabaseInstance201Response
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `instance`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateDatabaseUser201Response update_database_user(db_cluster_id, admin_id, update_admin)
Изменение пользователя базы данных
Чтобы изменить пользователя базы данных на вашем аккаунте, отправьте PATCH-запрос на /api/v1/databases/{db_cluster_id}/admins/{admin_id}.
- Bearer (JWT) Authentication (Bearer):
import time
import os
import timeweb_cloud_api
from timeweb_cloud_api.models.create_database_user201_response import CreateDatabaseUser201Response
from timeweb_cloud_api.models.update_admin import UpdateAdmin
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.DatabasesApi(api_client)
db_cluster_id = None # object | ID кластера базы данных
admin_id = None # object | ID пользователя базы данных
update_admin = timeweb_cloud_api.UpdateAdmin() # UpdateAdmin |
try:
# Изменение пользователя базы данных
api_response = api_instance.update_database_user(db_cluster_id, admin_id, update_admin)
print("The response of DatabasesApi->update_database_user:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->update_database_user: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_cluster_id | object | ID кластера базы данных | |
| admin_id | object | ID пользователя базы данных | |
| update_admin | UpdateAdmin |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Ответ будет представлять собой объект JSON c ключом `admin`. | - |
| 400 | - | |
| 401 | - | |
| 403 | - | |
| 404 | - | |
| 429 | - | |
| 500 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]