Guest User

Untitled

a guest
Jun 11th, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.09 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. class SolusVm extends VPSModule {
  5.  
  6. protected $modname = "SolusVM";
  7. protected $description = "SolusVM provisioning module";
  8. protected $version = "1.11.8";
  9. protected $serverFieldsDescription = array("username" => "API ID", "password" => "API Key", "field2" => "User prefix");
  10. protected $serverFields = array("hostname" => false, "ip" => true, "maxaccounts" => false, "status_url" => false, "username" => true, "password" => true, "hash" => false, "ssl" => false, "nameservers" => false, "field2" => true);
  11. 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"));
  12. private $formmap = array("option3" => "ipaddresses", "option10" => "burst", "option7" => "disk_size", "option8" => "bandwidth", "option9" => "cpu");
  13. 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));
  14. protected $cache = array();
  15. protected $extra = array();
  16. protected $import_type = "2";
  17. public function connect($connect) {
  18.  
  19. $this->user_id = $connect["username"];
  20. $this->user_key = $connect["password"];
  21. $this->url = "https://" . $connect["ip"] . ":5656";
  22. require_once HBFDIR_LIBS . "resty" . DS . "class.resty.php";
  23. $this->api = new Resty();
  24. $this->api->setBaseURL($this->url);
  25. $this->api->useCurl(true);
  26. $this->api->parseBody(false);
  27. $this->connection = $connect;
  28. return;
  29. }
  30.  
  31. public function Install() {
  32.  
  33. $this->db->exec("CREATE TABLE IF NOT EXISTS `hb_vpscloud_details` (
  34. `account_id` INT(11) NOT NULL,
  35. `veid` VARCHAR(64) NOT NULL,
  36. `name` TEXT NOT NULL,
  37. `rootpassword` TEXT NOT NULL,
  38. `type` ENUM('Xen','Xen HVM','OpenVZ','KVM','Virtuozzo','Other') NOT NULL,
  39. `ip` VARCHAR(40) NOT NULL,
  40. `additional_ip` TEXT NOT NULL,
  41. `guaranteed_ram` INT(3) NOT NULL,
  42. `burstable_ram` INT(3) NOT NULL,
  43. `disk_usage` INT(11) NOT NULL,
  44. `disk_limit` INT(11) NOT NULL,
  45. `bw_usage` INT(11) NOT NULL,
  46. `bw_limit` INT(11) NOT NULL,
  47. `os` TEXT NOT NULL,
  48. `node` VARCHAR(32) NOT NULL,
  49. `extra` TEXT NOT NULL,
  50. PRIMARY KEY (`account_id`, `veid`)
  51. )ENGINE=InnoDB DEFAULT CHARSET=utf8;");
  52. return;
  53. }
  54. .........................................................
  55. ............................
  56. ...............
Advertisement
Add Comment
Please, Sign In to add comment