Zend_Service_Amazon_Ec2.xml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.service.amazon.ec2" xmlns:xi="http://www.w3.org/2001/XInclude">
  4. <title>Zend_Service_Amazon_Ec2</title>
  5. <sect2 id="zend.service.amazon.ec2.introduction">
  6. <title>Introduction</title>
  7. <para>
  8. <classname>Zend_Service_Amazon_Ec2</classname> provides an interface to Amazon Elastic
  9. Clound Computing (EC2).
  10. </para>
  11. </sect2>
  12. <sect2 id="zend.service.amazon.ec2.whatis">
  13. <title>What is Amazon Ec2?</title>
  14. <para>
  15. Amazon EC2 is a web service that enables you to launch and manage server instances in
  16. Amazon's data centers using <acronym>API</acronym>s or available tools and utilities.
  17. You can use Amazon EC2 server instances at any time, for as long as you need, and for
  18. any legal purpose.
  19. </para>
  20. </sect2>
  21. <sect2 id="zend.service.amazon.ec2.staticmethods">
  22. <title>Static Methods</title>
  23. <para>
  24. To make using the Ec2 class easier to use there are two static methods that can be
  25. invoked from any of the Ec2 Elements. The first static method is <code>setKeys</code>
  26. which will defind you <acronym>AWS</acronym> Access Keys as default keys. When you then
  27. create any new object you don't need to pass in any keys to the constructor.
  28. </para>
  29. <example id="zend.service.amazon.ec2.staticmethods.setkeys">
  30. <title>setKeys() Example</title>
  31. <programlisting language="php"><![CDATA[
  32. Zend_Service_Amazon_Ec2_Ebs::setKeys('aws_key','aws_secret_key');
  33. ]]></programlisting>
  34. </example>
  35. <para>
  36. To set the region that you are working in you can call the <code>setRegion</code> to set
  37. which Amazon Ec2 Region you are working in. Currently there is only two region available
  38. us-east-1 and eu-west-1. If an invalid value is passed it will throw an exception
  39. stating that.
  40. </para>
  41. <example id="zend.service.amazon.ec2.staticmethods.setregion">
  42. <title>setRegion() Example</title>
  43. <programlisting language="php"><![CDATA[
  44. Zend_Service_Amazon_Ec2_Ebs::setRegion('us-east-1');
  45. ]]></programlisting>
  46. </example>
  47. <note id="zend.service.amazon.ec2.staticmethods.setregion.note">
  48. <title>Set Amazon Ec2 Region</title>
  49. <para>
  50. Alternativly you can set the region when you create each class as the third
  51. parameter in the constructor method.
  52. </para>
  53. </note>
  54. </sect2>
  55. </sect1>