From 0915b3ef56dfac3113cce55a59a5765dc94976be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:34:54 +0200 Subject: Adding upstream version 2.13.6. Signed-off-by: Daniel Baumann --- lib/db_ido/commanddbobject.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lib/db_ido/commanddbobject.cpp (limited to 'lib/db_ido/commanddbobject.cpp') diff --git a/lib/db_ido/commanddbobject.cpp b/lib/db_ido/commanddbobject.cpp new file mode 100644 index 0000000..2ac167a --- /dev/null +++ b/lib/db_ido/commanddbobject.cpp @@ -0,0 +1,31 @@ +/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ + +#include "db_ido/commanddbobject.hpp" +#include "db_ido/dbtype.hpp" +#include "db_ido/dbvalue.hpp" +#include "icinga/command.hpp" +#include "icinga/compatutility.hpp" +#include "base/objectlock.hpp" +#include "base/convert.hpp" + +using namespace icinga; + +REGISTER_DBTYPE(Command, "command", DbObjectTypeCommand, "object_id", CommandDbObject); + +CommandDbObject::CommandDbObject(const DbType::Ptr& type, const String& name1, const String& name2) + : DbObject(type, name1, name2) +{ } + +Dictionary::Ptr CommandDbObject::GetConfigFields() const +{ + Command::Ptr command = static_pointer_cast(GetObject()); + + return new Dictionary({ + { "command_line", CompatUtility::GetCommandLine(command) } + }); +} + +Dictionary::Ptr CommandDbObject::GetStatusFields() const +{ + return nullptr; +} -- cgit v1.2.3