Container class

feature/node-rewrite
Sven Slootweg 13 years ago
parent bd62849ed2
commit 91cb3335e8

@ -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"
)
);
}
?>

@ -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);
?>

Loading…
Cancel
Save