Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Hannaford committed Nov 20, 2015
1 parent 03f769a commit 02ed846
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/services/block-storage/v2/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Block Storage v2
================

.. toctree::
:maxdepth: 3

volumes
volume-types
snapshots
Empty file.
60 changes: 60 additions & 0 deletions doc/services/block-storage/v2/volume-types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Volume Types
============

Listing volume types
--------------------

.. sample:: block_storage/v2/volume_types/list.php
.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_listVolumeTypes

Each iteration will return a :apiref:`VolumeType instance <OpenStack/BlockStorage/v2/Models/VolumeType.html>`.

.. include:: /common/generators.rst


Create volume type
------------------

The only attributes that are required when creating a volume are a name. The simplest example
would therefore be this:

.. sample:: block_storage/v2/volume_types/create.php
.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_createVolumeType


Retrieve details of a volume type
---------------------------------

When retrieving a volume type, sometimes you only want to operate on it - say to update or delete it. If this is the
case, then there is no need to perform an initial GET request to the API:

.. sample:: block_storage/v2/volume_types/get.php

If, however, you *do* want to retrieve all the details of a remote volume type from the API, you just call:

.. code-block:: php
$volumeType->retrieve();
which will update the state of the local object. This gives you an element of control over your app's performance.

.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_getVolumeType


Update a volume type
--------------------

The first step when updating a volume type is modifying the attributes you want updated. By default, only a volume
type's name can be edited.

.. sample:: block_storage/v2/volume_types/update.php
.. refdoc:: OpenStack/BlockStorage/v2/Models/VolumeType.html#method_update


Delete volume type
------------------

To permanently delete a volume type:

.. sample:: block_storage/v2/volume_types/delete.php
.. refdoc:: OpenStack/BlockStorage/v2/Models/VolumeType.html#method_delete
85 changes: 85 additions & 0 deletions doc/services/block-storage/v2/volumes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
Volumes
=======

List volumes
------------

.. sample:: block_storage/v2/volumes/list.php
.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_listVolumes

Each iteration will return a :apiref:`Volume instance <OpenStack/BlockStorage/v2/Models/Volume.html>`.

.. include:: /common/generators.rst

Detailed information
~~~~~~~~~~~~~~~~~~~~

By default, only the ``id``, ``links`` and ``name`` attributes are returned. To return *all* information
for a flavor, you must enable detailed information, like so:

.. sample:: block_storage/v2/volumes/list_detail.php

Create volume
-------------

The only attributes that are required when creating a volume are a size in GiB. The simplest example
would therefore be this:

.. sample:: block_storage/v2/volumes/create.php

You can further configure your new volume, however, by following the below sections, which instruct you how to add
specific functionality.

.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_createVolume

Create from image
~~~~~~~~~~~~~~~~~

.. sample:: block_storage/v2/volumes/create_from_image.php

Create from snapshot
~~~~~~~~~~~~~~~~~~~~

.. sample:: block_storage/v2/volumes/create_from_snapshot.php

Create from source volume
~~~~~~~~~~~~~~~~~~~~~~~~~

.. sample:: block_storage/v2/volumes/create_from_source_volume.php


Retrieve volume details
-----------------------

When retrieving a volume, sometimes you only want to operate on it - say to update or delete it. If this is the case,
then there is no need to perform an initial GET request to the API:

.. sample:: block_storage/v2/volumes/get.php

If, however, you *do* want to retrieve all the details of a remote volume from the API, you just call:

.. code-block:: php
$volume->retrieve();
which will update the state of the local object. This gives you an element of control over your app's performance.

.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_getVolume


Update volume
-------------

The first step when updating a volume is modifying the attributes you want updated. By default, only a volume's name
and description can be edited.

.. sample:: block_storage/v2/volumes/update.php
.. refdoc:: OpenStack/BlockStorage/v2/Models/Volume.html#method_update

Delete volume
-------------

To permanently delete a volume:

.. sample:: block_storage/v2/volumes/delete.php
.. refdoc:: OpenStack/BlockStorage/v2/Models/Volume.html#method_delete

0 comments on commit 02ed846

Please sign in to comment.