archeti-org / planethoster-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

planethoster

| <a href="https://apidoc.planethoster.com/fr\">Version Française ## Description The PlanetHoster API allows actions related to domain management and web hosting. ## Details - SSL only: we require that all requests be done over encrypted TLS/SSL connections. - Supported HTTP verbs are GET and POST. If your client does not support all HTTP verbs, you can override the verb with X-Http-Method-Override HTTP header. - Unless otherwise specified in the method documentation, all successful API calls return an HTTP code 200 with a JSON object. - Errors are returned with an HTTP code 4XX or 5XX, a JSON object with properties "error" (an error message) and an "error_code" (optional, an integer). - Every string passed to and from the API needs to be UTF-8 encoded. - The API sends ETag headers and supports the If-None-Match header. - Unless otherwise specified, all API methods require authentication with api_user and api_key. ## Authentication and whitelist 1. In order to be able to contact the API, you must whitelist your IPs. 2. API user and API key are required in the HTTP header. Whitelisted IP and credentials can be found in the <a href="https://my.planethoster.com/domain-reseller\" target="_blank">PlanetHoster Client Area / Reseller section.

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 2.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

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 planethoster 

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 planethoster

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import planethoster
from planethoster.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = planethoster.CMSApi(planethoster.ApiClient(configuration))
body = planethoster.UserTempdomainBody() # UserTempdomainBody | World account settings credentials.
x_api_user = NULL # object | API user provided in the client area.
x_api_key = NULL # object | API key provided in the client area.

