Zend_Service_Amazon_Ec2-Image.xml 10 KB

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