当前位置: 首页>>代码示例>>PHP>>正文


PHP Amazon_EC2_Interface::describeImages方法代码示例

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


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

示例1: invokeDescribeImages

/**
 * Describe Images Action Sample
 * The DescribeImages operation returns information about AMIs, AKIs, and ARIs
 * available to the user. Information returned includes image type, product codes,
 * architecture, and kernel and RAM disk IDs. Images available to the user include
 * public images available for any user to launch, private images owned by the
 * user making the request, and private images owned by other users for which the
 * user has explicit launch permissions.
 * Launch permissions fall into three categories:
 * Public:
 * The owner of the AMI granted launch permissions for the AMI to the all group.
 * All users have launch permissions for these AMIs.
 * Explicit:
 * The owner of the AMI granted launch permissions to a specific user.
 * Implicit:
 * A user has implicit launch permissions for all AMIs he or she owns.
 * The list of AMIs returned can be modified by specifying AMI IDs, AMI owners, or
 * users with launch permissions. If no options are specified, Amazon EC2 returns
 * all AMIs for which the user has launch permissions.
 * If you specify one or more AMI IDs, only AMIs that have the specified IDs are
 * returned. If you specify an invalid AMI ID, a fault is returned. If you specify
 * an AMI ID for which you do not have access, it will not be included in the
 * returned results.
 * If you specify one or more AMI owners, only AMIs from the specified owners and
 * for which you have access are returned. The results can include the account IDs
 * of the specified owners, amazon for AMIs owned by Amazon or self for AMIs that
 * you own.
 * If you specify a list of executable users, only users that have launch
 * permissions for the AMIs are returned. You can specify account IDs (if you own
 * the AMI(s)), self for AMIs for which you own or have explicit permissions, or
 * all for public AMIs.
 * Note:
 * Deregistered images are included in the returned results for an unspecified
 * interval after deregistration.
 *   
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_DescribeImages or array of parameters
 */
function invokeDescribeImages(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->describeImages($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        DescribeImagesResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetDescribeImagesResult()) {
            echo "            DescribeImagesResult\n";
            $describeImagesResult = $response->getDescribeImagesResult();
            $imageList = $describeImagesResult->getImage();
            foreach ($imageList as $image) {
                echo "                Image\n";
                if ($image->isSetImageId()) {
                    echo "                    ImageId\n";
                    echo "                        " . $image->getImageId() . "\n";
                }
                if ($image->isSetImageLocation()) {
                    echo "                    ImageLocation\n";
                    echo "                        " . $image->getImageLocation() . "\n";
                }
                if ($image->isSetImageState()) {
                    echo "                    ImageState\n";
                    echo "                        " . $image->getImageState() . "\n";
                }
                if ($image->isSetOwnerId()) {
                    echo "                    OwnerId\n";
                    echo "                        " . $image->getOwnerId() . "\n";
                }
                if ($image->isSetVisibility()) {
                    echo "                    Visibility\n";
                    echo "                        " . $image->getVisibility() . "\n";
                }
                $productCodeList = $image->getProductCode();
                foreach ($productCodeList as $productCode) {
                    echo "                    ProductCode\n";
                    echo "                        " . $productCode;
                }
                if ($image->isSetArchitecture()) {
                    echo "                    Architecture\n";
                    echo "                        " . $image->getArchitecture() . "\n";
                }
                if ($image->isSetImageType()) {
                    echo "                    ImageType\n";
                    echo "                        " . $image->getImageType() . "\n";
                }
                if ($image->isSetKernelId()) {
                    echo "                    KernelId\n";
                    echo "                        " . $image->getKernelId() . "\n";
                }
                if ($image->isSetRamdiskId()) {
                    echo "                    RamdiskId\n";
                    echo "                        " . $image->getRamdiskId() . "\n";
                }
//.........这里部分代码省略.........
开发者ID:marcaopxt,项目名称:ec2-delete-old-snapshots,代码行数:101,代码来源:DescribeImagesSample.php

示例2: invokeDescribeImages

/**
 * Describe Images Action Sample
 * The DescribeImages operation returns information about AMIs, AKIs, and ARIs
 * available to the user. Information returned includes image type, product codes,
 * architecture, and kernel and RAM disk IDs. Images available to the user include
 * public images available for any user to launch, private images owned by the
 * user making the request, and private images owned by other users for which the
 * user has explicit launch permissions.
 * Launch permissions fall into three categories:
 * Public:
 * The owner of the AMI granted launch permissions for the AMI to the all group.
 * All users have launch permissions for these AMIs.
 * Explicit:
 * The owner of the AMI granted launch permissions to a specific user.
 * Implicit:
 * A user has implicit launch permissions for all AMIs he or she owns.
 * The list of AMIs returned can be modified by specifying AMI IDs, AMI owners, or
 * users with launch permissions. If no options are specified, Amazon EC2 returns
 * all AMIs for which the user has launch permissions.
 * If you specify one or more AMI IDs, only AMIs that have the specified IDs are
 * returned. If you specify an invalid AMI ID, a fault is returned. If you specify
 * an AMI ID for which you do not have access, it will not be included in the
 * returned results.
 * If you specify one or more AMI owners, only AMIs from the specified owners and
 * for which you have access are returned. The results can include the account IDs
 * of the specified owners, amazon for AMIs owned by Amazon or self for AMIs that
 * you own.
 * If you specify a list of executable users, only users that have launch
 * permissions for the AMIs are returned. You can specify account IDs (if you own
 * the AMI(s)), self for AMIs for which you own or have explicit permissions, or
 * all for public AMIs.
 * Note:
 * Deregistered images are included in the returned results for an unspecified
 * interval after deregistration.  
 * @param Amazon_EC2_Interface $service instance of Amazon_EC2_Interface
 * @param mixed $request Amazon_EC2_Model_DescribeImages or array of parameters
 */
function invokeDescribeImages(Amazon_EC2_Interface $service, $request)
{
    try {
        $response = $service->describeImages($request);
        echo "Service Response\n";
        echo "=============================================================================\n";
        echo "        DescribeImagesResponse\n";
        if ($response->isSetResponseMetadata()) {
            echo "            ResponseMetadata\n";
            $responseMetadata = $response->getResponseMetadata();
            if ($responseMetadata->isSetRequestId()) {
                echo "                RequestId\n";
                echo "                    " . $responseMetadata->getRequestId() . "\n";
            }
        }
        if ($response->isSetDescribeImagesResult()) {
            echo "            DescribeImagesResult\n";
            $describeImagesResult = $response->getDescribeImagesResult();
            $imageList = $describeImagesResult->getImage();
            foreach ($imageList as $image) {
                echo "                Image\n";
                if ($image->isSetImageId()) {
                    echo "                    ImageId\n";
                    echo "                        " . $image->getImageId() . "\n";
                }
                if ($image->isSetImageLocation()) {
                    echo "                    ImageLocation\n";
                    echo "                        " . $image->getImageLocation() . "\n";
                }
                if ($image->isSetImageState()) {
                    echo "                    ImageState\n";
                    echo "                        " . $image->getImageState() . "\n";
                }
                if ($image->isSetOwnerId()) {
                    echo "                    OwnerId\n";
                    echo "                        " . $image->getOwnerId() . "\n";
                }
                if ($image->isSetVisibility()) {
                    echo "                    Visibility\n";
                    echo "                        " . $image->getVisibility() . "\n";
                }
                $productCodeList = $image->getProductCode();
                foreach ($productCodeList as $productCode) {
                    echo "                    ProductCode\n";
                    echo "                        " . $productCode;
                }
                if ($image->isSetArchitecture()) {
                    echo "                    Architecture\n";
                    echo "                        " . $image->getArchitecture() . "\n";
                }
                if ($image->isSetImageType()) {
                    echo "                    ImageType\n";
                    echo "                        " . $image->getImageType() . "\n";
                }
                if ($image->isSetKernelId()) {
                    echo "                    KernelId\n";
                    echo "                        " . $image->getKernelId() . "\n";
                }
                if ($image->isSetRamdiskId()) {
                    echo "                    RamdiskId\n";
                    echo "                        " . $image->getRamdiskId() . "\n";
                }
                if ($image->isSetPlatform()) {
//.........这里部分代码省略.........
开发者ID:edasque,项目名称:ec2-manage-snapshots,代码行数:101,代码来源:DescribeImagesSample.php


注:本文中的Amazon_EC2_Interface::describeImages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。