Skip to content

Latest commit

 

History

History
782 lines (545 loc) · 23.3 KB

File metadata and controls

782 lines (545 loc) · 23.3 KB

plesk_client.ClientsApi

All URIs are relative to /api/v2

Method HTTP request Description
clients_get GET /clients List all clients
clients_id_activate_put PUT /clients/{id}/activate Activate client
clients_id_delete DELETE /clients/{id} Delete client account
clients_id_domains_get GET /clients/{id}/domains List of client domains
clients_id_get GET /clients/{id} Client details
clients_id_put PUT /clients/{id} Update client account
clients_id_statistics_get GET /clients/{id}/statistics Get client stats
clients_id_suspend_put PUT /clients/{id}/suspend Suspend client
clients_post POST /clients Create a new Client account

clients_get

List[Client] clients_get()

List all clients

Example

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

    try:
        # List all clients
        api_response = api_instance.clients_get()
        print("The response of ClientsApi->clients_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClientsApi->clients_get: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[Client]

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]

clients_id_activate_put

StatusResponse clients_id_activate_put(id)

Activate client

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.ClientsApi(api_client)
    id = 7 # int | Client ID

    try:
        # Activate client
        api_response = api_instance.clients_id_activate_put(id)
        print("The response of ClientsApi->clients_id_activate_put:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClientsApi->clients_id_activate_put: %s\n" % e)

Parameters

Name Type Description Notes
id int Client ID

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 Client is not found -

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

clients_id_delete

CreatedResponse clients_id_delete(id)

Delete client account

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.created_response import CreatedResponse
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.ClientsApi(api_client)
    id = 7 # int | Client ID

    try:
        # Delete client account
        api_response = api_instance.clients_id_delete(id)
        print("The response of ClientsApi->clients_id_delete:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClientsApi->clients_id_delete: %s\n" % e)

Parameters

Name Type Description Notes
id int Client ID

Return type

CreatedResponse

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Client is not found -

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

clients_id_domains_get

List[DomainResponse] clients_id_domains_get(id)

List of client domains

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.domain_response import DomainResponse
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.ClientsApi(api_client)
    id = 7 # int | Client ID

    try:
        # List of client domains
        api_response = api_instance.clients_id_domains_get(id)
        print("The response of ClientsApi->clients_id_domains_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClientsApi->clients_id_domains_get: %s\n" % e)

Parameters

Name Type Description Notes
id int Client ID

Return type

List[DomainResponse]

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Client is not found -

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

clients_id_get

Client clients_id_get(id)

Client details

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.client import 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.ClientsApi(api_client)
    id = 7 # int | Client ID

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

Parameters

Name Type Description Notes
id int Client ID

Return type

Client

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Client is not found -

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

clients_id_put

CreatedResponse clients_id_put(id, body)

Update client account

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.client_update_request import ClientUpdateRequest
from plesk_client.models.created_response import CreatedResponse
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.ClientsApi(api_client)
    id = 7 # int | Client ID
    body = plesk_client.ClientUpdateRequest() # ClientUpdateRequest | Client data

    try:
        # Update client account
        api_response = api_instance.clients_id_put(id, body)
        print("The response of ClientsApi->clients_id_put:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClientsApi->clients_id_put: %s\n" % e)

Parameters

Name Type Description Notes
id int Client ID
body ClientUpdateRequest Client data

Return type

CreatedResponse

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Invalid request data -
404 Client is not found -

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

clients_id_statistics_get

ClientStatistics clients_id_statistics_get(id)

Get client stats

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.client_statistics import ClientStatistics
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.ClientsApi(api_client)
    id = 7 # int | Client ID

    try:
        # Get client stats
        api_response = api_instance.clients_id_statistics_get(id)
        print("The response of ClientsApi->clients_id_statistics_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClientsApi->clients_id_statistics_get: %s\n" % e)

Parameters

Name Type Description Notes
id int Client ID

Return type

ClientStatistics

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Client is not found -

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

clients_id_suspend_put

StatusResponse clients_id_suspend_put(id)

Suspend client

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.ClientsApi(api_client)
    id = 7 # int | Client ID

    try:
        # Suspend client
        api_response = api_instance.clients_id_suspend_put(id)
        print("The response of ClientsApi->clients_id_suspend_put:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClientsApi->clients_id_suspend_put: %s\n" % e)

Parameters

Name Type Description Notes
id int Client ID

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 Client is not found -

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

clients_post

CreatedResponse clients_post(body)

Create a new Client account

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.client_request import ClientRequest
from plesk_client.models.created_response import CreatedResponse
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.ClientsApi(api_client)
    body = plesk_client.ClientRequest() # ClientRequest | Client data

    try:
        # Create a new Client account
        api_response = api_instance.clients_post(body)
        print("The response of ClientsApi->clients_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ClientsApi->clients_post: %s\n" % e)

Parameters

Name Type Description Notes
body ClientRequest Client data

Return type

CreatedResponse

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Client account successfully created -
400 Invalid request data -

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