-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
175 additions
and
197 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
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,12 @@ | ||
Create Service | ||
============== | ||
|
||
In order to work with the service you have to :doc:`setup the client </setup>` first. | ||
|
||
Service can be created via ``blockStorageV3()`` method of the ``OpenStack`` object. | ||
|
||
.. sample:: BlockStorage/v3/create.php | ||
|
||
A list of additional options can be passed to the method. For example, to change the region: | ||
|
||
.. sample:: BlockStorage/v3/create_with_region.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,36 @@ | ||
Flavors | ||
======= | ||
|
||
List flavors | ||
------------ | ||
Flavors define the compute, memory, and storage capacity of nova computing instances. To put it simply, a flavor is | ||
an available hardware configuration for a server. It defines the size of a virtual server that can be launched. | ||
|
||
.. sample:: Compute/v2/flavors/list_flavors.php | ||
.. refdoc:: OpenStack/Compute/v2/Service.html#method_listFlavors | ||
.. osdoc:: https://docs.openstack.org/nova/latest/user/flavors.html | ||
|
||
Each iteration will return a :php:class:`Flavor` instance <OpenStack/Compute/v2/Models/Flavor.html>. | ||
|
||
.. include:: /common/generators.rst | ||
|
||
Detailed information | ||
~~~~~~~~~~~~~~~~~~~~ | ||
.. |models| replace:: flavors | ||
|
||
By default, only the ``id``, ``links`` and ``name`` attributes are returned. To return *all* information | ||
for a flavor, you must pass ``true`` as the last parameter, like so: | ||
.. include:: /common/service.rst | ||
|
||
.. code-block:: php | ||
Read | ||
---- | ||
|
||
$flavors = $service->listFlavors([], function ($flavor) { | ||
return $flavor; | ||
}, true); | ||
.. sample:: Compute/v2/flavors/read.php | ||
|
||
Retrieve a flavor | ||
----------------- | ||
List | ||
---- | ||
|
||
.. sample:: Compute/v2/flavors/get_flavor.php | ||
.. refdoc:: OpenStack/Compute/v2/Service.html#method_getFlavor | ||
.. sample:: Compute/v2/flavors/list.php | ||
|
||
When retrieving a flavor, sometimes you only want to operate on it. If this is the case, | ||
then there is no need to perform an initial ``GET`` request to the server: | ||
Each iteration will return a :php:class:`Flavor` instance <OpenStack/Compute/v2/Models/Flavor.html>. | ||
|
||
.. code-block:: php | ||
.. include:: /common/generators.rst | ||
|
||
// Get an unpopulated object | ||
$flavor = $service->getFlavor(['id' => '{flavorId}']); | ||
Detailed information | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
If, however, you *do* want to retrieve all the details of a remote flavor from the API, you just call: | ||
By default, only the ``id``, ``links`` and ``name`` attributes are returned. To return *all* information | ||
for a flavor, you must pass ``true`` as the last parameter, like so: | ||
|
||
.. code-block:: php | ||
$flavor->retrieve(); | ||
$flavors = $service->listFlavors([], null, true); | ||
which will update the state of the local object. This gives you an element of control over your app's performance. |
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
Oops, something went wrong.