Good afternoon,
maybe will be interested for somebody, just add a new API call for scalr:
public function DNSZoneUpdate($ZoneName, $FarmID = null, $FarmRoleID =
null)
{
$this->restrictAccess(Acl::RESOURCE_DNS_ZONES);
$zoneinfo = $this->DB->GetRow("SELECT id, env_id,
allow_manage_system_records FROM dns_zones WHERE zone_name=? LIMIT 1",
array($ZoneName));
if (!$zoneinfo || $zoneinfo['env_id'] != $this->Environment->id)
throw new Exception (sprintf("Zone '%s' not found in database",
$ZoneName));
if ($FarmID) {
$DBFarm = DBFarm::LoadByID($FarmID);
if ($DBFarm->EnvID != $this->Environment->id)
throw new Exception(sprintf("Farm #%s not found", $FarmID));
$this->user->getPermissions()->validate($DBFarm);
}
if ($FarmRoleID) {
$DBFarmRole = DBFarmRole::LoadByID($FarmRoleID);
if ($DBFarm->ID != $DBFarmRole->FarmID)
throw new Exception(sprintf("FarmRole #%s not found on Farm
#%s", $FarmRoleID, $FarmID));
}
$response = $this->CreateInitialResponse();
$DBDNSZone = DBDNSZone::loadById($zoneinfo['id']);
$DBDNSZone->farmRoleId = (int)$FarmRoleID;
$DBDNSZone->farmId = (int)$FarmID;
$DBDNSZone->clientId = $this->user->getAccountId();
$DBDNSZone->envId = $this->Environment->id;
$DBDNSZone->save(true);
$response->Result = 1;
return $response;
}
--
You received this message because you are subscribed to the Google Groups
"scalr-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.