-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sort_key and sort_dir parameters for BlockStorage/v2/listSnapshot…
…s and Images/v2/listImages
- Loading branch information
Showing
8 changed files
with
207 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,24 @@ | ||
Snapshots | ||
========= | ||
|
||
List volumes | ||
------------ | ||
|
||
.. sample:: BlockStorage/v2/snapshots/list.php | ||
.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_listSnapshots | ||
|
||
Each iteration will return a php:class:`Snapshot` instance <OpenStack/BlockStorage/v2/Models/Snapshot.html>. | ||
|
||
.. include:: /common/generators.rst | ||
|
||
List volumes sorted | ||
~~~~~~~~~~~~~~~~~~~ | ||
|
||
Possible values for sort_key are: | ||
* display_name | ||
|
||
Possible values for sort_dir are: | ||
* asc | ||
* desc | ||
|
||
.. sample:: BlockStorage/v2/snapshots/list_sorted.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
$openstack = new OpenStack\OpenStack([ | ||
'authUrl' => '{authUrl}', | ||
'region' => '{region}', | ||
'user' => ['id' => '{userId}', 'password' => '{password}'], | ||
'scope' => ['project' => ['id' => '{projectId}']] | ||
]); | ||
|
||
$service = $openstack->blockStorageV2(); | ||
|
||
$snapshots = $service->listSnapshots(false, ['sortKey' => '{sortKey}', 'sortDir' => '{sortDir}']); | ||
|
||
foreach ($snapshots as $snapshot) { | ||
/** @var $snapshot \OpenStack\BlockStorage\v2\Models\Snapshot */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ | |
->listImages(); | ||
|
||
foreach ($images as $image) { | ||
/** @var \OpenStack\Images\v2\Models\Image $image */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
$openstack = new OpenStack\OpenStack([ | ||
'authUrl' => '{authUrl}', | ||
'region' => '{region}', | ||
'user' => ['id' => '{userId}', 'password' => '{password}'], | ||
'scope' => ['project' => ['id' => '{projectId}']] | ||
]); | ||
|
||
$images = $openstack->imagesV2()->listImages(['sortKey' => '{sortKey}', 'sortDir' => '{sortDir}']); | ||
|
||
foreach ($images as $image) { | ||
/** @var \OpenStack\Images\v2\Models\Image $image */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters