public function getVersions() { $res = $this->getClient()->get($this->getUri()); $v = new Version(); $collection = new ResourceCollection(); $collection->fill($v, $res->getJson()->versions->values); return $collection; }
/** * オブジェクトストレージの使用容量を取得する。単位は byte。 * * @api * @link https://www.conoha.jp/docs/account-get_objectstorage_size_rrd.html * * @param \DateTime $start_date_raw (Optional)データ取得開始時間 * @param \DateTime $end_date_raw (Optional)データ取得終了時間 * @param string $mode (Optional)データ統合方法(average,max,min) * @return \ConoHa\Account\Resource\Notification */ public function objectStorageRrdSize($start_date_raw = null, $end_date_raw = null, $mode = 'average') { $query = []; if ($start_date_raw instanceof \DateTime) { $query['start_date_raw'] = $start_date_raw->format('U'); } if ($end_date_raw instanceof \DateTime) { $query['end_date_raw'] = $end_date_raw->format('U'); } switch ($mode) { case 'average': case 'max': case 'min': $query = ['mode' => $mode]; break; default: throw new \InvalidArgumentException('Invalid mode.'); } $res = $this->getClient()->get($this->getUri('object-storage/rrd/size', $query)); $col = new ResourceCollection(); $item = new ObjectStorageSize(); $col->fill($item, $res->getJson()->size->data); return $col; }