€cdocutils.nodes
document
q)q}q(U	nametypesq}q(X   getting startedqNXC   3. create a container for your objects (also referred to as files).qNX   object storeqNX%   4. upload an object to the container.q	NX
   next stepsq
NX0   1. instantiate an openstack or rackspace client.qNX9   2. obtain an object store service object from the client.qNuUsubstitution_defsq}qUparse_messagesq]qUcurrent_sourceqNU
decorationqNUautofootnote_startqKUnameidsq}q(hUgetting-startedqhU=create-a-container-for-your-objects-also-referred-to-as-filesqhUobject-storeqh	U!upload-an-object-to-the-containerqh
U
next-stepsqhU,instantiate-an-openstack-or-rackspace-clientqhU5obtain-an-object-store-service-object-from-the-clientquUchildrenq]qcdocutils.nodes
section
q)q }q!(U	rawsourceq"U Uparentq#hUsourceq$XO   /Users/jamie/projects/php/php-opencloud/doc/services/object-store/README.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   Object Storeq7h#h h$h%h&Utitleq8h(}q9(h*]h+]h,]h-]h/]uh1Kh2hh]q:cdocutils.nodes
Text
q;X   Object Storeq<…q=}q>(h"h7h#h5ubaubcdocutils.nodes
paragraph
q?)q@}qA(h"Xj   **Object Store** is an object-based storage system that stores content
and metadata as objects in a cloud.h#h h$h%h&U	paragraphqBh(}qC(h*]h+]h,]h-]h/]uh1Kh2hh]qD(cdocutils.nodes
strong
qE)qF}qG(h"X   **Object Store**h(}qH(h*]h+]h,]h-]h/]uh#h@h]qIh;X   Object StoreqJ…qK}qL(h"U h#hFubah&UstrongqMubh;XZ    is an object-based storage system that stores content
and metadata as objects in a cloud.qN…qO}qP(h"XZ    is an object-based storage system that stores content
and metadata as objects in a cloud.h#h@ubeubh?)qQ}qR(h"Xá   Specifically, a cloud is made up of one or more regions. Each region can
have several **containers**, created by a user. Each container can
container several **objects** (sometimes referred to as files), uploaded
by the user.h#h h$h%h&hBh(}qS(h*]h+]h,]h-]h/]uh1Kh2hh]qT(h;XV   Specifically, a cloud is made up of one or more regions. Each region can
have several qU…qV}qW(h"XV   Specifically, a cloud is made up of one or more regions. Each region can
have several h#hQubhE)qX}qY(h"X   **containers**h(}qZ(h*]h+]h,]h-]h/]uh#hQh]q[h;X
   containersq\…q]}q^(h"U h#hXubah&hMubh;X:   , created by a user. Each container can
container several q_…q`}qa(h"X:   , created by a user. Each container can
container several h#hQubhE)qb}qc(h"X   **objects**h(}qd(h*]h+]h,]h-]h/]uh#hQh]qeh;X   objectsqf…qg}qh(h"U h#hbubah&hMubh;X8    (sometimes referred to as files), uploaded
by the user.qi…qj}qk(h"X8    (sometimes referred to as files), uploaded
by the user.h#hQubeubh)ql}qm(h"U h#h h$h%h&h'h(}qn(h*]h+]h,]h-]qohah/]qphauh1Kh2hh]qq(h4)qr}qs(h"X   Getting startedqth#hlh$h%h&h8h(}qu(h*]h+]h,]h-]h/]uh1Kh2hh]qvh;X   Getting startedqw…qx}qy(h"hth#hrubaubh)qz}q{(h"U h#hlh$h%h&h'h(}q|(h*]h+]h,]h-]q}hah/]q~hauh1Kh2hh]q(h4)q€}q(h"X0   1. Instantiate an OpenStack or Rackspace client.q‚h#hzh$h%h&h8h(}qƒ(h*]h+]h,]h-]h/]uh1Kh2hh]q„h;X0   1. Instantiate an OpenStack or Rackspace client.q……q†}q‡(h"h‚h#h€ubaubh?)qˆ}q‰(h"X(   Choose one of the following two options:qŠh#hzh$h%h&hBh(}q‹(h*]h+]h,]h-]h/]uh1Kh2hh]qŒh;X(   Choose one of the following two options:q…qŽ}q(h"hŠh#hˆubaubcdocutils.nodes
bullet_list
q)q‘}q’(h"U h#hzh$h%h&Ubullet_listq“h(}q”(Ubulletq•X   -h-]h,]h*]h+]h/]uh1Kh2hh]q–(cdocutils.nodes
list_item
q—)q˜}q™(h"X^  If you are working with a vanilla OpenStack cloud, instantiate an
``OpenCloud\OpenStack`` client as shown below.

.. code:: php

    use OpenCloud\OpenStack;

     $client = new OpenStack('<OPENSTACK CLOUD IDENTITY ENDPOINT URL>', array(
         'username' => '<YOUR OPENSTACK USERNAME>',
         'password' => '<YOUR OPENSTACK PASSWORD>'
     ));
h#h‘h$Nh&U	list_itemqšh(}q›(h*]h+]h,]h-]h/]uh1Nh2hh]qœ(h?)q}qž(h"Xp   If you are working with a vanilla OpenStack cloud, instantiate an
``OpenCloud\OpenStack`` client as shown below.h#h˜h$h%h&hBh(}qŸ(h*]h+]h,]h-]h/]uh1Kh]q (h;XB   If you are working with a vanilla OpenStack cloud, instantiate an
q¡…q¢}q£(h"XB   If you are working with a vanilla OpenStack cloud, instantiate an
h#hubcdocutils.nodes
literal
q¤)q¥}q¦(h"X   ``OpenCloud\OpenStack``h(}q§(h*]h+]h,]h-]h/]uh#hh]q¨h;X   OpenCloud\OpenStackq©…qª}q«(h"U h#h¥ubah&Uliteralq¬ubh;X    client as shown below.q­…q®}q¯(h"X    client as shown below.h#hubeubcdocutils.nodes
literal_block
q°)q±}q²(h"XÈ   use OpenCloud\OpenStack;

 $client = new OpenStack('<OPENSTACK CLOUD IDENTITY ENDPOINT URL>', array(
     'username' => '<YOUR OPENSTACK USERNAME>',
     'password' => '<YOUR OPENSTACK PASSWORD>'
 ));h(}q³(U	xml:spaceq´Upreserveqµh-]h,]h*]h+]q¶(Ucodeq·X   phpq¸eh/]uh#h˜h]q¹cdocutils.nodes
inline
qº)q»}q¼(h"XÈ   use OpenCloud\OpenStack;

 $client = new OpenStack('<OPENSTACK CLOUD IDENTITY ENDPOINT URL>', array(
     'username' => '<YOUR OPENSTACK USERNAME>',
     'password' => '<YOUR OPENSTACK PASSWORD>'
 ));h(}q½(h*]h+]q¾Uotherq¿ah,]h-]h/]uh#h±h]qÀh;XÈ   use OpenCloud\OpenStack;

 $client = new OpenStack('<OPENSTACK CLOUD IDENTITY ENDPOINT URL>', array(
     'username' => '<YOUR OPENSTACK USERNAME>',
     'password' => '<YOUR OPENSTACK PASSWORD>'
 ));qÁ…qÂ}qÃ(h"U h#h»ubah&UinlineqÄubah&Uliteral_blockqÅubeubh—)qÆ}qÇ(h"Xe  If you are working with the Rackspace cloud, instantiate a
``OpenCloud\Rackspace`` client as shown below.

.. code:: php

    use OpenCloud\Rackspace;

    $client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
        'username' => '<YOUR RACKSPACE CLOUD ACCOUNT USERNAME>',
        'apiKey'   => '<YOUR RACKSPACE CLOUD ACCOUNT API KEY>'
     ));
h#h‘h$Nh&hšh(}qÈ(h*]h+]h,]h-]h/]uh1Nh2hh]qÉ(h?)qÊ}qË(h"Xi   If you are working with the Rackspace cloud, instantiate a
``OpenCloud\Rackspace`` client as shown below.h#hÆh$h%h&hBh(}qÌ(h*]h+]h,]h-]h/]uh1K h]qÍ(h;X;   If you are working with the Rackspace cloud, instantiate a
qÎ…qÏ}qÐ(h"X;   If you are working with the Rackspace cloud, instantiate a
h#hÊubh¤)qÑ}qÒ(h"X   ``OpenCloud\Rackspace``h(}qÓ(h*]h+]h,]h-]h/]uh#hÊh]qÔh;X   OpenCloud\RackspaceqÕ…qÖ}q×(h"U h#hÑubah&h¬ubh;X    client as shown below.qØ…qÙ}qÚ(h"X    client as shown below.h#hÊubeubh°)qÛ}qÜ(h"XÖ   use OpenCloud\Rackspace;

$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
    'username' => '<YOUR RACKSPACE CLOUD ACCOUNT USERNAME>',
    'apiKey'   => '<YOUR RACKSPACE CLOUD ACCOUNT API KEY>'
 ));h(}qÝ(h´hµh-]h,]h*]h+]qÞ(h·X   phpqßeh/]uh#hÆh]qàhº)qá}qâ(h"XÖ   use OpenCloud\Rackspace;

$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
    'username' => '<YOUR RACKSPACE CLOUD ACCOUNT USERNAME>',
    'apiKey'   => '<YOUR RACKSPACE CLOUD ACCOUNT API KEY>'
 ));h(}qã(h*]h+]qäUotherqåah,]h-]h/]uh#hÛh]qæh;XÖ   use OpenCloud\Rackspace;

$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
    'username' => '<YOUR RACKSPACE CLOUD ACCOUNT USERNAME>',
    'apiKey'   => '<YOUR RACKSPACE CLOUD ACCOUNT API KEY>'
 ));qç…qè}qé(h"U h#háubah&hÄubah&hÅubeubeubeubh)qê}që(h"U h#hlh$h%h&h'h(}qì(h*]h+]h,]h-]qíhah/]qîhauh1K-h2hh]qï(h4)qð}qñ(h"X9   2. Obtain an Object Store service object from the client.qòh#hêh$h%h&h8h(}qó(h*]h+]h,]h-]h/]uh1K-h2hh]qôh;X9   2. Obtain an Object Store service object from the client.qõ…qö}q÷(h"hòh#hðubaubh°)qø}qù(h"XR   $region = 'DFW';
$objectStoreService = $client->objectStoreService(null, $region);h#hêh$h%h&hÅh(}qú(h´hµh-]h,]h*]h+]qû(h·X   phpqüeh/]uh1K3h2hh]qýhº)qþ}qÿ(h"XR   $region = 'DFW';
$objectStoreService = $client->objectStoreService(null, $region);h(}r   (h*]h+]r  Uotherr  ah,]h-]h/]uh#høh]r  h;XR   $region = 'DFW';
$objectStoreService = $client->objectStoreService(null, $region);r  …r  }r  (h"U h#hþubah&hÄubaubh?)r  }r  (h"X¿   In the example above, you are connecting to the ``DFW`` region of the
cloud. Any containers and objects created with this
``$objectStoreService`` instance will be stored in that cloud region.h#hêh$h%h&hBh(}r	  (h*]h+]h,]h-]h/]uh1K4h2hh]r
  (h;X0   In the example above, you are connecting to the r  …r  }r  (h"X0   In the example above, you are connecting to the h#j  ubh¤)r  }r  (h"X   ``DFW``h(}r  (h*]h+]h,]h-]h/]uh#j  h]r  h;X   DFWr  …r  }r  (h"U h#j  ubah&h¬ubh;XC    region of the
cloud. Any containers and objects created with this
r  …r  }r  (h"XC    region of the
cloud. Any containers and objects created with this
h#j  ubh¤)r  }r  (h"X   ``$objectStoreService``h(}r  (h*]h+]h,]h-]h/]uh#j  h]r  h;X   $objectStoreServicer  …r  }r  (h"U h#j  ubah&h¬ubh;X.    instance will be stored in that cloud region.r  …r   }r!  (h"X.    instance will be stored in that cloud region.h#j  ubeubeubh)r"  }r#  (h"U h#hlh$h%h&h'h(}r$  (h*]h+]h,]h-]r%  hah/]r&  hauh1K9h2hh]r'  (h4)r(  }r)  (h"XC   3. Create a container for your objects (also referred to as files).r*  h#j"  h$h%h&h8h(}r+  (h*]h+]h,]h-]h/]uh1K9h2hh]r,  h;XC   3. Create a container for your objects (also referred to as files).r-  …r.  }r/  (h"j*  h#j(  ubaubh°)r0  }r1  (h"X(  $container = $objectStoreService->createContainer('logos');

**Note:** when working with names that contain non-standard
alphanumerical characters (such as spaces or non-English
characters), you must ensure they are encoded with
```urlencode`` <http://php.net/urlencode>`__ before passing them inh#j"  h$h%h&hÅh(}r2  (h´hµh-]h,]h*]h+]r3  (h·X   phpr4  eh/]uh1KCh2hh]r5  hº)r6  }r7  (h"X(  $container = $objectStoreService->createContainer('logos');

**Note:** when working with names that contain non-standard
alphanumerical characters (such as spaces or non-English
characters), you must ensure they are encoded with
```urlencode`` <http://php.net/urlencode>`__ before passing them inh(}r8  (h*]h+]r9  Uotherr:  ah,]h-]h/]uh#j0  h]r;  h;X(  $container = $objectStoreService->createContainer('logos');

