mirror of https://github.com/apache/jclouds.git
Issue 158: Tests for virtualguest to node metadata. Fix virtual guest equals/hashcode/toString. Added hardware to node data
This commit is contained in:
parent
5d179a6bd8
commit
2a30b2df2f
|
@ -48,7 +48,7 @@ import static org.jclouds.softlayer.predicates.ProductItemPredicates.*;
|
|||
@Singleton
|
||||
public class ProductItemsToHardware implements Function<Set<ProductItem>, Hardware> {
|
||||
|
||||
private static final double CORE_SPEED = 2.0;
|
||||
static final double CORE_SPEED = 2.0;
|
||||
|
||||
@Override
|
||||
public Hardware apply(Set<ProductItem> items) {
|
||||
|
|
|
@ -20,6 +20,7 @@ package org.jclouds.softlayer.compute.functions;
|
|||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.jclouds.compute.util.ComputeServiceUtils.parseGroupFromName;
|
||||
import static org.jclouds.softlayer.compute.functions.ProductItemsToHardware.CORE_SPEED;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -29,9 +30,7 @@ import javax.inject.Singleton;
|
|||
|
||||
import org.jclouds.collect.FindResourceInSet;
|
||||
import org.jclouds.collect.Memoized;
|
||||
import org.jclouds.compute.domain.NodeMetadata;
|
||||
import org.jclouds.compute.domain.NodeMetadataBuilder;
|
||||
import org.jclouds.compute.domain.NodeState;
|
||||
import org.jclouds.compute.domain.*;
|
||||
import org.jclouds.domain.Credentials;
|
||||
import org.jclouds.domain.Location;
|
||||
import org.jclouds.softlayer.domain.Datacenter;
|
||||
|
@ -50,7 +49,7 @@ public class VirtualGuestToNodeMetadata implements Function<VirtualGuest, NodeMe
|
|||
|
||||
public static final Map<VirtualGuest.State, NodeState> serverStateToNodeState = ImmutableMap
|
||||
.<VirtualGuest.State, NodeState> builder().put(VirtualGuest.State.HALTED, NodeState.PENDING).put(
|
||||
VirtualGuest.State.PAUSED, NodeState.SUSPENDED).put(VirtualGuest.State.RUNNING, NodeState.RUNNING)
|
||||
VirtualGuest.State.PAUSED, NodeState.SUSPENDED).put(VirtualGuest.State.RUNNING, NodeState.RUNNING)
|
||||
.put(VirtualGuest.State.UNRECOGNIZED, NodeState.UNRECOGNIZED).build();
|
||||
|
||||
private final Map<String, Credentials> credentialStore;
|
||||
|
@ -75,8 +74,8 @@ public class VirtualGuestToNodeMetadata implements Function<VirtualGuest, NodeMe
|
|||
// builder.imageId(from.imageId + "");
|
||||
// TODO make operating system from virtual guest
|
||||
// builder.operatingSystem(OperatingSystem.builder()...);
|
||||
// TODO make hardware from virtual guest
|
||||
// builder.hardware(Hardware.builder()...);
|
||||
|
||||
builder.hardware(getHardware(from));
|
||||
builder.state(serverStateToNodeState.get(from.getPowerState().getKeyName()));
|
||||
|
||||
// These are null for 'bad' guest orders in the HALTED state.
|
||||
|
@ -105,4 +104,20 @@ public class VirtualGuestToNodeMetadata implements Function<VirtualGuest, NodeMe
|
|||
return input.getId().equals(Integer.toString(dc.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
private Hardware getHardware(VirtualGuest from) {
|
||||
HardwareBuilder builder = new HardwareBuilder().id("TODO");
|
||||
|
||||
final double cpus = from.getMaxCpu();
|
||||
if (cpus>0) {
|
||||
builder.processor(new Processor(cpus, CORE_SPEED));
|
||||
}
|
||||
|
||||
final int maxMemory = from.getMaxMemory();
|
||||
if (maxMemory>0) {
|
||||
builder.ram(maxMemory);
|
||||
}
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,7 @@
|
|||
*/
|
||||
package org.jclouds.softlayer.config;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.jclouds.http.HttpErrorHandler;
|
||||
import org.jclouds.http.HttpRetryHandler;
|
||||
import org.jclouds.http.RequiresHttp;
|
||||
|
@ -33,17 +32,10 @@ import org.jclouds.rest.ConfiguresRestClient;
|
|||
import org.jclouds.rest.config.RestClientModule;
|
||||
import org.jclouds.softlayer.SoftLayerAsyncClient;
|
||||
import org.jclouds.softlayer.SoftLayerClient;
|
||||
import org.jclouds.softlayer.features.AccountAsyncClient;
|
||||
import org.jclouds.softlayer.features.AccountClient;
|
||||
import org.jclouds.softlayer.features.DatacenterAsyncClient;
|
||||
import org.jclouds.softlayer.features.DatacenterClient;
|
||||
import org.jclouds.softlayer.features.ProductPackageAsyncClient;
|
||||
import org.jclouds.softlayer.features.ProductPackageClient;
|
||||
import org.jclouds.softlayer.features.VirtualGuestAsyncClient;
|
||||
import org.jclouds.softlayer.features.VirtualGuestClient;
|
||||
import org.jclouds.softlayer.features.*;
|
||||
import org.jclouds.softlayer.handlers.SoftLayerErrorHandler;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Configures the SoftLayer connection.
|
||||
|
@ -68,6 +60,7 @@ public class SoftLayerRestClientModule extends RestClientModule<SoftLayerClient,
|
|||
@Override
|
||||
protected void configure() {
|
||||
bind(DateAdapter.class).to(Iso8601DateAdapter.class);
|
||||
//install(new SoftLayerParserModule()); TODO Is this needed?
|
||||
super.configure();
|
||||
}
|
||||
|
||||
|
|
|
@ -525,7 +525,7 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
|||
result = prime * result + startCpus;
|
||||
result = prime * result + statusId;
|
||||
result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
|
||||
result = prime * result + (billingItemId ^ (billingItemId >>> 32));
|
||||
result = prime * result + (getBillingItemId() ^ (getBillingItemId() >>> 32));
|
||||
result = prime * result + ((operatingSystem == null) ? 0 : operatingSystem.hashCode());
|
||||
result = prime * result + ((datacenter == null) ? 0 : datacenter.hashCode());
|
||||
result = prime * result + ((powerState == null) ? 0 : powerState.hashCode());
|
||||
|
@ -617,7 +617,7 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
|||
return false;
|
||||
} else if (!uuid.equals(other.uuid))
|
||||
return false;
|
||||
if (billingItemId != other.billingItemId)
|
||||
if (getBillingItemId() != other.getBillingItemId())
|
||||
return false;
|
||||
if (operatingSystem == null) {
|
||||
if (other.operatingSystem != null)
|
||||
|
@ -646,7 +646,7 @@ public class VirtualGuest implements Comparable<VirtualGuest> {
|
|||
+ ", metricPollDate=" + metricPollDate + ", modifyDate=" + modifyDate + ", notes=" + notes
|
||||
+ ", primaryBackendIpAddress=" + primaryBackendIpAddress + ", primaryIpAddress=" + primaryIpAddress
|
||||
+ ", privateNetworkOnly=" + privateNetworkOnly + ", startCpus=" + startCpus + ", statusId=" + statusId
|
||||
+ ", uuid=" + uuid + ", billingItemId="+billingItemId+", operatingSystem="+operatingSystem+", datacenter="+datacenter
|
||||
+ ", uuid=" + uuid + ", billingItemId="+getBillingItemId()+", operatingSystem="+operatingSystem+", datacenter="+datacenter
|
||||
+ ", powerState="+powerState+"]";
|
||||
}
|
||||
|
||||
|
|
|
@ -20,9 +20,14 @@ package org.jclouds.softlayer.compute;
|
|||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
import org.jclouds.compute.ComputeServiceContext;
|
||||
import org.jclouds.compute.ComputeServiceContextFactory;
|
||||
import org.jclouds.compute.RunNodesException;
|
||||
import org.jclouds.compute.domain.NodeMetadata;
|
||||
import org.jclouds.compute.domain.Template;
|
||||
import org.jclouds.logging.log4j.config.Log4JLoggingModule;
|
||||
import org.jclouds.sshj.config.SshjSshClientModule;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
|
@ -31,6 +36,8 @@ import org.testng.annotations.Test;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.inject.Module;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Adrian Cole
|
||||
|
@ -69,4 +76,29 @@ public class SoftLayerExperimentLiveTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateAndDestoryNode() throws RunNodesException {
|
||||
ComputeServiceContext context = null;
|
||||
try {
|
||||
String identity = checkNotNull(System.getProperty("test.softlayer.identity"), "test.softlayer.identity");
|
||||
String credential = checkNotNull(System.getProperty("test.softlayer.credential"), "test.softlayer.credential");
|
||||
|
||||
context = new ComputeServiceContextFactory().createContext("softlayer", identity, credential, ImmutableSet
|
||||
.<Module> of(new Log4JLoggingModule(), new SshjSshClientModule()));
|
||||
|
||||
Template template = context.getComputeService().templateBuilder()
|
||||
.locationId("3") // the default (singapore) doesn't work.
|
||||
.build();
|
||||
|
||||
Set<? extends NodeMetadata> nodes = context.getComputeService().createNodesInGroup("computeservice",1,template);
|
||||
assertTrue(nodes.size() == 1);
|
||||
NodeMetadata data = Iterables.get(nodes,0);
|
||||
context.getComputeService().destroyNode(data.getId());
|
||||
|
||||
} finally {
|
||||
if (context != null)
|
||||
context.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -24,14 +24,14 @@ import java.net.UnknownHostException;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jclouds.compute.domain.NodeMetadata;
|
||||
import org.jclouds.compute.domain.NodeMetadataBuilder;
|
||||
import org.jclouds.compute.domain.NodeState;
|
||||
import com.google.common.collect.Iterables;
|
||||
import org.jclouds.compute.domain.*;
|
||||
import org.jclouds.domain.Credentials;
|
||||
import org.jclouds.domain.Location;
|
||||
import org.jclouds.softlayer.compute.functions.VirtualGuestToNodeMetadata.FindLocationForVirtualGuest;
|
||||
import org.jclouds.softlayer.domain.Password;
|
||||
import org.jclouds.softlayer.domain.VirtualGuest;
|
||||
import org.jclouds.softlayer.parse.ParseVirtualGuestWithNoPasswordTest;
|
||||
import org.jclouds.softlayer.parse.*;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
@ -65,11 +65,132 @@ public class VirtualGuestToNodeMetadataTest {
|
|||
|
||||
NodeMetadata node = parser.apply(guest);
|
||||
|
||||
assertEquals(node, new NodeMetadataBuilder().ids("416696").name("node-246105155").group("node").location(
|
||||
expectedLocation).state(NodeState.PENDING).publicAddresses(ImmutableSet.of("173.192.29.186"))
|
||||
.privateAddresses(ImmutableSet.of("10.37.102.194")).build());
|
||||
assertEquals(node, new NodeMetadataBuilder().ids("416788").name("node1000360500").location(
|
||||
expectedLocation).state(NodeState.PENDING).publicAddresses(ImmutableSet.of("173.192.29.186"))
|
||||
.privateAddresses(ImmutableSet.of("10.37.102.194"))
|
||||
.hardware(new HardwareBuilder().id("TODO").processor(new Processor(1,2.0)).ram(1042).build())
|
||||
.build());
|
||||
|
||||
// because it wasn't present in the credential store.
|
||||
assertEquals(node.getCredentials(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyWhereVirtualIsBad() throws UnknownHostException {
|
||||
|
||||
// notice if we've already parsed this properly here, we can rely on it.
|
||||
VirtualGuest guest = new ParseBadVirtualGuest().expected();
|
||||
|
||||
// note we are testing when no credentials are here. otherwise would be ("node#416696", new
|
||||
// Credentials("root", "password"))
|
||||
Map<String, Credentials> credentialStore = ImmutableMap.<String, Credentials> of();
|
||||
|
||||
// no location here
|
||||
Supplier<Set<? extends Location>> locationSupplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
|
||||
.<Location> of());
|
||||
|
||||
VirtualGuestToNodeMetadata parser = new VirtualGuestToNodeMetadata(credentialStore,
|
||||
new FindLocationForVirtualGuest(locationSupplier));
|
||||
|
||||
NodeMetadata node = parser.apply(guest);
|
||||
|
||||
assertEquals(node, new NodeMetadataBuilder().ids("413348")
|
||||
.name("foo-ef4").group("foo")
|
||||
.state(NodeState.PENDING)
|
||||
.hardware(new HardwareBuilder().id("TODO").ram(256).build())
|
||||
.build());
|
||||
|
||||
// because it wasn't present in the credential store.
|
||||
assertEquals(node.getCredentials(), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyWhereVirtualGuestIsHalted() throws UnknownHostException {
|
||||
|
||||
// notice if we've already parsed this properly here, we can rely on it.
|
||||
VirtualGuest guest = new ParseVirtualGuestHaltedTest().expected();
|
||||
|
||||
Password password = Iterables.get(guest.getOperatingSystem().getPasswords(), 0);
|
||||
Credentials credentials = new Credentials(password.getUsername(),password.getPassword());
|
||||
Map<String, Credentials> credentialStore = ImmutableMap.<String, Credentials> of("node#416700",credentials);
|
||||
|
||||
// setup so that we have an expected Location to be parsed from the guest.
|
||||
Location expectedLocation = DatacenterToLocationTest.function.apply(guest.getDatacenter());
|
||||
Supplier<Set<? extends Location>> locationSupplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
|
||||
.<Location> of(expectedLocation));
|
||||
|
||||
VirtualGuestToNodeMetadata parser = new VirtualGuestToNodeMetadata(credentialStore,
|
||||
new FindLocationForVirtualGuest(locationSupplier));
|
||||
|
||||
NodeMetadata node = parser.apply(guest);
|
||||
|
||||
assertEquals(node, new NodeMetadataBuilder().ids("416700").name("node1703810489").location(
|
||||
expectedLocation).state(NodeState.PENDING).credentials(credentials)
|
||||
.publicAddresses(ImmutableSet.of("173.192.29.187")).privateAddresses(ImmutableSet.of("10.37.102.195"))
|
||||
.hardware(new HardwareBuilder().id("TODO").processor(new Processor(1,2.0)).ram(1042).build())
|
||||
.build());
|
||||
|
||||
// because it wasn't present in the credential store.
|
||||
assertEquals(node.getCredentials(), credentials);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyWhereVirtualGuestIsPaused() throws UnknownHostException {
|
||||
|
||||
// notice if we've already parsed this properly here, we can rely on it.
|
||||
VirtualGuest guest = new ParseVirtualGuestPausedTest().expected();
|
||||
|
||||
Password password = Iterables.get(guest.getOperatingSystem().getPasswords(),0);
|
||||
Credentials credentials = new Credentials(password.getUsername(),password.getPassword());
|
||||
Map<String, Credentials> credentialStore = ImmutableMap.<String, Credentials> of("node#416700",credentials);
|
||||
|
||||
// setup so that we have an expected Location to be parsed from the guest.
|
||||
Location expectedLocation = DatacenterToLocationTest.function.apply(guest.getDatacenter());
|
||||
Supplier<Set<? extends Location>> locationSupplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
|
||||
.<Location> of(expectedLocation));
|
||||
|
||||
VirtualGuestToNodeMetadata parser = new VirtualGuestToNodeMetadata(credentialStore,
|
||||
new FindLocationForVirtualGuest(locationSupplier));
|
||||
|
||||
NodeMetadata node = parser.apply(guest);
|
||||
|
||||
assertEquals(node, new NodeMetadataBuilder().ids("416700").name("node1703810489").location(
|
||||
expectedLocation).state(NodeState.SUSPENDED).credentials(credentials)
|
||||
.publicAddresses(ImmutableSet.of("173.192.29.187")).privateAddresses(ImmutableSet.of("10.37.102.195"))
|
||||
.hardware(new HardwareBuilder().id("TODO").processor(new Processor(1,2.0)).ram(1042).build())
|
||||
.build());
|
||||
|
||||
// because it wasn't present in the credential store.
|
||||
assertEquals(node.getCredentials(), credentials);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyWhereVirtualGuestIsRunning() throws UnknownHostException {
|
||||
|
||||
// notice if we've already parsed this properly here, we can rely on it.
|
||||
VirtualGuest guest = new ParseVirtualGuestRunningTest().expected();
|
||||
|
||||
Password password = Iterables.get(guest.getOperatingSystem().getPasswords(),0);
|
||||
Credentials credentials = new Credentials(password.getUsername(),password.getPassword());
|
||||
Map<String, Credentials> credentialStore = ImmutableMap.<String, Credentials> of("node#416700",credentials);
|
||||
|
||||
// setup so that we have an expected Location to be parsed from the guest.
|
||||
Location expectedLocation = DatacenterToLocationTest.function.apply(guest.getDatacenter());
|
||||
Supplier<Set<? extends Location>> locationSupplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
|
||||
.<Location> of(expectedLocation));
|
||||
|
||||
VirtualGuestToNodeMetadata parser = new VirtualGuestToNodeMetadata(credentialStore,
|
||||
new FindLocationForVirtualGuest(locationSupplier));
|
||||
|
||||
NodeMetadata node = parser.apply(guest);
|
||||
|
||||
assertEquals(node, new NodeMetadataBuilder().ids("416700").name("node1703810489").location(
|
||||
expectedLocation).state(NodeState.RUNNING).credentials(credentials)
|
||||
.publicAddresses(ImmutableSet.of("173.192.29.187")).privateAddresses(ImmutableSet.of("10.37.102.195"))
|
||||
.hardware(new HardwareBuilder().id("TODO").processor(new Processor(1,2.0)).ram(1042).build())
|
||||
.build());
|
||||
|
||||
// because it wasn't present in the credential store.
|
||||
assertEquals(node.getCredentials(), credentials);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.jclouds.softlayer.parse;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import org.jclouds.date.internal.SimpleDateFormatDateService;
|
||||
import org.jclouds.json.BaseItemParserTest;
|
||||
import org.jclouds.json.config.GsonModule;
|
||||
import org.jclouds.softlayer.compute.config.SoftLayerParserModule;
|
||||
import org.jclouds.softlayer.domain.Datacenter;
|
||||
import org.jclouds.softlayer.domain.OperatingSystem;
|
||||
import org.jclouds.softlayer.domain.PowerState;
|
||||
import org.jclouds.softlayer.domain.VirtualGuest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "unit", testName = "ParseVirtualGuestWithNoPasswordTest")
|
||||
public class ParseBadVirtualGuest extends BaseItemParserTest<VirtualGuest> {
|
||||
|
||||
@Override
|
||||
public String resource() {
|
||||
return "/virtual_guest_bad_halted.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public VirtualGuest expected() {
|
||||
return VirtualGuest
|
||||
.builder()
|
||||
.id(413348).accountId(93750).billingItemId(-1)
|
||||
.createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-09-28T01:52:45-08:00"))
|
||||
.domain("jclouds.org").fullyQualifiedDomainName("foo-ef4.jclouds.org")
|
||||
.hostname("foo-ef4").maxCpu(0).maxCpuUnits("CORE").maxMemory(256)
|
||||
.statusId(1001).startCpus(0)
|
||||
//TODO: maybe powerState can be flattened like billingItemId
|
||||
.powerState(new PowerState(VirtualGuest.State.HALTED)).build();
|
||||
}
|
||||
|
||||
protected Injector injector() {
|
||||
return Guice.createInjector(new SoftLayerParserModule(), new GsonModule() {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(DateAdapter.class).to(Iso8601DateAdapter.class);
|
||||
super.configure();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.jclouds.softlayer.parse;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import org.jclouds.date.internal.SimpleDateFormatDateService;
|
||||
import org.jclouds.json.BaseItemParserTest;
|
||||
import org.jclouds.json.config.GsonModule;
|
||||
import org.jclouds.softlayer.compute.config.SoftLayerParserModule;
|
||||
import org.jclouds.softlayer.domain.*;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "unit", testName = "ParseVirtualGuestWithNoPasswordTest")
|
||||
public class ParseVirtualGuestHaltedTest extends BaseItemParserTest<VirtualGuest> {
|
||||
|
||||
@Override
|
||||
public String resource() {
|
||||
return "/virtual_guest_good_halted.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public VirtualGuest expected() {
|
||||
return VirtualGuest
|
||||
.builder()
|
||||
.id(416700).accountId(93750).billingItemId(7184019)
|
||||
.createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-01T11:47:35-08:00"))
|
||||
.metricPollDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T02:32:00-08:00"))
|
||||
.dedicatedAccountHostOnly(true).domain("me.org").fullyQualifiedDomainName("node1703810489.me.org")
|
||||
.hostname("node1703810489").maxCpu(1).maxCpuUnits("CORE").maxMemory(1024)
|
||||
.modifyDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T03:19:43-08:00"))
|
||||
.primaryBackendIpAddress("10.37.102.195").primaryIpAddress("173.192.29.187").startCpus(1).statusId(1001)
|
||||
.uuid("02ddbbba-9225-3d54-6de5-fc603b309dd8")
|
||||
.operatingSystem(OperatingSystem.builder().id(913824)
|
||||
.password(Password.builder().id(729122).username("root").password("KnJqhC2l").build())
|
||||
.build())
|
||||
.datacenter(Datacenter.builder().id(3).name("dal01").longName("Dallas").build())
|
||||
//TODO: maybe powerState can be flattened like billingItemId
|
||||
.powerState(new PowerState(VirtualGuest.State.HALTED)).build();
|
||||
}
|
||||
|
||||
protected Injector injector() {
|
||||
return Guice.createInjector(new SoftLayerParserModule(), new GsonModule() {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(DateAdapter.class).to(Iso8601DateAdapter.class);
|
||||
super.configure();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.jclouds.softlayer.parse;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import org.jclouds.date.internal.SimpleDateFormatDateService;
|
||||
import org.jclouds.json.BaseItemParserTest;
|
||||
import org.jclouds.json.config.GsonModule;
|
||||
import org.jclouds.softlayer.compute.config.SoftLayerParserModule;
|
||||
import org.jclouds.softlayer.domain.*;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "unit", testName = "ParseVirtualGuestWithNoPasswordTest")
|
||||
public class ParseVirtualGuestPausedTest extends BaseItemParserTest<VirtualGuest> {
|
||||
|
||||
@Override
|
||||
public String resource() {
|
||||
return "/virtual_guest_paused.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public VirtualGuest expected() {
|
||||
return VirtualGuest
|
||||
.builder()
|
||||
.id(416700).accountId(93750).billingItemId(7184019)
|
||||
.createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-01T11:47:35-08:00"))
|
||||
.metricPollDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T02:32:00-08:00"))
|
||||
.dedicatedAccountHostOnly(true).domain("me.org").fullyQualifiedDomainName("node1703810489.me.org")
|
||||
.hostname("node1703810489").maxCpu(1).maxCpuUnits("CORE").maxMemory(1024)
|
||||
.modifyDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T03:18:12-08:00"))
|
||||
.primaryBackendIpAddress("10.37.102.195").primaryIpAddress("173.192.29.187").startCpus(1).statusId(1001)
|
||||
.uuid("02ddbbba-9225-3d54-6de5-fc603b309dd8")
|
||||
.operatingSystem(OperatingSystem.builder().id(913824)
|
||||
.password(Password.builder().id(729122).username("root").password("KnJqhC2l").build())
|
||||
.build())
|
||||
.datacenter(Datacenter.builder().id(3).name("dal01").longName("Dallas").build())
|
||||
//TODO: maybe powerState can be flattened like billingItemId
|
||||
.powerState(new PowerState(VirtualGuest.State.PAUSED)).build();
|
||||
}
|
||||
|
||||
protected Injector injector() {
|
||||
return Guice.createInjector(new SoftLayerParserModule(), new GsonModule() {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(DateAdapter.class).to(Iso8601DateAdapter.class);
|
||||
super.configure();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.jclouds.softlayer.parse;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import org.jclouds.date.internal.SimpleDateFormatDateService;
|
||||
import org.jclouds.json.BaseItemParserTest;
|
||||
import org.jclouds.json.config.GsonModule;
|
||||
import org.jclouds.softlayer.compute.config.SoftLayerParserModule;
|
||||
import org.jclouds.softlayer.domain.*;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "unit", testName = "ParseVirtualGuestWithNoPasswordTest")
|
||||
public class ParseVirtualGuestRunningTest extends BaseItemParserTest<VirtualGuest> {
|
||||
|
||||
@Override
|
||||
public String resource() {
|
||||
return "/virtual_guest_running.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public VirtualGuest expected() {
|
||||
return VirtualGuest
|
||||
.builder()
|
||||
.id(416700).accountId(93750).billingItemId(7184019)
|
||||
.createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-01T11:47:35-08:00"))
|
||||
.metricPollDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T02:32:00-08:00"))
|
||||
.dedicatedAccountHostOnly(true).domain("me.org").fullyQualifiedDomainName("node1703810489.me.org")
|
||||
.hostname("node1703810489").maxCpu(1).maxCpuUnits("CORE").maxMemory(1024)
|
||||
.modifyDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T02:32:40-08:00"))
|
||||
.primaryBackendIpAddress("10.37.102.195").primaryIpAddress("173.192.29.187").startCpus(1).statusId(1001)
|
||||
.uuid("02ddbbba-9225-3d54-6de5-fc603b309dd8")
|
||||
.operatingSystem(OperatingSystem.builder().id(913824)
|
||||
.password(Password.builder().id(729122).username("root").password("KnJqhC2l").build())
|
||||
.build())
|
||||
.datacenter(Datacenter.builder().id(3).name("dal01").longName("Dallas").build())
|
||||
//TODO: maybe powerState can be flattened like billingItemId
|
||||
.powerState(new PowerState(VirtualGuest.State.RUNNING)).build();
|
||||
}
|
||||
|
||||
protected Injector injector() {
|
||||
return Guice.createInjector(new SoftLayerParserModule(), new GsonModule() {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(DateAdapter.class).to(Iso8601DateAdapter.class);
|
||||
super.configure();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -18,9 +18,8 @@
|
|||
*/
|
||||
package org.jclouds.softlayer.parse;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import org.jclouds.date.internal.SimpleDateFormatDateService;
|
||||
import org.jclouds.json.BaseItemParserTest;
|
||||
import org.jclouds.json.config.GsonModule;
|
||||
|
@ -31,8 +30,8 @@ import org.jclouds.softlayer.domain.PowerState;
|
|||
import org.jclouds.softlayer.domain.VirtualGuest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -51,15 +50,14 @@ public class ParseVirtualGuestWithNoPasswordTest extends BaseItemParserTest<Virt
|
|||
public VirtualGuest expected() {
|
||||
return VirtualGuest
|
||||
.builder()
|
||||
//TODO: why is there no billingItem in the json?
|
||||
.id(416696).accountId(93750).billingItemId(0)
|
||||
.createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-01T11:10:16-08:00"))
|
||||
.dedicatedAccountHostOnly(true).domain("me.org").fullyQualifiedDomainName("node-246105155.me.org")
|
||||
.hostname("node-246105155").maxCpu(1).maxCpuUnits("CORE").maxMemory(1024)
|
||||
.modifyDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-01T11:11:31-08:00"))
|
||||
.id(416788).accountId(93750).billingItemId(7185261)
|
||||
.createDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T03:24:43-08:00"))
|
||||
.dedicatedAccountHostOnly(true).domain("me.org").fullyQualifiedDomainName("node1000360500.me.org")
|
||||
.hostname("node1000360500").maxCpu(1).maxCpuUnits("CORE").maxMemory(1024)
|
||||
.modifyDate(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-10-02T03:25:33-08:00"))
|
||||
.primaryBackendIpAddress("10.37.102.194").primaryIpAddress("173.192.29.186").startCpus(1).statusId(1001)
|
||||
.uuid("694d34c3-9c36-b590-4ba7-4ec58954b9dc")
|
||||
.operatingSystem(OperatingSystem.builder().id(913812).build())
|
||||
.uuid("96fe22ad-8182-924d-ce51-a037e477dd83")
|
||||
.operatingSystem(OperatingSystem.builder().id(913960).build())
|
||||
.datacenter(Datacenter.builder().id(3).name("dal01").longName("Dallas").build())
|
||||
//TODO: maybe powerState can be flattened like billingItemId
|
||||
.powerState(new PowerState(VirtualGuest.State.HALTED)).build();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{"accountId":93750,"createDate":"2011-09-28T01:52:45-08:00","dedicatedAccountHostOnlyFlag":false,"domain":"jclouds.org","fullyQualifiedDomainName":"foo-ef4.jclouds.org","hostname":"foo-ef4","id":413348,"lastVerifiedDate":null,"maxCpu":null,"maxCpuUnits":"CORE","maxMemory":256,"metricPollDate":null,"modifyDate":null,"privateNetworkOnlyFlag":false,"startCpus":null,"statusId":1001,"globalIdentifier":"9a8b20f0-a758-4c1f-b65b-0e63b791009f","managedResourceFlag":false,"networkVlans":[],"powerState":{
|
||||
"keyName":"HALTED",
|
||||
"name":"Halted"
|
||||
}}
|
||||
}}
|
||||
|
|
|
@ -1,8 +1,36 @@
|
|||
{"accountId":93750,"createDate":"2011-10-01T06:10:38-08:00","dedicatedAccountHostOnlyFlag":true,"domain":"me.org","fullyQualifiedDomainName":"node-1928752820.me.org","hostname":"node-1928752820","id":416591,"lastVerifiedDate":null,"maxCpu":1,"maxCpuUnits":"CORE","maxMemory":1024,"metricPollDate":"2011-10-01T09:36:00-08:00","modifyDate":"2011-10-01T10:47:14-08:00","privateNetworkOnlyFlag":false,"startCpus":1,"statusId":1001,"uuid":"754c011b-7e80-8185-7e5a-c6424873c509","datacenter":{
|
||||
{"accountId":93750,"createDate":"2011-10-01T11:47:35-08:00","dedicatedAccountHostOnlyFlag":true,"domain":"me.org","fullyQualifiedDomainName":"node1703810489.me.org","hostname":"node1703810489","id":416700,"lastVerifiedDate":null,"maxCpu":1,"maxCpuUnits":"CORE","maxMemory":1024,"metricPollDate":"2011-10-02T02:32:00-08:00","modifyDate":"2011-10-02T03:19:43-08:00","privateNetworkOnlyFlag":false,"startCpus":1,"statusId":1001,"uuid":"02ddbbba-9225-3d54-6de5-fc603b309dd8","billingItem":{
|
||||
"cancellationDate":null,
|
||||
"categoryCode":"guest_core",
|
||||
"createDate":"2011-10-01T11:48:10-08:00",
|
||||
"currentHourlyCharge":"0",
|
||||
"cycleStartDate":"2011-10-01T11:58:26-08:00",
|
||||
"description":"Private 1 x 2.0 GHz Core",
|
||||
"domainName":"me.org",
|
||||
"hostName":"node1703810489",
|
||||
"hourlyRecurringFee":"0",
|
||||
"hoursUsed":"16",
|
||||
"id":7184019,
|
||||
"laborFee":"0",
|
||||
"laborFeeTaxRate":"0",
|
||||
"lastBillDate":"2011-10-01T11:58:26-08:00",
|
||||
"modifyDate":"2011-10-01T11:58:26-08:00",
|
||||
"nextBillDate":"2011-10-17T21:00:00-08:00",
|
||||
"oneTimeFee":"0",
|
||||
"oneTimeFeeTaxRate":"0",
|
||||
"orderItemId":8021579,
|
||||
"parentId":null,
|
||||
"recurringFee":"0",
|
||||
"recurringFeeTaxRate":"0",
|
||||
"recurringMonths":1,
|
||||
"serviceProviderId":1,
|
||||
"setupFee":"0",
|
||||
"setupFeeTaxRate":"0",
|
||||
"resourceTableId":416700
|
||||
},"datacenter":{
|
||||
"id":3,
|
||||
"longName":"Dallas",
|
||||
"name":"dal01"
|
||||
},"globalIdentifier":"0f10b863-f6b3-49a3-a2b9-9b0fe956a912","managedResourceFlag":false,"networkVlans":[
|
||||
},"globalIdentifier":"0ea2db7f-800d-479a-88e0-8e276e500b80","managedResourceFlag":false,"networkVlans":[
|
||||
{
|
||||
"accountId":93750,
|
||||
"id":144615,
|
||||
|
@ -21,29 +49,29 @@
|
|||
}
|
||||
],"operatingSystem":{
|
||||
"hardwareId":null,
|
||||
"id":913636,
|
||||
"id":913824,
|
||||
"manufacturerLicenseInstance":"",
|
||||
"passwords":[
|
||||
{
|
||||
"createDate":"2011-10-01T06:12:33-08:00",
|
||||
"id":728987,
|
||||
"modifyDate":"2011-10-01T06:12:33-08:00",
|
||||
"password":"XKL4cHym",
|
||||
"createDate":"2011-10-01T11:48:52-08:00",
|
||||
"id":729122,
|
||||
"modifyDate":"2011-10-01T11:48:52-08:00",
|
||||
"password":"KnJqhC2l",
|
||||
"port":null,
|
||||
"softwareId":913636,
|
||||
"softwareId":913824,
|
||||
"username":"root",
|
||||
"software":{
|
||||
"hardwareId":null,
|
||||
"id":913636,
|
||||
"id":913824,
|
||||
"manufacturerLicenseInstance":"",
|
||||
"passwords":[
|
||||
{
|
||||
"createDate":"2011-10-01T06:12:33-08:00",
|
||||
"id":728987,
|
||||
"modifyDate":"2011-10-01T06:12:33-08:00",
|
||||
"password":"XKL4cHym",
|
||||
"createDate":"2011-10-01T11:48:52-08:00",
|
||||
"id":729122,
|
||||
"modifyDate":"2011-10-01T11:48:52-08:00",
|
||||
"password":"KnJqhC2l",
|
||||
"port":null,
|
||||
"softwareId":913636,
|
||||
"softwareId":913824,
|
||||
"username":"root",
|
||||
"software":null
|
||||
}
|
||||
|
@ -86,4 +114,4 @@
|
|||
},"powerState":{
|
||||
"keyName":"HALTED",
|
||||
"name":"Halted"
|
||||
},"primaryBackendIpAddress":"10.37.102.197","primaryIpAddress":"173.192.29.189"}
|
||||
},"primaryBackendIpAddress":"10.37.102.195","primaryIpAddress":"173.192.29.187"}
|
||||
|
|
|
@ -1,8 +1,36 @@
|
|||
{"accountId":93750,"createDate":"2011-10-01T11:10:16-08:00","dedicatedAccountHostOnlyFlag":true,"domain":"me.org","fullyQualifiedDomainName":"node-246105155.me.org","hostname":"node-246105155","id":416696,"lastVerifiedDate":null,"maxCpu":1,"maxCpuUnits":"CORE","maxMemory":1024,"metricPollDate":null,"modifyDate":"2011-10-01T11:11:31-08:00","privateNetworkOnlyFlag":false,"startCpus":1,"statusId":1001,"uuid":"694d34c3-9c36-b590-4ba7-4ec58954b9dc","datacenter":{
|
||||
{"accountId":93750,"createDate":"2011-10-02T03:24:43-08:00","dedicatedAccountHostOnlyFlag":true,"domain":"me.org","fullyQualifiedDomainName":"node1000360500.me.org","hostname":"node1000360500","id":416788,"lastVerifiedDate":null,"maxCpu":1,"maxCpuUnits":"CORE","maxMemory":1024,"metricPollDate":null,"modifyDate":"2011-10-02T03:25:33-08:00","privateNetworkOnlyFlag":false,"startCpus":1,"statusId":1001,"uuid":"96fe22ad-8182-924d-ce51-a037e477dd83","billingItem":{
|
||||
"cancellationDate":null,
|
||||
"categoryCode":"guest_core",
|
||||
"createDate":"2011-10-02T03:25:12-08:00",
|
||||
"currentHourlyCharge":"0",
|
||||
"cycleStartDate":"2011-10-02T03:25:12-08:00",
|
||||
"description":"Private 1 x 2.0 GHz Core",
|
||||
"domainName":"me.org",
|
||||
"hostName":"node1000360500",
|
||||
"hourlyRecurringFee":"0",
|
||||
"hoursUsed":"1",
|
||||
"id":7185261,
|
||||
"laborFee":"0",
|
||||
"laborFeeTaxRate":"0",
|
||||
"lastBillDate":"2011-10-02T03:25:12-08:00",
|
||||
"modifyDate":"2011-10-02T03:25:51-08:00",
|
||||
"nextBillDate":"2011-10-17T21:00:00-08:00",
|
||||
"oneTimeFee":"0",
|
||||
"oneTimeFeeTaxRate":"0",
|
||||
"orderItemId":8023216,
|
||||
"parentId":null,
|
||||
"recurringFee":"0",
|
||||
"recurringFeeTaxRate":"0",
|
||||
"recurringMonths":1,
|
||||
"serviceProviderId":1,
|
||||
"setupFee":"0",
|
||||
"setupFeeTaxRate":"0",
|
||||
"resourceTableId":416788
|
||||
},"datacenter":{
|
||||
"id":3,
|
||||
"longName":"Dallas",
|
||||
"name":"dal01"
|
||||
},"globalIdentifier":"a867e0a2-01f6-4c80-ad0f-2688f2eab1a7","managedResourceFlag":false,"networkVlans":[
|
||||
},"globalIdentifier":"0a07b4fc-2b3c-4053-9220-55992de14d21","managedResourceFlag":false,"networkVlans":[
|
||||
{
|
||||
"accountId":93750,
|
||||
"id":144615,
|
||||
|
@ -21,7 +49,7 @@
|
|||
}
|
||||
],"operatingSystem":{
|
||||
"hardwareId":null,
|
||||
"id":913812,
|
||||
"id":913960,
|
||||
"manufacturerLicenseInstance":"",
|
||||
"passwords":[],
|
||||
"softwareLicense":{
|
||||
|
@ -43,4 +71,4 @@
|
|||
},"powerState":{
|
||||
"keyName":"HALTED",
|
||||
"name":"Halted"
|
||||
},"primaryBackendIpAddress":"10.37.102.194","primaryIpAddress":"173.192.29.186"}
|
||||
},"primaryBackendIpAddress":"10.37.102.194","primaryIpAddress":"173.192.29.186"}
|
||||
|
|
|
@ -1,8 +1,36 @@
|
|||
{"accountId":93750,"createDate":"2011-10-01T06:10:38-08:00","dedicatedAccountHostOnlyFlag":true,"domain":"me.org","fullyQualifiedDomainName":"node-1928752820.me.org","hostname":"node-1928752820","id":416591,"lastVerifiedDate":null,"maxCpu":1,"maxCpuUnits":"CORE","maxMemory":1024,"metricPollDate":"2011-10-01T09:36:00-08:00","modifyDate":"2011-10-01T10:45:44-08:00","privateNetworkOnlyFlag":false,"startCpus":1,"statusId":1001,"uuid":"754c011b-7e80-8185-7e5a-c6424873c509","datacenter":{
|
||||
{"accountId":93750,"createDate":"2011-10-01T11:47:35-08:00","dedicatedAccountHostOnlyFlag":true,"domain":"me.org","fullyQualifiedDomainName":"node1703810489.me.org","hostname":"node1703810489","id":416700,"lastVerifiedDate":null,"maxCpu":1,"maxCpuUnits":"CORE","maxMemory":1024,"metricPollDate":"2011-10-02T02:32:00-08:00","modifyDate":"2011-10-02T03:18:12-08:00","privateNetworkOnlyFlag":false,"startCpus":1,"statusId":1001,"uuid":"02ddbbba-9225-3d54-6de5-fc603b309dd8","billingItem":{
|
||||
"cancellationDate":null,
|
||||
"categoryCode":"guest_core",
|
||||
"createDate":"2011-10-01T11:48:10-08:00",
|
||||
"currentHourlyCharge":"0",
|
||||
"cycleStartDate":"2011-10-01T11:58:26-08:00",
|
||||
"description":"Private 1 x 2.0 GHz Core",
|
||||
"domainName":"me.org",
|
||||
"hostName":"node1703810489",
|
||||
"hourlyRecurringFee":"0",
|
||||
"hoursUsed":"16",
|
||||
"id":7184019,
|
||||
"laborFee":"0",
|
||||
"laborFeeTaxRate":"0",
|
||||
"lastBillDate":"2011-10-01T11:58:26-08:00",
|
||||
"modifyDate":"2011-10-01T11:58:26-08:00",
|
||||
"nextBillDate":"2011-10-17T21:00:00-08:00",
|
||||
"oneTimeFee":"0",
|
||||
"oneTimeFeeTaxRate":"0",
|
||||
"orderItemId":8021579,
|
||||
"parentId":null,
|
||||
"recurringFee":"0",
|
||||
"recurringFeeTaxRate":"0",
|
||||
"recurringMonths":1,
|
||||
"serviceProviderId":1,
|
||||
"setupFee":"0",
|
||||
"setupFeeTaxRate":"0",
|
||||
"resourceTableId":416700
|
||||
},"datacenter":{
|
||||
"id":3,
|
||||
"longName":"Dallas",
|
||||
"name":"dal01"
|
||||
},"globalIdentifier":"0f10b863-f6b3-49a3-a2b9-9b0fe956a912","managedResourceFlag":false,"networkVlans":[
|
||||
},"globalIdentifier":"0ea2db7f-800d-479a-88e0-8e276e500b80","managedResourceFlag":false,"networkVlans":[
|
||||
{
|
||||
"accountId":93750,
|
||||
"id":144615,
|
||||
|
@ -21,29 +49,29 @@
|
|||
}
|
||||
],"operatingSystem":{
|
||||
"hardwareId":null,
|
||||
"id":913636,
|
||||
"id":913824,
|
||||
"manufacturerLicenseInstance":"",
|
||||
"passwords":[
|
||||
{
|
||||
"createDate":"2011-10-01T06:12:33-08:00",
|
||||
"id":728987,
|
||||
"modifyDate":"2011-10-01T06:12:33-08:00",
|
||||
"password":"XKL4cHym",
|
||||
"createDate":"2011-10-01T11:48:52-08:00",
|
||||
"id":729122,
|
||||
"modifyDate":"2011-10-01T11:48:52-08:00",
|
||||
"password":"KnJqhC2l",
|
||||
"port":null,
|
||||
"softwareId":913636,
|
||||
"softwareId":913824,
|
||||
"username":"root",
|
||||
"software":{
|
||||
"hardwareId":null,
|
||||
"id":913636,
|
||||
"id":913824,
|
||||
"manufacturerLicenseInstance":"",
|
||||
"passwords":[
|
||||
{
|
||||
"createDate":"2011-10-01T06:12:33-08:00",
|
||||
"id":728987,
|
||||
"modifyDate":"2011-10-01T06:12:33-08:00",
|
||||
"password":"XKL4cHym",
|
||||
"createDate":"2011-10-01T11:48:52-08:00",
|
||||
"id":729122,
|
||||
"modifyDate":"2011-10-01T11:48:52-08:00",
|
||||
"password":"KnJqhC2l",
|
||||
"port":null,
|
||||
"softwareId":913636,
|
||||
"softwareId":913824,
|
||||
"username":"root",
|
||||
"software":null
|
||||
}
|
||||
|
@ -86,4 +114,4 @@
|
|||
},"powerState":{
|
||||
"keyName":"PAUSED",
|
||||
"name":"Paused"
|
||||
},"primaryBackendIpAddress":"10.37.102.197","primaryIpAddress":"173.192.29.189"}
|
||||
},"primaryBackendIpAddress":"10.37.102.195","primaryIpAddress":"173.192.29.187"}
|
||||
|
|
|
@ -1,8 +1,36 @@
|
|||
{"accountId":93750,"createDate":"2011-10-01T06:10:38-08:00","dedicatedAccountHostOnlyFlag":true,"domain":"me.org","fullyQualifiedDomainName":"node-1928752820.me.org","hostname":"node-1928752820","id":416591,"lastVerifiedDate":null,"maxCpu":1,"maxCpuUnits":"CORE","maxMemory":1024,"metricPollDate":"2011-10-01T09:36:00-08:00","modifyDate":"2011-10-01T09:36:29-08:00","privateNetworkOnlyFlag":false,"startCpus":1,"statusId":1001,"uuid":"754c011b-7e80-8185-7e5a-c6424873c509","datacenter":{
|
||||
{"accountId":93750,"createDate":"2011-10-01T11:47:35-08:00","dedicatedAccountHostOnlyFlag":true,"domain":"me.org","fullyQualifiedDomainName":"node1703810489.me.org","hostname":"node1703810489","id":416700,"lastVerifiedDate":null,"maxCpu":1,"maxCpuUnits":"CORE","maxMemory":1024,"metricPollDate":"2011-10-02T02:32:00-08:00","modifyDate":"2011-10-02T02:32:40-08:00","privateNetworkOnlyFlag":false,"startCpus":1,"statusId":1001,"uuid":"02ddbbba-9225-3d54-6de5-fc603b309dd8","billingItem":{
|
||||
"cancellationDate":null,
|
||||
"categoryCode":"guest_core",
|
||||
"createDate":"2011-10-01T11:48:10-08:00",
|
||||
"currentHourlyCharge":"0",
|
||||
"cycleStartDate":"2011-10-01T11:58:26-08:00",
|
||||
"description":"Private 1 x 2.0 GHz Core",
|
||||
"domainName":"me.org",
|
||||
"hostName":"node1703810489",
|
||||
"hourlyRecurringFee":"0",
|
||||
"hoursUsed":"16",
|
||||
"id":7184019,
|
||||
"laborFee":"0",
|
||||
"laborFeeTaxRate":"0",
|
||||
"lastBillDate":"2011-10-01T11:58:26-08:00",
|
||||
"modifyDate":"2011-10-01T11:58:26-08:00",
|
||||
"nextBillDate":"2011-10-17T21:00:00-08:00",
|
||||
"oneTimeFee":"0",
|
||||
"oneTimeFeeTaxRate":"0",
|
||||
"orderItemId":8021579,
|
||||
"parentId":null,
|
||||
"recurringFee":"0",
|
||||
"recurringFeeTaxRate":"0",
|
||||
"recurringMonths":1,
|
||||
"serviceProviderId":1,
|
||||
"setupFee":"0",
|
||||
"setupFeeTaxRate":"0",
|
||||
"resourceTableId":416700
|
||||
},"datacenter":{
|
||||
"id":3,
|
||||
"longName":"Dallas",
|
||||
"name":"dal01"
|
||||
},"globalIdentifier":"0f10b863-f6b3-49a3-a2b9-9b0fe956a912","managedResourceFlag":false,"networkVlans":[
|
||||
},"globalIdentifier":"0ea2db7f-800d-479a-88e0-8e276e500b80","managedResourceFlag":false,"networkVlans":[
|
||||
{
|
||||
"accountId":93750,
|
||||
"id":144615,
|
||||
|
@ -21,29 +49,29 @@
|
|||
}
|
||||
],"operatingSystem":{
|
||||
"hardwareId":null,
|
||||
"id":913636,
|
||||
"id":913824,
|
||||
"manufacturerLicenseInstance":"",
|
||||
"passwords":[
|
||||
{
|
||||
"createDate":"2011-10-01T06:12:33-08:00",
|
||||
"id":728987,
|
||||
"modifyDate":"2011-10-01T06:12:33-08:00",
|
||||
"password":"XKL4cHym",
|
||||
"createDate":"2011-10-01T11:48:52-08:00",
|
||||
"id":729122,
|
||||
"modifyDate":"2011-10-01T11:48:52-08:00",
|
||||
"password":"KnJqhC2l",
|
||||
"port":null,
|
||||
"softwareId":913636,
|
||||
"softwareId":913824,
|
||||
"username":"root",
|
||||
"software":{
|
||||
"hardwareId":null,
|
||||
"id":913636,
|
||||
"id":913824,
|
||||
"manufacturerLicenseInstance":"",
|
||||
"passwords":[
|
||||
{
|
||||
"createDate":"2011-10-01T06:12:33-08:00",
|
||||
"id":728987,
|
||||
"modifyDate":"2011-10-01T06:12:33-08:00",
|
||||
"password":"XKL4cHym",
|
||||
"createDate":"2011-10-01T11:48:52-08:00",
|
||||
"id":729122,
|
||||
"modifyDate":"2011-10-01T11:48:52-08:00",
|
||||
"password":"KnJqhC2l",
|
||||
"port":null,
|
||||
"softwareId":913636,
|
||||
"softwareId":913824,
|
||||
"username":"root",
|
||||
"software":null
|
||||
}
|
||||
|
@ -86,4 +114,4 @@
|
|||
},"powerState":{
|
||||
"keyName":"RUNNING",
|
||||
"name":"Running"
|
||||
},"primaryBackendIpAddress":"10.37.102.197","primaryIpAddress":"173.192.29.189"}
|
||||
},"primaryBackendIpAddress":"10.37.102.195","primaryIpAddress":"173.192.29.187"}
|
||||
|
|
Loading…
Reference in New Issue