2
0

Zend_Service_Amazon_Ec2-Image.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  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 <acronym>AMI</acronym> is associated with an unique ID
  15. which 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 <acronym>AMI</acronym>. Once deregistered,
  32. instances of the <acronym>AMI</acronym> can no longer be launched.
  33. </para>
  34. <para>
  35. <code>deregister</code> returns boolean <constant>TRUE</constant> or
  36. <constant>FALSE</constant>.
  37. </para>
  38. <programlisting language="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 <acronym>AMI</acronym>s, AKIs, and
  47. ARIs available to the user. Information returned includes image type,
  48. product codes, architecture, and kernel and <acronym>RAM</acronym> 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>
  68. <para>
  69. The owner of the <acronym>AMI</acronym> granted launch
  70. permissions for the <acronym>AMI</acronym> to the all group.
  71. All users have launch permissions for these
  72. <constant>AMIs</constant>.
  73. </para>
  74. </entry>
  75. </row>
  76. <row>
  77. <entry><code>explicit</code></entry>
  78. <entry>
  79. <para>
  80. The owner of the <acronym>AMI</acronym> granted launch
  81. permissions to a specific user.
  82. </para>
  83. </entry>
  84. </row>
  85. <row>
  86. <entry><code>implicit</code></entry>
  87. <entry>
  88. <para>
  89. A user has implicit launch permissions for all
  90. <constant>AMIs</constant> he or she owns.
  91. </para>
  92. </entry>
  93. </row>
  94. </tbody>
  95. </tgroup>
  96. </table>
  97. </para>
  98. <para>
  99. The list of <acronym>AMI</acronym>s returned can be modified by specifying
  100. <acronym>AMI</acronym> IDs, <acronym>AMI</acronym> owners, or users with launch
  101. permissions. If no options are specified, Amazon EC2 returns all
  102. <acronym>AMI</acronym>s for which the user has launch permissions.
  103. </para>
  104. <para>
  105. If you specify one or more <acronym>AMI</acronym> IDs, only <acronym>AMI</acronym>s
  106. that have the specified IDs are returned. If you specify an invalid
  107. <acronym>AMI</acronym> ID, a fault is returned. If you specify an
  108. <acronym>AMI</acronym> ID for which you do not have access, it will not be included
  109. in the returned results.
  110. </para>
  111. <para>
  112. If you specify one or more <acronym>AMI</acronym> owners, only
  113. <acronym>AMI</acronym>s from the specified owners and for which you have access are
  114. returned. The results can include the account IDs of the specified owners, amazon
  115. for <acronym>AMI</acronym>s owned by Amazon or self for <acronym>AMI</acronym>s that
  116. you own.
  117. </para>
  118. <para>
  119. If you specify a list of executable users, only users that have launch permissions
  120. for the <acronym>AMI</acronym>s are returned. You can specify account IDs (if you
  121. own the <acronym>AMI</acronym>(s)), self for <acronym>AMI</acronym>s for which you
  122. own or have explicit permissions, or all for public <acronym>AMI</acronym>s.
  123. </para>
  124. <para>
  125. <code>describe</code> returns an array for all the images that match the critera
  126. that was passed in. The array contains the imageId, imageLocation, imageState,
  127. imageOwnerId, isPublic, architecture, imageType, kernelId, ramdiskId and platform.
  128. </para>
  129. <programlisting language="php"><![CDATA[
  130. $ec2_img = new Zend_Service_Amazon_Ec2_Image('aws_key','aws_secret_key');
  131. $ip = $ec2_img->describe();
  132. ]]></programlisting>
  133. </example>
  134. </sect2>
  135. <sect2 id="zend.service.amazon.ec2.images.attribute">
  136. <title>AMI Attribute Utilities</title>
  137. <example id="zend.service.amazon.ec2.images.attribute.modify">
  138. <title>Modify Image Attributes</title>
  139. <para>Modifies an attribute of an <acronym>AMI</acronym></para>
  140. <para>
  141. <table id="zend.service.amazon.ec2.images.attribute.modify-table">
  142. <title>Valid Attributes</title>
  143. <tgroup cols="2">
  144. <thead>
  145. <row>
  146. <entry>Name</entry>
  147. <entry>Description</entry>
  148. </row>
  149. </thead>
  150. <tbody>
  151. <row>
  152. <entry><code>launchPermission</code></entry>
  153. <entry>
  154. <para>
  155. Controls who has permission to launch the
  156. <acronym>AMI</acronym>. Launch permissions can be granted to
  157. specific users by adding userIds.
  158. </para>
  159. <para>
  160. To make the <acronym>AMI</acronym> public, add the all
  161. group.
  162. </para>
  163. </entry>
  164. </row>
  165. <row>
  166. <entry><code>productCodes</code></entry>
  167. <entry>
  168. <para>
  169. Associates a product code with <constant>AMIs</constant>.
  170. This allows developers to charge users for using
  171. <constant>AMIs</constant>. The user must be signed up for
  172. the product before they can launch the
  173. <acronym>AMI</acronym>. <emphasis>This is a write once
  174. attribute; after it is set, it cannot be changed or
  175. removed.</emphasis>
  176. </para>
  177. </entry>
  178. </row>
  179. </tbody>
  180. </tgroup>
  181. </table>
  182. </para>
  183. <para>
  184. <code>modifyAttribute</code> returns boolean <constant>TRUE</constant> or
  185. <constant>FALSE</constant>.
  186. </para>
  187. <programlisting language="php"><![CDATA[
  188. $ec2_img = new Zend_Service_Amazon_Ec2_Image('aws_key','aws_secret_key');
  189. // modify the launchPermission of an AMI
  190. $return = $ec2_img->modifyAttribute('imageId',
  191. 'launchPermission',
  192. 'add',
  193. 'userId',
  194. 'userGroup');
  195. // set the product code of the AMI.
  196. $return = $ec2_img->modifyAttribute('imageId',
  197. 'productCodes',
  198. 'add',
  199. null,
  200. null,
  201. 'productCode');
  202. ]]></programlisting>
  203. </example>
  204. <example id="zend.service.amazon.ec2.images.attribute.reset">
  205. <title>Reset an AMI Attribute</title>
  206. <para>
  207. <code>resetAttribute</code> will reset the attribute of an <acronym>AMI</acronym> to
  208. its default value. <emphasis>The productCodes attribute cannot be reset.</emphasis>
  209. </para>
  210. <programlisting language="php"><![CDATA[
  211. $ec2_img = new Zend_Service_Amazon_Ec2_Image('aws_key','aws_secret_key');
  212. $return = $ec2_img->resetAttribute('imageId', 'launchPermission');
  213. ]]></programlisting>
  214. </example>
  215. <example id="zend.service.amazon.ec2.images.attribute.describe">
  216. <title>Describe AMI Attribute</title>
  217. <para>
  218. <code>describeAttribute</code> returns information about an attribute of an
  219. <acronym>AMI</acronym>. Only one attribute can be specified per call. Currently only
  220. launchPermission and productCodes are supported.
  221. </para>
  222. <para>
  223. <code>describeAttribute</code> returns an array with the value of the attribute
  224. that was requested.
  225. </para>
  226. <programlisting language="php"><![CDATA[
  227. $ec2_img = new Zend_Service_Amazon_Ec2_Image('aws_key','aws_secret_key');
  228. $return = $ec2_img->describeAttribute('imageId', 'launchPermission');
  229. ]]></programlisting>
  230. </example>
  231. </sect2>
  232. </sect1>