Class HostGroupDAL

Description

Provides access to HostGroups stored in the Foundation Database. shallow and deep retrieval are provided.

Provides access to HostGroups stored in the Foundation Database. Both shallow and deep retrieval are provided. Shallow retrieval returns data in the following format:

Array
 (
   [Count] => 4
   [HostGroups] => Array
   (
           [0] => Array
           (
                   [HostGroupID] => 21
                   [Name] => Engineering
                   [Description] =>
                   [ApplicationTypeID] => 100
                   [ApplicationName] => NAGIOS
           )
          [1] => Array
          (
                  [HostGroupID] => 28
                  [Name] => google
                  [Description] =>
                  [ApplicationTypeID] => 100
                  [ApplicationName] => NAGIOS
          )
          [2] => Array
          (
                  [HostGroupID] => 29
                  [Name] => infrastructure
                  [Description] =>
                  [ApplicationTypeID] => 100
                  [ApplicationName] => NAGIOS
          )
          [3] => Array
          (
                  [HostGroupID] => 22
                  [Name] => Linux Servers
                  [Description] =>
                  [ApplicationTypeID] => 100
                  [ApplicationName] => NAGIOS
          )
      )
)
Deep retrieval returns data in the following format:
 Array
(
   [Count] => 10  <=== this is the TOTAL count of hostgroups in foundation, not how many are being retrieved.
   [HostGroups] => Array
   (
           [0] => Array
           (
                   [HostGroupID] => 22
                   [Name] => Linux Servers
                   [Description] =>
                   [ApplicationTypeID] => 100
                   [ApplicationName] => NAGIOS
                   [Hosts] => Array
                   (
                           [0] => Array
                           (
                                   [HostID] => 1
                                   [Name] => localhost
                                   [ApplicationTypeID] => 100
                                   [Device] => Array
                                   (
                                           [DeviceID] => 1
                                           [Name] => 127.0.0.1
                                           [Identification] => 127.0.0.1
                                   )
                                   [MonitorStatus] => stdClass Object
                                   (
                                           [MonitorStatusID] => 7
                                           [Name] => UP
                                           [Description] => Status UP
                                       )
                               )
                       )
               )
           [1] => Array
           (
                   [HostGroupID] => 23
                   [Name] => Marketing
                   [Description] =>
                   [ApplicationTypeID] => 100
                   [ApplicationName] => NAGIOS
                   [Hosts] => Array
                   (
                           [0] => Array
                           (
                                   [HostID] => 228
                                   [ApplicationTypeID] => 100
                                   [Device] => Array
                                   (
                                           [DeviceID] => 229
                                           [Name] => sales-linux-fs02
                                           [Identification] => 172.28.114.200
                                   )
                                   [Name] => sales-linux-fs02
                                   [MonitorStatus] => stdClass Object
                                   (
                                           [MonitorStatusID] => 7
                                           [Name] => UP
                                           [Description] => Status UP
                                   )
                           )
                           [1] => Array
                           (
                                   [HostID] => 232
                                   [ApplicationTypeID] => 100
                                   [Device] => Array
                                   (
                                           [DeviceID] => 233
                                           [Name] => 172.28.113.147
                                           [Identification] => 172.28.113.147
                                   )
                                   [Name] => 172.28.113.147
                                   [MonitorStatus] => stdClass Object
                                   (
                                           [MonitorStatusID] => 8
                                           [Name] => PENDING
                                           [Description] => Status PENDING
                                   )
                           )
                   )
           )
    )
)

Located in /HostGroupDAL.inc.php (line 164)


	
			
Method Summary
HostGroupDAL __construct (string $foundationURL)
A getHostGroupById (integer $hostGroupId, [boolean $deep = false])
a getHostGroupByName (string $hostGroupName, [boolean $deep = false])
a getHostGroups ([boolean $deep = false])
list getHostGroupsByFilter ([unknown_type $filter = null], [list $sort = null], [integer $firstResult = -1], [integer $maxResults = -1], [boolean $deep = false])
Methods
Constructor __construct (line 174)

create an instance of the HostGroupDAL

create an instance of the HostGroupDAL

  • access: public
HostGroupDAL __construct (string $foundationURL)
  • string $foundationURL: - path to foundation MUST be provided
getHostGroupById (line 215)

gets the hostgroup corresponding to $hostGroupId. hostgroups that will include detailed host information in the response.

gets the hostgroup corresponding to $hostGroupId. Set $deep to true to do a deep retrieval of hostgroups that will include detailed host information in the response.

  • return: hostgroup
  • access: public
A getHostGroupById (integer $hostGroupId, [boolean $deep = false])
  • integer $hostGroupId
  • boolean $deep
getHostGroupByName (line 238)

gets the hostgroup corresponding to $hostGroupName. hostgroups that will include detailed host information in the response.

gets the hostgroup corresponding to $hostGroupName. Set $deep to true to do a deep retrieval of hostgroups that will include detailed host information in the response.

  • return: hostgroup
  • access: public
a getHostGroupByName (string $hostGroupName, [boolean $deep = false])
  • string $hostGroupName
  • boolean $deep
getHostGroups (line 188)

Gets all the HostGroups. detailed host information in the response.

Gets all the HostGroups. Set $deep to true to do a deep retrieval of hostgroups that will include detailed host information in the response.

  • return: list of HostGroups
  • access: public
a getHostGroups ([boolean $deep = false])
  • boolean $deep
getHostGroupsByFilter (line 265)

gets the hostgroups according the the filter passed in, sorted according to the fields in $sort.

gets the hostgroups according the the filter passed in, sorted according to the fields in $sort. Set $deep to true to do a deep retrieval of hostgroups that will include detailed host information in the response. Use $firstResult and $maxResults to constrain the number of hostgroups returned.

  • return: of hostgroups
  • access: public
list getHostGroupsByFilter ([unknown_type $filter = null], [list $sort = null], [integer $firstResult = -1], [integer $maxResults = -1], [boolean $deep = false])
  • unknown_type $filter
  • list $sort: - a list of Foundation database fields to sort on.
  • integer $firstResult: Number of HostGroup to start with - use for pagination
  • integer $maxResults: Total number of hostgroups to return, starting from $firstResult.
  • boolean $deep: - deep retrieval or not?

Documentation generated on Fri, 04 May 2007 16:49:44 -0700 by phpDocumentor 1.3.0RC3