public function RemoveServerSnapshot(DBRole $DBRole) { foreach ($DBRole->getImageId(SERVER_PLATFORMS::EC2) as $location => $imageId) { $RDSClient = $this->getRdsClient($DBRole->GetEnvironmentObject(), $location); $RDSClient->DeleteDBSnapshot($imageId); } return true; }
public function RemoveServerSnapshot(DBRole $DBRole) { foreach ($DBRole->getImageId(SERVER_PLATFORMS::GCE) as $location => $imageId) { $gce = $this->getClient($DBRole->GetEnvironmentObject(), $location); try { $projectId = $DBRole->GetEnvironmentObject()->getPlatformConfigValue(self::PROJECT_ID); $imageId = str_replace("{$projectId}/images/", "", $imageId); $gce->images->delete($projectId, $imageId); } catch (Exception $e) { if (stristr($e->getMessage(), "was not found")) { return true; } else { throw $e; } } } return true; }