Skip to content

Commit

Permalink
Merge pull request #555 from jamiehannaford/rst-conversion
Browse files Browse the repository at this point in the history
RST updates
  • Loading branch information
ycombinator committed Mar 11, 2015
2 parents 21ce8b1 + baef47e commit 3dfe7c4
Show file tree
Hide file tree
Showing 21 changed files with 203 additions and 312 deletions.
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinxcontrib-phpdomain
2 changes: 2 additions & 0 deletions doc/services/compute/flavors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ List flavors
/** @param $flavor OpenCloud\Common\Resource\FlavorInterface */
}
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Compute/list_flavors.php>`_


Detailed results
~~~~~~~~~~~~~~~~
Expand Down
3 changes: 3 additions & 0 deletions doc/services/compute/images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Below is the simplest usage for retrieving a list of images:
}
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Compute/list_images.php>`_


Detailed results
~~~~~~~~~~~~~~~~

Expand Down
5 changes: 5 additions & 0 deletions doc/services/compute/keypairs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ value is automatically generated for you.
$pubKey = $keypair->getPublicKey();
$priKey = $keypair->getPrivateKey();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Compute/create_new_keypair.php>`_


Upload existing keypair
-----------------------
Expand All @@ -41,6 +43,9 @@ filesystem.
'publicKey' => $content
));
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Compute/upload_existing_keypair.php>`_


List keypairs
-------------

Expand Down
29 changes: 23 additions & 6 deletions doc/services/compute/servers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ URL parameters for filtering servers
| RAX-SI:image_schedule | If scheduled images enabled or not. If the value is TRUE, the list contains all servers that have an image schedule resource set on them. If the value is set to FALSE, the list contains all servers that do not have an image schedule. | bool |
+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------+

`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Compute/list_servers.php>`_


Create server
-------------

Expand All @@ -59,19 +62,22 @@ Now we're ready to create our instance:

.. code-block:: php
$server = $compute->server();
$server = $compute->server();
$server->create(array(
'name' => 'My lovely server',
'imageId' => '{imageId}',
'flavorId' => '{flavorId}',
));
$server->create(array(
'name' => 'My lovely server',
'imageId' => '{imageId}',
'flavorId' => '{flavorId}',
));
It's always best to be defensive when executing functionality over HTTP;
you can achieve this best by wrapping calls in a try/catch block. It
allows you to debug your failed operations in a graceful and efficient
manner.

`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Compute/create_server.php>`_


Using a bootable volume
~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -98,6 +104,9 @@ you can achieve this best by wrapping calls in a try/catch block. It
allows you to debug your failed operations in a graceful and efficient
manner.

`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Compute/create_server_with_bootable_volume.php>`_


Create parameters
~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -146,6 +155,8 @@ as usual, with one extra parameter:
So, as you can see, you specify the **name** of an existing keypair that
you previously created on the API.

`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Compute/create_server_with_keypair.php>`_


Creating a server with personality files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -176,6 +187,10 @@ attributes are detailed in the next section.
'name' => 'NEW SERVER NAME'
));
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Compute/update_server.php>`_


Updatable attributes
~~~~~~~~~~~~~~~~~~~~

Expand All @@ -195,3 +210,5 @@ Delete server
.. code-block:: php
$server->delete();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Compute/delete_server.php>`_
14 changes: 14 additions & 0 deletions doc/services/identity/users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ List users
// ...
}
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Identity/list_users.php>`_


Retrieve a user by username
---------------------------
Expand All @@ -42,6 +44,8 @@ Retrieve a user by username
$user = $service->getUser('jamie');
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Identity/get_user_by_name.php>`_


Retrieve a user by user ID
--------------------------
Expand All @@ -52,6 +56,8 @@ Retrieve a user by user ID
$user = $service->getUser('{userId}', UserConst::MODE_ID);
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Identity/get_user_by_id.php>`_


Retrieve a user by email address
--------------------------------
Expand All @@ -62,6 +68,8 @@ Retrieve a user by email address
$user = $service->getUser('{emailAddress}', UserConst::MODE_EMAIL);
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Identity/get_user_by_email.php>`_


Create user
-----------
Expand Down Expand Up @@ -98,6 +106,8 @@ automatically generated and provided in the response.
// show generated password
echo $user->getPassword();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Identity/add_user.php>`_


Update user
-----------
Expand Down Expand Up @@ -129,6 +139,8 @@ Delete user
$user->delete();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Identity/delete_user.php>`_


