jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alibazlamit <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs] JCLOUDS-1183 - oneandone-monitoringcenter-api (#322)
Date Fri, 07 Oct 2016 14:21:58 GMT
alibazlamit 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;

Creating a server is not enough since i will need to create a monitoring policy on that server
too, that is the next PR, maybe open the next PR and then merge it into this one to be able
to create the policy, i am following the order of the API documentation for the PR'S WDYT?

-- 
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