| The Cube Panel´s API 2.2 Reference Guide: Accessing Cube Panel's WebServices | ||
|---|---|---|
| Prev | Chapter 1. Introduction | Next |
Cube Panel's WebServices´s API access library. Download here.
Cube Panel's API access library also includes following libraries that are needed to access Web Services:
This class provides access to Cube Panel servers and configures connection: Constructor has following definition:
WSAccess access = new WSAccess(user_name, password, wsdl_url, endpoint, id_language)
user_name : username with the maximum privileges with which the WebServices will be accessed
password : user password
wsdl_url : URL of the WSDL file that describe Cube Panel server web services. Its recommended to save a copy of the file in the client machine that is calling webservices. It can be gotten from the URL https://cubepanelhost:25112/modules/cubeservices.php?wsdl (you must authenticate as "admin" user)
endpoint : URL of the end point to access Cube Panel web services (https://cubepanelhost:25112/modules/cubeservices.php)
id_language : Language id id_language : desired Language ID for the WebServices responses
Once a WSAccess class request is obtained, a CubePanelWSBindingStub object is needed. WSAccess class provides a method to get a CubePanelWSBindingStub instance:
WSAccess a = new WSAccess("admin", "123456",
"file:///C:/cubeservices/cubeservices.wsdl", "https://127.0.0.1:25112/modules/cubeservices.php",
WSAccess.CUBE_PANEL_LANG_ENGLISH);
CubePanelWSBindingStub bs = a.getUser("admin");
ClientInfo clients[] = bs.ADMINCLIENTS_GetClients(null, null, null);
The param that is passed to getUser method is the name of the user who is going to be used to make the call.
WSAccess class has defined also following methods:
void setTimeOut(int seconds) : defines the timeout to connect to Cube Panel server (in seconds).
Date UnixTimestamp2Date(int timestamp) : converts a unix time stamp to a Date object.
These are the constants defined in WSAccess class:
CUBE_PANEL_LANG_SPANISH : Spanish language identifier.
CUBE_PANEL_LANG_ENGLISH : English language identifier.
CUBE_PANEL_LANG_GERMAN : German language identifier.
CUBE_PANEL_LANG_FRENCH : French language identifier.
CUBE_PANEL_LANG_PORTUGUESE : Portuguese language identifier.
CUBE_PANEL_ORDER_ASC : Identifier to get results in ascendant order.
CUBE_PANEL_ORDER_DESC : Identifier to get results in descendant order.
CUBE_PANEL_CURRENCY_EUR : Euro currency identifier.
CUBE_PANEL_CURRENCY_USD : US dollar currency indentifier.
CUBE_PANEL_DNS_RECORD_TYPE_A : DNS "A" entry identifier.
CUBE_PANEL_DNS_RECORD_TYPE_CNAME : DNS "CNAME" entry identifier.
CUBE_PANEL_DNS_RECORD_TYPE_NS : DNS "NS" entry identifier.
CUBE_PANEL_DNS_RECORD_TYPE_MX10 : DNS "MX10" entry identifier.
CUBE_PANEL_DNS_RECORD_TYPE_MX20 : DNS "MX20" entry identifier.
CUBE_PANEL_FTP_QUOTA_UNLIMITED : Unlimited quota for FTP identifier.
CUBE_PANEL_FTP_READ_ONLY : Read only identifier for FTP accounts.
CUBE_PANEL_FTP_READ_WRITE : Read/Write identifier for FTP accounts.
CUBE_PANEL_RESOURCE_TRAFFIC : Identificador del recurso "Tráfico".
CUBE_PANEL_RESOURCE_ACTIVE_DOMAINS : "Active domains" resource identifier.
CUBE_PANEL_RESOURCE_MAILBOXES : "Mail boxes" resource identifier.
CUBE_PANEL_RESOURCE_MAILALIASES : "Mail aliases" resource identifier.
CUBE_PANEL_RESOURCE_MYSQL_DBS : "MySQL databases" resource identifier.
CUBE_PANEL_RESOURCE_FTP_ACCOUNTS : "FTP accounts" resource identifier.
CUBE_PANEL_RESOURCE_INBOUND_TRAFFIC : "Inbound traffic" resource identifier.
CUBE_PANEL_RESOURCE_OUTBOUND_TRAFFIC : "Outbound traffic" resource identifier.
CUBE_PANEL_RESOURCE_DISK_USAGE : "Disk usage" resource identifier.
CUBE_PANEL_RESOURCE_SQL_SERVER_DBS : "SQL databases" resource identifier.
CUBE_PANEL_RESOURCE_ACTIVE_CLIENTS : "Active clients" resource identifier.
CUBE_PANEL_RESOURCE_CLIENTS : "Clients created" resource identifier.