**Note:** when working with names that contain non-standard
alphanumerical characters (such as spaces or non-English
characters), you must ensure they are encoded with
```urlencode`` <http://php.net/urlencode>`__ before passing them inr<  …r=  }r>  (h"U h#j6  ubah&hÄubaubeubh)r?  }r@  (h"U h#hlh$h%h&h'h(}rA  (h*]h+]h,]h-]rB  hah/]rC  h	auh1KEh2hh]rD  (h4)rE  }rF  (h"X%   4. Upload an object to the container.rG  h#j?  h$h%h&h8h(}rH  (h*]h+]h,]h-]h/]uh1KEh2hh]rI  h;X%   4. Upload an object to the container.rJ  …rK  }rL  (h"jG  h#jE  ubaubh°)rM  }rN  (h"X¹   $localFileName  = '/path/to/local/php-elephant.jpg';
$remoteFileName = 'php-elephant.jpg';

$fileData = fopen($localFileName, 'r');
$container->uploadObject($remoteFileName, $fileData);h#j?  h$h%h&hÅh(}rO  (h´hµh-]h,]h*]h+]rP  (h·X   phprQ  eh/]uh1KNh2hh]rR  hº)rS  }rT  (h"X¹   $localFileName  = '/path/to/local/php-elephant.jpg';
$remoteFileName = 'php-elephant.jpg';

$fileData = fopen($localFileName, 'r');
$container->uploadObject($remoteFileName, $fileData);h(}rU  (h*]h+]rV  UotherrW  ah,]h-]h/]uh#jM  h]rX  h;X¹   $localFileName  = '/path/to/local/php-elephant.jpg';
$remoteFileName = 'php-elephant.jpg';

