mirror of https://github.com/apache/jclouds.git
Issue 158: Tidy up VirtualGuest.State after feedback from Softlayer
This commit is contained in:
parent
81796319aa
commit
7894d830bf
|
@ -49,14 +49,13 @@ import com.google.common.collect.ImmutableSet;
|
|||
@Singleton
|
||||
public class VirtualGuestToNodeMetadata implements Function<VirtualGuest, NodeMetadata> {
|
||||
|
||||
//TODO: There may be more states than this.
|
||||
public static final Map<VirtualGuest.State, NodeState> serverStateToNodeState = ImmutableMap
|
||||
.<VirtualGuest.State, NodeState> builder()
|
||||
.put(VirtualGuest.State.RUNNING, NodeState.RUNNING)
|
||||
.put(VirtualGuest.State.PAUSED, NodeState.SUSPENDED)
|
||||
.put(VirtualGuest.State.HALTED, NodeState.PENDING)
|
||||
.put(VirtualGuest.State.UNRECOGNIZED, NodeState.UNRECOGNIZED)
|
||||
.build();
|
||||
.put(VirtualGuest.State.HALTED, NodeState.PENDING)
|
||||
.put(VirtualGuest.State.PAUSED, NodeState.SUSPENDED)
|
||||
.put(VirtualGuest.State.RUNNING, NodeState.RUNNING)
|
||||
.put(VirtualGuest.State.UNRECOGNIZED, NodeState.UNRECOGNIZED)
|
||||
.build();
|
||||
|
||||
private final FindHardwareForVirtualGuest findHardwareForVirtualGuest;
|
||||
private final FindLocationForVirtualGuest findLocationForVirtualGuest;
|
||||
|
|
|
@ -205,14 +205,13 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
|||
}
|
||||
|
||||
/**
|
||||
* TBD: These states come from the powerState field. i.e.
|
||||
* These states come from the powerState field. i.e.
|
||||
* https://api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests/{id}?objectMask=powerState
|
||||
*/
|
||||
public static enum State {
|
||||
//ACTIVE, // Get this from https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/{id}/getStatus
|
||||
HALTED,
|
||||
PAUSED,
|
||||
RUNNING,
|
||||
HALTED,
|
||||
UNRECOGNIZED;
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue