API References
Main Interface
- class cherryservers_sdk_python.facade.CherryApiFacade(token: str, user_agent_prefix: str = '', request_timeout: int = 120)[source]
Cherry Servers API Python facade.
This is the preferred way of managing Cherry Servers resources with the SDK. For Cherry Servers API reference, see https://api.cherryservers.com/doc/.
- users
Manage user resources.
- Type:
- sshkeys
Manage SSH key resources.
- Type:
- projects
Manage project resources.
- Type:
- regions
Manage region resources.
- Type:
- ips
Manage IP resources.
- Type:
- teams
Manage team resources.
- Type:
- plans
Manage plan resources.
- Type:
- images
Manage image resources.
- Type:
- servers
Manage server resources.
- Type:
- block_storages
Manage EBS resources.
- backup_storages
Manage backup storage resources.
- __init__(token: str, user_agent_prefix: str = '', request_timeout: int = 120) None[source]
Create a new
CherryApiFacadeinstance.- Parameters:
token (str) – Cherry Servers API token. Can be created at https://portal.cherryservers.com/settings/api-keys.
user_agent_prefix (str) – User-Agent prefix that will be added to the header. Empty by default.
request_timeout (int) – Default timeout for API requests, in seconds.
Example
# Instantiate the facade. token = environ["CHERRY_AUTH_TOKEN"] facade = cherryservers_sdk_python.facade.CherryApiFacade(token) # Order a VPS. creation_req = (cherryservers_sdk_python.servers. CreationRequest(region="LT-Siauliai", plan="B1-1-1gb-20s-shared")) server = facade.servers.create(creation_req, project_id=217727)