You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2020/12/07 10:27:42 UTC

[GitHub] [brooklyn-server] ahgittin commented on a change in pull request #1128: add interfaces to MachineManagementMixins for shutdown/startup/reboot…

ahgittin commented on a change in pull request #1128:
URL: https://github.com/apache/brooklyn-server/pull/1128#discussion_r537393869



##########
File path: locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
##########
@@ -1256,6 +1257,39 @@ public JcloudsMachineLocation resumeMachine(Map<?, ?> flags) {
         return registered;
     }
 
+    @Override
+    public void shutdownMachine(MachineLocation l) {
+        // jclouds doesn't expose shutdown so just do a suspend
+        suspendMachine(l);
+    }
+
+    @Override
+    public MachineLocation startupMachine(MachineLocation l) {
+        if (!(l instanceof JcloudsSshMachineLocation)) {
+            throw new IllegalStateException("Cannot startup machine "+l+"; wrong type");
+        }
+        return resumeMachine(ImmutableMap.of("id", ((JcloudsSshMachineLocation)l).getJcloudsId()));
+    }
+
+    @Override
+    public MachineLocation rebootMachine(MachineLocation l) {
+        if (!(l instanceof JcloudsSshMachineLocation)) {
+            throw new IllegalStateException("Cannot startup machine "+l+"; wrong type");
+        }
+        getComputeService().rebootNode(((JcloudsSshMachineLocation)l).getJcloudsId());
+        return l;
+    }
+
+    @Override
+    public Map<String, Object> getMachineMetrics(MachineLocation l) {
+        return MutableMap.of();

Review comment:
       a subclass might




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org