Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class SolusVm extends VPSModule {
- protected $modname = "SolusVM";
- protected $description = "SolusVM provisioning module";
- protected $version = "1.11.8";
- protected $serverFieldsDescription = array("username" => "API ID", "password" => "API Key", "field2" => "User prefix");
- protected $serverFields = array("hostname" => false, "ip" => true, "maxaccounts" => false, "status_url" => false, "username" => true, "password" => true, "hash" => false, "ssl" => false, "nameservers" => false, "field2" => true);
- protected $options = array("option1" => array("name" => "type", "value" => false, "default" => array(0 => "OpenVZ", 1 => "Xen PV", 2 => "Xen HVM", 3 => "KVM")), "option2" => array("name" => "node", "value" => false, "variable" => "node"), "option22" => array("name" => "details", "value" => false), "option3" => array("name" => "ips", "value" => false, "type" => "input", "variable" => "ip_address"), "ipsv6" => array("name" => "ipsv6", "value" => false, "type" => "input", "variable" => "ipsv6"), "option4" => array("name" => "template", "value" => false, "variable" => "os"), "option5" => array("name" => "plan", "value" => false), "option6" => array("name" => "memory", "value" => false, "variable" => "memory"), "option10" => array("name" => "burst", "value" => false, "variable" => "burstmem"), "option7" => array("name" => "diskspace", "value" => false, "variable" => "disk_size"), "option8" => array("name" => "bandwidth", "value" => false, "variable" => "bandwidth"), "option9" => array("name" => "cpu", "value" => 1, "variable" => "cpu_cores"), "type" => array("value" => "single"), "nodegroup" => array("value" => false, "variable" => "nodegroup"), "mediagroup" => array("value" => false, "variable" => "mediagroup"), "allowedvpstypes" => array("value" => false), "maxallowed" => array("value" => 1, "variable" => "vpslimit"));
- private $formmap = array("option3" => "ipaddresses", "option10" => "burst", "option7" => "disk_size", "option8" => "bandwidth", "option9" => "cpu");
- protected $details = array("option4" => array("name" => "domain", "value" => false, "type" => "input", "default" => false), "option1" => array("name" => "username", "value" => false, "type" => "input", "default" => false), "option2" => array("name" => "password", "value" => false, "type" => "input", "default" => false), "option5" => array("name" => "rootpassword", "value" => false, "type" => "input", "default" => false), "option6" => array("name" => "VPS ID", "value" => false, "type" => "input", "default" => false), "option10" => array("name" => "Node", "value" => false, "type" => "input", "default" => false));
- protected $cache = array();
- protected $extra = array();
- protected $import_type = "2";
- public function connect($connect) {
- $this->user_id = $connect["username"];
- $this->user_key = $connect["password"];
- $this->url = "https://" . $connect["ip"] . ":5656";
- require_once HBFDIR_LIBS . "resty" . DS . "class.resty.php";
- $this->api = new Resty();
- $this->api->setBaseURL($this->url);
- $this->api->useCurl(true);
- $this->api->parseBody(false);
- $this->connection = $connect;
- return;
- }
- public function Install() {
- $this->db->exec("CREATE TABLE IF NOT EXISTS `hb_vpscloud_details` (
- `account_id` INT(11) NOT NULL,
- `veid` VARCHAR(64) NOT NULL,
- `name` TEXT NOT NULL,
- `rootpassword` TEXT NOT NULL,
- `type` ENUM('Xen','Xen HVM','OpenVZ','KVM','Virtuozzo','Other') NOT NULL,
- `ip` VARCHAR(40) NOT NULL,
- `additional_ip` TEXT NOT NULL,
- `guaranteed_ram` INT(3) NOT NULL,
- `burstable_ram` INT(3) NOT NULL,
- `disk_usage` INT(11) NOT NULL,
- `disk_limit` INT(11) NOT NULL,
- `bw_usage` INT(11) NOT NULL,
- `bw_limit` INT(11) NOT NULL,
- `os` TEXT NOT NULL,
- `node` VARCHAR(32) NOT NULL,
- `extra` TEXT NOT NULL,
- PRIMARY KEY (`account_id`, `veid`)
- )ENGINE=InnoDB DEFAULT CHARSET=utf8;");
- return;
- }
- .........................................................
- ............................
- ...............
Advertisement
Add Comment
Please, Sign In to add comment