€cdocutils.nodes
document
q)�q}q(U	nametypesq}q(X   update imageqNX   a note on schema classesqNX   setupqNX   get image detailsq	NX   imagesq
NX   list imagesqNX   delete imageqNuUsubstitution_defsq}qUparse_messagesq]qUcurrent_sourceqNU
decorationqNUautofootnote_startqKUnameidsq}q(hUupdate-imageqhUa-note-on-schema-classesqhUsetupqh	Uget-image-detailsqh
UimagesqhUlist-imagesqhUdelete-imagequUchildrenq]qcdocutils.nodes
section
q)�q }q!(U	rawsourceq"U Uparentq#hUsourceq$XH   /Users/jamie/projects/php/php-opencloud/doc/services/image/Images.md.rstq%Utagnameq&Usectionq'U
attributesq(}q)(Udupnamesq*]Uclassesq+]Ubackrefsq,]Uidsq-]q.haUnamesq/]q0h
auUlineq1KUdocumentq2hh]q3(cdocutils.nodes
title
q4)�q5}q6(h"X   Imagesq7h#h h$h%h&Utitleq8h(}q9(h*]h+]h,]h-]h/]uh1Kh2hh]q:cdocutils.nodes
Text
q;X   Imagesq<…�q=}q>(h"h7h#h5ubaubcdocutils.nodes
paragraph
q?)�q@}qA(h"X  A virtual machine image is a single file which contains a virtual disk
that has an installed bootable operating system. In the Cloud Images
API, an image is represented by a JSON-encoded data structure (the image
schema) and its raw binary data (the image file).qBh#h h$h%h&U	paragraphqCh(}qD(h*]h+]h,]h-]h/]uh1Kh2hh]qEh;X  A virtual machine image is a single file which contains a virtual disk
that has an installed bootable operating system. In the Cloud Images
API, an image is represented by a JSON-encoded data structure (the image
schema) and its raw binary data (the image file).qF…�qG}qH(h"hBh#h@ubaubh?)�qI}qJ(h"XH   An Image is represented by the ``OpenCloud\Image\Resource\Image`` class.qKh#h h$h%h&hCh(}qL(h*]h+]h,]h-]h/]uh1K	h2hh]qM(h;X   An Image is represented by the qN…�qO}qP(h"X   An Image is represented by the h#hIubcdocutils.nodes
literal
qQ)�qR}qS(h"X"   ``OpenCloud\Image\Resource\Image``h(}qT(h*]h+]h,]h-]h/]uh#hIh]qUh;X   OpenCloud\Image\Resource\ImageqV…�qW}qX(h"U h#hRubah&UliteralqYubh;X    class.qZ…�q[}q\(h"X    class.h#hIubeubh)�q]}q^(h"U h#h h$h%h&h'h(}q_(h*]h+]h,]h-]q`hah/]qahauh1Kh2hh]qb(h4)�qc}qd(h"X   Setupqeh#h]h$h%h&h8h(}qf(h*]h+]h,]h-]h/]uh1Kh2hh]qgh;X   Setupqh…�qi}qj(h"heh#hcubaubh?)�qk}ql(h"Xƒ   You instantiate an Image object from its ``OpenCloud\Image\Service``
class, which is available from the OpenStack/Rackspace client:h#h]h$h%h&hCh(}qm(h*]h+]h,]h-]h/]uh1Kh2hh]qn(h;X)   You instantiate an Image object from its qo…�qp}qq(h"X)   You instantiate an Image object from its h#hkubhQ)�qr}qs(h"X   ``OpenCloud\Image\Service``h(}qt(h*]h+]h,]h-]h/]uh#hkh]quh;X   OpenCloud\Image\Serviceqv…�qw}qx(h"U h#hrubah&hYubh;X?   
class, which is available from the OpenStack/Rackspace client:qy…�qz}q{(h"X?   
class, which is available from the OpenStack/Rackspace client:h#hkubeubcdocutils.nodes
literal_block
q|)�q}}q~(h"X7   $service = $client->imageService('cloudImages', 'IAD');h#h]h$h%h&Uliteral_blockqh(}q€(U	xml:spaceq�Upreserveq‚h-]h,]h*]h+]qƒ(Ucodeq„X   phpq…eh/]uh1Kh2hh]q†cdocutils.nodes
inline
q‡)�qˆ}q‰(h"X7   $service = $client->imageService('cloudImages', 'IAD');h(}qŠ(h*]h+]q‹UotherqŒah,]h-]h/]uh#h}h]q�h;X7   $service = $client->imageService('cloudImages', 'IAD');qŽ…�q�}q�(h"U h#hˆubah&Uinlineq‘ubaubh?)�q’}q“(h"Xh   View the guides for more information about `clients <../Clients.md>`__
or `services <../Services.md>`__.h#h]h$h%h&hCh(}q”(h*]h+]h,]h-]h/]uh1Kh2hh]q•(h;X+   View the guides for more information about q–…�q—}q˜(h"X+   View the guides for more information about h#h’ubcdocutils.nodes
reference
q™)�qš}q›(h"X   `clients <../Clients.md>`__h(}qœ(UnameX   clientsUrefuriq�X   ../Clients.mdh-]h,]h*]h+]h/]uh#h’h]qžh;X   clientsqŸ…�q }q¡(h"U h#hšubah&U	referenceq¢ubh;X   
or q£…�q¤}q¥(h"X   
or h#h’ubh™)�q¦}q§(h"X   `services <../Services.md>`__h(}q¨(UnameX   servicesh�X   ../Services.mdh-]h,]h*]h+]h/]uh#h’h]q©h;X   servicesqª…�q«}q¬(h"U h#h¦ubah&h¢ubh;X   .…�q­}q®(h"X   .h#h’ubeubeubh)�q¯}q°(h"U h#h h$h%h&h'h(}q±(h*]h+]h,]h-]q²hah/]q³hauh1Kh2hh]q´(h4)�qµ}q¶(h"X   List imagesq·h#h¯h$h%h&h8h(}q¸(h*]h+]h,]h-]h/]uh1Kh2hh]q¹h;X   List imagesqº…�q»}q¼(h"h·h#hµubaubh|)�q½}q¾(h"Xy   $images = $service->listImages();

foreach ($images as $image) {
   /** @param $image OpenCloud\Image\Resource\Image */
}h#h¯h$h%h&hh(}q¿(h�h‚h-]h,]h*]h+]qÀ(h„X   phpqÁeh/]uh1K"h2hh]qÂh‡)�qÃ}qÄ(h"Xy   $images = $service->listImages();

foreach ($images as $image) {
   /** @param $image OpenCloud\Image\Resource\Image */
}h(}qÅ(h*]h+]qÆUotherqÇah,]h-]h/]uh#h½h]qÈh;Xy   $images = $service->listImages();

