• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Amazon_EC2_Interface类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Amazon_EC2_Interface的典型用法代码示例。如果您正苦于以下问题:PHP Amazon_EC2_Interface类的具体用法?PHP Amazon_EC2_Interface怎么用?PHP Amazon_EC2_Interface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Amazon_EC2_Interface类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: invokeStartInstances

/**
 * Start Instances Action Sample
 * Starts an instance that uses an Amazon EBS volume as its root device.
 * Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started.
 * When an instance is stopped, the compute resources are released and you are not billed for hourly
 * instance usage. However, your root partition Amazon EBS volume remains, continues to persist your
 * data, and you are charged for Amazon EBS volume usage. You can restart your instance at any time.  
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_StartInstances or array of parameters
 */
function invokeStartInstances(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->startInstances($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        StartInstancesResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetStartInstancesResult()) {
            echo "            StartInstancesResult\n";
            $startInstancesResult = $response->getStartInstancesResult();
            $startingInstancesList = $startInstancesResult->getStartingInstances();
            foreach ($startingInstancesList as $startingInstances) {
                echo "                StartingInstances\n";
                if ($startingInstances->isSetInstanceId()) {
                    echo "                    InstanceId\n";
                    echo "                        " . $startingInstances->getInstanceId() . "\n";
                }
                if ($startingInstances->isSetCurrentState()) {
                    echo "                    CurrentState\n";
                    $currentState = $startingInstances->getCurrentState();
                    if ($currentState->isSetCode()) {
                        echo "                        Code\n";
                        echo "                            " . $currentState->getCode() . "\n";
                    }
                    if ($currentState->isSetName()) {
                        echo "                        Name\n";
                        echo "                            " . $currentState->getName() . "\n";
                    }
                }
                if ($startingInstances->isSetPreviousState()) {
                    echo "                    PreviousState\n";
                    $previousState = $startingInstances->getPreviousState();
                    if ($previousState->isSetCode()) {
                        echo "                        Code\n";
                        echo "                            " . $previousState->getCode() . "\n";
                    }
                    if ($previousState->isSetName()) {
                        echo "                        Name\n";
                        echo "                            " . $previousState->getName() . "\n";
                    }
                }
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:edasque,项目名称:ec2-manage-snapshots,代码行数:70,代码来源:StartInstancesSample.php


示例2: invokeDescribeReservedInstancesOfferings

/**
 * Describe Reserved Instances Offerings Action Sample
 * The DescribeReservedInstancesOfferings operation describes Reserved
 * Instance offerings that are available for purchase. With Amazon EC2
 * Reserved Instances, you purchase the right to launch Amazon EC2 instances
 * for a period of time (without getting insufficient capacity errors) and
 * pay a lower usage rate for the actual time used.  
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_DescribeReservedInstancesOfferings or array of parameters
 */
function invokeDescribeReservedInstancesOfferings(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->describeReservedInstancesOfferings($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        DescribeReservedInstancesOfferingsResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetDescribeReservedInstancesOfferingsResult()) {
            echo "            DescribeReservedInstancesOfferingsResult\n";
            $describeReservedInstancesOfferingsResult = $response->getDescribeReservedInstancesOfferingsResult();
            $reservedInstancesOfferingList = $describeReservedInstancesOfferingsResult->getReservedInstancesOffering();
            foreach ($reservedInstancesOfferingList as $reservedInstancesOffering) {
                echo "                ReservedInstancesOffering\n";
                if ($reservedInstancesOffering->isSetReservedInstancesOfferingId()) {
                    echo "                    ReservedInstancesOfferingId\n";
                    echo "                        " . $reservedInstancesOffering->getReservedInstancesOfferingId() . "\n";
                }
                if ($reservedInstancesOffering->isSetInstanceType()) {
                    echo "                    InstanceType\n";
                    echo "                        " . $reservedInstancesOffering->getInstanceType() . "\n";
                }
                if ($reservedInstancesOffering->isSetAvailabilityZone()) {
                    echo "                    AvailabilityZone\n";
                    echo "                        " . $reservedInstancesOffering->getAvailabilityZone() . "\n";
                }
                if ($reservedInstancesOffering->isSetDuration()) {
                    echo "                    Duration\n";
                    echo "                        " . $reservedInstancesOffering->getDuration() . "\n";
                }
                if ($reservedInstancesOffering->isSetUsagePrice()) {
                    echo "                    UsagePrice\n";
                    echo "                        " . $reservedInstancesOffering->getUsagePrice() . "\n";
                }
                if ($reservedInstancesOffering->isSetFixedPrice()) {
                    echo "                    FixedPrice\n";
                    echo "                        " . $reservedInstancesOffering->getFixedPrice() . "\n";
                }
                if ($reservedInstancesOffering->isSetProductDescription()) {
                    echo "                    ProductDescription\n";
                    echo "                        " . $reservedInstancesOffering->getProductDescription() . "\n";
                }
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:edasque,项目名称:ec2-manage-snapshots,代码行数:70,代码来源:DescribeReservedInstancesOfferingsSample.php


示例3: invokeAllocateAddress

/**
 * Allocate Address Action Sample
 * The AllocateAddress operation acquires an elastic IP address for use with your
 * account.
 *   
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_AllocateAddress or array of parameters
 */
function invokeAllocateAddress(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->allocateAddress($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        AllocateAddressResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetAllocateAddressResult()) {
            echo "            AllocateAddressResult\n";
            $allocateAddressResult = $response->getAllocateAddressResult();
            if ($allocateAddressResult->isSetPublicIp()) {
                echo "                PublicIp\n";
                echo "                    " . $allocateAddressResult->getPublicIp() . "\n";
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:marcaopxt,项目名称:ec2-delete-old-snapshots,代码行数:40,代码来源:AllocateAddressSample.php


示例4: invokeCreateSpotDatafeedSubscription

/**
 * Create Spot Datafeed Subscription Action Sample
 * Creates the data feed for spot instances, enabling you to view Spot Instance usage logs. You can
 * create one data feed per account.  
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_CreateSpotDatafeedSubscription or array of parameters
 */
function invokeCreateSpotDatafeedSubscription(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->createSpotDatafeedSubscription($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        CreateSpotDatafeedSubscriptionResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetCreateSpotDatafeedSubscriptionResult()) {
            echo "            CreateSpotDatafeedSubscriptionResult\n";
            $createSpotDatafeedSubscriptionResult = $response->getCreateSpotDatafeedSubscriptionResult();
            if ($createSpotDatafeedSubscriptionResult->isSetSpotDatafeedSubscription()) {
                echo "                SpotDatafeedSubscription\n";
                $spotDatafeedSubscription = $createSpotDatafeedSubscriptionResult->getSpotDatafeedSubscription();
                if ($spotDatafeedSubscription->isSetOwnerId()) {
                    echo "                    OwnerId\n";
                    echo "                        " . $spotDatafeedSubscription->getOwnerId() . "\n";
                }
                if ($spotDatafeedSubscription->isSetBucket()) {
                    echo "                    Bucket\n";
                    echo "                        " . $spotDatafeedSubscription->getBucket() . "\n";
                }
                if ($spotDatafeedSubscription->isSetPrefix()) {
                    echo "                    Prefix\n";
                    echo "                        " . $spotDatafeedSubscription->getPrefix() . "\n";
                }
                if ($spotDatafeedSubscription->isSetState()) {
                    echo "                    State\n";
                    echo "                        " . $spotDatafeedSubscription->getState() . "\n";
                }
                if ($spotDatafeedSubscription->isSetFault()) {
                    echo "                    Fault\n";
                    $fault = $spotDatafeedSubscription->getFault();
                    if ($fault->isSetCode()) {
                        echo "                        Code\n";
                        echo "                            " . $fault->getCode() . "\n";
                    }
                    if ($fault->isSetMessage()) {
                        echo "                        Message\n";
                        echo "                            " . $fault->getMessage() . "\n";
                    }
                }
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:edasque,项目名称:ec2-manage-snapshots,代码行数:67,代码来源:CreateSpotDatafeedSubscriptionSample.php


示例5: invokeRegisterImage

/**
 * Register Image Action Sample
 * The RegisterImage operation registers an AMI with Amazon EC2. Images must be
 * registered before they can be launched. For more information, see RunInstances.
 * Each AMI is associated with an unique ID which is provided by the Amazon EC2
 * service through the RegisterImage operation. During registration, Amazon EC2
 * retrieves the specified image manifest from Amazon S3 and verifies that the
 * image is owned by the user registering the image.
 * The image manifest is retrieved once and stored within the Amazon EC2. Any
 * modifications to an image in Amazon S3 invalidates this registration. If you
 * make changes to an image, deregister the previous image and register the new
 * image. For more information, see DeregisterImage.
 *   
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_RegisterImage or array of parameters
 */
function invokeRegisterImage(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->registerImage($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        RegisterImageResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetRegisterImageResult()) {
            echo "            RegisterImageResult\n";
            $registerImageResult = $response->getRegisterImageResult();
            if ($registerImageResult->isSetImageId()) {
                echo "                ImageId\n";
                echo "                    " . $registerImageResult->getImageId() . "\n";
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:marcaopxt,项目名称:ec2-delete-old-snapshots,代码行数:48,代码来源:RegisterImageSample.php


示例6: invokePurchaseReservedInstancesOffering

/**
 * Purchase Reserved Instances Offering Action Sample
 * The PurchaseReservedInstancesOffering operation purchases a
 * Reserved Instance for use with your account. With Amazon EC2
 * Reserved Instances, you purchase the right to launch Amazon EC2
 * instances for a period of time (without getting insufficient
 * capacity errors) and pay a lower usage rate for the
 * actual time used.  
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_PurchaseReservedInstancesOffering or array of parameters
 */
function invokePurchaseReservedInstancesOffering(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->purchaseReservedInstancesOffering($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        PurchaseReservedInstancesOfferingResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetPurchaseReservedInstancesOfferingResult()) {
            echo "            PurchaseReservedInstancesOfferingResult\n";
            $purchaseReservedInstancesOfferingResult = $response->getPurchaseReservedInstancesOfferingResult();
            if ($purchaseReservedInstancesOfferingResult->isSetReservedInstancesId()) {
                echo "                ReservedInstancesId\n";
                echo "                    " . $purchaseReservedInstancesOfferingResult->getReservedInstancesId() . "\n";
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:edasque,项目名称:ec2-manage-snapshots,代码行数:43,代码来源:PurchaseReservedInstancesOfferingSample.php


示例7: invokeDescribeVpnGateways

/**
 * Describe Vpn Gateways Action Sample
 * Gives you information about your VPN gateways. You can filter the results to return
 * information only about VPN gateways that match criteria you specify. For example,
 * you could ask to get information about a particular VPN gateway (or all) only if the
 * gateway's state is pending or available. You can specify multiple filters (e.g., the
 * VPN gateway is in a particular Availability Zone and the gateway's state is pending or
 * available). The result includes information for a particular VPN gateway only if the
 * gateway matches all your filters. If there's no match, no special message is returned;
 * the response is simply empty.  
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_DescribeVpnGateways or array of parameters
 */
function invokeDescribeVpnGateways(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->describeVpnGateways($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        DescribeVpnGatewaysResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetDescribeVpnGatewaysResult()) {
            echo "            DescribeVpnGatewaysResult\n";
            $describeVpnGatewaysResult = $response->getDescribeVpnGatewaysResult();
            $vpnGatewayList = $describeVpnGatewaysResult->getVpnGateway();
            foreach ($vpnGatewayList as $vpnGateway) {
                echo "                VpnGateway\n";
                if ($vpnGateway->isSetVpnGatewayId()) {
                    echo "                    VpnGatewayId\n";
                    echo "                        " . $vpnGateway->getVpnGatewayId() . "\n";
                }
                if ($vpnGateway->isSetVpnGatewayState()) {
                    echo "                    VpnGatewayState\n";
                    echo "                        " . $vpnGateway->getVpnGatewayState() . "\n";
                }
                if ($vpnGateway->isSetType()) {
                    echo "                    Type\n";
                    echo "                        " . $vpnGateway->getType() . "\n";
                }
                if ($vpnGateway->isSetAvailabilityZone()) {
                    echo "                    AvailabilityZone\n";
                    echo "                        " . $vpnGateway->getAvailabilityZone() . "\n";
                }
                $vpcAttachmentList = $vpnGateway->getVpcAttachment();
                foreach ($vpcAttachmentList as $vpcAttachment) {
                    echo "                    VpcAttachment\n";
                    if ($vpcAttachment->isSetVpcId()) {
                        echo "                        VpcId\n";
                        echo "                            " . $vpcAttachment->getVpcId() . "\n";
                    }
                    if ($vpcAttachment->isSetVpcAttachmentState()) {
                        echo "                        VpcAttachmentState\n";
                        echo "                            " . $vpcAttachment->getVpcAttachmentState() . "\n";
                    }
                }
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:edasque,项目名称:ec2-manage-snapshots,代码行数:73,代码来源:DescribeVpnGatewaysSample.php


示例8: invokeDetachVolume

/**
 * Detach Volume Action Sample
 * Detach a previously attached volume from a running instance.  
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_DetachVolume or array of parameters
 */
function invokeDetachVolume(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->detachVolume($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        DetachVolumeResponse\n";
        if ($response->isSetDetachVolumeResult()) {
            echo "            DetachVolumeResult\n";
            $detachVolumeResult = $response->getDetachVolumeResult();
            if ($detachVolumeResult->isSetAttachment()) {
                echo "                Attachment\n";
                $attachment = $detachVolumeResult->getAttachment();
                if ($attachment->isSetVolumeId()) {
                    echo "                    VolumeId\n";
                    echo "                        " . $attachment->getVolumeId() . "\n";
                }
                if ($attachment->isSetInstanceId()) {
                    echo "                    InstanceId\n";
                    echo "                        " . $attachment->getInstanceId() . "\n";
                }
                if ($attachment->isSetDevice()) {
                    echo "                    Device\n";
                    echo "                        " . $attachment->getDevice() . "\n";
                }
                if ($attachment->isSetStatus()) {
                    echo "                    Status\n";
                    echo "                        " . $attachment->getStatus() . "\n";
                }
                if ($attachment->isSetAttachTime()) {
                    echo "                    AttachTime\n";
                    echo "                        " . $attachment->getAttachTime() . "\n";
                }
                if ($attachment->isSetDeleteOnTermination()) {
                    echo "                    DeleteOnTermination\n";
                    echo "                        " . $attachment->getDeleteOnTermination() . "\n";
                }
            }
        }
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:edasque,项目名称:ec2-manage-snapshots,代码行数:62,代码来源:DetachVolumeSample.php


示例9: invokeCreateVpnConnection

/**
 * Create Vpn Connection Action Sample
 * Creates a new VPN connection between an existing VPN gateway and customer
 * gateway. The only supported connection type is ipsec.1.
 * The response includes information that you need to configure your customer gateway,
 * in XML format. We recommend you use the command line version of this operation
 * (ec2-create-vpn-connection), which lets you get the configuration information
 * formatted in a friendlier way. For information about the command, go to
 * ec2-create-vpn-connection in the Amazon Virtual Private Cloud Command Line Reference.
 * Important
 * We strongly recommend you use HTTPS when calling this operation because
 * the response contains sensitive cryptographic information for configuring
 * your customer gateway.
 * If you decide to shut down your VPN connection for any reason and then create a new
 * one, you must re-configure your customer gateway with the new information
 * returned from this call.  
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_CreateVpnConnection or array of parameters
 */
function invokeCreateVpnConnection(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->createVpnConnection($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        CreateVpnConnectionResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetCreateVpnConnectionResult()) {
            echo "            CreateVpnConnectionResult\n";
            $createVpnConnectionResult = $response->getCreateVpnConnectionResult();
            if ($createVpnConnectionResult->isSetVpnConnection()) {
                echo "                VpnConnection\n";
                $vpnConnection = $createVpnConnectionResult->getVpnConnection();
                if ($vpnConnection->isSetVpnConnectionId()) {
                    echo "                    VpnConnectionId\n";
                    echo "                        " . $vpnConnection->getVpnConnectionId() . "\n";
                }
                if ($vpnConnection->isSetVpnConnectionState()) {
                    echo "                    VpnConnectionState\n";
                    echo "                        " . $vpnConnection->getVpnConnectionState() . "\n";
                }
                if ($vpnConnection->isSetCustomerGatewayConfiguration()) {
                    echo "                    CustomerGatewayConfiguration\n";
                    echo "                        " . $vpnConnection->getCustomerGatewayConfiguration() . "\n";
                }
                if ($vpnConnection->isSetType()) {
                    echo "                    Type\n";
                    echo "                        " . $vpnConnection->getType() . "\n";
                }
                if ($vpnConnection->isSetCustomerGatewayId()) {
                    echo "                    CustomerGatewayId\n";
                    echo "                        " . $vpnConnection->getCustomerGatewayId() . "\n";
                }
                if ($vpnConnection->isSetVpnGatewayId()) {
                    echo "                    VpnGatewayId\n";
                    echo "                        " . $vpnConnection->getVpnGatewayId() . "\n";
                }
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:edasque,项目名称:ec2-manage-snapshots,代码行数:75,代码来源:CreateVpnConnectionSample.php


示例10: invokeCreateSubnet

/**
 * Create Subnet Action Sample
 * Creates a subnet in an existing VPC. You can create up to 20 subnets in a VPC.
 * If you add more than one subnet to a VPC, they're set up in a star topology with
 * a logical router in the middle. If you feel you need more than 20 subnets, you can
 * request more by going to http://aws.amazon.com/contact-us/vpc-request/.
 * When you create each subnet, you provide the VPC ID and the CIDR block you
 * want for the subnet. Once you create a subnet, you can't change its CIDR block.
 * The subnet's CIDR block can be the same as the VPC's CIDR block (assuming you
 * want only a single subnet in the VPC), or a subset of the VPC's CIDR block.
 * If you create more than one subnet in a VPC, the subnets' CIDR blocks must not overlap.
 * The smallest subnet (and VPC) you can create uses a /28 netmask (16 IP addresses),
 * and the largest uses a /18 netmask (16,384 IP addresses).
 * Important
 * AWS reserves both the first four and the last IP address in each subnet's CIDR block.
 * They're not available for use.
 * AWS might delete any subnet you create with this operation if you leave it inactive
 * for an extended period of time (inactive means that there are no running Amazon EC2
 * instances in the subnet).  
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_CreateSubnet or array of parameters
 */
function invokeCreateSubnet(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->createSubnet($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        CreateSubnetResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetCreateSubnetResult()) {
            echo "            CreateSubnetResult\n";
            $createSubnetResult = $response->getCreateSubnetResult();
            if ($createSubnetResult->isSetSubnet()) {
                echo "                Subnet\n";
                $subnet = $createSubnetResult->getSubnet();
                if ($subnet->isSetSubnetId()) {
                    echo "                    SubnetId\n";
                    echo "                        " . $subnet->getSubnetId() . "\n";
                }
                if ($subnet->isSetSubnetState()) {
                    echo "                    SubnetState\n";
                    echo "                        " . $subnet->getSubnetState() . "\n";
                }
                if ($subnet->isSetVpcId()) {
                    echo "                    VpcId\n";
                    echo "                        " . $subnet->getVpcId() . "\n";
                }
                if ($subnet->isSetCidrBlock()) {
                    echo "                    CidrBlock\n";
                    echo "                        " . $subnet->getCidrBlock() . "\n";
                }
                if ($subnet->isSetAvailableIpAddressCount()) {
                    echo "                    AvailableIpAddressCount\n";
                    echo "                        " . $subnet->getAvailableIpAddressCount() . "\n";
                }
                if ($subnet->isSetAvailabilityZone()) {
                    echo "                    AvailabilityZone\n";
                    echo "                        " . $subnet->getAvailabilityZone() . "\n";
                }
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:edasque,项目名称:ec2-manage-snapshots,代码行数:78,代码来源:CreateSubnetSample.php


示例11: invokeDescribeCustomerGateways

/**
 * Describe Customer Gateways Action Sample
 * Gives you information about your customer gateways. You can filter the results to return
 * information only about customer gateways that match criteria you specify. For example,
 * you could ask to get information about a particular customer gateway (or all) only if
 * the gateway's state is pending or available. You can specify multiple filters (e.g.,
 * the customer gateway has a particular IP address for the Internet-routable external
 * interface, and the gateway's state is pending or available). The result includes
 * information for a particular customer gateway only if the gateway matches all  your
 * filters. If there's no match, no special message is returned; the response is simply empty.  
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_DescribeCustomerGateways or array of parameters
 */
function invokeDescribeCustomerGateways(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->describeCustomerGateways($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        DescribeCustomerGatewaysResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetDescribeCustomerGatewaysResult()) {
            echo "            DescribeCustomerGatewaysResult\n";
            $describeCustomerGatewaysResult = $response->getDescribeCustomerGatewaysResult();
            $customerGatewayList = $describeCustomerGatewaysResult->getCustomerGateway();
            foreach ($customerGatewayList as $customerGateway) {
                echo "                CustomerGateway\n";
                if ($customerGateway->isSetCustomerGatewayId()) {
                    echo "                    CustomerGatewayId\n";
                    echo "                        " . $customerGateway->getCustomerGatewayId() . "\n";
                }
                if ($customerGateway->isSetCustomerGatewayState()) {
                    echo "                    CustomerGatewayState\n";
                    echo "                        " . $customerGateway->getCustomerGatewayState() . "\n";
                }
                if ($customerGateway->isSetType()) {
                    echo "                    Type\n";
                    echo "                        " . $customerGateway->getType() . "\n";
                }
                if ($customerGateway->isSetIpAddress()) {
                    echo "                    IpAddress\n";
                    echo "                        " . $customerGateway->getIpAddress() . "\n";
                }
                if ($customerGateway->isSetBgpAsn()) {
                    echo "                    BgpAsn\n";
                    echo "                        " . $customerGateway->getBgpAsn() . "\n";
                }
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:edasque,项目名称:ec2-manage-snapshots,代码行数:65,代码来源:DescribeCustomerGatewaysSample.php


示例12: invokeCreateSnapshot

/**
 * Create Snapshot Action Sample
 * Create a snapshot of the volume identified by volume ID. A volume does not have to be detached
 * at the time the snapshot is taken.
 * Important Note:
 * Snapshot creation requires that the system is in a consistent state.
 * For instance, this means that if taking a snapshot of a database, the tables must
 * be read-only locked to ensure that the snapshot will not contain a corrupted
 * version of the database.  Therefore, be careful when using this API to ensure that
 * the system remains in the consistent state until the create snapshot status
 * has returned.
 *   
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_CreateSnapshot or array of parameters
 */
function invokeCreateSnapshot(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->createSnapshot($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        CreateSnapshotResponse\n";
        if ($response->isSetCreateSnapshotResult()) {
            echo "            CreateSnapshotResult\n";
            $createSnapshotResult = $response->getCreateSnapshotResult();
            if ($createSnapshotResult->isSetSnapshot()) {
                echo "                Snapshot\n";
                $snapshot = $createSnapshotResult->getSnapshot();
                if ($snapshot->isSetSnapshotId()) {
                    echo "                    SnapshotId\n";
                    echo "                        " . $snapshot->getSnapshotId() . "\n";
                }
                if ($snapshot->isSetVolumeId()) {
                    echo "                    VolumeId\n";
                    echo "                        " . $snapshot->getVolumeId() . "\n";
                }
                if ($snapshot->isSetStatus()) {
                    echo "                    Status\n";
                    echo "                        " . $snapshot->getStatus() . "\n";
                }
                if ($snapshot->isSetStartTime()) {
                    echo "                    StartTime\n";
                    echo "                        " . $snapshot->getStartTime() . "\n";
                }
                if ($snapshot->isSetProgress()) {
                    echo "                    Progress\n";
                    echo "                        " . $snapshot->getProgress() . "\n";
                }
            }
        }
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
    } catch (Amazon_EC2_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
}
开发者ID:marcaopxt,项目名称:ec2-delete-old-snapshots,代码行数:67,代码来源:CreateSnapshotSample.php


示例13: invokeDescribeAvailabilityZones

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Amazon_EC2_Model类代码示例发布时间:2022-05-23
下一篇:
PHP AmazonS3类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap