Scalr\Service\Aws\Ec2\V20150415\Ec2Api::describeImages PHP 메소드

describeImages() 공개 메소드

Describes the images (AMIs, AKIs, and ARIs) available to you. Images available to you include public images, private images that you own, and private images owned by other AWS accounts but for which you have explicit launch permissions.
public describeImages ( ListDataType $imageIdList = null, ListDataType $ownerList = null, Scalr\Service\Aws\Ec2\DataType\ImageFilterList $filter = null, ListDataType $executableByList = null ) : Scalr\Service\Aws\Ec2\DataType\ImageList
$imageIdList Scalr\Service\Aws\DataType\ListDataType optional One or more AMI IDs.
$ownerList Scalr\Service\Aws\DataType\ListDataType optional The AMIs owned by the specified owner. Multiple owner values can be specified. The IDs amazon, aws-marketplace, and self can be used to include AMIs owned by Amazon, AWS Marketplace, or AMIs owned by you, respectively. Valid values: amazon | aws-marketplace | self | AWS account ID | all
$filter Scalr\Service\Aws\Ec2\DataType\ImageFilterList optional Filter list
$executableByList Scalr\Service\Aws\DataType\ListDataType optional The AMIs for which the specified user ID has explicit launch permissions. The user ID can be an AWS account ID, self to return AMIs for which the sender of the request has explicit launch permissions, or all to return AMIs with public launch permissions.
리턴 Scalr\Service\Aws\Ec2\DataType\ImageList Returns the list of Images on success or throws an exception otherwise
    public function describeImages(ListDataType $imageIdList = null, ListDataType $ownerList = null, ImageFilterList $filter = null, ListDataType $executableByList = null)
    {
        $result = null;
        $options = [];
        if ($imageIdList !== null) {
            $options = array_merge($options, $imageIdList->getQueryArrayBare('ImageId'));
        }
        if ($executableByList !== null) {
            $options = array_merge($options, $executableByList->getQueryArrayBare('ExecutableBy'));
        }
        if ($ownerList !== null) {
            $options = array_merge($options, $ownerList->getQueryArrayBare('Owner'));
        }
        if ($filter !== null) {
            $options = array_merge($options, $filter->getQueryArrayBare('Filter'));
        }
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            //Success
            $sxml = simplexml_load_string($response->getRawContent());
            $response = null;
            $result = new ImageList();
            $result->setEc2($this->ec2);
            $result->setRequestId((string) $sxml->requestId);
            if (!empty($sxml->imagesSet->item)) {
                foreach ($sxml->imagesSet->item as $v) {
                    $imageId = (string) $v->imageId;
                    $item = $this->ec2->getEntityManagerEnabled() ? $this->ec2->image->get($imageId) : null;
                    if ($item === null) {
                        $item = new ImageData();
                        $item->setEc2($this->ec2);
                        $bAttach = true;
                    } else {
                        $item->resetObject();
                        $bAttach = false;
                    }
                    $item->imageId = $imageId;
                    $item->architecture = $this->exist($v->architecture) ? (string) $v->architecture : null;
                    $item->description = $this->exist($v->description) ? (string) $v->description : null;
                    $item->hypervisor = $this->exist($v->hypervisor) ? (string) $v->hypervisor : null;
                    $item->imageLocation = $this->exist($v->imageLocation) ? (string) $v->imageLocation : null;
                    $item->imageOwnerAlias = $this->exist($v->imageOwnerAlias) ? (string) $v->imageOwnerAlias : null;
                    $item->imageOwnerId = $this->exist($v->imageOwnerId) ? (string) $v->imageOwnerId : null;
                    $item->imageState = $this->exist($v->imageState) ? (string) $v->imageState : null;
                    $item->imageType = $this->exist($v->imageType) ? (string) $v->imageType : null;
                    $item->isPublic = $this->exist($v->isPublic) ? (string) $v->isPublic == 'true' : null;
                    $item->kernelId = $this->exist($v->kernelId) ? (string) $v->kernelId : null;
                    $item->name = $this->exist($v->name) ? (string) $v->name : null;
                    $item->platform = $this->exist($v->platform) ? (string) $v->platform : null;
                    $item->sriovNetSupport = $this->exist($v->sriovNetSupport) ? (string) $v->sriovNetSupport : null;
                    $item->ramdiskId = $this->exist($v->ramdiskId) ? (string) $v->ramdiskId : null;
                    $item->rootDeviceName = $this->exist($v->rootDeviceName) ? (string) $v->rootDeviceName : null;
                    $item->rootDeviceType = $this->exist($v->rootDeviceType) ? (string) $v->rootDeviceType : null;
                    $item->virtualizationType = $this->exist($v->virtualizationType) ? (string) $v->virtualizationType : null;
                    $item->setStateReason($this->_loadStateReasonData($v->stateReason))->setProductCodes($this->_loadProductCodeSetList($v->productCodes))->setTagSet($this->_loadResourceTagSetList($v->tagSet))->setBlockDeviceMapping($this->_loadBlockDeviceMappingList($v->blockDeviceMapping));
                    $result->append($item);
                    if ($bAttach && $this->ec2->getEntityManagerEnabled()) {
                        $this->getEntityManager()->attach($item);
                    }
                    unset($item);
                }
            }
        }
        return $result;
    }
Ec2Api