mirror of https://github.com/Icinga/icinga2.git
Expose Zone#all_parents via API
This commit is contained in:
parent
7bcbd9b497
commit
ea5614f7df
|
@ -20,6 +20,7 @@
|
|||
#include "remote/zone.hpp"
|
||||
#include "remote/zone-ti.cpp"
|
||||
#include "remote/jsonrpcconnection.hpp"
|
||||
#include "base/array.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/logger.hpp"
|
||||
|
||||
|
@ -94,6 +95,16 @@ std::vector<Zone::Ptr> Zone::GetAllParentsRaw() const
|
|||
return m_AllParents;
|
||||
}
|
||||
|
||||
Array::Ptr Zone::GetAllParents() const
|
||||
{
|
||||
auto result (new Array);
|
||||
|
||||
for (auto& parent : m_AllParents)
|
||||
result->Add(parent->GetName());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Zone::CanAccessObject(const ConfigObject::Ptr& object)
|
||||
{
|
||||
Zone::Ptr object_zone;
|
||||
|
|
|
@ -41,6 +41,7 @@ public:
|
|||
Zone::Ptr GetParent() const;
|
||||
std::set<Endpoint::Ptr> GetEndpoints() const;
|
||||
std::vector<Zone::Ptr> GetAllParentsRaw() const;
|
||||
Array::Ptr GetAllParents() const override;
|
||||
|
||||
bool CanAccessObject(const ConfigObject::Ptr& object);
|
||||
bool IsChildOf(const Zone::Ptr& zone);
|
||||
|
|
|
@ -34,6 +34,9 @@ class Zone : ConfigObject
|
|||
|
||||
[config] array(name(Endpoint)) endpoints (EndpointsRaw);
|
||||
[config] bool global;
|
||||
[no_user_modify, no_storage] array(Value) all_parents {
|
||||
get;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue