2
0

Zend_Service_Amazon_Ec2-Image.xml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.service.amazon.ec2.images">
  4. <title>Zend_Service_Amazon_Ec2: Amazon Machine Images (AMI)</title>
  5. <para>
  6. Amazon Machine Images (AMIs) are preconfigured with an ever-growing list
  7. of operating systems.
  8. </para>
  9. <sect2 id="zend.service.amazon.ec2.images.info">
  10. <title>AMI Information Utilities</title>
  11. <example id="zend.service.amazon.ec2.images.register">
  12. <title>Register an AMI with EC2</title>
  13. <para>
  14. <code>register</code> Each AMI is associated with an unique ID which
  15. is provided by the Amazon EC2 service through the RegisterImage
  16. operation. During registration, Amazon EC2 retrieves the specified
  17. image manifest from Amazon S3 and verifies that the image is owned by
  18. the user registering the image.
  19. </para>
  20. <para>
  21. <code>register</code> returns the imageId for the registered Image.
  22. </para>
  23. <programlisting language="php"><![CDATA[
  24. $ec2_img = new Zend_Service_Amazon_Ec2_Image('aws_key','aws_secret_key');
  25. $ip = $ec2_img->register('imageLocation');
  26. ]]></programlisting>
  27. </example>
  28. <example id="zend.service.amazon.ec2.images.deregister">
  29. <title>Deregister an AMI with EC2</title>
  30. <para>
  31. <code>deregister</code>, Deregisters an AMI. Once deregistered, instances
  32. of the AMI can no longer be launched.
  33. </para>
  34. <para>
  35. <code>deregister</code> returns boolean true or false.
  36. </para>
  37. <programlisting language="php"><![CDATA[
  38. $ec2_img = new Zend_Service_Amazon_Ec2_Image('aws_key','aws_secret_key');
  39. $ip = $ec2_img->deregister('imageId');
  40. ]]></programlisting>
  41. </example>
  42. <example id="zend.service.amazon.ec2.images.describe">
  43. <title>Describe an AMI</title>
  44. <para>
  45. <code>describe</code> Returns information about AMIs, AKIs, and ARIs
  46. available to the user. Information returned includes image type,
  47. product codes, architecture, and kernel and RAM disk IDs. Images
  48. available to the user include public images available for any user
  49. to launch, private images owned by the user making the request,
  50. and private images owned by other users for which the user has
  51. explicit launch permissions.
  52. </para>
  53. <para>
  54. <table id="zend.service.amazon.ec2.images.describe-table">
  55. <title>Launch permissions fall into three categories</title>
  56. <tgroup cols="2">
  57. <thead>
  58. <row>
  59. <entry>Name</entry>
  60. <entry>Description</entry>
  61. </row>
  62. </thead>
  63. <tbody>
  64. <row>
  65. <entry><code>public</code></entry>
  66. <entry><para>
  67. The owner of the AMI granted launch permissions for the AMI
  68. to the all group. All users have launch permissions for these AMIs.
  69. </para></entry>
  70. </row>
  71. <row>
  72. <entry><code>explicit</code></entry>
  73. <entry><para>
  74. The owner of the AMI granted launch permissions to a specific user.
  75. </para></entry>
  76. </row>
  77. <row>
  78. <entry><code>implicit</code></entry>
  79. <entry><para>
  80. A user has implicit launch permissions for all AMIs he or she owns.
  81. </para></entry>
  82. </row>
  83. </tbody>
  84. </tgroup>
  85. </table>
  86. </para>
  87. <para>
  88. The list of AMIs returned can be modified by specifying AMI IDs, AMI owners,
  89. or users with launch permissions. If no options are specified, Amazon EC2 returns
  90. all AMIs for which the user has launch permissions.
  91. </para>
  92. <para>
  93. If you specify one or more AMI IDs, only AMIs that have the specified IDs are returned.
  94. If you specify an invalid AMI ID, a fault is returned. If you specify an AMI ID for which
  95. you do not have access, it will not be included in the returned results.
  96. </para>
  97. <para>
  98. If you specify one or more AMI owners, only AMIs from the specified owners and for
  99. which you have access are returned. The results can include the account IDs of the
  100. specified owners, amazon for AMIs owned by Amazon or self for AMIs that you own.
  101. </para>
  102. <para>
  103. If you specify a list of executable users, only users that have launch permissions
  104. for the AMIs are returned. You can specify account IDs (if you own the AMI(s)), self
  105. for AMIs for which you own or have explicit permissions, or all for public AMIs.
  106. </para>
  107. <para>
  108. <code>describe</code> returns an array for all the images that match the critera that was
  109. passed in. The array contains the imageId, imageLocation, imageState, imageOwnerId, isPublic,
  110. architecture, imageType, kernelId, ramdiskId and platform.
  111. </para>
  112. <programlisting language="php"><![CDATA[
  113. $ec2_img = new Zend_Service_Amazon_Ec2_Image('aws_key','aws_secret_key');
  114. $ip = $ec2_img->describe();
  115. ]]></programlisting>
  116. </example>
  117. </sect2>
  118. <sect2 id="zend.service.amazon.ec2.images.attribute">
  119. <title>AMI Attribute Utilities</title>
  120. <example id="zend.service.amazon.ec2.images.attribute.modify">
  121. <title>Modify Image Attributes</title>
  122. <para>Modifies an attribute of an AMI</para>
  123. <para>
  124. <table id="zend.service.amazon.ec2.images.attribute.modify-table">
  125. <title>Valid Attributes</title>
  126. <tgroup cols="2">
  127. <thead>
  128. <row>
  129. <entry>Name</entry>
  130. <entry>Description</entry>
  131. </row>
  132. </thead>
  133. <tbody>
  134. <row>
  135. <entry><code>launchPermission</code></entry>
  136. <entry><para>
  137. Controls who has permission to launch the AMI. Launch permissions
  138. can be granted to specific users by adding userIds.
  139. </para><para>To make the AMI public, add the all group.</para></entry>
  140. </row>
  141. <row>
  142. <entry><code>productCodes</code></entry>
  143. <entry><para>
  144. Associates a product code with AMIs. This allows developers to
  145. charge users for using AMIs. The user must be signed up for the
  146. product before they can launch the AMI.
  147. <emphasis>This is a write once attribute;
  148. after it is set, it cannot be changed or
  149. removed.</emphasis>
  150. </para></entry>
  151. </row>
  152. </tbody>
  153. </tgroup>
  154. </table>
  155. </para>
  156. <para>
  157. <code>modifyAttribute</code> returns boolean true or false.
  158. </para>
  159. <programlisting language="php"><![CDATA[
  160. $ec2_img = new Zend_Service_Amazon_Ec2_Image('aws_key','aws_secret_key');
  161. // modify the launchPermission of an AMI
  162. $return = $ec2_img->modifyAttribute('imageId',
  163. 'launchPermission',
  164. 'add',
  165. 'userId',
  166. 'userGroup');
  167. // set the product code of the AMI.
  168. $return = $ec2_img->modifyAttribute('imageId',
  169. 'productCodes',
  170. 'add',
  171. null,
  172. null,
  173. 'productCode');
  174. ]]></programlisting>
  175. </example>
  176. <example id="zend.service.amazon.ec2.images.attribute.reset">
  177. <title>Reset an AMI Attribute</title>
  178. <para>
  179. <code>resetAttribute</code> will reset the attribute of an AMI to its default value.
  180. <emphasis>The productCodes attribute cannot be reset.</emphasis>
  181. </para>
  182. <programlisting language="php"><![CDATA[
  183. $ec2_img = new Zend_Service_Amazon_Ec2_Image('aws_key','aws_secret_key');
  184. $return = $ec2_img->resetAttribute('imageId', 'launchPermission');
  185. ]]></programlisting>
  186. </example>
  187. <example id="zend.service.amazon.ec2.images.attribute.describe">
  188. <title>Describe AMI Attribute</title>
  189. <para>
  190. <code>describeAttribute</code> returns information about an attribute of an AMI.
  191. Only one attribute can be specified per call. Currently only launchPermission and
  192. productCodes are supported.
  193. </para>
  194. <para>
  195. <code>describeAttribute</code> returns an array with the value of the attribute
  196. that was requested.
  197. </para>
  198. <programlisting language="php"><![CDATA[
  199. $ec2_img = new Zend_Service_Amazon_Ec2_Image('aws_key','aws_secret_key');
  200. $return = $ec2_img->describeAttribute('imageId', 'launchPermission');
  201. ]]></programlisting>
  202. </example>
  203. </sect2>
  204. </sect1>