Scalr\Api\Service\User\V1beta0\Controller\Images::getImageByCloudId PHP Method

getImageByCloudId() public method

Checks whether Image does exist in the user's scope
public getImageByCloudId ( string $cloudImageId, string $platform, string $cloudLocation ) : boolean
$cloudImageId string The identifier of the image on the Cloud
$platform string The cloud platform
$cloudLocation string The cloud location
return boolean Returns TRUE if image exists in the user's scope
    public function getImageByCloudId($cloudImageId, $platform, $cloudLocation)
    {
        $criteria = array_merge($this->getDefaultCriteria(), [['id' => $cloudImageId], ['platform' => $platform], ['cloudLocation' => $cloudLocation]]);
        $image = Entity\Image::findOne($criteria);
        if (!$image) {
            throw new ApiErrorException(404, ErrorMessage::ERR_OBJECT_NOT_FOUND, "Requested Image either does not exist or is not owned by your environment.");
        }
        return $image;
    }