Scalr\Service\Aws\Ec2\V20140615\Ec2Api::createImage PHP Method

createImage() public method

Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped. Note! If you customized your instance with instance store volumes or EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes.
public createImage ( Scalr\Service\Aws\Ec2\DataType\CreateImageRequestData $request ) : string
$request Scalr\Service\Aws\Ec2\DataType\CreateImageRequestData Request object
return string Returns ID of the created image on success
    public function createImage(CreateImageRequestData $request)
    {
        $result = null;
        $options = $request->getQueryArrayBare();
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            $result = (string) $sxml->imageId;
        }
        return $result;
    }
Ec2Api