Пример #1
0
 /**
  * Convenient constructor
  *
  * @param   string|array        $name         optional The one or more name of the port
  * @param   string|array        $id           optional The one or more ID of the port
  * @param   string|array        $networkid    optional The one or more ID of the network
  * @param   string              $marker       optional A marker.
  * @param   int                 $limit        optional Limit.
  */
 public function __construct($name = null, $id = null, $networkId = null, $marker = null, $limit = null)
 {
     parent::__construct($marker, $limit);
     $this->setName($name);
     $this->setId($id);
     $this->setNetworkId($networkId);
 }
Пример #2
0
 /**
  * Convenient constructor
  *
  * @param   string|array        $name         optional The one or more name of the router
  * @param   string|array        $id           optional The one or more ID of the router
  * @param   string|array        $status       optional The one or more status of the router
  * @param   string              $marker       optional A marker.
  * @param   int                 $limit        optional Limit.
  */
 public function __construct($name = null, $id = null, $status = null, $marker = null, $limit = null)
 {
     parent::__construct($marker, $limit);
     $this->setName($name);
     $this->setId($id);
     $this->setStatus($status);
 }
Пример #3
0
 /**
  * Convenient constructor
  *
  * @param   string|array            $name         optional The one or more name of the network
  * @param   NetworkStatusType|array $status       optional The one or more status of the Network
  * @param   bool                    $adminStateUp optional The admin state
  * @param   bool                    $shared       optional The shared flag
  * @param   string|array            $id           optional The one or more ID of the network
  * @param   string                  $marker       optional A marker.
  * @param   int                     $limit        optional Limit.
  */
 public function __construct($name = null, $status = null, $adminStateUp = null, $shared = null, $id = null, $marker = null, $limit = null)
 {
     parent::__construct($marker, $limit);
     $this->setName($name);
     $this->setStatus($status);
     $this->setId($id);
     $this->setShared($shared);
     $this->setAdminStateUp($adminStateUp);
 }
Пример #4
0
 /**
  * @test
  */
 public function testInit()
 {
     $m = Marker::init()->setMarker('10')->setLimit(20);
     $this->assertEquals('10', $m->getMarker());
     $this->assertEquals(20, $m->getLimit());
     unset($m);
     $m = Marker::init(10, '20');
     $this->assertEquals('10', $m->getMarker());
     $this->assertEquals(20, $m->getLimit());
     unset($m);
 }
Пример #5
0
 /**
  * Convenient constructor
  *
  * @param   string|array        $id           optional The one or more ID
  * @param   string              $marker       optional A marker.
  * @param   int                 $limit        optional Limit.
  */
 public function __construct($id = null, $marker = null, $limit = null)
 {
     parent::__construct($marker, $limit);
     $this->setId($id);
 }
Пример #6
0
 /**
  * List tenants action
  *
  * @param   Marker $marker  Marker Data.
  * @return  array  Return tenants list
  */
 public function listTenants(Marker $marker = null)
 {
     $result = null;
     if ($marker !== null) {
         $options = $marker->getQueryData();
     } else {
         $options = array();
     }
     $response = $this->getClient()->call($this->config->getIdentityEndpoint(), '/tenants', $options);
     if ($response->hasError() === false) {
         $result = json_decode($response->getContent());
         $result = $result->tenants;
     }
     return $result;
 }
Пример #7
0
 /**
  * {@inheritdoc}
  * @see Scalr\Service\OpenStack\Type.Marker::getQueryData()
  */
 public function getQueryData()
 {
     $options = parent::getQueryData();
     if ($this->getChangesSince() !== null) {
         $options['changes-since'] = $this->getChangesSince()->format('c');
     }
     if ($this->getServerId() !== null) {
         $options['server'] = (string) $this->getServerId();
     }
     if ($this->getName() !== null) {
         $options['name'] = (string) $this->getName();
     }
     if ($this->getStatus() !== null) {
         $options['status'] = (string) $this->getStatus();
     }
     if ($this->getType() !== null) {
         $options['type'] = (string) $this->getType();
     }
     return $options;
 }
Пример #8
0
 /**
  * {@inheritdoc}
  * @see Scalr\Service\OpenStack\Type.Marker::getQueryString()
  */
 public function getQueryString()
 {
     $str = parent::getQueryString();
     $str .= $this->_getQueryStringForFields(array('name', 'id', 'status'), __CLASS__);
     return ltrim($str, '&');
 }
Пример #9
0
 /**
  * Gets query data array
  *
  * @return array Returns query data array
  */
 public function getQueryData()
 {
     $options = parent::getQueryData();
     if ($this->getChangesSince() !== null) {
         unset($options['changes_since']);
         $options['changes-since'] = $this->getChangesSince()->format('c');
     }
     return $options;
 }