$fileData = fopen($localFileName, 'r');
$container->uploadObject($remoteFileName, $fileData);rY  …rZ  }r[  (h"U h#jS  ubah&hÄubaubh?)r\  }r]  (h"X\   [ `Get the executable PHP script for this
example </samples/ObjectStore/quickstart.php>`__ ]h#j?  h$h%h&hBh(}r^  (h*]h+]h,]h-]h/]uh1KOh2hh]r_  (h;X   [ r`  …ra  }rb  (h"X   [ h#j\  ubcdocutils.nodes
reference
rc  )rd  }re  (h"XX   `Get the executable PHP script for this
example </samples/ObjectStore/quickstart.php>`__h(}rf  (UnameX.   Get the executable PHP script for this exampleUrefurirg  X#   /samples/ObjectStore/quickstart.phph-]h,]h*]h+]h/]uh#j\  h]rh  h;X.   Get the executable PHP script for this
exampleri  …rj  }rk  (h"U h#jd  ubah&U	referencerl  ubh;X    ]rm  …rn  }ro  (h"X    ]h#j\  ubeubeubeubh)rp  }rq  (h"U h#h h$h%h&h'h(}rr  (h*]h+]h,]h-]rs  hah/]rt  h
auh1KSh2hh]ru  (h4)rv  }rw  (h"X
   Next stepsrx  h#jp  h$h%h&h8h(}ry  (h*]h+]h,]h-]h/]uh1KSh2hh]rz  h;X
   Next stepsr{  …r|  }r}  (h"jx  h#jv  ubaubh?)r~  }r  (h"X‡   There is a lot more you can do with containers and objects. See the
`complete user guide to the Object Store service <USERGUIDE.md>`__.h#jp  h$h%h&hBh(}r€  (h*]h+]h,]h-]h/]uh1KUh2hh]r  (h;XD   There is a lot more you can do with containers and objects. See the
r‚  …rƒ  }r„  (h"XD   There is a lot more you can do with containers and objects. See the
h#j~  ubjc  )r…  }r†  (h"XB   `complete user guide to the Object Store service <USERGUIDE.md>`__h(}r‡  (UnameX/   complete user guide to the Object Store servicejg  X   USERGUIDE.mdh-]h,]h*]h+]h/]uh#j~  h]rˆ  h;X/   complete user guide to the Object Store servicer‰  …rŠ  }r‹  (h"U h#j…  ubah&jl  ubh;X   .…rŒ  }r  (h"X   .h#j~  ubeubeubeubah"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_backlinksr±  Uentryr²  Ulanguage_coder³  Uenr´  U	datestamprµ  NUreport_levelr¶  KU_destinationr·  NU
halt_levelr¸  KUstrip_classesr¹  Nh8NUerror_encoding_error_handlerrº  Ubackslashreplacer»  Udebugr¼  NUembed_stylesheetr½  ‰Uoutput_encoding_error_handlerr¾  Ustrictr¿  Usectnum_xformrÀ  KUdump_transformsrÁ  NUdocinfo_xformrÂ  KUwarning_streamrÃ  NUpep_file_url_templaterÄ  Upep-%04drÅ  Uexit_status_levelrÆ  KUconfigrÇ  NUstrict_visitorrÈ  NUcloak_email_addressesrÉ  ˆUtrim_footnote_reference_spacerÊ  ‰UenvrË  NUdump_pseudo_xmlrÌ  NUexpose_internalsrÍ  NUsectsubtitle_xformrÎ  ‰Usource_linkrÏ  NUrfc_referencesrÐ  NUoutput_encodingrÑ  Uutf-8rÒ  U
source_urlrÓ  NUinput_encodingrÔ  U	utf-8-sigrÕ  U_disable_configrÖ  NU	id_prefixr×  U U	tab_widthrØ  KUerror_encodingrÙ  UUTF-8rÚ  U_sourcerÛ  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_highlightrâ  Ulongrã  Uinput_encoding_error_handlerrä  j¿  Uauto_id_prefixrå  Uidræ  Udoctitle_xformrç  ‰Ustrip_elements_with_classesrè  NU_config_filesré  ]rê  Ufile_insertion_enabledrë  ˆUraw_enabledrì  KUdump_settingsrí  NubUsymbol_footnote_startrî  K Uidsrï  }rð  (hhlhhzhjp  hhêhh hj?  hj"  uUsubstitution_namesrñ  }rò  h&h2h(}ró  (h*]h-]h,]Usourceh%h+]h/]uU	footnotesrô  ]rõ  Urefidsrö  }r÷  ub.