foreach ($images as $image) {
   /** @param $image OpenCloud\Image\Resource\Image */
}qÉ…�qÊ}qË(h"U h#hÃubah&h‘ubaubh?)�qÌ}qÍ(h"Xp   For more information about working with iterators, please see the
`iterators documentation <../Iterators.md>`__.h#h¯h$h%h&hCh(}qÎ(h*]h+]h,]h-]h/]uh1K#h2hh]qÏ(h;XB   For more information about working with iterators, please see the
qÐ…�qÑ}qÒ(h"XB   For more information about working with iterators, please see the
h#hÌubh™)�qÓ}qÔ(h"X-   `iterators documentation <../Iterators.md>`__h(}qÕ(UnameX   iterators documentationh�X   ../Iterators.mdh-]h,]h*]h+]h/]uh#hÌh]qÖh;X   iterators documentationq×…�qØ}qÙ(h"U h#hÓubah&h¢ubh;X   .…�qÚ}qÛ(h"X   .h#hÌubeubeubh)�qÜ}qÝ(h"U h#h h$h%h&h'h(}qÞ(h*]h+]h,]h-]qßhah/]qàh	auh1K'h2hh]qá(h4)�qâ}qã(h"X   Get image detailsqäh#hÜh$h%h&h8h(}qå(h*]h+]h,]h-]h/]uh1K'h2hh]qæh;X   Get image detailsqç…�qè}qé(h"häh#hâubaubh|)�qê}që(h"X^   /** @param $image OpenCloud\Image\Resource\Image */
$image = $service->getImage('<image_id>');h#hÜh$h%h&hh(}qì(h�h‚h-]h,]h*]h+]qí(h„X   phpqîeh/]uh1K-h2hh]qïh‡)�qð}qñ(h"X^   /** @param $image OpenCloud\Image\Resource\Image */
$image = $service->getImage('<image_id>');h(}qò(h*]h+]qóUotherqôah,]h-]h/]uh#hêh]qõh;X^   /** @param $image OpenCloud\Image\Resource\Image */
$image = $service->getImage('<image_id>');qö…�q÷}qø(h"U h#hðubah&h‘ubaubh)�qù}qú(h"U h#hÜh$h%h&h'h(}qû(h*]h+]h,]h-]qühah/]qýhauh1K/h2hh]qþ(h4)�qÿ}r   (h"X   A note on schema classesr  h#hùh$h%h&h8h(}r  (h*]h+]h,]h-]h/]uh1K/h2hh]r  h;X   A note on schema classesr  …�r  }r  (h"j  h#hÿubaubh?)�r  }r  (h"X­   Both ``OpenCloud\Image\Resource\Image`` and
``OpenCloud\Image\Resource\Member`` extend the
``AbstractSchemaResource`` abstract class, which offers some unique
functionality.h#hùh$h%h&hCh(}r	  (h*]h+]h,]h-]h/]uh1K1h2hh]r
  (h;X   Both r  …�r  }r  (h"X   Both h#j  ubhQ)�r  }r  (h"X"   ``OpenCloud\Image\Resource\Image``h(}r  (h*]h+]h,]h-]h/]uh#j  h]r  h;X   OpenCloud\Image\Resource\Imager  …�r  }r  (h"U h#j  ubah&hYubh;X    and
r  …�r  }r  (h"X    and
h#j  ubhQ)�r  }r  (h"X#   ``OpenCloud\Image\Resource\Member``h(}r  (h*]h+]h,]h-]h/]uh#j  h]r  h;X   OpenCloud\Image\Resource\Memberr  …�r  }r  (h"U h#j  ubah&hYubh;X    extend the
r  …�r   }r!  (h"X    extend the
h#j  ubhQ)�r"  }r#  (h"X   ``AbstractSchemaResource``h(}r$  (h*]h+]h,]h-]h/]uh#j  h]r%  h;X   AbstractSchemaResourcer&  …�r'  }r(  (h"U h#j"  ubah&hYubh;X8    abstract class, which offers some unique
functionality.r)  …�r*  }r+  (h"X8    abstract class, which offers some unique
functionality.h#j  ubeubh?)�r,  }r-  (h"X–  Because these resources are inherently dynamic - i.e. they are modelled
on dynamic JSON schema - you need to access their state in a way
different than conventional getter/setter methods, and even class
properties. For this reason, they implement SPL's native
```ArrayAccess`` <http://www.php.net/manual/en/class.arrayaccess.php>`__
interface which allows you to access their state as a conventional
array:h#hùh$h%h&hCh(}r.  (h*]h+]h,]h-]h/]uh1K6h2hh]r/  (h;X  Because these resources are inherently dynamic - i.e. they are modelled
on dynamic JSON schema - you need to access their state in a way
different than conventional getter/setter methods, and even class
properties. For this reason, they implement SPL's native
r0  …�r1  }r2  (h"X  Because these resources are inherently dynamic - i.e. they are modelled
on dynamic JSON schema - you need to access their state in a way
different than conventional getter/setter methods, and even class
properties. For this reason, they implement SPL's native
h#j,  ubhQ)�r3  }r4  (h"X   ```ArrayAccess``h(}r5  (h*]h+]h,]h-]h/]uh#j,  h]r6  h;X   `ArrayAccessr7  …�r8  }r9  (h"U h#j3  ubah&hYubh;X    <r:  …�r;  }r<  (h"X    <h#j,  ubh™)�r=  }r>  (h"X2   http://www.php.net/manual/en/class.arrayaccess.phpr?  h(}r@  (Urefurij?  h-]h,]h*]h+]h/]uh#j,  h]rA  h;X2   http://www.php.net/manual/en/class.arrayaccess.phprB  …�rC  }rD  (h"U h#j=  ubah&h¢ubh;XN   >`__
interface which allows you to access their state as a conventional
array:rE  …�rF  }rG  (h"XN   >`__
interface which allows you to access their state as a conventional
array:h#j,  ubeubh|)�rH  }rI  (h"XW   $image = $service->getImage('<image_id>');

$id = $image['id'];
$tags = $image['tags'];h#hùh$h%h&hh(}rJ  (h�h‚h-]h,]h*]h+]rK  (h„X   phprL  eh/]uh1KDh2hh]rM  h‡)�rN  }rO  (h"XW   $image = $service->getImage('<image_id>');

$id = $image['id'];
$tags = $image['tags'];h(}rP  (h*]h+]rQ  UotherrR  ah,]h-]h/]uh#jH  h]rS  h;XW   $image = $service->getImage('<image_id>');

$id = $image['id'];
$tags = $image['tags'];rT  …�rU  }rV  (h"U h#jN  ubah&h‘ubaubeubeubh)�rW  }rX  (h"U h#h h$h%h&h'h(}rY  (h*]h+]h,]h-]rZ  hah/]r[  hauh1KFh2hh]r\  (h4)�r]  }r^  (h"X   Update imager_  h#jW  h$h%h&h8h(}r`  (h*]h+]h,]h-]h/]uh1KFh2hh]ra  h;X   Update imagerb  …�rc  }rd  (h"j_  h#j]  ubaubh?)�re  }rf  (h"X¬   You can only update your own custom images - you cannot update or delete
base images. The way in which you may update your image is dictated by
its `schema <Schemas.md>`__.h#jW  h$h%h&hCh(}rg  (h*]h+]h,]h-]h/]uh1KHh2hh]rh  (h;X”   You can only update your own custom images - you cannot update or delete
base images. The way in which you may update your image is dictated by
its ri  …�rj  }rk  (h"X”   You can only update your own custom images - you cannot update or delete
base images. The way in which you may update your image is dictated by
its h#je  ubh™)�rl  }rm  (h"X   `schema <Schemas.md>`__h(}rn  (UnameX   schemah�X
   Schemas.mdh-]h,]h*]h+]h/]uh#je  h]ro  h;X   schemarp  …�rq  }rr  (h"U h#jl  ubah&h¢ubh;X   .…�rs  }rt  (h"X   .h#je  ubeubh?)�ru  }rv  (h"XŒ   Although you should be able to add new and replace existing properties,
always prepare yourself for a situation where it might be forbidden:rw  h#jW  h$h%h&hCh(}rx  (h*]h+]h,]h-]h/]uh1KLh2hh]ry  h;XŒ   Although you should be able to add new and replace existing properties,
always prepare yourself for a situation where it might be forbidden:rz  …�r{  }r|  (h"jw  h#ju  ubaubh|)�r}  }r~  (h"Xõ   use OpenCloud\Common\Exceptions\ForbiddenOperationException;

try {
    $image->update(array(
        'name'        => 'foo',
        'newProperty' => 'bar'
    ));
} catch (ForbiddenOperationException $e) {
    // A 403 Forbidden was returned
}h#jW  h$h%h&hh(}r  (h�h‚h-]h,]h*]h+]r€  (h„X   phpr�  eh/]uh1K[h2hh]r‚  h‡)�rƒ  }r„  (h"Xõ   use OpenCloud\Common\Exceptions\ForbiddenOperationException;

try {
    $image->update(array(
        'name'        => 'foo',
        'newProperty' => 'bar'
    ));
} catch (ForbiddenOperationException $e) {
    // A 403 Forbidden was returned
}h(}r…  (h*]h+]r†  Uotherr‡  ah,]h-]h/]uh#j}  h]rˆ  h;Xõ   use OpenCloud\Common\Exceptions\ForbiddenOperationException;