try:
    # List of CMS available
    api_response = api_instance.cms_list_available(body, x_api_user, x_api_key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CMSApi->cms_list_available: %s\n" % e)

# create an instance of the API class
api_instance = planethoster.CMSApi(planethoster.ApiClient(configuration))
body = planethoster.UserTempdomainBody() # UserTempdomainBody | 
x_api_user = NULL # object | API user provided in the client area.
x_api_key = NULL # object | API key provided in the client area.

try:
    # List the installed CMS
    api_response = api_instance.cms_list_installed(body, x_api_user, x_api_key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CMSApi->cms_list_installed: %s\n" % e)

# create an instance of the API class
api_instance = planethoster.CMSApi(planethoster.ApiClient(configuration))
body = planethoster.CmsInstallationsprogressBody() # CmsInstallationsprogressBody | 
x_api_user = NULL # object | API user provided in the client area.
x_api_key = NULL # object | API key provided in the client area.

try:
    # List installation in progress
    api_response = api_instance.cms_list_progress(body, x_api_user, x_api_key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CMSApi->cms_list_progress: %s\n" % e)

# create an instance of the API class
api_instance = planethoster.CMSApi(planethoster.ApiClient(configuration))
body = planethoster.CmsDeleteBody() # CmsDeleteBody | 
x_api_user = NULL # object | API user provided in the client area.
x_api_key = NULL # object | API key provided in the client area.

try:
    # Delete a CMS installation
    api_response = api_instance.delete_cms(body, x_api_user, x_api_key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CMSApi->delete_cms: %s\n" % e)

# create an instance of the API class
api_instance = planethoster.CMSApi(planethoster.ApiClient(configuration))
body = planethoster.CmsInstallBody() # CmsInstallBody | World account settings credentials.
x_api_user = NULL # object | API user provided in the client area.
x_api_key = NULL # object | API key provided in the client area.

try:
    # Installing a CMS
    api_response = api_instance.install_cms(body, x_api_user, x_api_key)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CMSApi->install_cms: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.planethoster.net

Class Method HTTP request Description
CMSApi cms_list_available GET /n0c-api/cms/list-available List of CMS available
CMSApi cms_list_installed GET /n0c-api/cms/list-installed List the installed CMS
CMSApi cms_list_progress GET /n0c-api/cms/installations-progress List installation in progress
CMSApi delete_cms POST /n0c-api/cms/delete Delete a CMS installation
CMSApi install_cms POST /n0c-api/cms/install Installing a CMS
CronApi n0c_add_cron POST /n0c-api/cron/add Add
CronApi n0c_add_cron_email POST /n0c-api/cron/email/set Set email
CronApi n0c_get_cron GET /n0c-api/crons Crons
CronApi n0c_remove_cron POST /n0c-api/cron/remove Remove
CronApi n0c_remove_cron_email POST /n0c-api/cron/email/remove Remove email
DNSApi n0c_domain_edit_zone POST /n0c-api/dns/edit-zone Edit / add zone records
DNSApi n0c_domain_reset_zone POST /n0c-api/dns/reset-zone Zone create / reset to default value
DNSApi n0cdomain_get_zone GET /n0c-api/dns/get-records Get DNS zone
DatabaseApi n0c_create_database POST /n0c-api/database/add Add
DatabaseApi n0c_create_database_user POST /n0c-api/database/user/add Add user
DatabaseApi n0c_database_grant_permission POST /n0c-api/database/user/grant-access Grant permission
DatabaseApi n0c_database_remove_permission POST /n0c-api/database/user/remove-access Remove permission
DatabaseApi n0c_remove_database POST /n0c-api/database/remove Remove
DatabaseApi n0c_remove_database_user POST /n0c-api/database/user/remove Remove user
DatabaseApi n0c_users GET /n0c-api/database/users Users
DatabaseApi noc_databases GET /n0c-api/databases Databases
DomainApi n0c_add_domain POST /n0c-api/domain/add Add
DomainApi n0c_add_sub_domain POST /n0c-api/domain/add-sub-domain Add sub-domain
DomainApi n0c_change_doc_root POST /n0c-api/domain/change-doc-root Change doc-root
DomainApi n0c_delete_redirection POST /n0c-api/domain/delete-redirection Delete redirection
DomainApi n0c_domain_waf_logs GET /n0c-api/domain/waf-logs WAF logs
DomainApi n0c_domain_waf_rules GET /n0c-api/domain/waf-rules WAF rules
DomainApi n0c_domains GET /n0c-api/domains Domains
DomainApi n0c_redirections GET /n0c-api/domain/redirections Redirections
DomainApi n0c_remove_domain POST /n0c-api/domain/remove Remove
DomainApi n0c_set_external_redirection POST /n0c-api/domain/external-redirection External redirection
DomainApi n0c_set_rediction POST /n0c-api/domain/redirection Internal redirection
DomainApi n0c_suspend_domain POST /n0c-api/domain/suspend Suspend domains
DomainApi n0c_unsuspend_domain POST /n0c-api/domain/unsuspend Unsuspend domains
DomainApi n0c_update_waf_rules POST /n0c-api/domain/update-waf-rules Update waf rules
EmailApi n0c_add_email POST /n0c-api/email/add Add
EmailApi n0c_disable_auth POST /n0c-api/email/auth/disable Disable Authentication
EmailApi n0c_email_auth GET /n0c-api/email/auths Authentication
EmailApi n0c_email_change_password POST /n0c-api/email/change-password Change password
EmailApi n0c_email_change_quota POST /n0c-api/email/change-quota Change quota
EmailApi n0c_emails GET /n0c-api/emails Emails
EmailApi n0c_enable_auth POST /n0c-api/email/auth/enable Enable Authentication
EmailApi n0c_remove_email POST /n0c-api/email/remove Remove
EmailApi n0c_suspend_emails POST /n0c-api/email/suspend Suspend emails
EmailApi n0c_unsuspend_emails POST /n0c-api/email/unsuspend Unsuspend emails
FTPApi n0c_change_ftp_password POST /n0c-api/ftp-account/password Change password
FTPApi n0c_create_ftp POST /n0c-api/ftp-account/add Add
FTPApi n0c_ftp_update_path POST /n0c-api/ftp-account/update-path Update path
FTPApi n0c_get_ftp GET /n0c-api/ftp-accounts FTP accounts
FTPApi n0c_list_ftp_connections GET /n0c-api/ftp-account/active-connection List connections
FTPApi n0c_remove_ftp POST /n0c-api/ftp-account/remove Remove
ResellerAPIApi account_info GET /reseller-api/account-info Account info
ResellerAPIApi check_availability GET /reseller-api/check-availability Check domain availability
ResellerAPIApi delete_ph_dns_zone POST /reseller-api/delete-ph-dns-zone Delete zone
ResellerAPIApi domain_info GET /reseller-api/domain-info Domain information
ResellerAPIApi email_epp_code POST /reseller-api/email-epp-code Email epp code
ResellerAPIApi get_contact_details GET /reseller-api/get-contact-details Contact details
ResellerAPIApi get_nameservers GET /reseller-api/get-nameservers Get nameservers
ResellerAPIApi get_ph_dns_records GET /reseller-api/get-ph-dns-records Get dns records
ResellerAPIApi get_registrar_lock GET /reseller-api/get-registrar-lock Get registrar lock
ResellerAPIApi register_domain POST /reseller-api/register-domain Register domain
ResellerAPIApi renew_domain POST /reseller-api/renew-domain Renew domain
ResellerAPIApi save_contact_details POST /reseller-api/save-contact-details Save contact details
ResellerAPIApi save_namervers POST /reseller-api/save-nameservers Save nameservers
ResellerAPIApi save_ph_dns_records POST /reseller-api/save-ph-dns-records Save dns records
ResellerAPIApi save_registrar_lock POST /reseller-api/save-registrar-lock Save registrar lock
ResellerAPIApi test_connection GET /reseller-api/test-connection Tests the connection
ResellerAPIApi tld_prices GET /reseller-api/tld-prices Tld prices
ResellerAPIApi transfer_domain POST /reseller-api/transfert-domain Transfer domain
StatsApi n0c_apache_stats POST /n0c-api/stats/apache Stats apache
StatsApi n0c_apache_unique_stats POST /n0c-api/stats/apache/unique Stats apache (Unique Visitor)
StatsApi n0c_disk_usage GET /n0c-api/stats/disk-usage Disk usage
StatsApi n0c_stats_performance POST /n0c-api/stats/performance Performance
UserApi disable_n0c_temp_domain POST /n0c-api/user/disable-temp-domain Disable temporary domain
UserApi n0c_add_ssh_key POST /n0c-api/user/add-ssh-key Add SSH key
UserApi n0c_edit_ssh_key POST /n0c-api/user/edit-ssh-key Edit SSH key
UserApi n0c_remove_ssh_key POST /n0c-api/user/remove-ssh-key Remove SSH key
UserApi n0c_ssh_keys GET /n0c-api/user/ssh-keys SSH keys
UserApi n0c_temp_domain POST /n0c-api/user/temp-domain Temporary domain
WordpressApi n0c_get_wp GET /n0c-api/wordpress Get installed wordpress
WordpressApi n0c_wp_install POST /n0c-api/wordpress/add Wordpress installation
WordpressApi n0c_wp_remove POST /n0c-api/wordpress/remove Delete wordpress installation
WorldAPIApi create_account POST /world-api/create-account Create account
WorldAPIApi get_accounts GET /world-api/get-accounts Get accounts
WorldAPIApi modify_resources POST /world-api/modify-resources Modify resources
WorldAPIApi suspend_acccount POST /world-api/suspend-account Suspend account
WorldAPIApi unsuspend_account POST /world-api/unsuspend-account Unsuspend account

Documentation For Models

Documentation For Authorization

api_key

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

api_sandbox

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

api_user

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

Author

tech@support.planethoster.info

About


Languages

Language:Python 99.9%Language:Shell 0.1%