€cdocutils.nodes
document
q)�q}q(U	nametypesq}q(X   delete keypairsqNX   keypairsqNX   upload existing keypairqNX    creating a server with a keypairq	NX   generate new keypairq
NX   list keypairsqNuUsubstitution_defsq}qUparse_messagesq]qUcurrent_sourceqNU
decorationqNUautofootnote_startqKUnameidsq}q(hUdelete-keypairsqhUkeypairsqhUupload-existing-keypairqh	U creating-a-server-with-a-keypairqh
Ugenerate-new-keypairqhUlist-keypairsquUchildrenq]qcdocutils.nodes
section
q)�q}q(U	rawsourceq U Uparentq!hUsourceq"XK   /Users/jamie/projects/php/php-opencloud/doc/services/compute/Keypair.md.rstq#Utagnameq$Usectionq%U
attributesq&}q'(Udupnamesq(]Uclassesq)]Ubackrefsq*]Uidsq+]q,haUnamesq-]q.hauUlineq/KUdocumentq0hh]q1(cdocutils.nodes
title
q2)�q3}q4(h X   Keypairsq5h!hh"h#h$Utitleq6h&}q7(h(]h)]h*]h+]h-]uh/Kh0hh]q8cdocutils.nodes
Text
q9X   Keypairsq:…�q;}q<(h h5h!h3ubaubh)�q=}q>(h U h!hh"h#h$h%h&}q?(h(]h)]h*]h+]q@hah-]qAh
auh/Kh0hh]qB(h2)�qC}qD(h X   Generate new keypairqEh!h=h"h#h$h6h&}qF(h(]h)]h*]h+]h-]uh/Kh0hh]qGh9X   Generate new keypairqH…�qI}qJ(h hEh!hCubaubcdocutils.nodes
paragraph
qK)�qL}qM(h Xt   This operation creates a new keypair under a provided name; the public
key value is automatically generated for you.qNh!h=h"h#h$U	paragraphqOh&}qP(h(]h)]h*]h+]h-]uh/Kh0hh]qQh9Xt   This operation creates a new keypair under a provided name; the public
key value is automatically generated for you.qR…�qS}qT(h hNh!hLubaubcdocutils.nodes
literal_block
qU)�qV}qW(h X„  $keypair = $service->keypair();

$keypair->create(array(
   'name' => 'jamie_keypair_1'
));

echo $keypair->getPublicKey();

// Save private key to a file so you can use it to SSH into
// your server later.
$sshPrivateKeyFilename = 'jamie_keypair_1_rsa';
$privateKey = $keypair->getPrivateKey();
file_put_contents($sshPrivateKeyFilename, $privateKey);
chmod($sshPrivateKeyFilename, 0600);h!h=h"h#h$Uliteral_blockqXh&}qY(U	xml:spaceqZUpreserveq[h+]h*]h(]h)]q\(Ucodeq]X   phpq^eh-]uh/Kh0hh]q_cdocutils.nodes
inline
q`)�qa}qb(h X„  $keypair = $service->keypair();

$keypair->create(array(
   'name' => 'jamie_keypair_1'
));

echo $keypair->getPublicKey();

// Save private key to a file so you can use it to SSH into
// your server later.
$sshPrivateKeyFilename = 'jamie_keypair_1_rsa';
$privateKey = $keypair->getPrivateKey();
file_put_contents($sshPrivateKeyFilename, $privateKey);
chmod($sshPrivateKeyFilename, 0600);h&}qc(h(]h)]qdUotherqeah*]h+]h-]uh!hVh]qfh9X„  $keypair = $service->keypair();

$keypair->create(array(
   'name' => 'jamie_keypair_1'
));

echo $keypair->getPublicKey();

// Save private key to a file so you can use it to SSH into
// your server later.
$sshPrivateKeyFilename = 'jamie_keypair_1_rsa';
$privateKey = $keypair->getPrivateKey();
file_put_contents($sshPrivateKeyFilename, $privateKey);
chmod($sshPrivateKeyFilename, 0600);qg…�qh}qi(h U h!haubah$Uinlineqjubaubeubh)�qk}ql(h U h!hh"h#h$h%h&}qm(h(]h)]h*]h+]qnhah-]qohauh/Kh0hh]qp(h2)�qq}qr(h X   Upload existing keypairqsh!hkh"h#h$h6h&}qt(h(]h)]h*]h+]h-]uh/Kh0hh]quh9X   Upload existing keypairqv…�qw}qx(h hsh!hqubaubhK)�qy}qz(h XÔ   This operation creates a new keypair under a provided name using a
provided public key value. This public key will probably exist on your
local filesystem, and so provide easy access to your server when
uploaded.q{h!hkh"h#h$hOh&}q|(h(]h)]h*]h+]h-]uh/Kh0hh]q}h9XÔ   This operation creates a new keypair under a provided name using a
provided public key value. This public key will probably exist on your
local filesystem, and so provide easy access to your server when
uploaded.q~…�q}q€(h h{h!hyubaubhU)�q�}q‚(h Xr  $keypair = $service->keypair();

$key = <<<EOT
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Example public key
EOT;

$keypair->create(array(
   'name'      => 'jamie_macbook',
   'publicKey' => $key
));h!hkh"h#h$hXh&}qƒ(hZh[h+]h*]h(]h)]q„(h]X   phpq…eh-]uh/K/h0hh]q†h`)�q‡}qˆ(h Xr  $keypair = $service->keypair();

$key = <<<EOT
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Example public key
EOT;

$keypair->create(array(
   'name'      => 'jamie_macbook',
   'publicKey' => $key
));h&}q‰(h(]h)]qŠUotherq‹ah*]h+]h-]uh!h�h]qŒh9Xr  $keypair = $service->keypair();

