diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index e6d247b421..23c0a4d239 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -34,6 +34,7 @@ enterprise_include_once ('include/functions_local_components.php'); enterprise_include_once ('include/functions_events.php'); enterprise_include_once ('include/functions_agents.php'); enterprise_include_once ('include/functions_modules.php'); +enterprise_include_once ('include/functions_collection.php'); /** * Parse the "other" parameter. @@ -10142,4 +10143,24 @@ function api_set_metaconsole_synch($keys) { } +/** + * Returns the collections associated to this agent + */ +function api_get_agent_collections($id_agent) { + // ACL! + $collections = enterprise_hook("collection_get_collections_in_agent", array($id_agent)); + echo json_encode($collections); +} + +/** + * Returns if collection exists in this node + */ +function api_get_check_collection_id($id_collection) { + // ACL! + $exists = enterprise_hook("collection_exits_directory", array($id_collection)); + echo json_encode($exists); +} + + + ?> diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index b43432c7b4..aaf1ef6eb8 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3081,3 +3081,26 @@ create table IF NOT EXISTS `tcluster_agent`( ON UPDATE CASCADE ) engine=InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tmigration_queue` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tmigration_queue`( + `id_metaconsole_agent` int unsigned not null, + `id_source_node` int unsigned not null, + `id_target_node` int unsigned not null, + `priority` int unsigned not null default 0, + `step` int unsigned not null default 0 +) engine=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tmigration_module_queue` +-- --------------------------------------------------------------------- + +create table IF NOT EXISTS `tmigration_module_queue`( + `id_source_node` int unsigned not null, + `id_target_node` int unsigned not null, + `id_source_agentmodule` int unsigned not null, + `id_target_agentmodule` int unsigned not null, + `last_replication_timestamp` bigint(20) NOT NULL default 0 +) engine=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file