ec2dns\ec2host::run PHP Method

run() protected method

This method executes the request via the instance of ec2dns\ec2 and stores the result in the class.
protected run ( ) : void
return void
    protected function run()
    {
        while ($instance = $this->ec2->getNext()) {
            $tag = false;
            $instanceId = false;
            $dnsName = false;
            if (isset($instance['Tags'])) {
                foreach ($instance['Tags'] as $tag) {
                    if ($tag['Key'] == 'Name' && !empty($tag['Value'])) {
                        $tag = $tag['Value'];
                        break;
                    } else {
                        $tag = false;
                    }
                }
            }
            $instanceId = $instance['InstanceId'];
            $dnsName = $instance['PublicDnsName'];
            $tag = $tag ? $tag : $this->emptyTag;
            $this->instances[] = ["instanceId" => $instanceId, "dnsName" => $dnsName, "tag" => $tag];
        }
    }