JCLOUDS-1255 - initial commit of Dimension Data CloudControl Apache jclouds implementation.
Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/8054a594 Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/8054a594 Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/8054a594 Branch: refs/heads/master Commit: 8054a5949b7eccccdd95d089b3b0d489e5866a2c Parents: 2fe3e0c Author: Trevor Flanagan <[email protected]> Authored: Thu Mar 16 15:27:28 2017 +0000 Committer: Ignasi Barrera <[email protected]> Committed: Wed Mar 22 16:00:40 2017 +0100 ---------------------------------------------------------------------- dimensiondata/README.md | 11 ++ dimensiondata/pom.xml | 155 +++++++++++++++++ .../cloudcontrol/domain/Account.java | 99 +++++++++++ .../domain/AdditionalInformationType.java | 51 ++++++ .../cloudcontrol/domain/Backup.java | 68 ++++++++ .../dimensiondata/cloudcontrol/domain/CPU.java | 55 ++++++ .../cloudcontrol/domain/ConsoleAccess.java | 64 +++++++ .../cloudcontrol/domain/CpuSpeed.java | 117 +++++++++++++ .../cloudcontrol/domain/Datacenter.java | 105 ++++++++++++ .../cloudcontrol/domain/Datacenters.java | 32 ++++ .../dimensiondata/cloudcontrol/domain/Disk.java | 66 ++++++++ .../cloudcontrol/domain/FirewallRule.java | 103 ++++++++++++ .../cloudcontrol/domain/FirewallRuleTarget.java | 111 +++++++++++++ .../cloudcontrol/domain/FirewallRules.java | 32 ++++ .../cloudcontrol/domain/Hypervisor.java | 130 +++++++++++++++ .../cloudcontrol/domain/IpRange.java | 38 +++++ .../cloudcontrol/domain/Monitoring.java | 64 +++++++ .../dimensiondata/cloudcontrol/domain/NIC.java | 74 +++++++++ .../cloudcontrol/domain/NatRule.java | 76 +++++++++ .../cloudcontrol/domain/NatRules.java | 31 ++++ .../cloudcontrol/domain/NetworkDomain.java | 91 ++++++++++ .../cloudcontrol/domain/NetworkDomains.java | 32 ++++ .../cloudcontrol/domain/NetworkInfo.java | 65 ++++++++ .../cloudcontrol/domain/Networking.java | 67 ++++++++ .../cloudcontrol/domain/OperatingSystem.java | 56 +++++++ .../cloudcontrol/domain/OperatingSystems.java | 32 ++++ .../cloudcontrol/domain/OsImage.java | 106 ++++++++++++ .../cloudcontrol/domain/OsImages.java | 31 ++++ .../domain/PaginatedCollection.java | 103 ++++++++++++ .../cloudcontrol/domain/Placement.java | 48 ++++++ .../cloudcontrol/domain/Progress.java | 91 ++++++++++ .../cloudcontrol/domain/Property.java | 38 +++++ .../cloudcontrol/domain/PublicIpBlock.java | 76 +++++++++ .../cloudcontrol/domain/PublicIpBlocks.java | 32 ++++ .../cloudcontrol/domain/Response.java | 94 +++++++++++ .../cloudcontrol/domain/RoleType.java | 49 ++++++ .../cloudcontrol/domain/Roles.java | 59 +++++++ .../cloudcontrol/domain/Server.java | 166 +++++++++++++++++++ .../cloudcontrol/domain/Servers.java | 31 ++++ .../cloudcontrol/domain/Status.java | 84 ++++++++++ .../dimensiondata/cloudcontrol/domain/Tag.java | 82 +++++++++ .../cloudcontrol/domain/TagInfo.java | 53 ++++++ .../cloudcontrol/domain/TagKey.java | 68 ++++++++ .../cloudcontrol/domain/TagKeys.java | 28 ++++ .../dimensiondata/cloudcontrol/domain/Tags.java | 28 ++++ .../cloudcontrol/domain/VMwareTools.java | 59 +++++++ .../cloudcontrol/domain/VirtualHardware.java | 51 ++++++ .../dimensiondata/cloudcontrol/domain/Vlan.java | 95 +++++++++++ .../cloudcontrol/domain/Vlans.java | 31 ++++ .../cloudcontrol/options/PaginationOptions.java | 69 ++++++++ .../domain/PaginatedCollectionTest.java | 50 ++++++ pom.xml | 1 + 52 files changed, 3448 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/README.md ---------------------------------------------------------------------- diff --git a/dimensiondata/README.md b/dimensiondata/README.md new file mode 100644 index 0000000..3f9bbfc --- /dev/null +++ b/dimensiondata/README.md @@ -0,0 +1,11 @@ +dimensiondata is a jclouds api modelled on DimensionData CloudControl API. + + +# How to use it + +- use a MCP2.0 datacenter (NA9, NA12, etc) + +# Known Limitations + +- it supports only MCP2.0 datacenters +- it currently supports only public images. http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/pom.xml ---------------------------------------------------------------------- diff --git a/dimensiondata/pom.xml b/dimensiondata/pom.xml new file mode 100644 index 0000000..964f52a --- /dev/null +++ b/dimensiondata/pom.xml @@ -0,0 +1,155 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.jclouds.labs</groupId> + <artifactId>jclouds-labs</artifactId> + <version>2.1.0-SNAPSHOT</version> + </parent> + + <!-- TODO: when out of labs, switch to org.jclouds.provider --> + <artifactId>dimensiondata-cloudcontrol</artifactId> + <description>jclouds components to access an implementation of Dimension Data CloudControl</description> + <packaging>bundle</packaging> + + <properties> + <test.dimensiondata-cloudcontrol.api-version>2.1</test.dimensiondata-cloudcontrol.api-version> + <test.dimensiondata-cloudcontrol.endpoint>FIXME</test.dimensiondata-cloudcontrol.endpoint> + <test.dimensiondata-cloudcontrol.identity>FIXME</test.dimensiondata-cloudcontrol.identity> + <test.dimensiondata-cloudcontrol.credential>FIXME</test.dimensiondata-cloudcontrol.credential> + <jclouds.osgi.export>org.jclouds.dimensiondata*;version="${project.version}"</jclouds.osgi.export> + <jclouds.osgi.import> + org.jclouds.compute.internal;version="${project.version}", + org.jclouds.rest.internal;version="${project.version}", + org.jclouds*;version="${project.version}", + * + </jclouds.osgi.import> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.jclouds</groupId> + <artifactId>jclouds-core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.jclouds</groupId> + <artifactId>jclouds-compute</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.jclouds</groupId> + <artifactId>jclouds-compute</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.jclouds</groupId> + <artifactId>jclouds-core</artifactId> + <version>${project.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.jclouds.driver</groupId> + <artifactId>jclouds-slf4j</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.jclouds.driver</groupId> + <artifactId>jclouds-sshj</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.squareup.okhttp</groupId> + <artifactId>mockwebserver</artifactId> + <scope>test</scope> + <exclusions> + <!-- Already provided by jclouds-sshj --> + <exclusion> + <groupId>org.bouncycastle</groupId> + <artifactId>bcprov-jdk15on</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>com.google.auto.value</groupId> + <artifactId>auto-value</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.google.auto.service</groupId> + <artifactId>auto-service</artifactId> + <scope>provided</scope> + </dependency> + </dependencies> + + <profiles> + <profile> + <id>live</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <executions> + <execution> + <id>integration</id> + <phase>integration-test</phase> + <goals> + <goal>test</goal> + </goals> + <configuration> + <threadCount>1</threadCount> + <systemPropertyVariables> + <test.dimensiondata-cloudcontrol.api-version> + ${test.dimensiondata-cloudcontrol.api-version} + </test.dimensiondata-cloudcontrol.api-version> + <test.dimensiondata-cloudcontrol.endpoint> + ${test.dimensiondata-cloudcontrol.endpoint} + </test.dimensiondata-cloudcontrol.endpoint> + <test.dimensiondata-cloudcontrol.identity> + ${test.dimensiondata-cloudcontrol.identity} + </test.dimensiondata-cloudcontrol.identity> + <test.dimensiondata-cloudcontrol.credential> + ${test.dimensiondata-cloudcontrol.credential} + </test.dimensiondata-cloudcontrol.credential> + </systemPropertyVariables> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Account.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Account.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Account.java new file mode 100644 index 0000000..1149a07 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Account.java @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +@AutoValue +public abstract class Account { + public abstract String userName(); + + @Nullable + public abstract String password(); + + public abstract String fullName(); + + public abstract String firstName(); + + public abstract String lastName(); + + public abstract String emailAddress(); + + @Nullable + public abstract String department(); + + @Nullable + public abstract String customDefined1(); + + @Nullable + public abstract String customDefined2(); + + public abstract String orgId(); + + @Nullable + public abstract Roles roles(); + + Account() { + } + + public static Builder builder() { + return new AutoValue_Account.Builder(); + } + + @SerializedNames({ "userName", "password", "fullName", "firstName", "lastName", "emailAddress", "department", + "customDefined1", "customDefined2", "orgId", "roles" }) + public static Account create(String userName, String password, String fullName, String firstName, String lastName, + String emailAddress, String department, String customDefined1, String customDefined2, String orgId, + Roles roles) { + return builder().userName(userName).password(password).fullName(fullName).firstName(firstName).lastName(lastName) + .emailAddress(emailAddress).department(department).customDefined1(customDefined1) + .customDefined2(customDefined2).orgId(orgId).roles(roles).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + public abstract Builder userName(String userName); + + public abstract Builder password(String password); + + public abstract Builder fullName(String fullName); + + public abstract Builder firstName(String firstName); + + public abstract Builder lastName(String lastName); + + public abstract Builder emailAddress(String emailAddress); + + public abstract Builder department(String department); + + public abstract Builder customDefined1(String customDefined1); + + public abstract Builder customDefined2(String customDefined2); + + public abstract Builder orgId(String orgId); + + public abstract Builder roles(Roles roles); + + public abstract Account build(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/AdditionalInformationType.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/AdditionalInformationType.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/AdditionalInformationType.java new file mode 100644 index 0000000..a0dd952 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/AdditionalInformationType.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.json.SerializedNames; + +@AutoValue +public abstract class AdditionalInformationType { + + public abstract String value(); + + public abstract String name(); + + AdditionalInformationType() { + } + + @SerializedNames({ "value", "name" }) + public static AdditionalInformationType create(String value, String name) { + return builder().value(value).name(name).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder value(String value); + + public abstract Builder name(String name); + + public abstract AdditionalInformationType build(); + } + + public static Builder builder() { + return new AutoValue_AdditionalInformationType.Builder(); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Backup.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Backup.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Backup.java new file mode 100644 index 0000000..b7a5f4d --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Backup.java @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableList; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +import java.util.List; + +@AutoValue +public abstract class Backup { + + Backup() { + } + + public abstract String type(); + + public abstract String maintenanceStatus(); + + @Nullable + public abstract List<Property> properties(); + + @SerializedNames({ "type", "maintenanceStatus", "property" }) + public static Backup create(String type, String maintenanceStatus, List<Property> properties) { + return builder().type(type).maintenanceStatus(maintenanceStatus).properties(properties).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + public abstract Builder type(String type); + + public abstract Builder maintenanceStatus(String maintenanceStatus); + + public abstract Builder properties(List<Property> properties); + + abstract Backup autoBuild(); + + abstract List<Property> properties(); + + public Backup build() { + properties(properties() != null ? ImmutableList.copyOf(properties()) : null); + return autoBuild(); + } + } + + public static Builder builder() { + return new AutoValue_Backup.Builder(); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/CPU.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/CPU.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/CPU.java new file mode 100644 index 0000000..e9754c2 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/CPU.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.json.SerializedNames; + +@AutoValue +public abstract class CPU { + + CPU() { + } + + public abstract int count(); + + public abstract String speed(); + + public abstract int coresPerSocket(); + + @SerializedNames({ "count", "speed", "coresPerSocket" }) + public static CPU create(int count, String speed, int coresPerSocket) { + return builder().count(count).speed(speed).coresPerSocket(coresPerSocket).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder count(int count); + + public abstract Builder speed(String speed); + + public abstract Builder coresPerSocket(int coresPerSocket); + + public abstract CPU build(); + } + + public static Builder builder() { + return new AutoValue_CPU.Builder(); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/ConsoleAccess.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/ConsoleAccess.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/ConsoleAccess.java new file mode 100644 index 0000000..ccc74eb --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/ConsoleAccess.java @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableList; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +import java.util.List; + +@AutoValue +public abstract class ConsoleAccess { + + ConsoleAccess() { + } + + @Nullable + public abstract List<Property> properties(); + + public abstract String maintenanceStatus(); + + @SerializedNames({ "property", "maintenanceStatus" }) + public static ConsoleAccess create(List<Property> properties, String maintenanceStatus) { + return builder().properties(properties).maintenanceStatus(maintenanceStatus).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + public abstract Builder properties(List<Property> properties); + + public abstract Builder maintenanceStatus(String maintenanceStatus); + + abstract ConsoleAccess autoBuild(); + + abstract List<Property> properties(); + + public ConsoleAccess build() { + properties(properties() != null ? ImmutableList.copyOf(properties()) : null); + return autoBuild(); + } + } + + public static Builder builder() { + return new AutoValue_ConsoleAccess.Builder(); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/CpuSpeed.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/CpuSpeed.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/CpuSpeed.java new file mode 100644 index 0000000..439294e --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/CpuSpeed.java @@ -0,0 +1,117 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +/** + * Defines the CPU speeds available in the Dimension Data Cloud. + */ +public enum CpuSpeed { + + /** + * Dimension Data Economy speed CPU. + * <p/> + * May not be available in all datacenters. + */ + ECONOMY(10), + + /** + * Dimension Data Standard speed CPU. + * <p/> + * The default CPU speed if not otherwise specified. + */ + STANDARD(20), + + /** + * Dimension Data High-Performance speed CPU. + * <p/> + * May not be available in all datacenters. + */ + HIGHPERFORMANCE(30); + + /** + * The value used to represent this CPU speed in JClouds. + * <p/> + * There is no significance to the numerical value other than ordering of the supported speeds. Values are not + * proportional to each other in any way. + */ + private final double speed; + + CpuSpeed(double speed) { + this.speed = speed; + } + + /** + * Gets the default CPU speed used in the Dimension Data cloud. + * + * @return the default speed. + */ + public static CpuSpeed getDefaultCpuSpeed() { + return STANDARD; + } + + /** + * Gets the CPU speed that corresponds to the supplied required speed. + * <p/> + * If there is no matching speed for the supplied value then the {@link #getDefaultCpuSpeed()} speed is returned. + * + * @param requiredSpeed the CPU speed that is required. + * @return the corresponding CPU speed. + */ + public static CpuSpeed fromSpeed(final double requiredSpeed) { + for (CpuSpeed cpuSpeed : CpuSpeed.values()) { + if (cpuSpeed.speed == requiredSpeed) { + return cpuSpeed; + } + } + return getDefaultCpuSpeed(); + } + + /** + * Gets the CPU speed that corresponds to the supplied required speed. + * <p/> + * If there is no matching speed for the supplied value then the {@link #getDefaultCpuSpeed()} speed is returned. + * + * @param requiredSpeed the CPU speed that is required. + * @return the corresponding CPU speed. + */ + public static CpuSpeed fromDimensionDataSpeed(final String requiredSpeed) { + for (CpuSpeed cpuSpeed : CpuSpeed.values()) { + if (cpuSpeed.getDimensionDataSpeed().equals(requiredSpeed)) { + return cpuSpeed; + } + } + return getDefaultCpuSpeed(); + } + + /** + * Gets the CPU speed as represented in JClouds. + * + * @return the CPU speed. + */ + public double getSpeed() { + return speed; + } + + /** + * Gets the CPU speed as represented in the Dimension Data cloud. + * + * @return the CPU speed. + */ + public String getDimensionDataSpeed() { + return name(); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Datacenter.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Datacenter.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Datacenter.java new file mode 100644 index 0000000..c331fda --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Datacenter.java @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +@AutoValue +public abstract class Datacenter { + + public static Builder builder() { + return new AutoValue_Datacenter.Builder(); + } + + Datacenter() { + } // For AutoValue only! + + public abstract String id(); + + public abstract String displayName(); + + public abstract String type(); + + public abstract String city(); + + public abstract String state(); + + public abstract String country(); + + public abstract String vpnUrl(); + + public abstract String ftpsHost(); + + public abstract Networking networking(); + + public abstract Hypervisor hypervisor(); + + @Nullable + public abstract Backup backup(); + + @Nullable + public abstract ConsoleAccess consoleAccess(); + + @Nullable + public abstract Monitoring monitoring(); + + @SerializedNames({ "id", "displayName", "type", "city", "state", "country", "vpnUrl", "ftpsHost", "networking", + "hypervisor", "backup", "consoleAccess", "monitoring" }) + public static Datacenter create(String id, String displayName, String type, String city, String state, + String country, String vpnUrl, String ftpsHost, Networking networking, Hypervisor hypervisor, Backup backup, + ConsoleAccess consoleAccess, Monitoring monitoring) { + return builder().id(id).displayName(displayName).type(type).city(city).state(state).country(country) + .vpnUrl(vpnUrl).ftpsHost(ftpsHost).networking(networking).hypervisor(hypervisor).backup(backup) + .consoleAccess(consoleAccess).monitoring(monitoring).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder id(String id); + + public abstract Builder displayName(String displayName); + + public abstract Builder type(String type); + + public abstract Builder city(String city); + + public abstract Builder state(String state); + + public abstract Builder country(String country); + + public abstract Builder vpnUrl(String vpnUrl); + + public abstract Builder ftpsHost(String ftpsHost); + + public abstract Builder networking(Networking networking); + + public abstract Builder hypervisor(Hypervisor hypervisor); + + public abstract Builder backup(Backup backup); + + public abstract Builder consoleAccess(ConsoleAccess consoleAccess); + + public abstract Builder monitoring(Monitoring monitoring); + + public abstract Datacenter build(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Datacenters.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Datacenters.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Datacenters.java new file mode 100644 index 0000000..53ecc86 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Datacenters.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import java.beans.ConstructorProperties; +import java.util.List; + +/** + * A collection of Datacenter + */ +public class Datacenters extends PaginatedCollection<Datacenter> { + + @ConstructorProperties({ "datacenter", "pageNumber", "pageCount", "totalCount", "pageSize" }) + public Datacenters(List<Datacenter> content, Integer pageNumber, Integer pageCount, Integer totalCount, + Integer pageSize) { + super(content, pageNumber, pageCount, totalCount, pageSize); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Disk.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Disk.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Disk.java new file mode 100644 index 0000000..a851fd2 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Disk.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +@AutoValue +public abstract class Disk { + + Disk() { + } + + @Nullable + public abstract String id(); + + public abstract int scsiId(); + + public abstract int sizeGb(); + + public abstract String speed(); + + @Nullable + public abstract String state(); + + @SerializedNames({ "id", "scsiId", "sizeGb", "speed", "state" }) + public static Disk create(String id, int scsiId, int sizeGb, String speed, String state) { + return builder().id(id).scsiId(scsiId).sizeGb(sizeGb).speed(speed).state(state).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder id(String id); + + public abstract Builder scsiId(int scsiId); + + public abstract Builder sizeGb(int sizeGb); + + public abstract Builder speed(String speed); + + public abstract Builder state(String state); + + public abstract Disk build(); + } + + public static Builder builder() { + return new AutoValue_Disk.Builder(); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRule.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRule.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRule.java new file mode 100644 index 0000000..70dc884 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRule.java @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +@AutoValue +public abstract class FirewallRule { + + public static Builder builder() { + return new AutoValue_FirewallRule.Builder(); + } + + FirewallRule() { + } // For AutoValue only! + + public abstract String id(); + + public abstract String name(); + + public abstract String ruleType(); + + public abstract String networkDomainId(); + + public abstract String state(); + + public abstract String action(); + + public abstract String ipVersion(); + + public abstract String protocol(); + + public abstract String datacenterId(); + + public abstract FirewallRuleTarget source(); + + public abstract FirewallRuleTarget destination(); + + public abstract Boolean enabled(); + + @Nullable + public abstract Placement placement(); + + @SerializedNames({ "id", "name", "ruleType", "networkDomainId", "state", "action", "ipVersion", "protocol", + "datacenterId", "source", "destination", "enabled", "placement" }) + public static FirewallRule create(String id, String name, String ruleType, String networkDomainId, String state, + String action, String ipVersion, String protocol, String datacenterId, FirewallRuleTarget source, + FirewallRuleTarget destination, Boolean enabled, Placement placement) { + return builder().id(id).name(name).ruleType(ruleType).networkDomainId(networkDomainId).state(state).action(action) + .ipVersion(ipVersion).protocol(protocol).datacenterId(datacenterId).source(source).destination(destination) + .enabled(enabled).placement(placement).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder id(String id); + + public abstract Builder name(String name); + + public abstract Builder ruleType(String ruleType); + + public abstract Builder networkDomainId(String networkDomainId); + + public abstract Builder state(String state); + + public abstract Builder action(String action); + + public abstract Builder ipVersion(String ipVersion); + + public abstract Builder protocol(String protocol); + + public abstract Builder datacenterId(String datacenterId); + + public abstract Builder source(FirewallRuleTarget source); + + public abstract Builder destination(FirewallRuleTarget destination); + + public abstract Builder enabled(Boolean enabled); + + public abstract Builder placement(Placement placement); + + public abstract FirewallRule build(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRuleTarget.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRuleTarget.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRuleTarget.java new file mode 100644 index 0000000..edd3efa --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRuleTarget.java @@ -0,0 +1,111 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +import java.util.List; + +@AutoValue +public abstract class FirewallRuleTarget { + + @AutoValue + public abstract static class Port { + + Port() { + } // For AutoValue only! + + public abstract int begin(); + + @Nullable + public abstract Integer end(); + + @SerializedNames({ "begin", "end" }) + public static Port create(int begin, Integer end) { + return new AutoValue_FirewallRuleTarget_Port(begin, end); + } + } + + @AutoValue + public abstract static class PortList { + + PortList() { + } // For AutoValue only! + + public abstract String id(); + + @Nullable + public abstract String name(); + + @Nullable + public abstract String description(); + + @Nullable + public abstract List<Port> port(); + + @Nullable + public abstract List<String> childPortList(); + + @SerializedNames({ "id", "name", "description", "port", "childPortList" }) + public static PortList create(String id, String name, String description, List<Port> port, + List<String> childPortList) { + return new AutoValue_FirewallRuleTarget_PortList(id, name, description, port, childPortList); + } + } + + public static Builder builder() { + return new AutoValue_FirewallRuleTarget.Builder(); + } + + FirewallRuleTarget() { + } // For AutoValue only! + + @Nullable + public abstract IpRange ip(); + + @Nullable + public abstract Port port(); + + @Nullable + public abstract String portListId(); + + @Nullable + public abstract PortList portList(); + + @SerializedNames({ "ip", "port", "portListId", "portList" }) + public static FirewallRuleTarget create(IpRange ip, Port port, String portListId, PortList portList) { + return builder().ip(ip).port(port).portListId(portListId).portList(portList).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder ip(IpRange ip); + + public abstract Builder port(Port port); + + public abstract Builder portListId(String portListId); + + public abstract Builder portList(PortList portList); + + public abstract FirewallRuleTarget build(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRules.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRules.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRules.java new file mode 100644 index 0000000..5772749 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/FirewallRules.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import java.beans.ConstructorProperties; +import java.util.List; + +/** + * A collection of FirewallRule + */ +public class FirewallRules extends PaginatedCollection<FirewallRule> { + + @ConstructorProperties({ "firewallRule", "pageNumber", "pageCount", "totalCount", "pageSize" }) + public FirewallRules(List<FirewallRule> content, Integer pageNumber, Integer pageCount, Integer totalCount, + Integer pageSize) { + super(content, pageNumber, pageCount, totalCount, pageSize); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Hypervisor.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Hypervisor.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Hypervisor.java new file mode 100644 index 0000000..0e8d448 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Hypervisor.java @@ -0,0 +1,130 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableList; +import org.jclouds.json.SerializedNames; + +import java.util.List; + +@AutoValue +public abstract class Hypervisor { + + @AutoValue + public abstract static class DiskSpeed { + + DiskSpeed() { + } // For AutoValue only! + + public abstract String id(); + + public abstract String displayName(); + + public abstract String abbreviation(); + + public abstract String description(); + + public abstract boolean available(); + + public abstract boolean _default(); + + @SerializedNames({ "id", "displayName", "abbreviation", "description", "available", "default" }) + public static DiskSpeed create(String id, String displayName, String abbreviation, String description, + boolean available, boolean _default) { + return new AutoValue_Hypervisor_DiskSpeed(id, displayName, abbreviation, description, available, _default); + } + } + + @AutoValue + public abstract static class CpuSpeed { + + CpuSpeed() { + } // For AutoValue only! + + public abstract String id(); + + public abstract String displayName(); + + public abstract String description(); + + public abstract boolean available(); + + public abstract boolean _default(); + + @SerializedNames({ "id", "displayName", "description", "available", "default" }) + public static CpuSpeed create(String id, String displayName, String description, boolean available, + boolean _default) { + return new AutoValue_Hypervisor_CpuSpeed(id, displayName, description, available, _default); + } + } + + Hypervisor() { + } + + public abstract String type(); + + public abstract String maintenanceStatus(); + + public abstract List<Property> properties(); + + public abstract List<DiskSpeed> diskSpeeds(); + + public abstract List<CpuSpeed> cpuSpeeds(); + + @SerializedNames({ "type", "maintenanceStatus", "property", "diskSpeed", "cpuSpeed" }) + public static Hypervisor create(String type, String maintenanceStatus, List<Property> properties, + List<DiskSpeed> diskSpeeds, List<CpuSpeed> cpuSpeeds) { + return builder().type(type).maintenanceStatus(maintenanceStatus).properties(properties).diskSpeeds(diskSpeeds) + .cpuSpeeds(cpuSpeeds).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder maintenanceStatus(String maintenanceStatus); + + public abstract Builder type(String type); + + public abstract Builder properties(List<Property> properties); + + public abstract Builder diskSpeeds(List<DiskSpeed> diskSpeeds); + + public abstract Builder cpuSpeeds(List<CpuSpeed> cpuSpeeds); + + abstract Hypervisor autoBuild(); + + abstract List<Property> properties(); + + abstract List<DiskSpeed> diskSpeeds(); + + abstract List<CpuSpeed> cpuSpeeds(); + + public Hypervisor build() { + properties(properties() != null ? ImmutableList.copyOf(properties()) : ImmutableList.<Property>of()); + diskSpeeds(diskSpeeds() != null ? ImmutableList.copyOf(diskSpeeds()) : ImmutableList.<DiskSpeed>of()); + cpuSpeeds(cpuSpeeds() != null ? ImmutableList.copyOf(cpuSpeeds()) : ImmutableList.<CpuSpeed>of()); + return autoBuild(); + } + + } + + public static Builder builder() { + return new AutoValue_Hypervisor.Builder(); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/IpRange.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/IpRange.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/IpRange.java new file mode 100644 index 0000000..78cd047 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/IpRange.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +@AutoValue +public abstract class IpRange { + + IpRange() { + } // For AutoValue only! + + public abstract String address(); + + @Nullable + public abstract Integer prefixSize(); + + @SerializedNames({ "address", "prefixSize" }) + public static IpRange create(String address, Integer prefixSize) { + return new AutoValue_IpRange(address, prefixSize); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Monitoring.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Monitoring.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Monitoring.java new file mode 100644 index 0000000..be43783 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Monitoring.java @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableList; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +import java.util.List; + +@AutoValue +public abstract class Monitoring { + + Monitoring() { + } + + @Nullable + public abstract List<Property> properties(); + + public abstract String maintenanceStatus(); + + @SerializedNames({ "property", "maintenanceStatus" }) + public static Monitoring create(List<Property> properties, String maintenanceStatus) { + return builder().properties(properties).maintenanceStatus(maintenanceStatus).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + public abstract Builder properties(List<Property> properties); + + public abstract Builder maintenanceStatus(String maintenanceStatus); + + abstract Monitoring autoBuild(); + + abstract List<Property> properties(); + + public Monitoring build() { + properties(properties() != null ? ImmutableList.copyOf(properties()) : null); + return autoBuild(); + } + } + + public static Builder builder() { + return new AutoValue_Monitoring.Builder(); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NIC.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NIC.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NIC.java new file mode 100644 index 0000000..33f468f --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NIC.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +@AutoValue +public abstract class NIC { + + NIC() { + } + + @Nullable + public abstract String id(); + + @Nullable + public abstract String privateIpv4(); + + @Nullable + public abstract String ipv6(); + + public abstract String vlanId(); + + @Nullable + public abstract String vlanName(); + + @Nullable + public abstract String state(); + + @SerializedNames({ "id", "privateIpv4", "ipv6", "vlanId", "vlanName", "state" }) + public static NIC create(String id, String privateIpv4, String ipv6, String vlanId, String vlanName, String state) { + return builder().id(id).privateIpv4(privateIpv4).ipv6(ipv6).vlanId(vlanId).vlanName(vlanName).state(state) + .build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder id(String id); + + public abstract Builder privateIpv4(String privateIpv4); + + public abstract Builder ipv6(String ipv6); + + public abstract Builder vlanId(String vlanId); + + public abstract Builder vlanName(String vlanName); + + public abstract Builder state(String state); + + public abstract NIC build(); + } + + public static Builder builder() { + return new AutoValue_NIC.Builder(); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NatRule.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NatRule.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NatRule.java new file mode 100644 index 0000000..b1cafb1 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NatRule.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.json.SerializedNames; + +import java.util.Date; + +@AutoValue +public abstract class NatRule { + + NatRule() { + } + + public static Builder builder() { + return new AutoValue_NatRule.Builder(); + } + + public abstract String id(); + + public abstract String datacenterId(); + + public abstract String state(); + + public abstract Date createTime(); + + public abstract String externalIp(); + + public abstract String internalIp(); + + public abstract String networkDomainId(); + + @SerializedNames({ "id", "datacenterId", "state", "createTime", "externalIp", "internalIp", "networkDomainId" }) + public static NatRule create(String id, String datacenterId, String state, Date createTime, String externalIp, + String internalIp, String networkDomainId) { + return builder().id(id).datacenterId(datacenterId).datacenterId(datacenterId).state(state).createTime(createTime) + .externalIp(externalIp).internalIp(internalIp).networkDomainId(networkDomainId).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder id(String id); + + public abstract Builder datacenterId(String datacenterId); + + public abstract Builder state(String state); + + public abstract Builder createTime(Date createTime); + + public abstract Builder externalIp(String externalIp); + + public abstract Builder internalIp(String internalIp); + + public abstract Builder networkDomainId(String networkDomainId); + + public abstract NatRule build(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NatRules.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NatRules.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NatRules.java new file mode 100644 index 0000000..1acb768 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NatRules.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import java.beans.ConstructorProperties; +import java.util.List; + +/** + * A collection of NAT rule + */ +public class NatRules extends PaginatedCollection<NatRule> { + + @ConstructorProperties({ "natRule", "pageNumber", "pageCount", "totalCount", "pageSize" }) + public NatRules(List<NatRule> content, Integer pageNumber, Integer pageCount, Integer totalCount, Integer pageSize) { + super(content, pageNumber, pageCount, totalCount, pageSize); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkDomain.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkDomain.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkDomain.java new file mode 100644 index 0000000..eb6c291 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkDomain.java @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +import java.util.Date; + +@AutoValue +public abstract class NetworkDomain { + + public enum Type { + ESSENTIALS, ADVANCED + } + + NetworkDomain() { + } + + public static Builder builder() { + return new AutoValue_NetworkDomain.Builder(); + } + + public abstract String id(); + + @Nullable + public abstract String datacenterId(); + + public abstract String name(); + + @Nullable + public abstract String description(); + + @Nullable + public abstract String state(); + + @Nullable + public abstract Type type(); + + @Nullable + public abstract String snatIpv4Address(); + + @Nullable + public abstract Date createTime(); + + @SerializedNames({ "id", "datacenterId", "name", "description", "state", "type", "snatIpv4Address", "createTime" }) + public static NetworkDomain create(String id, String datacenterId, String name, String description, String state, + Type type, String snatIpv4Address, Date createTime) { + return builder().id(id).datacenterId(datacenterId).name(name).description(description).state(state).type(type) + .snatIpv4Address(snatIpv4Address).createTime(createTime).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder id(String id); + + public abstract Builder datacenterId(String datacenterId); + + public abstract Builder name(String name); + + public abstract Builder description(String description); + + public abstract Builder state(String state); + + public abstract Builder type(Type type); + + public abstract Builder snatIpv4Address(String snatIpv4Address); + + public abstract Builder createTime(Date createTime); + + public abstract NetworkDomain build(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkDomains.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkDomains.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkDomains.java new file mode 100644 index 0000000..4844581 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkDomains.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import java.beans.ConstructorProperties; +import java.util.List; + +/** + * A collection of NetworkDomain + */ +public class NetworkDomains extends PaginatedCollection<NetworkDomain> { + + @ConstructorProperties({ "networkDomain", "pageNumber", "pageCount", "totalCount", "pageSize" }) + public NetworkDomains(List<NetworkDomain> content, Integer pageNumber, Integer pageCount, Integer totalCount, + Integer pageSize) { + super(content, pageNumber, pageCount, totalCount, pageSize); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkInfo.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkInfo.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkInfo.java new file mode 100644 index 0000000..faaa9c8 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/NetworkInfo.java @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableList; +import org.jclouds.json.SerializedNames; + +import java.util.List; + +@AutoValue +public abstract class NetworkInfo { + + public static Builder builder() { + return new AutoValue_NetworkInfo.Builder(); + } + + NetworkInfo() { + } // For AutoValue only! + + public abstract String networkDomainId(); + + public abstract NIC primaryNic(); + + public abstract List<NIC> additionalNic(); + + @SerializedNames({ "networkDomainId", "primaryNic", "additionalNic" }) + public static NetworkInfo create(String networkDomainId, NIC primaryNic, List<NIC> additionalNic) { + return builder().networkDomainId(networkDomainId).primaryNic(primaryNic).additionalNic(additionalNic).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder networkDomainId(String networkDomainId); + + public abstract Builder primaryNic(NIC primaryNic); + + public abstract Builder additionalNic(List<NIC> additionalNic); + + abstract NetworkInfo autoBuild(); + + abstract List<NIC> additionalNic(); + + public NetworkInfo build() { + additionalNic(additionalNic() != null ? ImmutableList.copyOf(additionalNic()) : ImmutableList.<NIC>of()); + return autoBuild(); + } + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Networking.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Networking.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Networking.java new file mode 100644 index 0000000..2f9c343 --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/Networking.java @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableList; +import org.jclouds.json.SerializedNames; + +import java.util.List; + +@AutoValue +public abstract class Networking { + + Networking() { + } + + public abstract String type(); + + public abstract String maintenanceStatus(); + + public abstract List<Property> properties(); + + @SerializedNames({ "type", "maintenanceStatus", "property" }) + public static Networking create(String type, String maintenanceStatus, List<Property> properties) { + return builder().type(type).maintenanceStatus(maintenanceStatus).properties(properties).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + public abstract Builder maintenanceStatus(String maintenanceStatus); + + public abstract Builder type(String type); + + public abstract Builder properties(List<Property> properties); + + abstract Networking autoBuild(); + + abstract List<Property> properties(); + + public Networking build() { + properties(properties() != null ? ImmutableList.copyOf(properties()) : ImmutableList.<Property>of()); + return autoBuild(); + } + } + + public static Builder builder() { + return new AutoValue_Networking.Builder(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OperatingSystem.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OperatingSystem.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OperatingSystem.java new file mode 100644 index 0000000..73035ca --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OperatingSystem.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import org.jclouds.json.SerializedNames; + +@AutoValue +public abstract class OperatingSystem { + + OperatingSystem() { + } + + public static Builder builder() { + return new AutoValue_OperatingSystem.Builder(); + } + + public abstract String id(); + + public abstract String displayName(); + + public abstract String family(); + + @SerializedNames({ "id", "displayName", "family" }) + public static OperatingSystem create(String id, String displayName, String family) { + return builder().id(id).displayName(displayName).family(family).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder id(String id); + + public abstract Builder displayName(String displayName); + + public abstract Builder family(String family); + + public abstract OperatingSystem build(); + } + +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OperatingSystems.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OperatingSystems.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OperatingSystems.java new file mode 100644 index 0000000..692fa2b --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OperatingSystems.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import java.beans.ConstructorProperties; +import java.util.List; + +/** + * A collection of OperatingSystem + */ +public class OperatingSystems extends PaginatedCollection<OperatingSystem> { + + @ConstructorProperties({ "operatingSystem", "pageNumber", "pageCount", "totalCount", "pageSize" }) + public OperatingSystems(List<OperatingSystem> content, Integer pageNumber, Integer pageCount, Integer totalCount, + Integer pageSize) { + super(content, pageNumber, pageCount, totalCount, pageSize); + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OsImage.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OsImage.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OsImage.java new file mode 100644 index 0000000..3d8cdae --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OsImage.java @@ -0,0 +1,106 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableList; +import org.jclouds.json.SerializedNames; + +import java.util.Date; +import java.util.List; + +@AutoValue +public abstract class OsImage { + + OsImage() { + } + + public static Builder builder() { + return new AutoValue_OsImage.Builder(); + } + + public abstract String id(); + + public abstract String name(); + + public abstract String description(); + + public abstract String datacenterId(); + + public abstract String osImageKey(); + + public abstract Date createTime(); + + public abstract OperatingSystem operatingSystem(); + + public abstract CPU cpu(); + + public abstract int memoryGb(); + + public abstract List<Disk> disks(); + + public abstract List<Object> softwareLabels(); + + @SerializedNames({ "id", "name", "description", "datacenterId", "osImageKey", "createTime", "operatingSystem", "cpu", + "memoryGb", "disk", "softwareLabel" }) + public static OsImage create(String id, String name, String description, String datacenterId, String osImageKey, + Date createTime, OperatingSystem operatingSystem, CPU cpu, int memoryGb, List<Disk> disks, + List<Object> softwareLabels) { + return builder().id(id).name(name).datacenterId(datacenterId).description(description).osImageKey(osImageKey) + .createTime(createTime).operatingSystem(operatingSystem).cpu(cpu).memoryGb(memoryGb).disks(disks) + .softwareLabels(softwareLabels).build(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder id(String id); + + public abstract Builder name(String name); + + public abstract Builder description(String description); + + public abstract Builder datacenterId(String datacenterId); + + public abstract Builder osImageKey(String osImageKey); + + public abstract Builder createTime(Date createTime); + + public abstract Builder operatingSystem(OperatingSystem operatingSystem); + + public abstract Builder cpu(CPU cpu); + + public abstract Builder memoryGb(int memoryGb); + + public abstract Builder disks(List<Disk> disks); + + public abstract Builder softwareLabels(List<Object> softwareLabels); + + abstract OsImage autoBuild(); + + abstract List<Disk> disks(); + + abstract List<Object> softwareLabels(); + + public OsImage build() { + disks(disks() != null ? ImmutableList.copyOf(disks()) : ImmutableList.<Disk>of()); + softwareLabels(softwareLabels() != null ? ImmutableList.copyOf(softwareLabels()) : ImmutableList.of()); + return autoBuild(); + } + } +} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/8054a594/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OsImages.java ---------------------------------------------------------------------- diff --git a/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OsImages.java b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OsImages.java new file mode 100644 index 0000000..69ffb0a --- /dev/null +++ b/dimensiondata/src/main/java/org/jclouds/dimensiondata/cloudcontrol/domain/OsImages.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF 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.dimensiondata.cloudcontrol.domain; + +import java.beans.ConstructorProperties; +import java.util.List; + +/** + * A collection of OsImage + */ +public class OsImages extends PaginatedCollection<OsImage> { + + @ConstructorProperties({ "osImage", "pageNumber", "pageCount", "totalCount", "pageSize" }) + public OsImages(List<OsImage> content, Integer pageNumber, Integer pageCount, Integer totalCount, Integer pageSize) { + super(content, pageNumber, pageCount, totalCount, pageSize); + } +}
