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).qFqG}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 qNqO}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\ImageqVqW}qX(h"U h#hRubah&UliteralqYubh;X    class.qZq[}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   Setupqhqi}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 qoqp}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\Serviceqvqw}qx(h"U h#hrubah&hYubh;X?   
class, which is available from the OpenStack/Rackspace client:qyqz}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:spaceqUpreserveqh-]h,]h*]h+]q(UcodeqX   phpqeh/]uh1Kh2hh]qcdocutils.nodes
inline
q)q}q(h"X7   $service = $client->imageService('cloudImages', 'IAD');h(}q(h*]h+]qUotherqah,]h-]h/]uh#h}h]qh;X7   $service = $client->imageService('cloudImages', 'IAD');qq}q(h"U h#hubah&Uinlinequbaubh?)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 qq}q(h"X+   View the guides for more information about h#hubcdocutils.nodes
reference
q)q}q(h"X   `clients <../Clients.md>`__h(}q(UnameX   clientsUrefuriqX   ../Clients.mdh-]h,]h*]h+]h/]uh#hh]qh;X   clientsqq}q(h"U h#hubah&U	referencequbh;X   
or qq}q(h"X   
or h#hubh)q}q(h"X   `services <../Services.md>`__h(}q(UnameX   serviceshX   ../Services.mdh-]h,]h*]h+]h/]uh#hh]qh;X   servicesqq}q(h"U h#hubah&hubh;X   .q}q(h"X   .h#hubeubeubh)q}q(h"U h#h h$h%h&h'h(}q(h*]h+]h,]h-]qhah/]qhauh1Kh2hh]q(h4)q}q(h"X   List imagesqh#hh$h%h&h8h(}q(h*]h+]h,]h-]h/]uh1Kh2hh]qh;X   List imagesqq}q(h"hh#hubaubh|)q}q(h"Xy   $images = $service->listImages();

foreach ($images as $image) {
   /** @param $image OpenCloud\Image\Resource\Image */
}h#hh$h%h&hh(}q(hhh-]h,]h*]h+]q(hX   phpqeh/]uh1K"h2hh]qh)q}q(h"Xy   $images = $service->listImages();

foreach ($images as $image) {
   /** @param $image OpenCloud\Image\Resource\Image */
}h(}q(h*]h+]qUotherqah,]h-]h/]uh#hh]qh;Xy   $images = $service->listImages();

foreach ($images as $image) {
   /** @param $image OpenCloud\Image\Resource\Image */
}qɅq}q(h"U h#hubah&hubaubh?)q}q(h"Xp   For more information about working with iterators, please see the
`iterators documentation <../Iterators.md>`__.h#hh$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#hubh)q}q(h"X-   `iterators documentation <../Iterators.md>`__h(}q(UnameX   iterators documentationhX   ../Iterators.mdh-]h,]h*]h+]h/]uh#hh]qh;X   iterators documentationqׅq}q(h"U h#hubah&hubh;X   .q}q(h"X   .h#hubeubeubh)q}q(h"U h#h h$h%h&h'h(}q(h*]h+]h,]h-]qhah/]qh	auh1K'h2hh]q(h4)q}q(h"X   Get image detailsqh#hh$h%h&h8h(}q(h*]h+]h,]h-]h/]uh1K'h2hh]qh;X   Get image detailsq煁q}q(h"hh#hubaubh|)q}q(h"X^   /** @param $image OpenCloud\Image\Resource\Image */
$image = $service->getImage('<image_id>');h#hh$h%h&hh(}q(hhh-]h,]h*]h+]q(hX   phpqeh/]uh1K-h2hh]qh)q}q(h"X^   /** @param $image OpenCloud\Image\Resource\Image */
$image = $service->getImage('<image_id>');h(}q(h*]h+]qUotherqah,]h-]h/]uh#hh]qh;X^   /** @param $image OpenCloud\Image\Resource\Image */
$image = $service->getImage('<image_id>');qq}q(h"U h#hubah&hubaubh)q}q(h"U h#hh$h%h&h'h(}q(h*]h+]h,]h-]qhah/]qhauh1K/h2hh]q(h4)q}r   (h"X   A note on schema classesr  h#hh$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#hubaubh?)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#hh$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#hh$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&hubh;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#hh$h%h&hh(}rJ  (hhh-]h,]h*]h+]rK  (hX   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&hubaubeubeubh)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   schemahX
   Schemas.mdh-]h,]h*]h+]h/]uh#je  h]ro  h;X   schemarp  rq  }rr  (h"U h#jl  ubah&hubh;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  (hhh-]h,]h*]h+]r  (hX   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&hubaubh?)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   (hhh-]h,]h*]h+]r  (hX   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&hubaubeubeubah"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hhjW  hhhh]hh hhuUsubstitution_namesro  }rp  h&h2h(}rq  (h*]h-]h,]Usourceh%h+]h/]uU	footnotesrr  ]rs  Urefidsrt  }ru  ub.