try {
    $image->update(array(
        'name'        => 'foo',
        'newProperty' => 'bar'
    ));
} catch (ForbiddenOperationException $e) {
    // A 403 Forbidden was returned
}r‰  …�rŠ  }r‹  (h"U h#jƒ  ubah&h‘ubaubh?)�rŒ  }r�  (h"XG   There are three operations that can take place for each Image property:rŽ  h#jW  h$h%h&hCh(}r�  (h*]h+]h,]h-]h/]uh1K\h2hh]r�  h;XG   There are three operations that can take place for each Image property:r‘  …�r’  }r“  (h"jŽ  h#jŒ  ubaubcdocutils.nodes
bullet_list
r”  )�r•  }r–  (h"U h#jW  h$h%h&Ubullet_listr—  h(}r˜  (Ubulletr™  X   -h-]h,]h*]h+]h/]uh1K^h2hh]rš  (cdocutils.nodes
list_item
r›  )�rœ  }r�  (h"X}   If a ``false`` or ``null`` value is provided, a ``REMOVE`` operation
will occur, removing the property from the JSON documenth#j•  h$h%h&U	list_itemrž  h(}rŸ  (h*]h+]h,]h-]h/]uh1Nh2hh]r   h?)�r¡  }r¢  (h"X}   If a ``false`` or ``null`` value is provided, a ``REMOVE`` operation
will occur, removing the property from the JSON documenth#jœ  h$h%h&hCh(}r£  (h*]h+]h,]h-]h/]uh1K^h]r¤  (h;X   If a r¥  …�r¦  }r§  (h"X   If a h#j¡  ubhQ)�r¨  }r©  (h"X	   ``false``h(}rª  (h*]h+]h,]h-]h/]uh#j¡  h]r«  h;X   falser¬  …�r­  }r®  (h"U h#j¨  ubah&hYubh;X    or r¯  …�r°  }r±  (h"X    or h#j¡  ubhQ)�r²  }r³  (h"X   ``null``h(}r´  (h*]h+]h,]h-]h/]uh#j¡  h]rµ  h;X   nullr¶  …�r·  }r¸  (h"U h#j²  ubah&hYubh;X    value is provided, a r¹  …�rº  }r»  (h"X    value is provided, a h#j¡  ubhQ)�r¼  }r½  (h"X
   ``REMOVE``h(}r¾  (h*]h+]h,]h-]h/]uh#j¡  h]r¿  h;X   REMOVErÀ  …�rÁ  }rÂ  (h"U h#j¼  ubah&hYubh;XC    operation
will occur, removing the property from the JSON documentrÃ  …�rÄ  }rÅ  (h"XC    operation
will occur, removing the property from the JSON documenth#j¡  ubeubaubj›  )�rÆ  }rÇ  (h"Xr   If a non-false value is provided and the property does not exist, an
``ADD`` operation will add it to the documenth#j•  h$h%h&jž  h(}rÈ  (h*]h+]h,]h-]h/]uh1Nh2hh]rÉ  h?)�rÊ  }rË  (h"Xr   If a non-false value is provided and the property does not exist, an
``ADD`` operation will add it to the documenth#jÆ  h$h%h&hCh(}rÌ  (h*]h+]h,]h-]h/]uh1K`h]rÍ  (h;XE   If a non-false value is provided and the property does not exist, an
rÎ  …�rÏ  }rÐ  (h"XE   If a non-false value is provided and the property does not exist, an
h#jÊ  ubhQ)�rÑ  }rÒ  (h"X   ``ADD``h(}rÓ  (h*]h+]h,]h-]h/]uh#jÊ  h]rÔ  h;X   ADDrÕ  …�rÖ  }r×  (h"U h#jÑ  ubah&hYubh;X&    operation will add it to the documentrØ  …�rÙ  }rÚ  (h"X&    operation will add it to the documenth#jÊ  ubeubaubj›  )�rÛ  }rÜ  (h"X   If a non-false value is provided and the property does exist, a
``REPLACE`` operation will modify the property in the document
h#j•  h$h%h&jž  h(}rÝ  (h*]h+]h,]h-]h/]uh1Nh2hh]rÞ  h?)�rß  }rà  (h"X~   If a non-false value is provided and the property does exist, a
``REPLACE`` operation will modify the property in the documenth#jÛ  h$h%h&hCh(}rá  (h*]h+]h,]h-]h/]uh1Kbh]râ  (h;X@   If a non-false value is provided and the property does exist, a
rã  …�rä  }rå  (h"X@   If a non-false value is provided and the property does exist, a
h#jß  ubhQ)�ræ  }rç  (h"X   ``REPLACE``h(}rè  (h*]h+]h,]h-]h/]uh#jß  h]ré  h;X   REPLACErê  …�rë  }rì  (h"U h#jæ  ubah&hYubh;X3    operation will modify the property in the documentrí  …�rî  }rï  (h"X3    operation will modify the property in the documenth#jß  ubeubaubeubeubh)�rð  }rñ  (h"U h#h h$h%h&h'h(}rò  (h*]h+]h,]h-]ró  hah/]rô  hauh1Kfh2hh]rõ  (h4)�rö  }r÷  (h"X   Delete imagerø  h#jð  h$h%h&h8h(}rù  (h*]h+]h,]h-]h/]uh1Kfh2hh]rú  h;X   Delete imagerû  …�rü  }rý  (h"jø  h#jö  ubaubh|)�rþ  }rÿ  (h"X   $image->delete();h#jð  h$h%h&hh(}r   (h�h‚h-]h,]h*]h+]r  (h„X   phpr  eh/]uh1Kkh2hh]r  h‡)�r  }r  (h"X   $image->delete();h(}r  (h*]h+]r  Uotherr  ah,]h-]h/]uh#jþ  h]r	  h;X   $image->delete();r
  …�r  }r  (h"U h#j  ubah&h‘ubaubeubeubah"U Utransformerr  NUfootnote_refsr  }r  Urefnamesr  }r  Usymbol_footnotesr  ]r  Uautofootnote_refsr  ]r  Usymbol_footnote_refsr  ]r  U	citationsr  ]r  h2hUcurrent_liner  NUtransform_messagesr  ]r  Ureporterr  NUid_startr  KUautofootnotesr  ]r   Ucitation_refsr!  }r"  Uindirect_targetsr#  ]r$  Usettingsr%  (cdocutils.frontend
