Zend_Service_Amazon_Ec2.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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
  16. in Amazon's data centers using APIs or available tools and utilities. You can use
  17. Amazon EC2 server instances at any time, for as long as you need, and for any legal
  18. 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 AWS Access Keys as default keys. When you then create any new
  27. 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 which
  37. Amazon Ec2 Region you are working in. Currently there is only two region available us-east-1
  38. and eu-west-1. If an invalid value is passed it will throw an exception stating that.
  39. </para>
  40. <example id="zend.service.amazon.ec2.staticmethods.setregion">
  41. <title>setRegion() Example</title>
  42. <programlisting language="php"><![CDATA[
  43. Zend_Service_Amazon_Ec2_Ebs::setRegion('us-east-1');
  44. ]]></programlisting>
  45. </example>
  46. <note id="zend.service.amazon.ec2.staticmethods.setregion.note">
  47. <title>Set Amazon Ec2 Region</title>
  48. <para>
  49. Alternativly you can set the region when you create each class as the third parameter in the
  50. constructor method.
  51. </para>
  52. </note>
  53. </sect2>
  54. </sect1>