IcingaDB: export environment_id via API

Primarily required for Icinga DB integration tests at the moment, but could
also be helpful in other situations.
This commit is contained in:
Julian Brost 2021-10-14 12:00:59 +02:00
parent 4ade4c757b
commit 6007848146
3 changed files with 10 additions and 0 deletions

View File

@ -240,6 +240,10 @@ void IcingaDB::DumpedGlobals::Reset()
m_Ids.clear();
}
String IcingaDB::GetEnvironmentId() const {
return m_EnvironmentId;
}
bool IcingaDB::DumpedGlobals::IsNew(const String& id)
{
std::lock_guard<std::mutex> l (m_Mutex);

View File

@ -39,6 +39,8 @@ public:
virtual void Start(bool runtimeCreated) override;
virtual void Stop(bool runtimeRemoved) override;
String GetEnvironmentId() const override;
protected:
void ValidateTlsProtocolmin(const Lazy<String>& lvalue, const ValidationUtils& utils) override;
void ValidateConnectTimeout(const Lazy<double>& lvalue, const ValidationUtils& utils) override;

View File

@ -44,6 +44,10 @@ class IcingaDB : ConfigObject
[config] double connect_timeout {
default {{{ return DEFAULT_CONNECT_TIMEOUT; }}}
};
[no_storage] String environment_id {
get;
};
};
}