Skip to content

Latest commit

 

History

History
240 lines (163 loc) · 7.28 KB

LanguageApi.md

File metadata and controls

240 lines (163 loc) · 7.28 KB

clientapi_cpanel.LanguageApi

All URIs are relative to https://cpanel-server.tld:2083/execute

Method HTTP request Description
get_attributes GET /Locale/get_attributes Return current locale settings
list_locales GET /Locale/list_locales Return available locales
set_locale GET /Locale/set_locale Update cPanel account locale

get_attributes

InlineResponse200291 get_attributes()

Return current locale settings

This function retrieves information about the user's current locale setting.

Example

  • Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200291 import InlineResponse200291
from clientapi_cpanel.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
    host = "https://cpanel-server.tld:2083/execute"
)

# 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 HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = clientapi_cpanel.LanguageApi(api_client)

    try:
        # Return current locale settings
        api_response = api_instance.get_attributes()
        print("The response of LanguageApi->get_attributes:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LanguageApi->get_attributes: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

InlineResponse200291

Authorization

BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 HTTP Request was successful. -

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

list_locales

InlineResponse200292 list_locales()

Return available locales

This function lists an account's available interface languages.

Example

  • Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200292 import InlineResponse200292
from clientapi_cpanel.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
    host = "https://cpanel-server.tld:2083/execute"
)

# 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 HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = clientapi_cpanel.LanguageApi(api_client)

    try:
        # Return available locales
        api_response = api_instance.list_locales()
        print("The response of LanguageApi->list_locales:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LanguageApi->list_locales: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

InlineResponse200292

Authorization

BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 HTTP Request was successful. -

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

set_locale

InlineResponse200293 set_locale(locale)

Update cPanel account locale

This function sets the account's locale.

Example

  • Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200293 import InlineResponse200293
from clientapi_cpanel.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
    host = "https://cpanel-server.tld:2083/execute"
)

# 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 HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = clientapi_cpanel.LanguageApi(api_client)
    locale = 'en' # str | The locale's abbreviated name according to UAPI's `Locale::list_locales` function.

    try:
        # Update cPanel account locale
        api_response = api_instance.set_locale(locale)
        print("The response of LanguageApi->set_locale:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling LanguageApi->set_locale: %s\n" % e)

Parameters

Name Type Description Notes
locale str The locale's abbreviated name according to UAPI's `Locale::list_locales` function.

Return type

InlineResponse200293

Authorization

BasicAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 HTTP Request was successful. -

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