mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-22 13:24:24 +02:00
parent
241f73f229
commit
ffcd33ee7e
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||||
|
|
||||||
|
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
|
||||||
|
|
||||||
|
class InstanceQuery extends IdoQuery
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected $columnMap = array(
|
||||||
|
'instances' => array(
|
||||||
|
'instance_id' => 'i.instance_id',
|
||||||
|
'instance_name' => 'i.instance_name'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function joinBaseTables()
|
||||||
|
{
|
||||||
|
$this->select()->from(array('i' => $this->prefix . 'instances'));
|
||||||
|
$this->joinedVirtualTables['instances'] = true;
|
||||||
|
}
|
||||||
|
}
|
33
modules/monitoring/library/Monitoring/DataView/Instance.php
Normal file
33
modules/monitoring/library/Monitoring/DataView/Instance.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||||
|
|
||||||
|
namespace Icinga\Module\Monitoring\DataView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* View representation for instances
|
||||||
|
*/
|
||||||
|
class Instance extends DataView
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getColumns()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'instance_id',
|
||||||
|
'instance_name'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getSortRules()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'instance_name' => array(
|
||||||
|
'order' => self::SORT_ASC
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user