Skip to content

Latest commit

 

History

History
520 lines (361 loc) · 15.8 KB

File metadata and controls

520 lines (361 loc) · 15.8 KB

plesk_client.ExtensionsApi

All URIs are relative to /api/v2

Method HTTP request Description
extensions_get GET /extensions List of installed Extensions
extensions_id_delete DELETE /extensions/{id} Delete an Extension
extensions_id_disable_put PUT /extensions/{id}/disable Disable extension
extensions_id_enable_put PUT /extensions/{id}/enable Enable extension
extensions_id_get GET /extensions/{id} Extension details
extensions_post POST /extensions Install a new Extension

extensions_get

List[Extension] extensions_get()

List of installed Extensions

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.extension import Extension
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.ExtensionsApi(api_client)

    try:
        # List of installed Extensions
        api_response = api_instance.extensions_get()
        print("The response of ExtensionsApi->extensions_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->extensions_get: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[Extension]

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

extensions_id_delete

StatusResponse extensions_id_delete(id)

Delete an Extension

Example

  • 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.ExtensionsApi(api_client)
    id = 'letsencrypt' # str | Extension identifier

    try:
        # Delete an Extension
        api_response = api_instance.extensions_id_delete(id)
        print("The response of ExtensionsApi->extensions_id_delete:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->extensions_id_delete: %s\n" % e)

Parameters

Name Type Description Notes
id str Extension identifier

Return type

StatusResponse

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
404 Extension is not installed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

extensions_id_disable_put

StatusResponse extensions_id_disable_put(id)

Disable extension

Example

  • 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.ExtensionsApi(api_client)
    id = 'letsencrypt' # str | Extension identifier

    try:
        # Disable extension
        api_response = api_instance.extensions_id_disable_put(id)
        print("The response of ExtensionsApi->extensions_id_disable_put:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->extensions_id_disable_put: %s\n" % e)

Parameters

Name Type Description Notes
id str Extension identifier

Return type

StatusResponse

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
404 Extension is not installed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

extensions_id_enable_put

StatusResponse extensions_id_enable_put(id)

Enable extension

Example

  • 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.ExtensionsApi(api_client)
    id = 'letsencrypt' # str | Extension identifier

    try:
        # Enable extension
        api_response = api_instance.extensions_id_enable_put(id)
        print("The response of ExtensionsApi->extensions_id_enable_put:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->extensions_id_enable_put: %s\n" % e)

Parameters

Name Type Description Notes
id str Extension identifier

Return type

StatusResponse

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
404 Extension is not installed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

extensions_id_get

Extension extensions_id_get(id)

Extension details

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.extension import Extension
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.ExtensionsApi(api_client)
    id = 'letsencrypt' # str | Extension identifier

    try:
        # Extension details
        api_response = api_instance.extensions_id_get(id)
        print("The response of ExtensionsApi->extensions_id_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->extensions_id_get: %s\n" % e)

Parameters

Name Type Description Notes
id str Extension identifier

Return type

Extension

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
404 Extension is not installed -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

extensions_post

StatusResponse extensions_post(body)

Install a new Extension

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.extension_install_request import ExtensionInstallRequest
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.ExtensionsApi(api_client)
    body = plesk_client.ExtensionInstallRequest() # ExtensionInstallRequest | Installation type and resource

    try:
        # Install a new Extension
        api_response = api_instance.extensions_post(body)
        print("The response of ExtensionsApi->extensions_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ExtensionsApi->extensions_post: %s\n" % e)

Parameters

Name Type Description Notes
body ExtensionInstallRequest Installation type and resource

Return type

StatusResponse

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Extension successfully installed -
400 Invalid request data -

[Back to top] [Back to API list] [Back to Model list] [Back to README]