Exemplo n.º 1
0
Arquivo: Ips.php Projeto: recipe/scalr
 public function viewAction()
 {
     if ($this->getParam('platform')) {
         $locations = self::loadController('Platforms')->getCloudLocations(array($this->getParam('platform')), false);
     } else {
         $locations = self::loadController('Platforms')->getCloudLocations(PlatformFactory::getOpenstackBasedPlatforms(), false);
     }
     $this->response->page('ui/tools/openstack/ips/view.js', array('locations' => $locations));
 }
Exemplo n.º 2
0
 public function RemoveServerSnapshot(DBRole $DBRole)
 {
     foreach (PlatformFactory::getOpenstackBasedPlatforms() as $platform) {
         foreach ($DBRole->getImageId($platform) as $location => $imageId) {
             try {
                 $osClient = $DBRole->getEnvironmentObject()->openstack($platform, $location);
                 $osClient->servers->images->delete($imageId);
             } catch (Exception $e) {
                 if (stristr($e->getMessage(), "Unavailable service \"compute\" or region") || stristr($e->getMessage(), "Image not found") || stristr($e->getMessage(), "Cannot destroy a destroyed snapshot") || stristr($e->getMessage(), "OpenStack error. Could not find user")) {
                     //DO NOTHING
                 } else {
                     throw $e;
                 }
             }
         }
     }
     return true;
 }