Values
r&  or'  }r(  (Ufootnote_backlinksr)  KUrecord_dependenciesr*  NUrfc_base_urlr+  Uhttp://tools.ietf.org/html/r,  U	tracebackr-  ˆUpep_referencesr.  NUstrip_commentsr/  NUtoc_backlinksr0  Uentryr1  Ulanguage_coder2  Uenr3  U	datestampr4  NUreport_levelr5  KU_destinationr6  NU
halt_levelr7  KUstrip_classesr8  Nh8NUerror_encoding_error_handlerr9  Ubackslashreplacer:  Udebugr;  NUembed_stylesheetr<  ‰Uoutput_encoding_error_handlerr=  Ustrictr>  Usectnum_xformr?  KUdump_transformsr@  NUdocinfo_xformrA  KUwarning_streamrB  NUpep_file_url_templaterC  Upep-%04drD  Uexit_status_levelrE  KUconfigrF  NUstrict_visitorrG  NUcloak_email_addressesrH  ˆUtrim_footnote_reference_spacerI  ‰UenvrJ  NUdump_pseudo_xmlrK  NUexpose_internalsrL  NUsectsubtitle_xformrM  ‰Usource_linkrN  NUrfc_referencesrO  NUoutput_encodingrP  Uutf-8rQ  U
source_urlrR  NUinput_encodingrS  U	utf-8-sigrT  U_disable_configrU  NU	id_prefixrV  U U	tab_widthrW  KUerror_encodingrX  UUTF-8rY  U_sourcerZ  h%Ugettext_compactr[  ˆU	generatorr\  NUdump_internalsr]  NUsmart_quotesr^  ‰Upep_base_urlr_  Uhttp://www.python.org/dev/peps/r`  Usyntax_highlightra  Ulongrb  Uinput_encoding_error_handlerrc  j>  Uauto_id_prefixrd  Uidre  Udoctitle_xformrf  ‰Ustrip_elements_with_classesrg  NU_config_filesrh  ]Ufile_insertion_enabledri  ˆUraw_enabledrj  KUdump_settingsrk  NubUsymbol_footnote_startrl  K Uidsrm  }rn  (hjð  hhùhjW  hh¯hh]hh hhÜuUsubstitution_namesro  }rp  h&h2h(}rq  (h*]h-]h,]Usourceh%h+]h/]uU	footnotesrr  ]rs  Urefidsrt  }ru  ub.