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 keypairqHqI}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.qRqS}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);qgqh}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 keypairqvqw}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   phpqeh-]uh/K/h0hh]qh`)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)]qUotherqah*]h+]h-]uh!hh]qh9Xr  $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
));qq}q(h U h!hubah$hjubaubeubh)q}q(h U h!hh"h#h$h%h&}q(h(]h)]h*]h+]qhah-]qhauh/K1h0hh]q(h2)q}q(h X   List keypairsqh!hh"h#h$h6h&}q(h(]h)]h*]h+]h-]uh/K1h0hh]qh9X   List keypairsqq}q(h hh!hubaubhK)q}q(h X   To list all existing keypairs:qh!hh"h#h$hOh&}q(h(]h)]h*]h+]h-]uh/K3h0hh]qh9X   To list all existing keypairs:qq}q(h hh!hubaubhU)q}q(h XH   $keys = $service->listKeypairs();

foreach ($keys as $key) {
   // ...
}h!hh"h#h$hXh&}q(hZh[h+]h*]h(]h)]q(h]X   phpqeh-]uh/K<h0hh]qh`)q}q(h XH   $keys = $service->listKeypairs();

foreach ($keys as $key) {
   // ...
}h&}q(h(]h)]qUotherqah*]h+]h-]uh!hh]qh9XH   $keys = $service->listKeypairs();

foreach ($keys as $key) {
   // ...
}qq}q(h U h!hubah$hjubaubhK)q}q(h XP   For more information about iterators, please see `the
docs <../Iterators.md>`__.h!hh"h#h$hOh&}q(h(]h)]h*]h+]h-]uh/K=h0hh]q(h9X1   For more information about iterators, please see qq}q(h X1   For more information about iterators, please see h!hubcdocutils.nodes
reference
q)q}q(h X   `the
docs <../Iterators.md>`__h&}q(UnameX   the docsUrefuriqX   ../Iterators.mdh+]h*]h(]h)]h-]uh!hh]qh9X   the
docsqq}q(h U h!hubah$U	referencequbh9X   .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auh/KAh0hh]q(h2)q}q(h X   Delete keypairsqh!hh"h#h$h6h&}q(h(]h)]h*]h+]h-]uh/KAh0hh]qh9X   Delete keypairsqӅq}q(h hh!hubaubhK)q}q(h X   To delete a specific keypair:qh!hh"h#h$hOh&}q(h(]h)]h*]h+]h-]uh/KCh0hh]qh9X   To delete a specific keypair:qۅq}q(h hh!hubaubhU)q}q(h X   $keypair->delete();h!hh"h#h$hXh&}q(hZh[h+]h*]h(]h)]q(h]X   phpqeh-]uh/KHh0hh]qh`)q}q(h X   $keypair->delete();h&}q(h(]h)]qUotherqah*]h+]h-]uh!hh]qh9X   $keypair->delete();qꅁq}q(h U h!hubah$hjubaubeubh)q}q(h U h!hh"h#h$h%h&}q(h(]h)]h*]h+]qhah-]qh	auh/KJh0hh]q(h2)q}q(h X    Creating a server with a keypairqh!hh"h#h$h6h&}q(h(]h)]h*]h+]h-]uh/KJh0hh]qh9X    Creating a server with a keypairqq}q(h hh!hubaubhK)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:qh!hh"h#h$hOh&}q(h(]h)]h*]h+]h-]uh/KLh0hh]qh9X   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 hh!hubaubhU)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!hh"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!hh"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hhhhhhhkhhhh=uUsubstitution_namesr  }r  h$h0h&}r  (h(]h+]h*]Usourceh#h)]h-]uU	footnotesr  ]r  Urefidsr  }r  ub.