Введение в Zend Framework

 Learning Zend Framework


 Zend Framework Reference

  • Zend_Gdata
  • Zend_Http
  • Zend_InfoCard
  • Zend_Json
  • Zend_Layout
  • Zend_Ldap
  • Zend_Loader
  • Zend_Locale
  • Zend_Log
  • Zend_Mail
  • Zend_Markup
  • Zend_Measure
  • Zend_Memory
  • Zend_Mime
  • Zend_Navigation
  • Zend_Oauth
  • Zend_OpenId
  • Zend_Paginator
  • Zend_Pdf
  • Zend_ProgressBar
  • Zend_Queue
  • Zend_Reflection
  • Zend_Registry
  • Zend_Rest

  • Zend_Search_Lucene
  • Zend_Serializer
  • Zend_Server
  • Zend_Service
  • Zend_Session
  • Zend_Soap
  • Zend_Tag
  • Zend_Test
  • Zend_Text
  • Zend_TimeSync
  • Zend_Tool
  • Zend_Tool_Framework
  • Zend_Tool_Project
  • Zend_Translate
  • Zend_Uri
  • Zend_Validate
  • Zend_Version
  • Zend_View
  • Zend_Wildfire
  • Zend_XmlRpc
  • ZendX_Console_Process_Unix
  • ZendX_JQuery
  • Ttranslation 27.4% Update 2010-11-28 - Revision 23238 - Version ZF 1.11.x

    63.11. Zend_Service_Amazon_Ec2: Elastic IP Addresses

    By default, all Amazon EC2 instances are assigned two IP addresses at launch: a private (RFC 1918) address and a public address that is mapped to the private IP address through Network Address Translation (NAT).

    If you use dynamic DNS to map an existing DNS name to a new instance's public IP address, it might take up to 24 hours for the IP address to propagate through the Internet. As a result, new instances might not receive traffic while terminated instances continue to receive requests.

    To solve this problem, Amazon EC2 provides elastic IP addresses. Elastic IP addresses are static IP addresses designed for dynamic cloud computing. Elastic IP addresses are associated with your account, not specific instances. Any elastic IP addresses that you associate with your account remain associated with your account until you explicitly release them. Unlike traditional static IP addresses, however, elastic IP addresses allow you to mask instance or Availability Zone failures by rapidly remapping your public IP addresses to any instance in your account.

    Пример 63.46. Allocating a new Elastic IP

    allocate will assign your account a new Elastic IP Address.

    allocate returns the newly allocated ip.

    $ec2_eip = new Zend_Service_Amazon_Ec2_Elasticip('aws_key','aws_secret_key');
    $ip $ec2_eip->allocate();

    // print out your newly allocated elastic ip address;
    print $ip;

    Пример 63.47. Describing Allocated Elastic IP Addresses

    describe has an optional paramater to describe all of your allocated Elastic IP addresses or just some of your allocated addresses.

    describe returns an array that contains information on each Elastic IP Address which contains the publicIp and the instanceId if it is assocated.

    $ec2_eip = new Zend_Service_Amazon_Ec2_Elasticip('aws_key','aws_secret_key');
    // describe all
    $ips $ec2_eip->describe();

    // describe a subset
    $ips $ec2_eip->describe(array('ip1''ip2''ip3'));

    // describe a single ip address
    $ip $ec2_eip->describe('ip1');

    Пример 63.48. Releasing Elastic IP

    release will release an Elastic IP to Amazon.

    Returns a boolean TRUE or FALSE.

    $ec2_eip = new Zend_Service_Amazon_Ec2_Elasticip('aws_key','aws_secret_key');

    Пример 63.49. Associates an Elastic IP to an Instance

    associate will assign an Elastic IP to an already running instance.

    Returns a boolean TRUE or FALSE.

    $ec2_eip = new Zend_Service_Amazon_Ec2_Elasticip('aws_key','aws_secret_key');

    Пример 63.50. Disassociate an Elastic IP from an instance

    disassociate will disassociate an Elastic IP from an instance. If you terminate an Instance it will automaticly disassociate the Elastic IP address for you.

    Returns a boolean TRUE or FALSE.

    $ec2_eip = new Zend_Service_Amazon_Ec2_Elasticip('aws_key','aws_secret_key');

    digg delicious meneame google twitter technorati facebook