/** * 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::getQueryData() */ public function getQueryData() { $options = parent::getQueryData(); if (!empty($this->name)) { $options['name'] = $this->getName(); } if (!empty($this->id)) { $options['id'] = $this->getId(); } if (!empty($this->status)) { $options['status'] = $this->getStatus(); } return $options; }
/** * 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; }
/** * {@inheritdoc} * @see Scalr\Service\OpenStack\Type.Marker::getQueryData() */ public function getQueryData() { $options = parent::getQueryData(); if (!empty($this->name)) { $options['name'] = $this->getName(); } if (!empty($this->status)) { $options['status'] = $this->getStatus(); } if (!empty($this->id)) { $options['id'] = $this->getId(); } if ($this->adminStateUp !== null) { $options['admin_state_up'] = (string) $this->getAdminStateUp(); } if ($this->shared !== null) { $options['shared'] = (string) $this->getShared(); } return $options; }
/** * {@inheritdoc} * @see Scalr\Service\OpenStack\Type.Marker::getQueryData() */ public function getQueryData() { $options = parent::getQueryData(); if (!empty($this->name)) { $options['name'] = $this->getName(); } if (!empty($this->id)) { $options['id'] = $this->getId(); } if (!empty($this->networkId)) { $options['network_id'] = $this->getNetworkId(); } return $options; }