Skip to content
Snippets Groups Projects
Select Git revision
  • fadf44e49f0abde3927e2679969f23eda96c43d5
  • master default protected
  • simple-task/7248-eol-check-add-node-22
  • 6877_check_iml_deployment
4 results

check_uptime

Blame
  • foremanapi.class.php 19.91 KiB
    <?php
    /**
     * ForemanApi
     * 
     * foreman access to API
     * 
     * @example
     * in project class
     * $oForeman=new ForemanApi($this->_aConfig['foreman']);
     * 
     * // enable debugging
     * $oForeman->setDebug(1);
     * 
     * // self check
     * $oForeman->selfcheck(); die(__FUNCTION__);
     *
     * // read operating systems and get id and title only
     * $aForemanHostgroups=$oForeman->read(array(
     *    'request'=>array(
     *        array('operatingsystems'),
     *    ),
     *    'response'=>array(
     *        'id','title'
     *   ),
     * ));
     * 
     * // read details for operating systems #4
     * $aForemanHostgroups=$oForeman->read(array(
     *    'request'=>array(
     *        array('operatingsystems', 4),
     *    ),
     * ));
     *
     * 
     * $aOptions ... can contain optional subkeys
     * - request
     *      [] list of array(keyword [,id])
     * - filter (array)
     *      - search (string)
     *      - page (string)
     *      - per_page (string)
     * - response (array)
     *      - list of keys, i.e. array('id', 'title')
    
     * @author hahn
     */
    class ForemanApi {
    
        protected $_aCfg=array();
        protected $_bDebug = false;
    
        protected $_aAllowedUrls=array(
            'api'=>array(
                ''=>array(),
                'architectures'=>array(),
                'audits'=>array('methods'=>array('GET')),
                'auth_source_ldaps'=>array(),
                'bookmarks'=>array(),
                'common_parameters'=>array(),
                'compliance'=>array(),
                'compute_attributes'=>array(),
                'compute_profiles'=>array(),
                'compute_resources'=>array(),
                'config_groups'=>array(),
                'config_reports'=>array(),
                'config_templates'=>array(),
                'dashboard'=>array('methods'=>array('GET')),
                'domains'=>array(),
                'environments'=>array(),
                'fact_values'=>array(),