Scalr_UI_Controller_Images::xEc2MigrateAction PHP 메소드

xEc2MigrateAction() 공개 메소드

public xEc2MigrateAction ( string $id, string $cloudLocation, string $destinationRegion )
$id string
$cloudLocation string
$destinationRegion string
    public function xEc2MigrateAction($id, $cloudLocation, $destinationRegion)
    {
        $this->request->restrictAccess(Acl::RESOURCE_IMAGES_ENVIRONMENT, Acl::PERM_IMAGES_ENVIRONMENT_MANAGE);
        /* @var $image Image */
        $image = Image::findOne([['platform' => SERVER_PLATFORMS::EC2], ['id' => $id], ['cloudLocation' => $cloudLocation], ['envId' => $this->getEnvironmentId()]]);
        if (!$image) {
            throw new Exception('Image not found');
        }
        $this->request->checkPermissions($image, true);
        $newImage = $image->migrateEc2Location($destinationRegion, $this->request->getUser());
        $this->response->data(['hash' => $newImage->hash]);
        $this->response->success('Image successfully migrated');
    }