All URIs are relative to /api/v2
| Method | HTTP request | Description |
|---|---|---|
| databases_get | GET /databases | Get databases |
| databases_id_delete | DELETE /databases/{id} | Delete database |
| databases_post | POST /databases | Create database |
| dbservers_get | GET /dbservers | Get database servers |
| dbusers_get | GET /dbusers | Get database users |
| dbusers_id_delete | DELETE /dbusers/{id} | Delete database user |
| dbusers_id_put | PUT /dbusers/{id} | Update database user |
| dbusers_post | POST /dbusers | Create database user |
List[Database] databases_get(domain=domain)
Get databases
- Api Key Authentication (APIKeyHeader):
- Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.database import Database
from plesk_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
host = "/api/v2"
)
# 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 API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'
# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = plesk_client.DatabasesApi(api_client)
domain = 'example.com' # str | Filter data by domain name (optional)
try:
# Get databases
api_response = api_instance.databases_get(domain=domain)
print("The response of DatabasesApi->databases_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->databases_get: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| domain | str | Filter data by domain name | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Invalid request data | - |
| 404 | Server is not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
StatusResponse databases_id_delete(id)
Delete database
- Api Key Authentication (APIKeyHeader):
- Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.status_response import StatusResponse
from plesk_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
host = "/api/v2"
)
# 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 API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'
# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = plesk_client.DatabasesApi(api_client)
id = 10 # int | Database ID
try:
# Delete database
api_response = api_instance.databases_id_delete(id)
print("The response of DatabasesApi->databases_id_delete:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->databases_id_delete: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Database ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 404 | Database is not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Database databases_post(body)
Create database
- Api Key Authentication (APIKeyHeader):
- Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.database import Database
from plesk_client.models.database_request import DatabaseRequest
from plesk_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
host = "/api/v2"
)
# 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 API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'
# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = plesk_client.DatabasesApi(api_client)
body = plesk_client.DatabaseRequest() # DatabaseRequest | Database data
try:
# Create database
api_response = api_instance.databases_post(body)
print("The response of DatabasesApi->databases_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->databases_post: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| body | DatabaseRequest | Database data |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Invalid request data | - |
| 404 | Domain is not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List[DatabaseServer] dbservers_get(id=id)
Get database servers
- Api Key Authentication (APIKeyHeader):
- Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.database_server import DatabaseServer
from plesk_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
host = "/api/v2"
)
# 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 API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'
# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = plesk_client.DatabasesApi(api_client)
id = 1 # int | Filter data by database server id (optional)
try:
# Get database servers
api_response = api_instance.dbservers_get(id=id)
print("The response of DatabasesApi->dbservers_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->dbservers_get: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Filter data by database server id | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Invalid request data | - |
| 404 | Server is not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List[DatabaseUser] dbusers_get(db_id=db_id)
Get database users
- Api Key Authentication (APIKeyHeader):
- Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.database_user import DatabaseUser
from plesk_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
host = "/api/v2"
)
# 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 API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'
# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = plesk_client.DatabasesApi(api_client)
db_id = 44 # int | Filter data by database ID (optional)
try:
# Get database users
api_response = api_instance.dbusers_get(db_id=db_id)
print("The response of DatabasesApi->dbusers_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->dbusers_get: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| db_id | int | Filter data by database ID | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Invalid request data | - |
| 404 | Domain/database is not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
StatusResponse dbusers_id_delete(id)
Delete database user
- Api Key Authentication (APIKeyHeader):
- Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.status_response import StatusResponse
from plesk_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
host = "/api/v2"
)
# 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 API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'
# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = plesk_client.DatabasesApi(api_client)
id = 12 # int | Database user ID
try:
# Delete database user
api_response = api_instance.dbusers_id_delete(id)
print("The response of DatabasesApi->dbusers_id_delete:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->dbusers_id_delete: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Database user ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 404 | Database user is not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
StatusResponse dbusers_id_put(id, body)
Update database user
- Api Key Authentication (APIKeyHeader):
- Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.database_user_update_request import DatabaseUserUpdateRequest
from plesk_client.models.status_response import StatusResponse
from plesk_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
host = "/api/v2"
)
# 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 API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'
# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = plesk_client.DatabasesApi(api_client)
id = 12 # int | Database user ID
body = plesk_client.DatabaseUserUpdateRequest() # DatabaseUserUpdateRequest | Database user data
try:
# Update database user
api_response = api_instance.dbusers_id_put(id, body)
print("The response of DatabasesApi->dbusers_id_put:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->dbusers_id_put: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | Database user ID | |
| body | DatabaseUserUpdateRequest | Database user data |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Invalid request data | - |
| 404 | Server/database/domain is not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DatabaseUser dbusers_post(body)
Create database user
- Api Key Authentication (APIKeyHeader):
- Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.database_user import DatabaseUser
from plesk_client.models.database_user_request import DatabaseUserRequest
from plesk_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_client.Configuration(
host = "/api/v2"
)
# 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 API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'
# Configure HTTP basic authorization: BasicAuth
configuration = plesk_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with plesk_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = plesk_client.DatabasesApi(api_client)
body = plesk_client.DatabaseUserRequest() # DatabaseUserRequest | Database User data
try:
# Create database user
api_response = api_instance.dbusers_post(body)
print("The response of DatabasesApi->dbusers_post:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DatabasesApi->dbusers_post: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| body | DatabaseUserRequest | Database User data |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 400 | Invalid request data | - |
| 404 | Server/database/domain is not found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]