Skip to content

Latest commit

 

History

History
344 lines (238 loc) · 10.3 KB

File metadata and controls

344 lines (238 loc) · 10.3 KB

plesk_client.ServerApi

All URIs are relative to /api/v2

Method HTTP request Description
server_get GET /server Server Meta Information
server_init_post POST /server/init Performing initial server setup
server_ips_get GET /server/ips Server IP Addresses
server_license_post POST /server/license Installing license key

server_get

ServerMeta server_get()

Server Meta Information

Example

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

    try:
        # Server Meta Information
        api_response = api_instance.server_get()
        print("The response of ServerApi->server_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ServerApi->server_get: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ServerMeta

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Return Server Meta Information -

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

server_init_post

StatusResponse server_init_post(body)

Performing initial server setup

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.server_init import ServerInit
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.ServerApi(api_client)
    body = plesk_client.ServerInit() # ServerInit | Inital setup parameters

    try:
        # Performing initial server setup
        api_response = api_instance.server_init_post(body)
        print("The response of ServerApi->server_init_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ServerApi->server_init_post: %s\n" % e)

Parameters

Name Type Description Notes
body ServerInit Inital setup parameters

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 Inital server setup was succesfully performed -
400 Invalid request data -

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

server_ips_get

List[ServerIp] server_ips_get()

Server IP Addresses

Example

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

    try:
        # Server IP Addresses
        api_response = api_instance.server_ips_get()
        print("The response of ServerApi->server_ips_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ServerApi->server_ips_get: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[ServerIp]

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Return Server IP Addresses list -

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

server_license_post

StatusResponse server_license_post(body)

Installing license key

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.server_license import ServerLicense
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.ServerApi(api_client)
    body = plesk_client.ServerLicense() # ServerLicense | License key

    try:
        # Installing license key
        api_response = api_instance.server_license_post(body)
        print("The response of ServerApi->server_license_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ServerApi->server_license_post: %s\n" % e)

Parameters

Name Type Description Notes
body ServerLicense License key

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 License key was succesfully installed -
400 Invalid request data -

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