List credentials
----------------
Expand Down Expand Up @@ -159,3 +171,5 @@ you:
$user->resetApiKey();
echo $user->getApiKey();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/Identity/reset_api_key.php>`_
7 changes: 6 additions & 1 deletion doc/services/load-balancer/access.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ You can add network items to a load balancer's access list very easily:
In the above example, we allowed access for 1 IP address, and used the
"0.0.0.0" wildcard to blacklist all other traffic.

Get the executable PHP scripts for this example:

* `Blacklist IP range <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/LoadBalancer/blacklist-ip-range.php>`_
* `Limit access to 1 IP <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/LoadBalancer/limit-access-to-1-ip.php>`_


Remove Network Item From Access List
------------------------------------
Expand All @@ -76,4 +81,4 @@ You an remove a network item from a load balancer's access list:

.. code-block:: php
$networkItem->delete();
$networkItem->delete();
14 changes: 10 additions & 4 deletions doc/services/load-balancer/load-balancer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ port number, before submitting to the API:
For a full list of available `protocols <#protocols>`_ and `algorithms <#algorithms>`_
please see the sections below.

`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/LoadBalancer/create-lb.php>`_

List Load Balancer Details
--------------------------

Get Load Balancer Details
-------------------------

You can retrieve a single load balancer's details by using its ID:

Expand All @@ -64,7 +66,7 @@ You can retrieve a single load balancer's details by using its ID:
List Load Balancers
~~~~~~~~~~~~~~~~~~~
-------------------

You can retrieve a list of all your load balancers:

Expand All @@ -76,6 +78,8 @@ You can retrieve a list of all your load balancers:
/** @var $loadBalancer OpenCloud\LoadBalancer\Resource\LoadBalancer **/
}
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/LoadBalancer/list-load-balancers.php>`_


Update a Load Balancer
----------------------
Expand Down Expand Up @@ -121,6 +125,8 @@ When you no longer have a need for the load balancer, you can remove it:
$loadBalancer->delete();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/LoadBalancer/delete-lb.php>`_


Protocols
---------
Expand Down Expand Up @@ -159,7 +165,7 @@ You can programmatically list all supported load balancing algorithms:
.. code-block:: php
$algorithms = $service->algorithmList();
foreach ($algorithms as $algorithm) {
/** @var $algorithm OpenCloud\LoadBalancer\Resource\Algorithm **/
}
2 changes: 2 additions & 0 deletions doc/services/load-balancer/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ For a full list, with explanations, of required and optional attributes,
please consult the `official
documentation <http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/SSLTermination-d1e2479.html>`__

`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/LoadBalancer/ssl-termination.php>`_


Delete configuration
--------------------
Expand Down
11 changes: 9 additions & 2 deletions doc/services/object-store/access.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ in a global state:
The string argument of ``setTempUrlSecret()`` is optional - if left out,
the SDK will generate a random hashed secret for you.

Get the executable PHP script for this example:

* `Specify a URL secret <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/ObjectStore/set-account-temp-url-secret-specified.php>`_
* `Generate random URL secret <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/ObjectStore/set-account-temp-url-secret.php>`_


Create a temporary URL
----------------------
Expand All @@ -32,14 +37,16 @@ your object. To allow GET access to your object for 1 minute:

.. code-block:: php
$object->getTemporaryUrl(60, 'GET');
$object->getTemporaryUrl(60, 'GET');
To allow PUT access for 1 hour:

.. code-block:: php
$object->getTemporaryUrl(360, 'PUT');
$object->getTemporaryUrl(360, 'PUT');
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/ObjectStore/create-object-temporary-url.php>`_


Hosting HTML sites on CDN
Expand Down
6 changes: 6 additions & 0 deletions doc/services/object-store/account.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Retrieve total container count
$account->getContainerCount();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/ObjectStore/get-account-container-count.php>`_


Retrieve total object count
---------------------
Expand All @@ -37,10 +39,14 @@ Retrieve total object count
$account->getObjectCount();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/ObjectStore/get-account-object-count.php>`_


Retrieve total bytes used
-------------------------

.. code-block:: php
$account->getBytesUsed();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/ObjectStore/get-account-bytes-used.php>`_
6 changes: 6 additions & 0 deletions doc/services/object-store/cdn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ execute the method on:
/** @var $cdnContainer OpenCloud\ObjectStore\Resource\CDNContainer */
}
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/ObjectStore/list-cdn-containers.php>`_


CDN-enable a container
----------------------
Expand All @@ -47,6 +49,8 @@ refetches and caches the object for the TTL period.
$container->enableCdn();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/ObjectStore/enable-container-cdn.php>`_


CDN-disable a container
-----------------------
Expand All @@ -55,6 +59,8 @@ CDN-disable a container
$container->disableCdn();
`Get the executable PHP script for this example <https://raw.githubusercontent.com/rackspace/php-opencloud/master/samples/ObjectStore/disable-container-cdn.php>`_


Operations on CDN-enabled containers
------------------------------------
Expand Down

0 comments on commit 3dfe7c4

Please sign in to comment.