Skip to content

truehostcloud/plesk-python-client

Repository files navigation

plesk-client

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v2
  • Package version: 1.0.0
  • Generator version: 7.11.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.8+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import plesk_client

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import plesk_client

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import plesk_client
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.AuthenticationApi(api_client)
    key = '3d2e93ad-85e6-1a3e-9f81-b9d26650e4f9' # str | Key ID

    try:
        # Delete a secret key
        api_response = api_instance.auth_keys_key_delete(key)
        print("The response of AuthenticationApi->auth_keys_key_delete:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AuthenticationApi->auth_keys_key_delete: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to /api/v2

Class Method HTTP request Description
AuthenticationApi auth_keys_key_delete DELETE /auth/keys/{key} Delete a secret key
AuthenticationApi auth_keys_post POST /auth/keys Generate a secret key
CliApi cli_commands_get GET /cli/commands List of available commands
CliApi cli_id_call_post POST /cli/{id}/call Execute command
CliApi cli_id_ref_get GET /cli/{id}/ref Command reference
ClientsApi clients_get GET /clients List all clients
ClientsApi clients_id_activate_put PUT /clients/{id}/activate Activate client
ClientsApi clients_id_delete DELETE /clients/{id} Delete client account
ClientsApi clients_id_domains_get GET /clients/{id}/domains List of client domains
ClientsApi clients_id_get GET /clients/{id} Client details
ClientsApi clients_id_put PUT /clients/{id} Update client account
ClientsApi clients_id_statistics_get GET /clients/{id}/statistics Get client stats
ClientsApi clients_id_suspend_put PUT /clients/{id}/suspend Suspend client
ClientsApi clients_post POST /clients Create a new Client account
DNSApi dns_records_get GET /dns/records Get domain or domain alias DNS records
DNSApi dns_records_id_delete DELETE /dns/records/{id} Delete DNS record
DNSApi dns_records_id_get GET /dns/records/{id} Get DNS record
DNSApi dns_records_id_put PUT /dns/records/{id} Update DNS record
DNSApi dns_records_post POST /dns/records Create domain or domain alias DNS record
DatabasesApi databases_get GET /databases Get databases
DatabasesApi databases_id_delete DELETE /databases/{id} Delete database
DatabasesApi databases_post POST /databases Create database
DatabasesApi dbservers_get GET /dbservers Get database servers
DatabasesApi dbusers_get GET /dbusers Get database users
DatabasesApi dbusers_id_delete DELETE /dbusers/{id} Delete database user
DatabasesApi dbusers_id_put PUT /dbusers/{id} Update database user
DatabasesApi dbusers_post POST /dbusers Create database user
DomainsApi domains_get GET /domains List all domains
DomainsApi domains_id_client_get GET /domains/{id}/client Get domain client
DomainsApi domains_id_delete DELETE /domains/{id} Delete a Domain
DomainsApi domains_id_get GET /domains/{id} Domain details
DomainsApi domains_id_put PUT /domains/{id} Update a Domain
DomainsApi domains_id_status_get GET /domains/{id}/status Get Domain status
DomainsApi domains_id_status_put PUT /domains/{id}/status Update a Domain status
DomainsApi domains_post POST /domains Create a new Domain
ExtensionsApi extensions_get GET /extensions List of installed Extensions
ExtensionsApi extensions_id_delete DELETE /extensions/{id} Delete an Extension
ExtensionsApi extensions_id_disable_put PUT /extensions/{id}/disable Disable extension
ExtensionsApi extensions_id_enable_put PUT /extensions/{id}/enable Enable extension
ExtensionsApi extensions_id_get GET /extensions/{id} Extension details
ExtensionsApi extensions_post POST /extensions Install a new Extension
FtpUsersApi ftpusers_get GET /ftpusers Get FTP users
FtpUsersApi ftpusers_name_delete DELETE /ftpusers/{name} Delete FTP user
FtpUsersApi ftpusers_name_put PUT /ftpusers/{name} Update FTP user
FtpUsersApi ftpusers_post POST /ftpusers Create FTP user
ServerApi server_get GET /server Server Meta Information
ServerApi server_init_post POST /server/init Performing initial server setup
ServerApi server_ips_get GET /server/ips Server IP Addresses
ServerApi server_license_post POST /server/license Installing license key

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

BasicAuth

  • Type: HTTP basic authentication

APIKeyHeader

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header

Author

About

Plesk API python client

Resources

Stars

Watchers

Forks

Packages

No packages published