All URIs are relative to https://example.com/api/modules/wp-toolkit
| Method | HTTP request | Description |
|---|---|---|
| get_password_protection | GET /v1/installations/{installationId}/features/password-protection | |
| update_password_protection | PATCH /v1/installations/{installationId}/features/password-protection |
PasswordProtectionResponse get_password_protection(installation_id)
Get information about password protection feature
- Basic Authentication (httpBasic):
- Api Key Authentication (pleskApiToken):
import plesk_wp_toolkit_client
from plesk_wp_toolkit_client.models.password_protection_response import PasswordProtectionResponse
from plesk_wp_toolkit_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://example.com/api/modules/wp-toolkit
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_wp_toolkit_client.Configuration(
host = "https://example.com/api/modules/wp-toolkit"
)
# 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 HTTP basic authorization: httpBasic
configuration = plesk_wp_toolkit_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: pleskApiToken
configuration.api_key['pleskApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['pleskApiToken'] = 'Bearer'
# Enter a context with an instance of the API client
with plesk_wp_toolkit_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = plesk_wp_toolkit_client.InstallationsFeaturesPasswordProtectionApi(api_client)
installation_id = 1 # int | Installation ID
try:
api_response = api_instance.get_password_protection(installation_id)
print("The response of InstallationsFeaturesPasswordProtectionApi->get_password_protection:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling InstallationsFeaturesPasswordProtectionApi->get_password_protection: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| installation_id | int | Installation ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Password protection feature status | - |
| 400 | Bad Request | - |
| 404 | Not Found | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PasswordProtectionResponse update_password_protection(installation_id, password_protection_request)
Update password protection
- Basic Authentication (httpBasic):
- Api Key Authentication (pleskApiToken):
import plesk_wp_toolkit_client
from plesk_wp_toolkit_client.models.password_protection_request import PasswordProtectionRequest
from plesk_wp_toolkit_client.models.password_protection_response import PasswordProtectionResponse
from plesk_wp_toolkit_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://example.com/api/modules/wp-toolkit
# See configuration.py for a list of all supported configuration parameters.
configuration = plesk_wp_toolkit_client.Configuration(
host = "https://example.com/api/modules/wp-toolkit"
)
# 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 HTTP basic authorization: httpBasic
configuration = plesk_wp_toolkit_client.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure API key authorization: pleskApiToken
configuration.api_key['pleskApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['pleskApiToken'] = 'Bearer'
# Enter a context with an instance of the API client
with plesk_wp_toolkit_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = plesk_wp_toolkit_client.InstallationsFeaturesPasswordProtectionApi(api_client)
installation_id = 1 # int | Installation ID
password_protection_request = plesk_wp_toolkit_client.PasswordProtectionRequest() # PasswordProtectionRequest |
try:
api_response = api_instance.update_password_protection(installation_id, password_protection_request)
print("The response of InstallationsFeaturesPasswordProtectionApi->update_password_protection:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling InstallationsFeaturesPasswordProtectionApi->update_password_protection: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| installation_id | int | Installation ID | |
| password_protection_request | PasswordProtectionRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Password protection feature status | - |
| 400 | Bad Request | - |
| 404 | Not Found | - |
| 422 | Unprocessable entity | - |
| 500 | Internal Server Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]