Skip to content

Latest commit

 

History

History
361 lines (253 loc) · 11 KB

File metadata and controls

361 lines (253 loc) · 11 KB

plesk_client.FtpUsersApi

All URIs are relative to /api/v2

Method HTTP request Description
ftpusers_get GET /ftpusers Get FTP users
ftpusers_name_delete DELETE /ftpusers/{name} Delete FTP user
ftpusers_name_put PUT /ftpusers/{name} Update FTP user
ftpusers_post POST /ftpusers Create FTP user

ftpusers_get

List[FtpUser] ftpusers_get(name=name, domain=domain)

Get FTP users

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.ftp_user import FtpUser
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.FtpUsersApi(api_client)
    name = 'exampleuser' # str | Filter data by user name (optional)
    domain = 'example.com' # str | Filter data by domain name (optional)

    try:
        # Get FTP users
        api_response = api_instance.ftpusers_get(name=name, domain=domain)
        print("The response of FtpUsersApi->ftpusers_get:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FtpUsersApi->ftpusers_get: %s\n" % e)

Parameters

Name Type Description Notes
name str Filter data by user name [optional]
domain str Filter data by domain name [optional]

Return type

List[FtpUser]

Authorization

APIKeyHeader, BasicAuth

HTTP request headers

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

HTTP response details

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

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

ftpusers_name_delete

StatusResponse ftpusers_name_delete(name)

Delete FTP user

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.FtpUsersApi(api_client)
    name = 'exampleuser' # str | FTP User name

    try:
        # Delete FTP user
        api_response = api_instance.ftpusers_name_delete(name)
        print("The response of FtpUsersApi->ftpusers_name_delete:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FtpUsersApi->ftpusers_name_delete: %s\n" % e)

Parameters

Name Type Description Notes
name str FTP User name

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

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

ftpusers_name_put

StatusResponse ftpusers_name_put(name, body)

Update FTP user

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.ftp_user_update_request import FtpUserUpdateRequest
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.FtpUsersApi(api_client)
    name = 'exampleuser' # str | FTP user name
    body = plesk_client.FtpUserUpdateRequest() # FtpUserUpdateRequest | FTP User data

    try:
        # Update FTP user
        api_response = api_instance.ftpusers_name_put(name, body)
        print("The response of FtpUsersApi->ftpusers_name_put:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FtpUsersApi->ftpusers_name_put: %s\n" % e)

Parameters

Name Type Description Notes
name str FTP user name
body FtpUserUpdateRequest FTP User data

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 OK -
400 Invalid request data -
404 User is not found -

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

ftpusers_post

FtpUser ftpusers_post(body)

Create FTP user

Example

  • Api Key Authentication (APIKeyHeader):
  • Basic Authentication (BasicAuth):
import plesk_client
from plesk_client.models.ftp_user import FtpUser
from plesk_client.models.ftp_user_request import FtpUserRequest
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.FtpUsersApi(api_client)
    body = plesk_client.FtpUserRequest() # FtpUserRequest | FTP User data

    try:
        # Create FTP user
        api_response = api_instance.ftpusers_post(body)
        print("The response of FtpUsersApi->ftpusers_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FtpUsersApi->ftpusers_post: %s\n" % e)

Parameters

Name Type Description Notes
body FtpUserRequest FTP User data

Return type

FtpUser

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

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