jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs] JCLOUDS-1183 - oneandone-monitoringcenter-api (#322)
Date Thu, 13 Oct 2016 13:55:04 GMT
nacx commented on this pull request.



> @@ -143,4 +143,17 @@ protected Server turnOnServer(String serverId) {
    protected Server turnOFFServer(String serverId) {
       return api.serverApi().updateStatus(serverId, Server.UpdateStatus.create(Types.ServerAction.POWER_OFF,
Types.ServerActionMethod.SOFTWARE));
    }
+
+   protected Server GetRandomServerWithMonitoringPolicy() throws InterruptedException {
+      List<Server> result = api.serverApi().list();
+      for (Server server : result) {
+         Thread.sleep(2000);
+         server = api.serverApi().get(server.id());
+         if (server.monitoringPolicy() != null) {
+            return server;
+         }
+      }
+
+      return null;

+1

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/322
Mime
View raw message