Пример #1
0
 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;
 }
Пример #2
0
 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;
 }