From e3e90c0b9cde273bb8ad36f098fa19069584020f Mon Sep 17 00:00:00 2001 From: Kedar Dave Date: Thu, 29 Mar 2012 10:46:37 -0500 Subject: [PATCH] First set of api's for opsource --- .../opsource/servers/OpSourceNameSpaces.java | 2 + .../servers/OpSourceServersAsyncClient.java | 16 + .../servers/OpSourceServersClient.java | 16 + .../OpSourceServersRestClientModule.java | 9 +- .../opsource/servers/domain/BaseServer.java | 77 ++ .../opsource/servers/domain/DataCenter.java | 223 ++++ .../servers/domain/DataCentersList.java | 103 ++ .../servers/domain/DeployedServer.java | 227 ++++ .../servers/domain/DeployedServersList.java | 103 ++ .../servers/domain/MachineSpecification.java | 150 +++ .../servers/domain/OperatingSystem.java | 109 ++ .../servers/domain/PendingDeployServer.java | 173 +++ .../domain/PendingDeployServersList.java | 103 ++ .../opsource/servers/domain/ServerImage.java | 221 ++++ .../servers/domain/ServerImagesList.java | 103 ++ .../opsource/servers/domain/Status.java | 177 ++++ .../jclouds/opsource/servers/domain/Step.java | 122 +++ .../servers/features/AccountAsyncClient.java | 11 + .../servers/features/AccountClient.java | 8 + .../servers/features/ServerAsyncClient.java | 59 ++ .../servers/features/ServerClient.java | 47 + .../features/ServerImageAsyncClient.java | 48 + .../servers/features/ServerImageClient.java | 41 + .../features/AccountClientLiveTest.java | 8 + .../features/ServerClientLiveTest.java | 49 + .../features/ServerImageClientExpectTest.java | 60 ++ .../features/ServerImageClientLiveTest.java | 38 + .../src/test/resources/dataCenters.xml | 25 + .../src/test/resources/deployedServers.xml | 216 ++++ .../src/test/resources/images.xml | 995 ++++++++++++++++++ .../test/resources/pendingDeployServers.xml | 2 + .../src/test/resources/serverDetails.xml | 21 + 32 files changed, 3561 insertions(+), 1 deletion(-) create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/BaseServer.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DataCenter.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DataCentersList.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DeployedServer.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DeployedServersList.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/MachineSpecification.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/OperatingSystem.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/PendingDeployServer.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/PendingDeployServersList.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/ServerImage.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/ServerImagesList.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/Status.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/Step.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerAsyncClient.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerClient.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerImageAsyncClient.java create mode 100644 labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerImageClient.java create mode 100644 labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerClientLiveTest.java create mode 100644 labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerImageClientExpectTest.java create mode 100644 labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerImageClientLiveTest.java create mode 100644 labs/opsource-servers/src/test/resources/dataCenters.xml create mode 100644 labs/opsource-servers/src/test/resources/deployedServers.xml create mode 100644 labs/opsource-servers/src/test/resources/images.xml create mode 100644 labs/opsource-servers/src/test/resources/pendingDeployServers.xml create mode 100644 labs/opsource-servers/src/test/resources/serverDetails.xml diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceNameSpaces.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceNameSpaces.java index 474dd6d3a1..9563fc1310 100644 --- a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceNameSpaces.java +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceNameSpaces.java @@ -25,4 +25,6 @@ package org.jclouds.opsource.servers; */ public interface OpSourceNameSpaces { public static final String DIRECTORY = "http://oec.api.opsource.net/schemas/directory"; + public static final String DATACENTER = "http://oec.api.opsource.net/schemas/datacenter"; + public static final String SERVER = "http://oec.api.opsource.net/schemas/server"; } diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceServersAsyncClient.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceServersAsyncClient.java index 2b07e18972..6d8f1d7e2a 100644 --- a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceServersAsyncClient.java +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceServersAsyncClient.java @@ -18,7 +18,11 @@ */ package org.jclouds.opsource.servers; +import org.jclouds.opsource.servers.domain.Account; +import org.jclouds.opsource.servers.domain.ServerImage; import org.jclouds.opsource.servers.features.AccountAsyncClient; +import org.jclouds.opsource.servers.features.ServerAsyncClient; +import org.jclouds.opsource.servers.features.ServerImageAsyncClient; import org.jclouds.rest.annotations.Delegate; /** @@ -34,5 +38,17 @@ public interface OpSourceServersAsyncClient { */ @Delegate AccountAsyncClient getAccountClient(); + + /** + * @return asynchronous access to {@link ServerImage} features + */ + @Delegate + ServerImageAsyncClient getServerImageClient(); + + /** + * @return asynchronous access to server features + */ + @Delegate + ServerAsyncClient getServerClient(); } diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceServersClient.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceServersClient.java index 16822419ff..ff824902ef 100644 --- a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceServersClient.java +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/OpSourceServersClient.java @@ -21,7 +21,11 @@ package org.jclouds.opsource.servers; import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; +import org.jclouds.opsource.servers.domain.Account; +import org.jclouds.opsource.servers.domain.ServerImage; import org.jclouds.opsource.servers.features.AccountClient; +import org.jclouds.opsource.servers.features.ServerClient; +import org.jclouds.opsource.servers.features.ServerImageClient; import org.jclouds.rest.annotations.Delegate; /** @@ -39,4 +43,16 @@ public interface OpSourceServersClient { @Delegate AccountClient getAccountClient(); + /** + * @return synchronous access to {@link ServerImage} features + */ + @Delegate + ServerImageClient getServerImageClient(); + + /** + * @return synchronous access to server features + */ + @Delegate + ServerClient getServerClient(); + } diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/config/OpSourceServersRestClientModule.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/config/OpSourceServersRestClientModule.java index 736526e296..98449c91a6 100644 --- a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/config/OpSourceServersRestClientModule.java +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/config/OpSourceServersRestClientModule.java @@ -30,6 +30,10 @@ import org.jclouds.opsource.servers.OpSourceServersAsyncClient; import org.jclouds.opsource.servers.OpSourceServersClient; import org.jclouds.opsource.servers.features.AccountAsyncClient; import org.jclouds.opsource.servers.features.AccountClient; +import org.jclouds.opsource.servers.features.ServerAsyncClient; +import org.jclouds.opsource.servers.features.ServerClient; +import org.jclouds.opsource.servers.features.ServerImageAsyncClient; +import org.jclouds.opsource.servers.features.ServerImageClient; import org.jclouds.opsource.servers.handlers.OpSourceServersErrorHandler; import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.config.RestClientModule; @@ -48,7 +52,10 @@ public class OpSourceServersRestClientModule extends RestClientModule { public static final Map, Class> DELEGATE_MAP = ImmutableMap., Class> builder()// - .put(AccountClient.class, AccountAsyncClient.class).build(); + .put(AccountClient.class, AccountAsyncClient.class) + .put(ServerImageClient.class, ServerImageAsyncClient.class) + .put(ServerClient.class, ServerAsyncClient.class) + .build(); public OpSourceServersRestClientModule() { super(OpSourceServersClient.class, OpSourceServersAsyncClient.class, DELEGATE_MAP); diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/BaseServer.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/BaseServer.java new file mode 100644 index 0000000000..23a106e3d1 --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/BaseServer.java @@ -0,0 +1,77 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; + +import com.google.common.base.Objects; + +/** + * + * + */ +public abstract class BaseServer { + + protected BaseServer() { + // For JAXB and builder use + } + + private String id; + private String name; + private String description; + + protected BaseServer(String id, String name, String description) { + this.id = id; + this.name = name; + this.description = description; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + BaseServer that = BaseServer.class.cast(o); + return equal(id, that.id); + } + + @Override + public int hashCode() { + return Objects.hashCode(id, name, description); + } + + @Override + public String toString() { + return Objects.toStringHelper("").toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DataCenter.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DataCenter.java new file mode 100644 index 0000000000..366cda5622 --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DataCenter.java @@ -0,0 +1,223 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; +import static org.jclouds.opsource.servers.OpSourceNameSpaces.DATACENTER; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; + +/** + * + * @author Kedar Dave + */ +@XmlRootElement(namespace = DATACENTER, name = "datacenterWithLimits") +public class DataCenter { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromDataCenter(this); + } + + public static class Builder { + + private String location; + private String displayName; + private String city; + private String state; + private String country; + private String vpnUrl; + private boolean isDefault; + private int maxCpu; + private long maxRamMb; + + /** + * @see DataCenter#getOrgId() + */ + public Builder location(String location) { + this.location = location; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = displayName; + return this; + } + + public Builder city(String city) { + this.city = city; + return this; + } + + public Builder state(String state) { + this.state = state; + return this; + } + + public Builder country(String country) { + this.country = country; + return this; + } + + public Builder vpnUrl(String vpnUrl) { + this.vpnUrl = vpnUrl; + return this; + } + + public Builder isDefault(boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + public Builder maxCpu(int maxCpu) { + this.maxCpu = maxCpu; + return this; + } + + public Builder maxRamMb(long maxRamMb) { + this.maxRamMb = maxRamMb; + return this; + } + + public DataCenter build() { + return new DataCenter(location, displayName, city, state, country, vpnUrl, isDefault, maxCpu, maxRamMb); + } + + public Builder fromDataCenter(DataCenter in) { + return new Builder().location(location).displayName(displayName).city(city).state(state) + .country(country).vpnUrl(vpnUrl).isDefault(isDefault).maxCpu(maxCpu).maxRamMb(maxRamMb); + } + } + + private DataCenter() { + // For JAXB and builder use + } + + @XmlElement(namespace = DATACENTER, name="location") + private String location; + @XmlElement(namespace = DATACENTER, name="displayName") + private String displayName; + @XmlElement(namespace = DATACENTER, name="city") + private String city; + @XmlElement(namespace = DATACENTER, name="state") + private String state; + @XmlElement(namespace = DATACENTER, name="country") + private String country; + @XmlElement(namespace = DATACENTER, name="vpnUrl") + private String vpnUrl; + @XmlElement(namespace = DATACENTER, name="isDefault") + private boolean isDefault; + @XmlElement(namespace = DATACENTER, name="maxCpu") + private long maxCpu; + @XmlElement(namespace = DATACENTER, name="maxRamMb") + private long maxRamMb; + + private DataCenter(String location, String displayName, String city, String state, String country, + String vpnUrl, boolean isDefault, long maxCpu, long maxRamMb) { + this.location = location; + this.displayName = displayName; + this.city = city; + this.state = state; + this.country = country; + this.vpnUrl = vpnUrl; + this.isDefault = isDefault; + this.maxCpu = maxCpu; + this.maxRamMb = maxRamMb; + } + + public String getLocation() { + return location; + } + + public String getDisplayName() { + return displayName; + } + + public String getCity() { + return city; + } + + public String getState() { + return state; + } + + public String getCountry() { + return country; + } + + /** + * VPN URL corresponding to this data center's location + * @return + */ + public String getVpnUrl() { + return vpnUrl; + } + + public boolean isDefault() { + return isDefault; + } + + /** + * defines the upper ceiling for the + * number of CPUs permitted respectively for Customer Servers deployed at this data + * center. + * @return + */ + public long getMaxCpu() { + return maxCpu; + } + + /** + * defines the upper ceiling for the + * quantity of RAM permitted respectively for Customer Servers deployed at this data + * center. + * @return + */ + public long getMaxRamMb() { + return maxRamMb; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + DataCenter that = DataCenter.class.cast(o); + return equal(location, that.location); + } + + @Override + public int hashCode() { + return Objects.hashCode(location); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("location", location).add("displayName", displayName).add("city", city). + add("state", state).add("country", country).add("vpnUrl", vpnUrl).add("isDefault", isDefault). + add("maxCpu", maxCpu).add("maxRamMb", maxRamMb).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DataCentersList.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DataCentersList.java new file mode 100644 index 0000000000..8215fa14cd --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DataCentersList.java @@ -0,0 +1,103 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.opsource.servers.OpSourceNameSpaces.DATACENTER; + +import java.util.Set; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + +/** + * Represents list of data centers for an account + * @author Kedar Dave + */ +@XmlRootElement(namespace = DATACENTER, name = "DatacentersWithLimits") +public class DataCentersList { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(); + } + + public static class Builder { + + Set dataCenters = Sets.newLinkedHashSet();; + + public Builder dataCenters(Set dataCenters) { + this.dataCenters = Sets.newLinkedHashSet(checkNotNull(dataCenters, "dataCenters")); + return this; + } + + public Builder dataCenter(DataCenter dataCenter) { + this.dataCenters.add(checkNotNull(dataCenter, "dataCenter")); + return this; + } + + public DataCentersList build() { + return new DataCentersList(dataCenters); + } + + } + + private DataCentersList() { + // For JAXB and builder use + } + + @XmlElement(name = "datacenterWithLimits", namespace = DATACENTER) + private Set dataCenters = Sets.newLinkedHashSet(); + + private DataCentersList(Set dataCenters) { + this.dataCenters = ImmutableSet.copyOf(dataCenters); + } + + public Set getDataCenters() { + return dataCenters; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + DataCentersList that = DataCentersList.class.cast(o); + return super.equals(that) && equal(dataCenters, that.dataCenters); + } + + @Override + public int hashCode() { + return Objects.hashCode(dataCenters); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("dataCenters", dataCenters).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DeployedServer.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DeployedServer.java new file mode 100644 index 0000000000..9a5afff2e0 --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DeployedServer.java @@ -0,0 +1,227 @@ +/* + * 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.opsource.servers.domain; + +import static org.jclouds.opsource.servers.OpSourceNameSpaces.SERVER; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; + +/** + * + * @author Kedar Dave + */ +@XmlRootElement(namespace = SERVER, name = "DeployedServer") +public class DeployedServer extends BaseServer{ + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromDeployedServer(this); + } + + public static class Builder { + + private String id; + private String name; + private String description; + private MachineSpecification machineSpecification; + private String sourceImageId; + private String networkId; + private String privateIpAddress; + private String publicIpAddress; + private String machineName; + private boolean isStarted; + private String deployedTime; + private Status status; + + public Builder id(String id) { + this.id = id; + return this; + } + + public Builder name(String name) { + this.name = name; + return this; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public Builder machineSpecification(MachineSpecification machineSpecification) { + this.machineSpecification = machineSpecification; + return this; + } + + public Builder sourceImageId(String sourceImageId) { + this.sourceImageId = sourceImageId; + return this; + } + + public Builder networkId(String networkId) { + this.networkId = networkId; + return this; + } + + public Builder privateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + public Builder publicIpAddress(String publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + public Builder machineName(String machineName) { + this.machineName = machineName; + return this; + } + + public Builder isStarted(boolean isStarted) { + this.isStarted = isStarted; + return this; + } + + public Builder deployedTime(String deployedTime) { + this.deployedTime = deployedTime; + return this; + } + + public Builder status(Status status) { + this.status = status; + return this; + } + + public DeployedServer build() { + return new DeployedServer(id, name, description, machineSpecification, sourceImageId, networkId, privateIpAddress, + publicIpAddress, machineName, isStarted, deployedTime, status); + } + + public Builder fromDeployedServer(DeployedServer in) { + return new Builder().id(id).name(name).description(description).machineSpecification(machineSpecification) + .sourceImageId(sourceImageId).networkId(networkId).privateIpAddress(privateIpAddress).publicIpAddress(publicIpAddress) + .machineName(machineName).isStarted(isStarted).deployedTime(deployedTime).status(status); + } + } + + private DeployedServer() { + // For JAXB and builder use + } + + @XmlElement(namespace = SERVER, name="id") + private String id; + @XmlElement(namespace = SERVER, name="name") + private String name; + @XmlElement(namespace = SERVER, name="description") + private String description; + @XmlElement(namespace = SERVER, name="machineSpecification") + private MachineSpecification machineSpecification; + @XmlElement(namespace = SERVER, name="sourceImageId") + private String sourceImageId; + @XmlElement(namespace = SERVER, name="networkId") + private String networkId; + @XmlElement(namespace = SERVER, name="privateIpAddress") + private String privateIpAddress; + @XmlElement(namespace = SERVER, name="publicIpAddress") + private String publicIpAddress; + @XmlElement(namespace = SERVER, name="machineName") + private String machineName; + @XmlElement(namespace = SERVER, name="isStarted") + private boolean isStarted; + @XmlElement(namespace = SERVER, name="deployedTime") + private String deployedTime; + @XmlElement(namespace = SERVER, name="status") + private Status status; + + private DeployedServer(String id, String name, String description, MachineSpecification machineSpecification, String sourceImageId, + String networkId, String privateIpAddress, String publicIpAddress, String machineName, boolean isStarted, String deployedTime, Status status) { + super(id, name, description); + this.machineSpecification = machineSpecification; + this.sourceImageId = sourceImageId; + this.networkId = networkId; + this.privateIpAddress = privateIpAddress; + this.publicIpAddress = publicIpAddress; + this.machineName = machineName; + this.isStarted = isStarted; + this.deployedTime = deployedTime; + this.status = status; + } + + public MachineSpecification getMachineSpecification() { + return machineSpecification; + } + + public String getSourceImageId() { + return sourceImageId; + } + + public String getNetworkId() { + return networkId; + } + + public String getPrivateIpAddress() { + return privateIpAddress; + } + + public String getPublicIpAddress() { + return publicIpAddress; + } + + public String getMachineName() { + return machineName; + } + + public boolean isStarted() { + return isStarted; + } + + public String getDeployedTime() { + return deployedTime; + } + + public Status getStatus() { + return status; + } + + @Override + public boolean equals(Object o) { + return super.equals(o); + } + + @Override + public int hashCode() { + return super.hashCode() + Objects.hashCode(id, name, description, machineSpecification, sourceImageId, networkId, + privateIpAddress, publicIpAddress, machineName, isStarted, deployedTime, status); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("id", id).add("name", name).add("description", description). + add("machineSpecification", machineSpecification).add("sourceImageId", sourceImageId).add("networkId", networkId). + add("privateIpAddress", privateIpAddress).add("publicIpAddress", publicIpAddress).add("machineName", machineName). + add("isStarted", isStarted).add("deployedTime", deployedTime).add("status", status).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DeployedServersList.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DeployedServersList.java new file mode 100644 index 0000000000..0969140e4c --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/DeployedServersList.java @@ -0,0 +1,103 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.opsource.servers.OpSourceNameSpaces.SERVER; + +import java.util.Set; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + +/** + * Represents list of data centers for an account + * @author Kedar Dave + */ +@XmlRootElement(namespace = SERVER, name = "DeployedServers") +public class DeployedServersList { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(); + } + + public static class Builder { + + Set deployedServers = Sets.newLinkedHashSet();; + + public Builder deployedServers(Set deployedServers) { + this.deployedServers = Sets.newLinkedHashSet(checkNotNull(deployedServers, "deployedServers")); + return this; + } + + public Builder deployedServer(DeployedServer deployedServer) { + this.deployedServers.add(checkNotNull(deployedServer, "deployedServer")); + return this; + } + + public DeployedServersList build() { + return new DeployedServersList(deployedServers); + } + + } + + private DeployedServersList() { + // For JAXB and builder use + } + + @XmlElement(name = "DeployedServer", namespace = SERVER) + private Set deployedServers = Sets.newLinkedHashSet(); + + private DeployedServersList(Set deployedServers) { + this.deployedServers = ImmutableSet.copyOf(deployedServers); + } + + public Set getDeployedServers() { + return deployedServers; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + DeployedServersList that = DeployedServersList.class.cast(o); + return super.equals(that) && equal(deployedServers, that.deployedServers); + } + + @Override + public int hashCode() { + return Objects.hashCode(deployedServers); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("deployedServers", deployedServers).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/MachineSpecification.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/MachineSpecification.java new file mode 100644 index 0000000000..f794865052 --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/MachineSpecification.java @@ -0,0 +1,150 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; +import static org.jclouds.opsource.servers.OpSourceNameSpaces.SERVER; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; + +/** + * + * + */ +@XmlRootElement(name = "machineSpecification", namespace = SERVER) +public class MachineSpecification { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromMachineSpecification(this); + } + + public static class Builder { + + private int cpuCount; + private long memoryMb; + private long osStorageGb; + private long additionalLocalStorageGb; + private OperatingSystem operatingSystem; + + public Builder cpuCount(int cpuCount) { + this.cpuCount = cpuCount; + return this; + } + + public Builder memoryMb(long memoryMb) { + this.memoryMb = memoryMb; + return this; + } + + public Builder osStorageGb(long osStorageGb) { + this.osStorageGb = osStorageGb; + return this; + } + + public Builder additionalLocalStorageGb(long additionalLocalStorageGb) { + this.additionalLocalStorageGb = additionalLocalStorageGb; + return this; + } + + public Builder operatingSystem(OperatingSystem operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + public MachineSpecification build() { + return new MachineSpecification(cpuCount, memoryMb, osStorageGb, additionalLocalStorageGb, operatingSystem); + } + + public Builder fromMachineSpecification(MachineSpecification in) { + return new Builder().cpuCount(cpuCount).memoryMb(memoryMb).osStorageGb(osStorageGb).additionalLocalStorageGb(additionalLocalStorageGb) + .operatingSystem(operatingSystem); + } + } + + private MachineSpecification() { + // For JAXB and builder use + } + + @XmlElement(namespace = SERVER) + private int cpuCount; + @XmlElement(namespace = SERVER) + private long memoryMb; + @XmlElement(namespace = SERVER) + private long osStorageGb; + @XmlElement(namespace = SERVER) + private long additionalLocalStorageGb; + @XmlElement(namespace = SERVER) + private OperatingSystem operatingSystem; + + private MachineSpecification(int cpuCount, long memoryMb, long osStorageGb, long additionalLocalStorageGb, OperatingSystem operatingSystem) { + this.cpuCount = cpuCount; + this.memoryMb = memoryMb; + this.osStorageGb = osStorageGb; + this.additionalLocalStorageGb = additionalLocalStorageGb; + this.operatingSystem = operatingSystem; + } + + public int getCpuCount() { + return cpuCount; + } + + public long getMemoryMb() { + return memoryMb; + } + + public long getOsStorageGb() { + return osStorageGb; + } + + public long getAdditionalLocalStorageGb() { + return additionalLocalStorageGb; + } + + public OperatingSystem getOperatingSystem() { + return operatingSystem; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + MachineSpecification that = MachineSpecification.class.cast(o); + return equal(this, that); + } + + @Override + public int hashCode() { + return Objects.hashCode(cpuCount, memoryMb, osStorageGb, additionalLocalStorageGb, operatingSystem); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("cpuCount", cpuCount).add("memoryMb", memoryMb).add("osStorageGb", osStorageGb) + .add("additionalLocalStorageGb", additionalLocalStorageGb).add("operatingSystem", operatingSystem).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/OperatingSystem.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/OperatingSystem.java new file mode 100644 index 0000000000..c46c68cbca --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/OperatingSystem.java @@ -0,0 +1,109 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; +import static org.jclouds.opsource.servers.OpSourceNameSpaces.SERVER; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; + +/** + * Holds operating system information for {@link ServerImage} + * @author Kedar Dave + */ +@XmlRootElement(name = "operatingSystem", namespace = SERVER) +public class OperatingSystem { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromOperatingSystem(this); + } + + public static class Builder { + + private String osType; + private String displayName; + + public Builder osType(String osType) { + this.osType = osType; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = displayName; + return this; + } + + public OperatingSystem build() { + return new OperatingSystem(osType, displayName); + } + + public Builder fromOperatingSystem(OperatingSystem in) { + return new Builder().osType(in.getOsType()).displayName(in.getDisplayName()); + } + } + + private OperatingSystem() { + // For JAXB and builder use + } + + @XmlElement(namespace = SERVER, name="type") + private String osType; + @XmlElement(namespace = SERVER, name="displayName") + private String displayName; + + private OperatingSystem(String osType, String displayName) { + this.osType = osType; + this.displayName = displayName; + } + + public String getOsType() { + return osType; + } + + public String getDisplayName() { + return displayName; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + OperatingSystem that = OperatingSystem.class.cast(o); + return equal(osType, that.osType) && equal(displayName, that.displayName); + } + + @Override + public int hashCode() { + return Objects.hashCode(osType, displayName); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("osType", osType).add("displayName", displayName).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/PendingDeployServer.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/PendingDeployServer.java new file mode 100644 index 0000000000..acbc86700f --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/PendingDeployServer.java @@ -0,0 +1,173 @@ +/* + * 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.opsource.servers.domain; + +import static org.jclouds.opsource.servers.OpSourceNameSpaces.SERVER; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; + +/** + * + * @author Kedar Dave + */ +@XmlRootElement(namespace = SERVER, name = "PendingDeployServer") +public class PendingDeployServer extends BaseServer{ + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromPendingDeployServer(this); + } + + public static class Builder { + + private String id; + private String name; + private String description; + private MachineSpecification machineSpecification; + private String sourceImageId; + private String networkId; + private String privateIpAddress; + private Status status; + + public Builder id(String id) { + this.id = id; + return this; + } + + public Builder name(String name) { + this.name = name; + return this; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public Builder machineSpecification(MachineSpecification machineSpecification) { + this.machineSpecification = machineSpecification; + return this; + } + + public Builder sourceImageId(String sourceImageId) { + this.sourceImageId = sourceImageId; + return this; + } + + public Builder networkId(String networkId) { + this.networkId = networkId; + return this; + } + + public Builder privateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + public Builder status(Status status) { + this.status = status; + return this; + } + + public PendingDeployServer build() { + return new PendingDeployServer(id, name, description, machineSpecification, sourceImageId, networkId, + privateIpAddress, status); + } + + public Builder fromPendingDeployServer(PendingDeployServer in) { + return new Builder().id(id).name(name).description(description).machineSpecification(machineSpecification) + .sourceImageId(sourceImageId).networkId(networkId).privateIpAddress(privateIpAddress).status(status); + } + } + + private PendingDeployServer() { + // For JAXB and builder use + } + + @XmlElement(namespace = SERVER, name="id") + private String id; + @XmlElement(namespace = SERVER, name="name") + private String name; + @XmlElement(namespace = SERVER, name="description") + private String description; + @XmlElement(namespace = SERVER, name="machineSpecification") + private MachineSpecification machineSpecification; + @XmlElement(namespace = SERVER, name="sourceImageId") + private String sourceImageId; + @XmlElement(namespace = SERVER, name="networkId") + private String networkId; + @XmlElement(namespace = SERVER, name="privateIpAddress") + private String privateIpAddress; + @XmlElement(namespace = SERVER, name="status") + private Status status; + + private PendingDeployServer(String id, String name, String description, MachineSpecification machineSpecification, String sourceImageId, + String networkId, String privateIpAddress, Status status) { + super(id, name, description); + this.machineSpecification = machineSpecification; + this.sourceImageId = sourceImageId; + this.networkId = networkId; + this.privateIpAddress = privateIpAddress; + this.status = status; + } + + public MachineSpecification getMachineSpecification() { + return machineSpecification; + } + + public String getSourceImageId() { + return sourceImageId; + } + + public String getNetworkId() { + return networkId; + } + + public String getPrivateIpAddress() { + return privateIpAddress; + } + + public Status getStatus() { + return status; + } + + @Override + public boolean equals(Object o) { + return super.equals(o); + } + + @Override + public int hashCode() { + return super.hashCode() + Objects.hashCode(id, name, description, machineSpecification, sourceImageId, networkId, + privateIpAddress, status); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("id", id).add("name", name).add("description", description). + add("machineSpecification", machineSpecification).add("sourceImageId", sourceImageId).add("networkId", networkId). + add("privateIpAddress", privateIpAddress).add("status", status).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/PendingDeployServersList.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/PendingDeployServersList.java new file mode 100644 index 0000000000..878c0b232d --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/PendingDeployServersList.java @@ -0,0 +1,103 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.opsource.servers.OpSourceNameSpaces.SERVER; + +import java.util.Set; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + +/** + * Represents list of data centers for an account + * @author Kedar Dave + */ +@XmlRootElement(namespace = SERVER, name = "PendingDeployServers") +public class PendingDeployServersList { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(); + } + + public static class Builder { + + Set pendingDeployServers = Sets.newLinkedHashSet();; + + public Builder pendingDeployServers(Set pendingDeployServers) { + this.pendingDeployServers = Sets.newLinkedHashSet(checkNotNull(pendingDeployServers, "pendingDeployServers")); + return this; + } + + public Builder pendingDeployServer(PendingDeployServer pendingDeployServer) { + this.pendingDeployServers.add(checkNotNull(pendingDeployServer, "pendingDeployServer")); + return this; + } + + public PendingDeployServersList build() { + return new PendingDeployServersList(pendingDeployServers); + } + + } + + private PendingDeployServersList() { + // For JAXB and builder use + } + + @XmlElement(name = "PendingDeployServer", namespace = SERVER) + private Set pendingDeployServers = Sets.newLinkedHashSet(); + + private PendingDeployServersList(Set pendingDeployServers) { + this.pendingDeployServers = ImmutableSet.copyOf(pendingDeployServers); + } + + public Set getPendingDeployServers() { + return pendingDeployServers; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + PendingDeployServersList that = PendingDeployServersList.class.cast(o); + return super.equals(that) && equal(pendingDeployServers, that.pendingDeployServers); + } + + @Override + public int hashCode() { + return Objects.hashCode(pendingDeployServers); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("pendingDeployServers", pendingDeployServers).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/ServerImage.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/ServerImage.java new file mode 100644 index 0000000000..ed9c4ff9aa --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/ServerImage.java @@ -0,0 +1,221 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; +import static org.jclouds.opsource.servers.OpSourceNameSpaces.SERVER; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; + +/** + * + * @author Kedar Dave + */ +@XmlRootElement(namespace = SERVER, name = "ServerImage") +public class ServerImage { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromServerImage(this); + } + + public static class Builder { + + private String id; + private String resourcePath; + private String name; + private String description; + private OperatingSystem operatingSystem; + private String location; + private int cpuCount; + private long memory; + private long osStorage; + private long additionalLocalStorage; + + public Builder id(String id) { + this.id = id; + return this; + } + + public Builder resourcePath(String resourcePath) { + this.resourcePath = resourcePath; + return this; + } + + public Builder name(String name) { + this.name = name; + return this; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public Builder operatingSystem(OperatingSystem operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + public Builder location(String location) { + this.location = location; + return this; + } + + public Builder cpuCount(int cpuCount) { + this.cpuCount = cpuCount; + return this; + } + + public Builder memory(long memory) { + this.memory = memory; + return this; + } + + public Builder osStorage(long osStorage) { + this.osStorage = osStorage; + return this; + } + + public Builder additionalLocalStorage(long additionalLocalStorage) { + this.additionalLocalStorage = additionalLocalStorage; + return this; + } + + public ServerImage build() { + return new ServerImage(id, resourcePath, name, description, operatingSystem, location, cpuCount, + memory, osStorage, additionalLocalStorage); + } + + public Builder fromServerImage(ServerImage in) { + return new Builder().id(id).resourcePath(resourcePath).name(name).description(description) + .operatingSystem(operatingSystem).location(location).cpuCount(cpuCount).memory(memory) + .osStorage(osStorage).additionalLocalStorage(additionalLocalStorage); + } + } + + private ServerImage() { + // For JAXB and builder use + } + + @XmlElement(namespace = SERVER, name="id") + private String id; + @XmlElement(namespace = SERVER, name="resourcePath") + private String resourcePath; + @XmlElement(namespace = SERVER, name="name") + private String name; + @XmlElement(namespace = SERVER, name="description") + private String description; + @XmlElement(namespace = SERVER, name="operatingSystem") + private OperatingSystem operatingSystem; + @XmlElement(namespace = SERVER, name="location") + private String location; + @XmlElement(namespace = SERVER, name="cpuCount") + private long cpuCount; + @XmlElement(namespace = SERVER, name="memory") + private long memory; + @XmlElement(namespace = SERVER, name="osStorage") + private long osStorage; + @XmlElement(namespace = SERVER, name="additionalLocalStorage") + private long additionalLocalStorage; + + private ServerImage(String id, String resourcePath, String name, String description, OperatingSystem operatingSystem, + String location, long cpuCount, long memory, long osStorage, long additionalLocalStorage) { + this.id = id; + this.resourcePath = resourcePath; + this.name = name; + this.description = description; + this.operatingSystem = operatingSystem; + this.location = location; + this.cpuCount = cpuCount; + this.memory = memory; + this.osStorage = osStorage; + this.additionalLocalStorage = additionalLocalStorage; + } + + public String getId() { + return id; + } + + public String getResourcePath() { + return resourcePath; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public OperatingSystem getOperatingSystem() { + return operatingSystem; + } + + public String getLocation() { + return location; + } + + public long getCpuCount() { + return cpuCount; + } + + public long getMemory() { + return memory; + } + + public long getOsStorage() { + return osStorage; + } + + public long getAdditionalLocalStorage() { + return additionalLocalStorage; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + ServerImage that = ServerImage.class.cast(o); + return equal(id, that.id); + } + + @Override + public int hashCode() { + return Objects.hashCode(id, resourcePath, name, description, operatingSystem, location, + cpuCount, memory, osStorage, additionalLocalStorage); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("id", id).add("resourcePath", resourcePath).add("name", name). + add("description", description).add("operatingSystem", operatingSystem).add("location", location). + add("cpuCount", cpuCount).add("memory", memory).add("osStorage", osStorage). + add("additionalLocalStorage", additionalLocalStorage).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/ServerImagesList.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/ServerImagesList.java new file mode 100644 index 0000000000..e8fd6f379f --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/ServerImagesList.java @@ -0,0 +1,103 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.opsource.servers.OpSourceNameSpaces.SERVER; + +import java.util.Set; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; + +/** + * Represents set of OS Server Images from which servers may be deployed + * @author Kedar Dave + */ +@XmlRootElement(namespace = SERVER, name = "ServerImages") +public class ServerImagesList { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(); + } + + public static class Builder { + + Set serverImages = Sets.newLinkedHashSet();; + + public Builder dataCenters(Set serverImages) { + this.serverImages = Sets.newLinkedHashSet(checkNotNull(serverImages, "serverImages")); + return this; + } + + public Builder serverImage(ServerImage serverImage) { + this.serverImages.add(checkNotNull(serverImage, "serverImage")); + return this; + } + + public ServerImagesList build() { + return new ServerImagesList(serverImages); + } + + } + + private ServerImagesList() { + // For JAXB and builder use + } + + @XmlElement(name = "ServerImage", namespace = SERVER) + private Set serverImages = Sets.newLinkedHashSet(); + + private ServerImagesList(Set serverImages) { + this.serverImages = ImmutableSet.copyOf(serverImages); + } + + public Set getServerImages() { + return serverImages; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + ServerImagesList that = ServerImagesList.class.cast(o); + return super.equals(that) && equal(serverImages, that.serverImages); + } + + @Override + public int hashCode() { + return Objects.hashCode(serverImages); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("serverImages", serverImages).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/Status.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/Status.java new file mode 100644 index 0000000000..aa08f72711 --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/Status.java @@ -0,0 +1,177 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; +import static org.jclouds.opsource.servers.OpSourceNameSpaces.SERVER; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; + +/** + * + * @author Kedar Dave + */ +@XmlRootElement(namespace = SERVER, name = "status") +public class Status { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromStatus(this); + } + + public static class Builder { + + private String action; + private String requestTime; + private String userName; + private int numberOfSteps; + private String updateTime; + private Step step; + private String failureReason; + + public Builder action(String action) { + this.action = action; + return this; + } + + public Builder requestTime(String requestTime) { + this.requestTime = requestTime; + return this; + } + + public Builder userName(String userName) { + this.userName = userName; + return this; + } + + public Builder numberOfSteps(int numberOfSteps) { + this.numberOfSteps = numberOfSteps; + return this; + } + + public Builder updateTime(String updateTime) { + this.updateTime = updateTime; + return this; + } + + public Builder step(Step step) { + this.step = step; + return this; + } + + public Builder failureReason(String failureReason) { + this.failureReason = failureReason; + return this; + } + + public Status build() { + return new Status(action, requestTime, userName, numberOfSteps, updateTime, step, failureReason); + } + + public Builder fromStatus(Status in) { + return new Builder().action(action).requestTime(requestTime).userName(userName).numberOfSteps(numberOfSteps) + .updateTime(updateTime).step(step).failureReason(failureReason); + } + } + + private Status() { + // For JAXB and builder use + } + + @XmlElement(namespace = SERVER, name="action") + private String action; + @XmlElement(namespace = SERVER, name="requestTime") + private String requestTime; + @XmlElement(namespace = SERVER, name="userName") + private String userName; + @XmlElement(namespace = SERVER, name="numberOfSteps") + private int numberOfSteps; + @XmlElement(namespace = SERVER, name="updateTime") + private String updateTime; + @XmlElement(namespace = SERVER, name="step") + private Step step; + @XmlElement(namespace = SERVER, name="failureReason") + private String failureReason; + + private Status(String action, String requestTime, String userName, int numberOfSteps, String updateTime, + Step step, String failureReason) { + this.action = action; + this.requestTime = requestTime; + this.userName = userName; + this.numberOfSteps = numberOfSteps; + this.updateTime = updateTime; + this.step = step; + this.failureReason = failureReason; + } + + public String getAction() { + return action; + } + + public String getRequestTime() { + return requestTime; + } + + public String getUserName() { + return userName; + } + + public int getNumberOfSteps() { + return numberOfSteps; + } + + public String getUpdateTime() { + return updateTime; + } + + public Step getStep() { + return step; + } + + public String getFailureReason() { + return failureReason; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Status that = Status.class.cast(o); + return equal(this, that); + } + + @Override + public int hashCode() { + return Objects.hashCode(action, requestTime, userName, numberOfSteps, updateTime, step, failureReason); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("action", action).add("requestTime", requestTime).add("userName", userName). + add("numberOfSteps", numberOfSteps).add("updateTime", updateTime).add("step", step).add("failureReason", failureReason).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/Step.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/Step.java new file mode 100644 index 0000000000..e4162f2068 --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/domain/Step.java @@ -0,0 +1,122 @@ +/* + * 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.opsource.servers.domain; + +import static com.google.common.base.Objects.equal; +import static org.jclouds.opsource.servers.OpSourceNameSpaces.SERVER; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.google.common.base.Objects; + +/** + * + * @author Kedar Dave + */ +@XmlRootElement(namespace = SERVER, name = "step") +public class Step { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromStep(this); + } + + public static class Builder { + + private String name; + private int number; + private int percentComplete; + + public Builder name(String name) { + this.name = name; + return this; + } + + public Builder number(int number) { + this.number = number; + return this; + } + + public Builder percentComplete(int percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + public Step build() { + return new Step(name, number, percentComplete); + } + + public Builder fromStep(Step in) { + return new Builder().name(name).number(number).percentComplete(percentComplete); + } + } + + private Step() { + // For JAXB and builder use + } + + @XmlElement(namespace = SERVER, name="name") + private String name; + @XmlElement(namespace = SERVER, name="number") + private int number; + @XmlElement(namespace = SERVER, name="percentComplete") + private int percentComplete; + + private Step(String name, int number, int percentComplete) { + this.name = name; + this.number = number; + this.percentComplete = percentComplete; + } + + public String getName() { + return name; + } + + public int getNumber() { + return number; + } + + public int getPercentComplete() { + return percentComplete; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Step that = Step.class.cast(o); + return equal(this, that); + } + + @Override + public int hashCode() { + return Objects.hashCode(name, number, percentComplete); + } + + @Override + public String toString() { + return Objects.toStringHelper("").add("name", name).add("number", number).add("percentComplete", percentComplete).toString(); + } + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/AccountAsyncClient.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/AccountAsyncClient.java index 7c3f8fbb9c..dcc8533e0c 100644 --- a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/AccountAsyncClient.java +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/AccountAsyncClient.java @@ -21,9 +21,11 @@ package org.jclouds.opsource.servers.features; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import org.jclouds.http.filters.BasicAuthentication; import org.jclouds.opsource.servers.domain.Account; +import org.jclouds.opsource.servers.domain.DataCentersList; import org.jclouds.rest.annotations.JAXBResponseParser; import org.jclouds.rest.annotations.RequestFilters; @@ -44,5 +46,14 @@ public interface AccountAsyncClient { @Consumes @JAXBResponseParser ListenableFuture getMyAccount(); + + /** + * @see AccountClient#getDataCentersWithLimits() + */ + @GET + @Path("/{org-id}/datacenterWithLimits") + @Consumes + @JAXBResponseParser + ListenableFuture getDataCentersWithLimits(@PathParam("org-id") String orgId); } diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/AccountClient.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/AccountClient.java index 1495a87924..34a82e709e 100644 --- a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/AccountClient.java +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/AccountClient.java @@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit; import org.jclouds.concurrent.Timeout; import org.jclouds.opsource.servers.domain.Account; +import org.jclouds.opsource.servers.domain.DataCentersList; /** * Provides synchronous access to Account. @@ -40,5 +41,12 @@ public interface AccountClient { * @return the user's details, including their organization ID. */ Account getMyAccount(); + + /** + * identifies the list of data centers available to the organization of the authenticating user + * @param orgId + * @return + */ + DataCentersList getDataCentersWithLimits(String orgId); } diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerAsyncClient.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerAsyncClient.java new file mode 100644 index 0000000000..96ab4f5bde --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerAsyncClient.java @@ -0,0 +1,59 @@ +/** + * 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.opsource.servers.features; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; + +import org.jclouds.http.filters.BasicAuthentication; +import org.jclouds.opsource.servers.domain.DeployedServersList; +import org.jclouds.opsource.servers.domain.PendingDeployServersList; +import org.jclouds.rest.annotations.JAXBResponseParser; +import org.jclouds.rest.annotations.RequestFilters; + +import com.google.common.util.concurrent.ListenableFuture; + +/** + * @see ServerClient + * @author Kedar Dave + */ +@RequestFilters(BasicAuthentication.class) +public interface ServerAsyncClient { + + /** + * @see ServerClient#getDeployedServers() + */ + @GET + @Path("/{org-id}/server/deployed") + @Consumes + @JAXBResponseParser + ListenableFuture getDeployedServers(@PathParam("org-id") String orgId); + + /** + * @see ServerClient#getPendingDeployServers() + */ + @GET + @Path("/{org-id}/server/pendingDeploy") + @Consumes + @JAXBResponseParser + ListenableFuture getPendingDeployServers(@PathParam("org-id") String orgId); + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerClient.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerClient.java new file mode 100644 index 0000000000..e9fba3ff40 --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerClient.java @@ -0,0 +1,47 @@ +/** + * 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.opsource.servers.features; + +import java.util.concurrent.TimeUnit; + +import org.jclouds.concurrent.Timeout; +import org.jclouds.opsource.servers.domain.DeployedServersList; +import org.jclouds.opsource.servers.domain.PendingDeployServersList; + +/** + * Provides synchronous access to server api's. + *

+ * + * @see ServerAsyncClient + * @author Kedar Dave + */ +@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) +public interface ServerClient { + + /** + * @see ServerAsyncClient#getDeployedServers() + */ + DeployedServersList getDeployedServers(String orgId); + + /** + * @see ServerAsyncClient#getPendingDeployServers() + */ + PendingDeployServersList getPendingDeployServers(String orgId); + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerImageAsyncClient.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerImageAsyncClient.java new file mode 100644 index 0000000000..9e9af53b0e --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerImageAsyncClient.java @@ -0,0 +1,48 @@ +/** + * 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.opsource.servers.features; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; + +import org.jclouds.http.filters.BasicAuthentication; +import org.jclouds.opsource.servers.domain.ServerImagesList; +import org.jclouds.rest.annotations.JAXBResponseParser; +import org.jclouds.rest.annotations.RequestFilters; + +import com.google.common.util.concurrent.ListenableFuture; + +/** + * @see ServerImageClient + * @author Kedar Dave + */ +@RequestFilters(BasicAuthentication.class) +public interface ServerImageAsyncClient { + + /** + * @see ServerImageClient#getServerImages() + */ + @GET + @Path("/base/image") + @Consumes + @JAXBResponseParser + ListenableFuture getServerImages(); + +} diff --git a/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerImageClient.java b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerImageClient.java new file mode 100644 index 0000000000..2edda56e70 --- /dev/null +++ b/labs/opsource-servers/src/main/java/org/jclouds/opsource/servers/features/ServerImageClient.java @@ -0,0 +1,41 @@ +/** + * 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.opsource.servers.features; + +import java.util.concurrent.TimeUnit; + +import org.jclouds.concurrent.Timeout; +import org.jclouds.opsource.servers.domain.ServerImagesList; + +/** + * Provides synchronous access to ServerImage. + *

+ * + * @see ServerImageAsyncClient + * @author Kedar Dave + */ +@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) +public interface ServerImageClient { + + /** + * @see ServerImageAsyncClient#getServerImages() + */ + ServerImagesList getServerImages(); + +} diff --git a/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/AccountClientLiveTest.java b/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/AccountClientLiveTest.java index a2c2bf3ccb..6028ffcec6 100644 --- a/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/AccountClientLiveTest.java +++ b/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/AccountClientLiveTest.java @@ -19,6 +19,7 @@ package org.jclouds.opsource.servers.features; import org.jclouds.opsource.servers.domain.Account; +import org.jclouds.opsource.servers.domain.DataCentersList; import org.jclouds.opsource.servers.internal.BaseOpSourceServersClientLiveTest; import org.testng.annotations.Test; @@ -34,5 +35,12 @@ public class AccountClientLiveTest extends BaseOpSourceServersClientLiveTest { Account account = context.getApi().getAccountClient().getMyAccount(); assert account.getOrgId() != null; } + + public void testGetDataCenterWithLimits() { + Account account = context.getApi().getAccountClient().getMyAccount(); + assert account.getOrgId() != null; + DataCentersList dataCentersList = context.getApi().getAccountClient().getDataCentersWithLimits(account.getOrgId()); + assert dataCentersList != null; + } } diff --git a/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerClientLiveTest.java b/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerClientLiveTest.java new file mode 100644 index 0000000000..672f1700d1 --- /dev/null +++ b/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerClientLiveTest.java @@ -0,0 +1,49 @@ +/* + * 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.opsource.servers.features; + +import org.jclouds.opsource.servers.domain.Account; +import org.jclouds.opsource.servers.domain.DeployedServersList; +import org.jclouds.opsource.servers.domain.PendingDeployServersList; +import org.jclouds.opsource.servers.internal.BaseOpSourceServersClientLiveTest; +import org.testng.annotations.Test; + +/** + * Tests live behavior of {@link ServerClient}. + * + * @author Kedar Dave + */ +@Test(groups = { "live" }, singleThreaded = true, testName = "ServerClientLiveTest") +public class ServerClientLiveTest extends BaseOpSourceServersClientLiveTest { + + public void testGetDeployedServers() { + Account account = context.getApi().getAccountClient().getMyAccount(); + assert account.getOrgId() != null; + DeployedServersList deployedServersList = context.getApi().getServerClient().getDeployedServers(account.getOrgId()); + assert deployedServersList != null; + } + + public void testGetPendingDeployServers() { + Account account = context.getApi().getAccountClient().getMyAccount(); + assert account.getOrgId() != null; + PendingDeployServersList pendingDeployServersList = context.getApi().getServerClient().getPendingDeployServers(account.getOrgId()); + assert pendingDeployServersList != null; + } + +} diff --git a/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerImageClientExpectTest.java b/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerImageClientExpectTest.java new file mode 100644 index 0000000000..a640e8d5f8 --- /dev/null +++ b/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerImageClientExpectTest.java @@ -0,0 +1,60 @@ +/* + * 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.opsource.servers.features; + +import static org.testng.Assert.assertEquals; + +import java.net.URI; + +import org.jclouds.http.HttpRequest; +import org.jclouds.http.HttpResponse; +import org.jclouds.opsource.servers.OpSourceServersClient; +import org.jclouds.opsource.servers.domain.Account; +import org.jclouds.opsource.servers.internal.BaseOpSourceServersRestClientExpectTest; +import org.testng.annotations.Test; + +import com.google.common.collect.ImmutableMultimap; + +/** + * Allows us to test the {@link ServerImageClient} + * + * @author Kedar Dave + */ +@Test(groups = { "unit" }, singleThreaded = true, testName = "AccountClientExpectTest") +public class ServerImageClientExpectTest extends BaseOpSourceServersRestClientExpectTest { + + @Test + public void testGetMyAccount() { + OpSourceServersClient client = requestSendsResponse( + HttpRequest + .builder() + .method("GET") + .endpoint(URI.create("https://api.opsourcecloud.net/oec/0.9/myaccount")) + .headers( + ImmutableMultimap. builder().put("Accept", "*/*") + .put("Authorization", "Basic dXNlcjpwYXNzd29yZA==").build()).build(), + + HttpResponse.builder().statusCode(200).payload(payloadFromResource("/myaccount.xml")).build()); + + Account expected = Account.builder().orgId("8a8f6abc-2745-4d8a-9cbc-8dabe5a7d0e4").build(); + + assertEquals(client.getAccountClient().getMyAccount(), expected); + } + +} diff --git a/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerImageClientLiveTest.java b/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerImageClientLiveTest.java new file mode 100644 index 0000000000..d55e155438 --- /dev/null +++ b/labs/opsource-servers/src/test/java/org/jclouds/opsource/servers/features/ServerImageClientLiveTest.java @@ -0,0 +1,38 @@ +/* + * 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.opsource.servers.features; + +import org.jclouds.opsource.servers.domain.ServerImagesList; +import org.jclouds.opsource.servers.internal.BaseOpSourceServersClientLiveTest; +import org.testng.annotations.Test; + +/** + * Tests live behavior of {@link ServerImageClient}. + * + * @author Kedar Dave + */ +@Test(groups = { "live" }, singleThreaded = true, testName = "ServerImageClientLiveTest") +public class ServerImageClientLiveTest extends BaseOpSourceServersClientLiveTest { + + public void testGetServerImages() { + ServerImagesList serverImagesList = context.getApi().getServerImageClient().getServerImages(); + assert serverImagesList != null; + } + +} diff --git a/labs/opsource-servers/src/test/resources/dataCenters.xml b/labs/opsource-servers/src/test/resources/dataCenters.xml new file mode 100644 index 0000000000..7b2dbbedb0 --- /dev/null +++ b/labs/opsource-servers/src/test/resources/dataCenters.xml @@ -0,0 +1,25 @@ + + + + NA1 + US - East + Ashburn + Virginia + US + https://opsource-na1.cloud-vpn.net/ + true + 8 + 65536 + + + NA3 + US - West + Santa Clara + California + US + https://na3.cloud-vpn.net + false + 4 + 32768 + + diff --git a/labs/opsource-servers/src/test/resources/deployedServers.xml b/labs/opsource-servers/src/test/resources/deployedServers.xml new file mode 100644 index 0000000000..301facd751 --- /dev/null +++ b/labs/opsource-servers/src/test/resources/deployedServers.xml @@ -0,0 +1,216 @@ + + + + 0e32cbcc-af24-44b2-9366-44e31b129d45 + CloudDemo3 + + + 2 + 4096 + 10 + 150 + + UNIX + REDHAT5/64 + + + 2b4768ed-852a-4372-bb4b-cc5f5540b11d + 220b3d5a-b90e-11e0-9963-001517c46400 + 10.166.17.23 + 207.20.38.141 + 10-166-17-23 + true + 2011-10-27T20:07:25.718Z + + + f8ff5765-2108-43bf-81bd-6360b427eaad + PRDOSTCPAPP01 + + + 2 + 2048 + 10 + 70 + + UNIX + REDHAT5/64 + + + 5181c83e-655e-4c58-9535-7f4c28719c1e + 220b3d5a-b90e-11e0-9963-001517c46400 + 10.166.17.13 + 10-166-17-13 + true + 2011-08-26T22:03:39.624Z + + + 7023d27b-ad69-4d29-a555-2d7406603f60 + PRDOSTCPAPP02 + + + 2 + 2048 + 10 + 70 + + UNIX + REDHAT5/64 + + + 9fa2664f-f891-4b16-90a7-12d78303790b + 220b3d5a-b90e-11e0-9963-001517c46400 + 10.166.17.15 + 10-166-17-15 + false + 2011-09-07T17:59:57.818Z + + + 8374aff6-788b-4be7-92b8-ae1616eb670e + PRDOSTCPDB01 + + + 2 + 2048 + 10 + 70 + + UNIX + REDHAT5/64 + + + f04b3933-f4b6-42b9-94ac-d1ea10abe700 + 220b3d5a-b90e-11e0-9963-001517c46400 + 10.166.17.11 + 10-166-17-11 + true + 2011-08-26T22:02:52.590Z + + + dcba26c8-5cee-409a-bbf9-181d87896648 + PRDOSTCPDB02 + + + 2 + 2048 + 10 + 70 + + UNIX + REDHAT5/64 + + + 1bccf60a-d771-495f-bf9f-e4ec24b13bec + 220b3d5a-b90e-11e0-9963-001517c46400 + 10.166.17.17 + 10-166-17-17 + true + 2011-09-06T23:07:09.201Z + + + baff15d5-12b3-4a68-8506-25b798ad7f13 + PRDOSTCPLDAP01 + + + 1 + 1024 + 10 + 0 + + UNIX + REDHAT5/64 + + + f426fe93-d798-446b-bf5a-7d82bb9dc85a + 220b3d5a-b90e-11e0-9963-001517c46400 + 10.166.17.12 + 207.20.38.142 + 10-166-17-12 + true + 2011-08-26T22:03:14.200Z + + + 6f8f4ee4-a5f2-452e-a2d4-3f1a76a5b680 + PRDOSTCPLDAP02 + + + 1 + 1024 + 10 + 0 + + UNIX + REDHAT5/64 + + + 307f3bbb-44c1-4cbf-aa1b-2df968c8859c + 220b3d5a-b90e-11e0-9963-001517c46400 + 10.166.17.18 + 10-166-17-18 + true + 2011-09-06T23:07:39.854Z + + + e9d644d2-64f2-442f-9eda-8e8dc1502b67 + PRDOSTCPWEB01 + + + 1 + 1024 + 10 + 0 + + UNIX + REDHAT5/64 + + + e92aef53-c03a-4671-992b-6be940ed8a3b + 220b3d5a-b90e-11e0-9963-001517c46400 + 10.166.17.14 + 10-166-17-14 + true + 2011-08-26T22:03:54.312Z + + + a7e347ae-caa8-4906-bf1e-906cf3469b80 + PRODOSTCPWEB02 + + + 1 + 1024 + 10 + 0 + + UNIX + REDHAT5/64 + + + aa966b57-af4f-4695-8bd5-fe4e014db894 + 220b3d5a-b90e-11e0-9963-001517c46400 + 10.166.17.16 + 10-166-17-16 + true + 2011-09-07T17:18:29.111Z + + + 8cae8be0-69dc-449d-9d88-ce22a69a34bb + TCSP-PROD-MIRROR + + + 2 + 4096 + 10 + 150 + + UNIX + REDHAT5/64 + + + 71413392-1483-4bdf-8e83-204bacca92b0 + 220b3d5a-b90e-11e0-9963-001517c46400 + 10.166.17.20 + 207.20.38.138 + 10-166-17-20 + false + 2012-02-29T23:40:04.840Z + + diff --git a/labs/opsource-servers/src/test/resources/images.xml b/labs/opsource-servers/src/test/resources/images.xml new file mode 100644 index 0000000000..20832bb3b0 --- /dev/null +++ b/labs/opsource-servers/src/test/resources/images.xml @@ -0,0 +1,995 @@ + + + + ad58c616-fbd0-11e0-9963-001517c46400 + /oec/base/image/ad58c616-fbd0-11e0-9963-001517c46400 + RedHat 6.1 64-bit 1 CPU + RedHat 6.1 Enterprise (Santiago), 64-bit + + UNIX + REDHAT6/64 + + NA1 + 1 + 2048 + 10 + 0 + 2011-10-21T10:00:00.000Z + + + ad58ca62-fbd0-11e0-9963-001517c46400 + /oec/base/image/ad58ca62-fbd0-11e0-9963-001517c46400 + RedHat 6.1 64-bit 1 CPU + RedHat 6.1 Enterprise (Santiago), 64-bit + + UNIX + REDHAT6/64 + + NA3 + 1 + 2048 + 10 + 0 + 2011-10-21T10:00:00.000Z + + + ad58d048-fbd0-11e0-9963-001517c46400 + /oec/base/image/ad58d048-fbd0-11e0-9963-001517c46400 + RedHat 6.1 64-bit 2 CPU + RedHat 6.1 Enterprise (Santiago), 64-bit + + UNIX + REDHAT6/64 + + NA1 + 2 + 4096 + 10 + 0 + 2011-10-21T10:00:00.000Z + + + ad58d264-fbd0-11e0-9963-001517c46400 + /oec/base/image/ad58d264-fbd0-11e0-9963-001517c46400 + RedHat 6.1 64-bit 2 CPU + RedHat 6.1 Enterprise (Santiago), 64-bit + + UNIX + REDHAT6/64 + + NA3 + 2 + 4096 + 10 + 0 + 2011-10-21T10:00:00.000Z + + + ad58d430-fbd0-11e0-9963-001517c46400 + /oec/base/image/ad58d430-fbd0-11e0-9963-001517c46400 + RedHat 6.1 32-bit 1 CPU + RedHat 6.1 Enterprise (Santiago), 32-bit + + UNIX + REDHAT6/32 + + NA1 + 1 + 2048 + 10 + 0 + 2011-10-21T10:00:00.000Z + + + ad58d8cc-fbd0-11e0-9963-001517c46400 + /oec/base/image/ad58d8cc-fbd0-11e0-9963-001517c46400 + RedHat 6.1 32-bit 1 CPU + RedHat 6.1 Enterprise (Santiago), 32-bit + + UNIX + REDHAT6/32 + + NA3 + 1 + 2048 + 10 + 0 + 2011-10-21T10:00:00.000Z + + + 52ed8b72-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed8b72-ebea-11df-bdc1-001517c46384 + RedHat 5.7 64-bit 1 CPU + RedHat 5.7 Enterprise (Tikanga), 64-bit + + UNIX + REDHAT5/64 + + NA1 + 1 + 2048 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + a9534478-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9534478-ddf9-11e0-9963-001517c46400 + RedHat 5.7 64-bit 1 CPU + RedHat 5.7 Enterprise (Tikanga), 64-bit + + UNIX + REDHAT5/64 + + NA3 + 1 + 2048 + 10 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed8dca-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed8dca-ebea-11df-bdc1-001517c46384 + RedHat 5.7 64-bit 2 CPU + RedHat 5.7 Enterprise (Tikanga), 64-bit + + UNIX + REDHAT5/64 + + NA1 + 2 + 4096 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + a9534824-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9534824-ddf9-11e0-9963-001517c46400 + RedHat 5.7 64-bit 2 CPU + RedHat 5.7 Enterprise (Tikanga), 64-bit + + UNIX + REDHAT5/64 + + NA3 + 2 + 4096 + 10 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed8ed8-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed8ed8-ebea-11df-bdc1-001517c46384 + RedHat 5.7 64-bit 4 CPU + RedHat 5.7 Enterprise (Tikanga), 64-bit + + UNIX + REDHAT5/64 + + NA1 + 4 + 6144 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + a95349be-ddf9-11e0-9963-001517c46400 + /oec/base/image/a95349be-ddf9-11e0-9963-001517c46400 + RedHat 5.7 64-bit 4 CPU + RedHat 5.7 Enterprise (Tikanga), 64-bit + + UNIX + REDHAT5/64 + + NA3 + 4 + 6144 + 10 + 0 + 2011-09-13T11:15:17.000Z + + + 0c231ef0-2a42-11e0-bfb5-001517c46384 + /oec/base/image/0c231ef0-2a42-11e0-bfb5-001517c46384 + RedHat 64-bit 2 CPU with MySQL + RedHat 5.7 Enterprise with MySQL 5.5 installed + + UNIX + REDHAT5/64 + + NA1 + 2 + 8192 + 10 + 0 + 2011-01-27T18:19:58.000Z + + + a95371d2-ddf9-11e0-9963-001517c46400 + /oec/base/image/a95371d2-ddf9-11e0-9963-001517c46400 + RedHat 64-bit 2 CPU with MySQL + RedHat 5.7 Enterprise with MySQL 5.5 installed + + UNIX + REDHAT5/64 + + NA3 + 2 + 8192 + 10 + 0 + 2011-09-13T11:15:17.000Z + + + 2fb5261a-2a42-11e0-bfb5-001517c46384 + /oec/base/image/2fb5261a-2a42-11e0-bfb5-001517c46384 + RedHat 64-bit 2 CPU with PostgreSQL + RedHat 5.7 Enterprise with PostgreSQL 9.0 installed + + UNIX + REDHAT5/64 + + NA1 + 2 + 8192 + 10 + 0 + 2011-01-27T18:20:57.000Z + + + a9537a38-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9537a38-ddf9-11e0-9963-001517c46400 + RedHat 64-bit 2 CPU with PostgreSQL + RedHat 5.7 Enterprise with PostgreSQL 9.0 installed + + UNIX + REDHAT5/64 + + NA3 + 2 + 8192 + 10 + 0 + 2011-09-13T11:15:17.000Z + + + 6fc040ae-3605-11e0-bfb5-001517c46384 + /oec/base/image/6fc040ae-3605-11e0-bfb5-001517c46384 + RedHat 5.7 32-bit 1 CPU + RedHat 5.7 Enterprise (Tikanga), 32-bit + + UNIX + REDHAT5/32 + + NA1 + 1 + 2048 + 10 + 0 + 2011-02-11T17:36:19.000Z + + + a9534b58-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9534b58-ddf9-11e0-9963-001517c46400 + RedHat 5.7 32-bit 1 CPU + RedHat 5.7 Enterprise (Tikanga), 32-bit + + UNIX + REDHAT5/32 + + NA3 + 1 + 2048 + 10 + 0 + 2011-09-13T11:15:17.000Z + + + 6925214c-3d07-11e1-b29c-001517c4643e + /oec/base/image/6925214c-3d07-11e1-b29c-001517c4643e + CentOS 6.0 64-bit 1 CPU + CentOS 6.0 (Final) + + UNIX + CENTOS6/64 + + NA3 + 1 + 2048 + 10 + 0 + 2012-01-12T10:23:03.000Z + + + b67d274e-1757-11e1-9963-001517c46400 + /oec/base/image/b67d274e-1757-11e1-9963-001517c46400 + CentOS 6.0 64-bit 1 CPU + CentOS 6.0 (Final) + + UNIX + CENTOS6/64 + + NA1 + 1 + 2048 + 10 + 0 + 2011-11-25T11:22:08.000Z + + + 52ed91da-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed91da-ebea-11df-bdc1-001517c46384 + CentOS 5.6 64-bit 1 CPU + CentOS release 5.6, 64-bit + + UNIX + CENTOS5/64 + + NA1 + 1 + 2048 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + a9536764-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9536764-ddf9-11e0-9963-001517c46400 + CentOS 5.6 64-bit 1 CPU + CentOS release 5.6, 64-bit + + UNIX + CENTOS5/64 + + NA3 + 1 + 2048 + 10 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed90cc-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed90cc-ebea-11df-bdc1-001517c46384 + CentOS 5.6 32-bit 1 CPU + CentOS release 5.6, 32-bit + + UNIX + CENTOS5/32 + + NA1 + 1 + 2048 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + a95365f2-ddf9-11e0-9963-001517c46400 + /oec/base/image/a95365f2-ddf9-11e0-9963-001517c46400 + CentOS 5.6 32-bit 1 CPU + CentOS release 5.6, 32-bit + + UNIX + CENTOS5/32 + + NA3 + 1 + 2048 + 10 + 0 + 2011-09-13T11:15:17.000Z + + + cda6a034-4b5b-11e1-b29c-001517c4643e + /oec/base/image/cda6a034-4b5b-11e1-b29c-001517c4643e + Ubuntu 10.04.3 2 CPU + Ubuntu 10.04.3 LTS, 64-bit + + UNIX + UBUNTU10/64 + + NA1 + 2 + 4096 + 10 + 0 + 2012-01-30T16:02:26.000Z + + + e9249c10-4c02-11e1-b29c-001517c4643e + /oec/base/image/e9249c10-4c02-11e1-b29c-001517c4643e + Ubuntu 10.04.3 2 CPU + Ubuntu 10.04.3 LTS, 64-bit + + UNIX + UBUNTU10/64 + + NA3 + 2 + 4096 + 10 + 0 + 2012-01-31T11:58:38.000Z + + + 52ed92d4-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed92d4-ebea-11df-bdc1-001517c46384 + Ubuntu 8.04.4 2 CPU + Ubuntu 8.04.4 LTS, 64-bit + + UNIX + UBUNTU8/64 + + NA1 + 2 + 4096 + 10 + 0 + 1970-01-01T00:00:02.010Z + + + a9535454-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9535454-ddf9-11e0-9963-001517c46400 + Ubuntu 8.04.4 2 CPU + Ubuntu 8.04.4 LTS, 64-bit + + UNIX + UBUNTU8/64 + + NA3 + 2 + 4096 + 10 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed876c-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed876c-ebea-11df-bdc1-001517c46384 + Win2008 Ent 64-bit R2 2 CPU + Windows 2008 Enterprise R2 64-bit + + WINDOWS + WIN2008R2E/64 + + NA1 + 2 + 4096 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + a953562a-ddf9-11e0-9963-001517c46400 + /oec/base/image/a953562a-ddf9-11e0-9963-001517c46400 + Win2008 Ent 64-bit R2 2 CPU + Windows 2008 Enterprise R2 64-bit + + WINDOWS + WIN2008R2E/64 + + NA3 + 2 + 4096 + 50 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed8a5a-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed8a5a-ebea-11df-bdc1-001517c46384 + Win2008 Ent 64-bit R2 4 CPU + Windows 2008 Enterprise R2 64-bit + + WINDOWS + WIN2008R2E/64 + + NA1 + 4 + 8192 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + a95357b0-ddf9-11e0-9963-001517c46400 + /oec/base/image/a95357b0-ddf9-11e0-9963-001517c46400 + Win2008 Ent 64-bit R2 4 CPU + Windows 2008 Enterprise R2 64-bit + + WINDOWS + WIN2008R2E/64 + + NA3 + 4 + 8192 + 50 + 0 + 2011-09-13T11:15:17.000Z + + + 095742a4-378a-11e1-b29c-001517c4643e + /oec/base/image/095742a4-378a-11e1-b29c-001517c4643e + Win2008 Ent 64-Bit R2 MS SQL Ent + Windows 2008 Enterprise R2 64-bit installed with Microsoft SQL Server 2008 R2 Enterprise edition + + WINDOWS + WIN2008R2E/64 + + NA1 + 4 + 8192 + 50 + 0 + 2012-01-05T10:42:59.000Z + + + 6b1bcf3e-fbbf-11e0-9963-001517c46400 + /oec/base/image/6b1bcf3e-fbbf-11e0-9963-001517c46400 + Win2008 Ent 64-Bit R2 MS SQL Std + Windows 2008 Enterprise R2 64-bit installed with Microsoft SQL Server 2008 R2 Standard edition + + WINDOWS + WIN2008R2E/64 + + NA3 + 4 + 8192 + 50 + 0 + 2011-10-21T09:00:00.000Z + + + c87d3c9c-3d11-11e1-b29c-001517c4643e + /oec/base/image/c87d3c9c-3d11-11e1-b29c-001517c4643e + Win2008 Ent 64-Bit R2 MS SQL Ent + Windows 2008 Enterprise R2 64-bit installed with Microsoft SQL Server 2008 R2 Enterprise edition + + WINDOWS + WIN2008R2E/64 + + NA3 + 4 + 8192 + 50 + 0 + 2012-01-12T11:37:18.000Z + + + 543cbfde-f96d-11e0-9963-001517c46400 + /oec/base/image/543cbfde-f96d-11e0-9963-001517c46400 + Win2008 Ent 64-Bit R2 MS SQL Std + Windows 2008 Enterprise R2 64-bit installed with Microsoft SQL Server 2008 R2 Standard edition + + WINDOWS + WIN2008R2E/64 + + NA1 + 4 + 8192 + 50 + 0 + 2011-10-18T09:00:00.000Z + + + 3018092e-4b6b-11e1-b29c-001517c4643e + /oec/base/image/3018092e-4b6b-11e1-b29c-001517c4643e + Win2008 Ent 64-Bit R2 MS SP Fnd + Windows 2008 Enterprise R2 64-bit installed with Microsoft SQL Express & SharePoint Foundation 2010 + + WINDOWS + WIN2008R2E/64 + + NA1 + 4 + 8192 + 50 + 0 + 2012-01-30T17:52:33.000Z + + + 36915134-4c2e-11e1-b29c-001517c4643e + /oec/base/image/36915134-4c2e-11e1-b29c-001517c4643e + Win2008 Ent 64-Bit R2 MS SP Fnd + Windows 2008 Enterprise R2 64-bit installed with Microsoft SQL Express & SharePoint Foundation 2010 + + WINDOWS + WIN2008R2E/64 + + NA3 + 4 + 8192 + 50 + 0 + 2012-01-31T17:08:36.000Z + + + a95361ba-ddf9-11e0-9963-001517c46400 + /oec/base/image/a95361ba-ddf9-11e0-9963-001517c46400 + Win2008 Ent 32-bit 2 CPU + Windows 2008 Enterprise SP2 32-bit + + WINDOWS + WIN2008E/32 + + NA3 + 2 + 4096 + 50 + 0 + 2011-09-13T11:15:17.000Z + + + cdfe3b38-ea9d-11e0-9963-001517c46400 + /oec/base/image/cdfe3b38-ea9d-11e0-9963-001517c46400 + Win2008 Ent 64-bit 2 CPU + Windows 2008 Enterprise SP2 64-bit + + WINDOWS + WIN2008E/64 + + NA1 + 2 + 4096 + 50 + 0 + 2011-09-29T13:20:30.000Z + + + 52ed7ea2-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7ea2-ebea-11df-bdc1-001517c46384 + Win2008 Ent 32-bit 2 CPU + Windows 2008 Enterprise SP2 32-bit + + WINDOWS + WIN2008E/32 + + NA1 + 2 + 4096 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + a9535918-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9535918-ddf9-11e0-9963-001517c46400 + Win2008 Std 64-bit R2 2 CPU + Windows 2008 Standard R2 64-bit + + WINDOWS + WIN2008R2S/64 + + NA3 + 2 + 4096 + 50 + 0 + 2011-09-13T11:15:17.000Z + + + a9536052-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9536052-ddf9-11e0-9963-001517c46400 + Win2008 Std 64-bit 4 CPU + Windows 2008 Standard SP2 64-bit + + WINDOWS + WIN2008S/64 + + NA3 + 4 + 6144 + 50 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed865e-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed865e-ebea-11df-bdc1-001517c46384 + Win2008 Std 64-bit R2 2 CPU + Windows 2008 Standard R2 64-bit + + WINDOWS + WIN2008R2S/64 + + NA1 + 2 + 4096 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + a9535bca-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9535bca-ddf9-11e0-9963-001517c46400 + Win2008 Std 32-bit 1 CPU + Windows 2008 Standard SP2 32-bit + + WINDOWS + WIN2008S/32 + + NA3 + 1 + 2048 + 50 + 0 + 2011-09-13T11:15:17.000Z + + + ca691894-ea9d-11e0-9963-001517c46400 + /oec/base/image/ca691894-ea9d-11e0-9963-001517c46400 + Win2008 Std 64-bit 4 CPU + Windows 2008 Standard SP2 64-bit + + WINDOWS + WIN2008S/64 + + NA1 + 4 + 6144 + 50 + 0 + 2011-09-29T13:20:24.000Z + + + 52ed7b96-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7b96-ebea-11df-bdc1-001517c46384 + Win2008 Std 32-bit 1 CPU + Windows 2008 Standard SP2 32-bit + + WINDOWS + WIN2008S/32 + + NA1 + 1 + 2048 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + a9535d6e-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9535d6e-ddf9-11e0-9963-001517c46400 + Win2008 Std 32-bit 2 CPU + Windows 2008 Standard SP2 32-bit + + WINDOWS + WIN2008S/32 + + NA3 + 2 + 4096 + 50 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed7cb8-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7cb8-ebea-11df-bdc1-001517c46384 + Win2008 Std 32-bit 2 CPU + Windows 2008 Standard SP2 32-bit + + WINDOWS + WIN2008S/32 + + NA1 + 2 + 4096 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + a9535ef4-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9535ef4-ddf9-11e0-9963-001517c46400 + Win2008 Std 32-bit 4 CPU + Windows 2008 Standard SP2 32-bit + + WINDOWS + WIN2008S/32 + + NA3 + 4 + 4096 + 50 + 0 + 2011-09-13T11:15:17.000Z + + + a9536322-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9536322-ddf9-11e0-9963-001517c46400 + Win2008 Ent 64-bit 2 CPU + Windows 2008 Enterprise SP2 64-bit + + WINDOWS + WIN2008E/64 + + NA3 + 2 + 4096 + 50 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed7da8-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7da8-ebea-11df-bdc1-001517c46384 + Win2008 Std 32-bit 4 CPU + Windows 2008 Standard SP2 32-bit + + WINDOWS + WIN2008S/32 + + NA1 + 4 + 4096 + 50 + 0 + 1970-01-01T00:00:02.010Z + + + a9536d18-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9536d18-ddf9-11e0-9963-001517c46400 + Win2003 Ent 64-bit 2 CPU + Windows 2003 Enterprise SP2 64-bit + + WINDOWS + WIN2003E/64 + + NA3 + 2 + 4096 + 16 + 0 + 2011-09-13T11:15:17.000Z + + + ce0ce084-ea9d-11e0-9963-001517c46400 + /oec/base/image/ce0ce084-ea9d-11e0-9963-001517c46400 + Win2003 Ent 64-bit 2 CPU + Windows 2003 Enterprise SP2 64-bit + + WINDOWS + WIN2003E/64 + + NA1 + 2 + 4096 + 16 + 0 + 2011-09-29T13:20:30.000Z + + + 52ed7a88-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7a88-ebea-11df-bdc1-001517c46384 + Win2003 Std 64-bit 2 CPU + Windows 2003 Standard x64 SP2, 64-bit + + WINDOWS + WIN2003S/64 + + NA1 + 2 + 4096 + 16 + 0 + 1970-01-01T00:00:02.010Z + + + a9536e94-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9536e94-ddf9-11e0-9963-001517c46400 + Win2003 Std 64-bit 2 CPU + Windows 2003 Standard x64 SP2, 64-bit + + WINDOWS + WIN2003S/64 + + NA3 + 2 + 4096 + 16 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed766e-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed766e-ebea-11df-bdc1-001517c46384 + Win2003 Ent 32-bit 1 CPU + Windows 2003 Enterprise SP2 32-bit + + WINDOWS + WIN2003E/32 + + NA1 + 1 + 2048 + 16 + 0 + 1970-01-01T00:00:02.010Z + + + a95368e0-ddf9-11e0-9963-001517c46400 + /oec/base/image/a95368e0-ddf9-11e0-9963-001517c46400 + Win2003 Ent 32-bit 1 CPU + Windows 2003 Enterprise SP2 32-bit + + WINDOWS + WIN2003E/32 + + NA3 + 1 + 2048 + 16 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed7876-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7876-ebea-11df-bdc1-001517c46384 + Win2003 Ent 32-bit 2 CPU + Windows 2003 Enterprise SP2 32-bit + + WINDOWS + WIN2003E/32 + + NA1 + 2 + 4096 + 16 + 0 + 1970-01-01T00:00:02.010Z + + + a9536a66-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9536a66-ddf9-11e0-9963-001517c46400 + Win2003 Ent 32-bit 2 CPU + Windows 2003 Enterprise SP2 32-bit + + WINDOWS + WIN2003E/32 + + NA3 + 2 + 4096 + 16 + 0 + 2011-09-13T11:15:17.000Z + + + 52ed7984-ebea-11df-bdc1-001517c46384 + /oec/base/image/52ed7984-ebea-11df-bdc1-001517c46384 + Win2003 Ent 32-bit 4 CPU + Windows 2003 Enterprise SP2 32-bit + + WINDOWS + WIN2003E/32 + + NA1 + 4 + 4096 + 16 + 0 + 1970-01-01T00:00:02.010Z + + + a9536bba-ddf9-11e0-9963-001517c46400 + /oec/base/image/a9536bba-ddf9-11e0-9963-001517c46400 + Win2003 Ent 32-bit 4 CPU + Windows 2003 Enterprise SP2 32-bit + + WINDOWS + WIN2003E/32 + + NA3 + 4 + 4096 + 16 + 0 + 2011-09-13T11:15:17.000Z + + diff --git a/labs/opsource-servers/src/test/resources/pendingDeployServers.xml b/labs/opsource-servers/src/test/resources/pendingDeployServers.xml new file mode 100644 index 0000000000..dca8d51f97 --- /dev/null +++ b/labs/opsource-servers/src/test/resources/pendingDeployServers.xml @@ -0,0 +1,2 @@ + + diff --git a/labs/opsource-servers/src/test/resources/serverDetails.xml b/labs/opsource-servers/src/test/resources/serverDetails.xml new file mode 100644 index 0000000000..81eb59b592 --- /dev/null +++ b/labs/opsource-servers/src/test/resources/serverDetails.xml @@ -0,0 +1,21 @@ + + + 0e32cbcc-af24-44b2-9366-44e31b129d45 + CloudDemo3 + + /oec/2a56409b-20cd-4d88-8358-2f32cce915c4/network/220b3d5a-b90e-11e0-9963-001517c46400 + + + UNIX + REDHAT5/64 + + 2 + 4096 + 10 + 150 + 10-166-17-23 + 10.166.17.23 + true + true + 2011-10-27T20:07:25.718Z +