changed pandora api functions to include possibility of using agent alias when agent id is accepted as argument

This commit is contained in:
alejandro-campos 2019-10-17 11:14:42 +02:00
parent dc3dd1cffa
commit 3a5bbb22bd
4 changed files with 3372 additions and 1439 deletions

File diff suppressed because it is too large Load Diff

View File

@ -57,6 +57,7 @@ our @EXPORT = qw(
get_addr_id
get_agent_addr_id
get_agent_id
get_agent_ids_from_alias
get_agent_address
get_agent_alias
get_agent_group
@ -232,6 +233,17 @@ sub get_agent_id ($$) {
return defined ($rc) ? $rc : -1;
}
########################################################################
## Return agent IDs given an agent alias.
########################################################################
sub get_agent_ids_from_alias ($$) {
my ($dbh, $agent_alias) = @_;
my @rc = get_db_rows ($dbh, "SELECT id_agente, nombre FROM tagente WHERE alias = ?", safe_input($agent_alias));
return @rc;
}
########################################################################
## Return server ID given the name of server.
########################################################################
@ -956,7 +968,7 @@ sub db_process_insert($$$$;@) {
}
}
my $columns_string = join(',', @columns_array);
my $res = db_insert ($dbh,
$index,
"INSERT INTO $table ($columns_string) VALUES " . $wildcards, @values_array);

View File

@ -141,6 +141,7 @@ our @EXPORT = qw(
long_to_ip
ip_to_long
get_enabled_servers
dateTimeToTimestamp
);
# ID of the different servers

File diff suppressed because it is too large Load Diff