/** * 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); }
/** * 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); }
/** * 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); }
/** * @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); }
/** * 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); }
/** * 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; }
/** * {@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; }
/** * {@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, '&'); }
/** * 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; }