diff --git a/frontend/classes/class.container.php b/frontend/classes/class.container.php index c188b95..5e89f95 100644 --- a/frontend/classes/class.container.php +++ b/frontend/classes/class.container.php @@ -15,7 +15,30 @@ if(!isset($_CVM)) { die("Unauthorized."); } class Container extends CPHPDatabaseRecordClass { + public $table_name = "containers"; + public $fill_query = "SELECT * FROM containers WHERE `Id` = '%d'"; + public $verify_query = "SELECT * FROM containers WHERE `Id` = '%d'"; + public $prototype = array( + 'string' => array( + 'Hostname' => "Hostname", + 'InternalId' => "InternalId" + ), + 'numeric' => array( + 'NodeId' => "NodeId", + 'TemplateId' => "TemplateId" + 'VirtualizationType' => "VirtualizationType", + 'DiskSpace' => "DiskSpace", + 'GuaranteedRam' => "GuaranteedRam", + 'BurstableRam' => "BurstableRam" + ), + 'node' => array( + 'Node' => "NodeId" + ), + 'template' => array( + 'Template' => "TemplateId" + ) + ); } ?> diff --git a/frontend/test.php b/frontend/test.php index 8bbf2a2..8cb4577 100644 --- a/frontend/test.php +++ b/frontend/test.php @@ -13,6 +13,6 @@ $settings['master_privkey'] = "/etc/cvm/key"; $settings['master_pubkey'] = "/etc/cvm/key.pub"; $sNode = new Node(1); -var_dump($sNode->sDiskFree, $sNode->sDiskUsed); +var_dump($sNode->sDiskFree, $sNode->sDiskUsed, $sNode->sRealHostname); ?>