Beispiel #1
0
 /**
  * Create a new instance
  *
  * @param string $name
  * @param array $options
  * @return Instance|boolean
  */
 public function createInstance($name, $options)
 {
     // @todo instance's name management?
     $this->adapterResult = $this->ec2->run($options);
     if (empty($this->adapterResult['instances'])) {
         return false;
     }
     $this->error = false;
     return new Instance($this, $this->convertAttributes($this->adapterResult['instances'][0]));
 }
Beispiel #2
0
 /**
  * Create a new instance
  *
  * @param string $name
  * @param array $options
  * @return Instance|boolean
  */
 public function createInstance($name, $options)
 {
     $this->resetError();
     try {
         $this->adapterResult = $this->ec2->run($options);
     } catch (Ec2Exception\RunTimeException $e) {
         $this->setError($e);
         return false;
     }
     return new Instance($this, $this->convertAttributes($this->adapterResult['instances'][0]));
 }