$key = <<<EOT
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Example public key
EOT;

$keypair->create(array(
   'name'      => 'jamie_macbook',
   'publicKey' => $key
));q�…�qŽ}q�(h U h!h‡ubah$hjubaubeubh)�q�}q‘(h U h!hh"h#h$h%h&}q’(h(]h)]h*]h+]q“hah-]q”hauh/K1h0hh]q•(h2)�q–}q—(h X   List keypairsq˜h!h�h"h#h$h6h&}q™(h(]h)]h*]h+]h-]uh/K1h0hh]qšh9X   List keypairsq›…�qœ}q�(h h˜h!h–ubaubhK)�qž}qŸ(h X   To list all existing keypairs:q h!h�h"h#h$hOh&}q¡(h(]h)]h*]h+]h-]uh/K3h0hh]q¢h9X   To list all existing keypairs:q£…�q¤}q¥(h h h!hžubaubhU)�q¦}q§(h XH   $keys = $service->listKeypairs();

foreach ($keys as $key) {
   // ...
}h!h�h"h#h$hXh&}q¨(hZh[h+]h*]h(]h)]q©(h]X   phpqªeh-]uh/K<h0hh]q«h`)�q¬}q­(h XH   $keys = $service->listKeypairs();

foreach ($keys as $key) {
   // ...
}h&}q®(h(]h)]q¯Uotherq°ah*]h+]h-]uh!h¦h]q±h9XH   $keys = $service->listKeypairs();

foreach ($keys as $key) {
   // ...
}q²…�q³}q´(h U h!h¬ubah$hjubaubhK)�qµ}q¶(h XP   For more information about iterators, please see `the
docs <../Iterators.md>`__.h!h�h"h#h$hOh&}q·(h(]h)]h*]h+]h-]uh/K=h0hh]q¸(h9X1   For more information about iterators, please see q¹…�qº}q»(h X1   For more information about iterators, please see h!hµubcdocutils.nodes
reference
q¼)�q½}q¾(h X   `the
docs <../Iterators.md>`__h&}q¿(UnameX   the docsUrefuriqÀX   ../Iterators.mdh+]h*]h(]h)]h-]uh!hµh]qÁh9X   the
docsqÂ…�qÃ}qÄ(h U h!h½ubah$U	referenceqÅubh9X   .…�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auh/KAh0hh]qÍ(h2)�qÎ}qÏ(h X   Delete keypairsqÐh!hÈh"h#h$h6h&}qÑ(h(]h)]h*]h+]h-]uh/KAh0hh]qÒh9X   Delete keypairsqÓ…�qÔ}qÕ(h hÐh!hÎubaubhK)�qÖ}q×(h X   To delete a specific keypair:qØh!hÈh"h#h$hOh&}qÙ(h(]h)]h*]h+]h-]uh/KCh0hh]qÚh9X   To delete a specific keypair:qÛ…�qÜ}qÝ(h hØh!hÖubaubhU)�qÞ}qß(h X   $keypair->delete();h!hÈh"h#h$hXh&}qà(hZh[h+]h*]h(]h)]qá(h]X   phpqâeh-]uh/KHh0hh]qãh`)�qä}qå(h X   $keypair->delete();h&}qæ(h(]h)]qçUotherqèah*]h+]h-]uh!hÞh]qéh9X   $keypair->delete();qê…�që}qì(h U h!häubah$hjubaubeubh)�qí}qî(h U h!hh"h#h$h%h&}qï(h(]h)]h*]h+]qðhah-]qñh	auh/KJh0hh]qò(h2)�qó}qô(h X    Creating a server with a keypairqõh!híh"h#h$h6h&}qö(h(]h)]h*]h+]h-]uh/KJh0hh]q÷h9X    Creating a server with a keypairqø…�qù}qú(h hõh!hóubaubhK)�qû}qü(h X²   In order to spawn an instance with a saved keypair (allowing you to SSH
in without passwords), you create your server using the same operation
as usual, with one extra parameter:qýh!híh"h#h$hOh&}qþ(h(]h)]h*]h+]h-]uh/KLh0hh]qÿh9X²   In order to spawn an instance with a saved keypair (allowing you to SSH
in without passwords), you create your server using the same operation
as usual, with one extra parameter:r   …�r  }r  (h hýh!hûubaubhU)�r  }r  (h X  use Guzzle\Http\Exception\BadResponseException;
use OpenCloud\Compute\Constants\Network;

$server = $compute->server();

try {
    $response = $server->create(array(
        'name'     => 'New server',
        'image'    => $ubuntuImage,
        'flavor'   => $twoGbFlavor,
        'networks' => array(
            $compute->network(Network::RAX_PUBLIC),
            $compute->network(Network::RAX_PRIVATE)
        ),
        'keypair' => 'jamie_macbook'
    ));
} catch (BadResponseException $e) {
   // error...
}h!híh"h#h$hXh&}r  (hZh[h+]h*]h(]h)]r  (h]X   phpr  eh-]uh/Keh0hh]r  h`)�r	  }r
  (h X  use Guzzle\Http\Exception\BadResponseException;
use OpenCloud\Compute\Constants\Network;

$server = $compute->server();

try {
    $response = $server->create(array(
        'name'     => 'New server',
        'image'    => $ubuntuImage,
        'flavor'   => $twoGbFlavor,
        'networks' => array(
            $compute->network(Network::RAX_PUBLIC),
            $compute->network(Network::RAX_PRIVATE)
        ),
        'keypair' => 'jamie_macbook'
    ));
} catch (BadResponseException $e) {
   // error...
}h&}r  (h(]h)]r  Uotherr  ah*]h+]h-]uh!j  h]r  h9X  use Guzzle\Http\Exception\BadResponseException;
use OpenCloud\Compute\Constants\Network;

