Scalr\Modules\Platforms\GoogleCE\GoogleCEPlatformModule::RemoveServerSnapshot PHP 메소드

RemoveServerSnapshot() 공개 메소드

또한 보기: Scalr\Modules\PlatformModuleInterface::RemoveServerSnapshot()
public RemoveServerSnapshot ( Image $image )
$image Scalr\Model\Entity\Image
    public function RemoveServerSnapshot(Image $image)
    {
        if (!$image->getEnvironment()) {
            return true;
        }
        $gce = $this->getClient($image->getEnvironment());
        try {
            $projectId = $image->getEnvironment()->keychain(SERVER_PLATFORMS::GCE)->properties[Entity\CloudCredentialsProperty::GCE_PROJECT_ID];
            $imageId = str_replace("{$projectId}/images/", "", $image->id);
            $gce->images->delete($projectId, $imageId);
        } catch (Exception $e) {
            if (stristr($e->getMessage(), "was not found")) {
                return true;
            } else {
                throw $e;
            }
        }
        return true;
    }