/** * getExecutorName * * @access public * @return void */ public function getExecutorName() { if (isset($this->m_executorName) && !empty($this->m_executorName)) { return $this->m_executorName; } else { return EC2ArgParser::getExecutor(); } }
/** * __construct * * Builds any otions that need set on instantiation * * @param mixed $options * @access public * @return void */ public function __construct($options) { $accountinfo = EC2ArgParser::getAccountInfo(); if ($accountinfo === false) { throw new EC2Exception(self::ACCOUNT_FAILURE); } $this->m_key = $accountinfo['key']; $this->m_secret = $accountinfo['secret']; $this->m_region = $accountinfo['region']; $this->m_cache = array(); }
/** * __construct * * @access public */ public function __construct($queryObj) { $filtervalue = EC2ArgParser::getKeyValue('filtertagkeyvalue'); if (!preg_match('/:/', $filtervalue)) { throw new Exception('Unable to properly parse tag value, expecting : to split tag and value'); } else { list($tag, $value) = preg_split('/:/', $filtervalue); $filter = array(array('Name' => "tag:{$tag}", 'Values' => array($value))); $queryObj->setParam('Filters', $filter); } }
public function getSearchResults($input) { $results = array(); if (preg_match("/^AWSEC2-(\\w+)-(\\w+)/", $input->location, $matches)) { if ($matches[2] == 'allinstances') { $inputArray = array('exec' => 'ec2nagios', 'account' => $matches[1], 'allinstances' => true); } elseif ($matches[2] == 'filtertagkeyvalue') { $inputArray = array('exec' => 'ec2nagios', 'account' => $matches[1], 'filtertagkeyvalue' => $input->srchparam); } elseif ($matches[2] == 'filtergroupname') { $inputArray = array('exec' => 'ec2nagios', 'account' => $matches[1], 'filtergroupname' => $input->srchparam); } else { return $results; } EC2ArgParser::setGlobalArgs($inputArray); $results = EC2QueryWrapper::execute(EC2ArgParser::getQueryLocation()); } return $results; }
/** * resetGlobalArgs * function to reset global args back to empty array * * @static * @access public * @return void */ public static function resetGlobalArgs() { self::$m_globalArgs = array(); }
/** * __construct * * @access public */ public function __construct($queryObj) { $filtervalue = EC2ArgParser::getKeyValue('filtergroupname'); $filter = array(array('Name' => 'group-name', 'Values' => array($filtervalue))); $queryObj->setParam('Filters', $filter); }