1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #include "db_ido/zonedbobject.hpp"
4 #include "db_ido/dbtype.hpp"
5 #include "db_ido/dbvalue.hpp"
6 #include "base/logger.hpp"
8 using namespace icinga;
11 REGISTER_DBTYPE(Zone, "zone", DbObjectTypeZone, "zone_object_id", ZoneDbObject);
13 ZoneDbObject::ZoneDbObject(const DbType::Ptr& type, const String& name1, const String& name2)
14 : DbObject(type, name1, name2)
17 Dictionary::Ptr ZoneDbObject::GetConfigFields() const
19 Zone::Ptr zone = static_pointer_cast<Zone>(GetObject());
21 return new Dictionary({
22 { "is_global", zone->IsGlobal() ? 1 : 0 },
23 { "parent_zone_object_id", zone->GetParent() }
28 Dictionary::Ptr ZoneDbObject::GetStatusFields() const
30 Zone::Ptr zone = static_pointer_cast<Zone>(GetObject());
32 Log(LogDebug, "ZoneDbObject")
33 << "update status for zone '" << zone->GetName() << "'";
35 return new Dictionary({
36 { "parent_zone_object_id", zone->GetParent() }