From cb0e3499d7ca1f5dbbea490f284789068c438afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gonz=C3=A1lez?= Date: Thu, 28 May 2020 17:58:14 +0200 Subject: [PATCH] M #: Add new monitoring parameter to JAVA api --- .../org/opennebula/client/host/HostPool.java | 14 +++++++++++ .../client/vm/VirtualMachinePool.java | 24 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/src/oca/java/src/org/opennebula/client/host/HostPool.java b/src/oca/java/src/org/opennebula/client/host/HostPool.java index 0acbf94d71..9de7640ff3 100644 --- a/src/oca/java/src/org/opennebula/client/host/HostPool.java +++ b/src/oca/java/src/org/opennebula/client/host/HostPool.java @@ -74,6 +74,20 @@ public class HostPool extends Pool implements Iterable{ return client.call(MONITORING); } + /** + * Retrieves the monitoring data for all the hosts in the pool. + * + * @param client XML-RPC Client. + * @param num number of monitoring records to be retrieved, if -1 + * every record will be retrieved. + * @return If successful the message contains the string + * with the information returned by OpenNebula. + */ + public static OneResponse monitoring(Client client, int num) + { + return client.call(MONITORING, num); + } + /** * Loads the xml representation of the host pool. * diff --git a/src/oca/java/src/org/opennebula/client/vm/VirtualMachinePool.java b/src/oca/java/src/org/opennebula/client/vm/VirtualMachinePool.java index 503b52f5ca..d17c971beb 100644 --- a/src/oca/java/src/org/opennebula/client/vm/VirtualMachinePool.java +++ b/src/oca/java/src/org/opennebula/client/vm/VirtualMachinePool.java @@ -251,6 +251,30 @@ public class VirtualMachinePool extends Pool implements Iterable return client.call(MONITORING, filter); } + /** + * Retrieves the monitoring data for all or part of the Virtual + * Machines in the pool. + * + * @param client XML-RPC Client. + * @param filter Filter flag to use. Possible values: + *
    + *
  • {@link Pool#ALL}: All Virtual Machines
  • + *
  • {@link Pool#MINE}: Connected user's Virtual Machines
  • + *
  • {@link Pool#MINE_GROUP}: Connected user's Virtual Machines, and + * the ones in his group
  • + *
  • {@link Pool#GROUP}: User's primary group Virtual Machines
  • + *
  • >= 0 UID User's Virtual Machines
  • + *
+ * @param num number of monitoring records to be retrieved, if -1 + * every record will be retrieved. + * @return If successful the message contains the string + * with the information returned by OpenNebula. + */ + public static OneResponse monitoring(Client client, int filter, int num) + { + return client.call(MONITORING, filter, num); + } + /** * Loads the xml representation of all or part of the * Virtual Machines in the pool. The filter used is the one set in