示例#1
0
 /**
  * Returns a Collection of server objects, filtered by the specified
  * parameters
  *
  * This is a factory method and should normally be called instead of
  * creating a ServerList object directly.
  *
  * @api
  * @param boolean $details - if TRUE, full server details are returned; if
  *                         FALSE, just the minimal set of info is listed. Defaults to TRUE;
  *                         you might set this to FALSE to improve performance at the risk of
  *                         not having all the information you need.
  * @param array   $filter  - a set of key/value pairs that is passed to the
  *                         servers list for filtering
  * @returns \OpenCloud\Common\Collection
  */
 public function serverList($details = true, array $filter = array())
 {
     $url = $this->getUrl(Resource\Server::resourceName() . ($details ? '/detail' : ''), $filter);
     return $this->collection('OpenCloud\\Compute\\Resource\\Server', $url);
 }
示例#2
0
 /**
  * returns a Collection of PTR records for a given Server
  *
  * @param \OpenCloud\Compute\Resource\Server $server the server for which to
  *      retrieve the PTR records
  * @return \OpenCloud\Common\Collection
  */
 public function ptrRecordList(Server $server)
 {
     $url = $this->getUrl()->addPath('rdns')->addPath($server->getService()->name())->setQuery(array('href' => $server->url()));
     return $this->collection('OpenCloud\\DNS\\Resource\\PtrRecord', $url);
 }
示例#3
0
 /**
  * @expectedException \OpenCloud\Common\Exceptions\ServerActionError
  */
 public function test_Unrescue()
 {
     $resp = $this->server->Unrescue();
     $this->assertEquals(200, $resp->getStatusCode());
     $blank = new Server($this->service);
     $blank->unrescue();
     // should trigger the exception
 }
示例#4
0
文件: Service.php 项目: huhugon/sso
 /**
  * returns a Collection of PTR records for a given Server
  *
  * @param \OpenCloud\Compute\Server $server the server for which to
  *      retrieve the PTR records
  * @return Collection
  */
 public function ptrRecordList(Server $server)
 {
     $url = $this->url('rdns/' . $server->getService()->name(), array('href' => $server->url()));
     return $this->collection('OpenCloud\\DNS\\Resource\\PtrRecord', $url);
 }