Exemple #1
0
 /**
  * Return the status of an instance
  *
  * @param  string
  * @return string|boolean
  */ 
 public function statusInstance($id)
 {
     $this->adapterResult = $this->rackspace->getServer($id);
     if ($this->adapterResult===false) {
         return false;
     }
     $array= $this->adapterResult->toArray();
     return $this->mapStatus[$array['status']];
 }
Exemple #2
0
 /**
  * Get the server 
  * 
  * @param integer $id
  * @return Zend\Service\Rackspace\Servers\Server|boolean
  */
 public function getServer($id)
 {
     if (empty($this->serversId)) {
         $this->getServersId();
     }
     if (in_array($id,$this->serversId)) {
         return $this->service->getServer($id);
     }
     return false;
 }
Exemple #3
0
 /**
  * Get the progress's status
  *
  * @return integer|boolean
  */
 public function getProgress()
 {
     $data = $this->service->getServer($this->id);
     if ($data !== false) {
         $data = $data->toArray();
         $this->progress = $data['progress'];
         return $this->progress;
     }
     return false;
 }
Exemple #4
0
 /**
  * Test Get Server
  */
 public function testGetServer()
 {
     $server = $this->rackspace->getServer(self::$serverId);
     $this->assertTrue($server !== false);
     $this->assertEquals(TESTS_ZEND_SERVICE_RACKSPACE_SERVER_NAME, $server->getName());
 }