1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.service.amazon.ec2.keypairs">
<title>Zend_Service_Amazon_Ec2: Keypairs</title>
<para>
Keypairs are used to access instances.
</para>
<example id="zend.service.amazon.ec2.keypairs.create">
<title>Creating a new Amazon Keypair</title>
<para>
<code>create</code>, creates a new 2048 bit RSA key pair and
returns a unique ID that can be used to reference this key
pair when launching new instances.
</para>
<para>
<code>create</code> returns an array which contains the keyName,
keyFingerprint and keyMaterial.
</para>
<programlisting language="php"><![CDATA[
$ec2_kp = new Zend_Service_Amazon_Ec2_Keypair('aws_key','aws_secret_key');
$return = $ec2_kp->create('my-new-key');
]]></programlisting>
</example>
<example id="zend.service.amazon.ec2.keypairs.delete">
<title>Deleting an Amazon Keypair</title>
<para>
<code>delete</code>, will delete the key pair. This will only
prevent it from being used with new instances. Instances currently
running with the keypair will still allow you to access them.
</para>
<para>
<code>delete</code> returns boolean <constant>TRUE</constant> or
<constant>FALSE</constant>
</para>
<programlisting language="php"><![CDATA[
$ec2_kp = new Zend_Service_Amazon_Ec2_Keypair('aws_key','aws_secret_key');
$return = $ec2_kp->delete('my-new-key');
]]></programlisting>
</example>
<example id="zend.service.amazon.ec2.describe">
<title>Describe an Amazon Keypair</title>
<para>
<code>describe</code> returns information about key pairs available to you.
If you specify key pairs, information about those key pairs is returned. Otherwise,
information for all registered key pairs is returned.
</para>
<para>
<code>describe</code> returns an array which contains keyName and keyFingerprint
</para>
<programlisting language="php"><![CDATA[
$ec2_kp = new Zend_Service_Amazon_Ec2_Keypair('aws_key','aws_secret_key');
$return = $ec2_kp->describe('my-new-key');
]]></programlisting>
</example>
</sect1>
|