$server = $compute->server();

try {
    $response = $server->create(array(
        'name'     => 'New server',
        'image'    => $ubuntuImage,
        'flavor'   => $twoGbFlavor,
        'networks' => array(
            $compute->network(Network::RAX_PUBLIC),
            $compute->network(Network::RAX_PRIVATE)
        ),
        'keypair' => 'jamie_macbook'
    ));
} catch (BadResponseException $e) {
   // error...
}r  …�r  }r  (h U h!j	  ubah$hjubaubhK)�r  }r  (h Xk   So, as you can see, you specify the **name** of an existing keypair that
you previously created on the API.h!híh"h#h$hOh&}r  (h(]h)]h*]h+]h-]uh/Kfh0hh]r  (h9X$   So, as you can see, you specify the r  …�r  }r  (h X$   So, as you can see, you specify the h!j  ubcdocutils.nodes
strong
r  )�r  }r  (h X   **name**h&}r  (h(]h)]h*]h+]h-]uh!j  h]r  h9X   namer  …�r  }r   (h U h!j  ubah$Ustrongr!  ubh9X?    of an existing keypair that
you previously created on the API.r"  …�r#  }r$  (h X?    of an existing keypair that
you previously created on the API.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	citationsr0  ]r1  h0hUcurrent_liner2  NUtransform_messagesr3  ]r4  Ureporterr5  NUid_startr6  KUautofootnotesr7  ]r8  Ucitation_refsr9  }r:  Uindirect_targetsr;  ]r<  Usettingsr=  (cdocutils.frontend
Values
r>  or?  }r@  (Ufootnote_backlinksrA  KUrecord_dependenciesrB  NUrfc_base_urlrC  Uhttp://tools.ietf.org/html/rD  U	tracebackrE  ˆUpep_referencesrF  NUstrip_commentsrG  NUtoc_backlinksrH  UentryrI  Ulanguage_coderJ  UenrK  U	datestamprL  NUreport_levelrM  KU_destinationrN  NU
halt_levelrO  KUstrip_classesrP  Nh6NUerror_encoding_error_handlerrQ  UbackslashreplacerR  UdebugrS  NUembed_stylesheetrT  ‰Uoutput_encoding_error_handlerrU  UstrictrV  Usectnum_xformrW  KUdump_transformsrX  NUdocinfo_xformrY  KUwarning_streamrZ  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_spacera  ‰Uenvrb  NUdump_pseudo_xmlrc  NUexpose_internalsrd  NUsectsubtitle_xformre  ‰Usource_linkrf  NUrfc_referencesrg  NUoutput_encodingrh  Uutf-8ri  U
source_urlrj  NUinput_encodingrk  U	utf-8-sigrl  U_disable_configrm  NU	id_prefixrn  U U	tab_widthro  KUerror_encodingrp  UUTF-8rq  U_sourcerr  h#Ugettext_compactrs  ˆU	generatorrt  NUdump_internalsru  NUsmart_quotesrv  ‰Upep_base_urlrw  Uhttp://www.python.org/dev/peps/rx  Usyntax_highlightry  Ulongrz  Uinput_encoding_error_handlerr{  jV  Uauto_id_prefixr|  Uidr}  Udoctitle_xformr~  ‰Ustrip_elements_with_classesr  NU_config_filesr€  ]Ufile_insertion_enabledr�  ˆUraw_enabledr‚  KUdump_settingsrƒ  NubUsymbol_footnote_startr„  K Uidsr…  }r†  (hhíhhhhÈhhkhh�hh=uUsubstitution_namesr‡  }rˆ  h$h0h&}r‰  (h(]h+]h*]Usourceh#h)]h-]uU	footnotesrŠ  ]r‹  UrefidsrŒ  }r�  ub.