LoadBalancerNotFound
SecurityGroupNotFoundForProject
Java class for CloneVAppTemplateParams complex type. - *
- *The following schema fragment specifies the expected content contained within this class. - *
+ * ** <complexType name="CloneVAppTemplateParams"> * <complexContent> @@ -63,6 +59,7 @@ public class CloneVAppTemplateParams extends ParamsType { return new ConcreteBuilder(); } + @Override public Builder> toBuilder() { return builder().fromCloneVAppTemplateParams(this); } @@ -75,6 +72,12 @@ public class CloneVAppTemplateParams extends ParamsType { private Reference source; private Boolean isSourceDelete; + @SuppressWarnings("unchecked") + @Override + protected B self() { + return (B) this; + } + /** * @see CloneVAppTemplateParams#getSource() */ @@ -101,6 +104,7 @@ public class CloneVAppTemplateParams extends ParamsType { return self(); } + @Override public CloneVAppTemplateParams build() { return new CloneVAppTemplateParams(this); } @@ -130,9 +134,6 @@ public class CloneVAppTemplateParams extends ParamsType { /** * Gets the value of the source property. - * - * @return possible object is - * {@link Reference } */ public Reference getSource() { return source; @@ -140,9 +141,6 @@ public class CloneVAppTemplateParams extends ParamsType { /** * Gets the value of the isSourceDelete property. - * - * @return possible object is - * {@link Boolean } */ public Boolean isSourceDelete() { return isSourceDelete; @@ -155,21 +153,21 @@ public class CloneVAppTemplateParams extends ParamsType { if (o == null || getClass() != o.getClass()) return false; CloneVAppTemplateParams that = CloneVAppTemplateParams.class.cast(o); - return equal(source, that.source) && - equal(isSourceDelete, that.isSourceDelete); + return super.equals(that) && + equal(this.source, that.source) && + equal(this.isSourceDelete, that.isSourceDelete); } @Override public int hashCode() { - return Objects.hashCode(source, - isSourceDelete); + return Objects.hashCode(super.hashCode(), source, isSourceDelete); } @Override - public String toString() { - return Objects.toStringHelper("") + public ToStringHelper string() { + return super.string() .add("source", source) - .add("isSourceDelete", isSourceDelete).toString(); + .add("isSourceDelete", isSourceDelete); } } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParams.java index 6f05baf96c..aeed48a8f5 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParams.java @@ -1,4 +1,4 @@ -/** +/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -16,48 +16,176 @@ * specific language governing permissions and limitations * under the License. */ - package org.jclouds.vcloud.director.v1_5.domain; +import static com.google.common.base.Objects.equal; +import java.net.URI; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; + +import com.google.common.base.Objects; +import com.google.common.base.Objects.ToStringHelper; /** - * Parameters for Instantiating a vApp + * Represents vApp instantiation parameters. * - * @author danikov + * @author grkvlt@apache.org + * @see + * vCloud REST API - InstantiateVAppParamsType + * @since 0.9 */ -public class InstantiateVAppParams extends InstantiateVAppParamsType { +@XmlRootElement(name = "InstantiateVAppParams") +@XmlType(name = "InstantiateVAppParamsType") +public class InstantiateVAppParams extends VAppCreationParamsType { + + public static final String MEDIA_TYPe = VCloudDirectorMediaType.INSTANTIATE_VAPP_TEMPLATE_PARAMS; public static Builder> builder() { return new ConcreteBuilder(); } + @Override public Builder> toBuilder() { - return builder().fromInstantiateVAppParams(this); + return builder().fromInstantiateVAppParamsType(this); } private static class ConcreteBuilder extends Builder*/ @XmlRootElement(name = "InstantiateVAppTemplateParams") -public class InstantiateVAppTemplateParams extends InstantiateVAppParamsType { +public class InstantiateVAppTemplateParams extends InstantiateVAppParams { public static Builder> builder() { return new ConcreteBuilder(); @@ -47,7 +47,7 @@ public class InstantiateVAppTemplateParams extends InstantiateVAppParamsType { private static class ConcreteBuilder extends Builder{ } - public static abstract class Builder> extends InstantiateVAppParamsType.Builder { + public static abstract class Builder> extends VAppCreationParamsType.Builder { + + private Reference source; + private Boolean sourceDelete; + private Boolean linkedClone; + + @SuppressWarnings("unchecked") + @Override + protected B self() { + return (B) this; + } + + /** + * @see InstantiateVAppParamsType#getSource() + */ + public B source(Reference source) { + this.source = source; + return self(); + } + + /** + * Sets source to a new Reference that uses this URI as the href. + * + * @see InstantiateVAppParamsType#getSource() + */ + public B source(URI source) { + this.source = Reference.builder().href(source).build(); + return self(); + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + public B isSourceDelete(Boolean sourceDelete) { + this.sourceDelete = sourceDelete; + return self(); + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + public B sourceDelete() { + this.sourceDelete = Boolean.TRUE; + return self(); + } + + /** + * @see InstantiateVAppParamsType#isSourceDelete() + */ + public B notSourceDelete() { + this.sourceDelete = Boolean.FALSE; + return self(); + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + public B isLinkedClone(Boolean linkedClone) { + this.linkedClone = linkedClone; + return self(); + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + public B linkedClone() { + this.linkedClone = Boolean.TRUE; + return self(); + } + + /** + * @see InstantiateVAppParamsType#isLinkedClone() + */ + public B notLinkedClone() { + this.linkedClone = Boolean.FALSE; + return self(); + } @Override public InstantiateVAppParams build() { return new InstantiateVAppParams(this); } - public B fromInstantiateVAppParams(InstantiateVAppParams in) { - return fromInstantiateVAppParamsType(in); + public B fromInstantiateVAppParamsType(InstantiateVAppParams in) { + return fromVAppCreationParamsType(in) + .source(in.getSource()) + .isSourceDelete(in.isSourceDelete()) + .isLinkedClone(in.isLinkedClone()); } } + + protected InstantiateVAppParams() { + // For JAXB and builder use + } public InstantiateVAppParams(Builder> builder) { super(builder); + this.source = builder.source; + this.sourceDelete = builder.sourceDelete; + this.linkedClone = builder.linkedClone; } - protected InstantiateVAppParams() { - // for JAXB + @XmlElement(name = "Source", required = true) + private Reference source; + @XmlElement(name = "IsSourceDelete") + private Boolean sourceDelete; + @XmlAttribute + private Boolean linkedClone; + + /** + * Gets the value of the source property. + */ + public Reference getSource() { + return source; + } + + /** + * Gets the value of the isSourceDelete property. + */ + public Boolean isSourceDelete() { + return sourceDelete; + } + + /** + * Gets the value of the linkedClone property. + */ + public Boolean isLinkedClone() { + return linkedClone; } @Override @@ -67,6 +195,22 @@ public class InstantiateVAppParams extends InstantiateVAppParamsType { if (o == null || getClass() != o.getClass()) return false; InstantiateVAppParams that = InstantiateVAppParams.class.cast(o); - return super.equals(that); + return super.equals(that) && + equal(this.source, that.source) && + equal(this.sourceDelete, that.sourceDelete) && + equal(this.linkedClone, that.linkedClone); + } + + @Override + public int hashCode() { + return Objects.hashCode(super.hashCode(), source, sourceDelete, linkedClone); + } + + @Override + public ToStringHelper string() { + return super.string() + .add("source", source) + .add("isSourceDelete", sourceDelete) + .add("linkedClone", linkedClone); } } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParamsType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParamsType.java deleted file mode 100644 index 95af149229..0000000000 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppParamsType.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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.vcloud.director.v1_5.domain; - -import static com.google.common.base.Objects.equal; - -import java.net.URI; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -import com.google.common.base.Objects; -import com.google.common.base.Objects.ToStringHelper; - -/** - * Represents vApp instantiation parameters. - * - * - * <complexType name="InstantiateVAppParams" /> - *- * - * @author grkvlt@apache.org - */ -@XmlType(name = "InstantiateVAppParams") -public class InstantiateVAppParamsType extends VAppCreationParamsType { - - public static Builder> builder() { - return new ConcreteBuilder(); - } - - public Builder> toBuilder() { - return builder().fromInstantiateVAppParamsType(this); - } - - private static class ConcreteBuilder extends Builder{ - } - - public static abstract class Builder> extends VAppCreationParamsType.Builder { - - private Reference source; - private Boolean sourceDelete; - private Boolean linkedClone; - - /** - * @see InstantiateVAppParamsType#getSource() - */ - public B source(Reference source) { - this.source = source; - return self(); - } - - /** - * Sets source to a new Reference that uses this URI as the href. - * - * @see InstantiateVAppParamsType#getSource() - */ - public B source(URI source) { - this.source = Reference.builder().href(source).build(); - return self(); - } - - /** - * @see InstantiateVAppParamsType#isSourceDelete() - */ - public B isSourceDelete(Boolean sourceDelete) { - this.sourceDelete = sourceDelete; - return self(); - } - - /** - * @see InstantiateVAppParamsType#isSourceDelete() - */ - public B sourceDelete() { - this.sourceDelete = Boolean.TRUE; - return self(); - } - - /** - * @see InstantiateVAppParamsType#isSourceDelete() - */ - public B notSourceDelete() { - this.sourceDelete = Boolean.FALSE; - return self(); - } - - /** - * @see InstantiateVAppParamsType#isLinkedClone() - */ - public B isLinkedClone(Boolean linkedClone) { - this.linkedClone = linkedClone; - return self(); - } - - /** - * @see InstantiateVAppParamsType#isLinkedClone() - */ - public B linkedClone() { - this.linkedClone = Boolean.TRUE; - return self(); - } - - /** - * @see InstantiateVAppParamsType#isLinkedClone() - */ - public B notLinkedClone() { - this.linkedClone = Boolean.FALSE; - return self(); - } - - @Override - public InstantiateVAppParamsType build() { - return new InstantiateVAppParamsType(this); - } - - public B fromInstantiateVAppParamsType(InstantiateVAppParamsType in) { - return fromVAppCreationParamsType(in) - .source(in.getSource()) - .isSourceDelete(in.isSourceDelete()) - .isLinkedClone(in.isLinkedClone()); - } - } - - protected InstantiateVAppParamsType() { - // For JAXB and builder use - } - - public InstantiateVAppParamsType(Builder> builder) { - super(builder); - this.source = builder.source; - this.sourceDelete = builder.sourceDelete; - this.linkedClone = builder.linkedClone; - } - - @XmlElement(name = "Source", required = true) - private Reference source; - @XmlElement(name = "IsSourceDelete") - private Boolean sourceDelete; - @XmlAttribute - private Boolean linkedClone; - - /** - * Gets the value of the source property. - */ - public Reference getSource() { - return source; - } - - /** - * Gets the value of the isSourceDelete property. - */ - public Boolean isSourceDelete() { - return sourceDelete; - } - - /** - * Gets the value of the linkedClone property. - */ - public Boolean isLinkedClone() { - return linkedClone; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - InstantiateVAppParamsType that = InstantiateVAppParamsType.class.cast(o); - return super.equals(that) && - equal(this.source, that.source) && - equal(this.sourceDelete, that.sourceDelete) && - equal(this.linkedClone, that.linkedClone); - } - - @Override - public int hashCode() { - return Objects.hashCode(super.hashCode(), source, sourceDelete, linkedClone); - } - - @Override - public ToStringHelper string() { - return super.string() - .add("source", source) - .add("isSourceDelete", sourceDelete) - .add("linkedClone", linkedClone); - } -} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppTemplateParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppTemplateParams.java index 73889ce692..9d515662d8 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppTemplateParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/InstantiateVAppTemplateParams.java @@ -34,7 +34,7 @@ import com.google.common.base.Objects.ToStringHelper; *
- * <complexType name="InstantiationParams" /> - *- * * @author grkvlt@apache.org + * @see + * vCloud REST API - InstantiationParamsType + * @since 0.9 */ @XmlRootElement(name = "InstantiationParams") @XmlType(name = "InstantiationParamsType") @@ -56,13 +54,21 @@ public class InstantiationParams { } public static class Builder { - private Set extends SectionType> sections = Sets.newLinkedHashSet(); + private Set
- * <complexType name="Params" /> - *+ * @see + * vCloud REST API - ParamsType + * @since 0.9 */ -@XmlType(name = "Params") +@XmlType(name = "ParamsType") public class ParamsType { public static Builder> builder() { @@ -100,14 +100,14 @@ public class ParamsType { protected String name; /** - * Gets the value of the description property. + * Optional description. */ public String getDescription() { return description; } /** - * Gets the value of the name property. + * A name as parameter. */ public String getName() { return name; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java index 5924b860af..d0ac707d74 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java @@ -127,6 +127,7 @@ public abstract class ResourceEntityType extends EntityType { return new ConcreteBuilder(); } + @Override public Builder> toBuilder() { return builder().fromResourceEntityType(this); } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UndeployVAppParams.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UndeployVAppParams.java index 65fb5f9147..ced084e9f5 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UndeployVAppParams.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/UndeployVAppParams.java @@ -20,26 +20,44 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; +import java.util.Arrays; +import java.util.List; + import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; +import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; + import com.google.common.base.Objects; /** * Represents vApp/VM undeployment parameters. * - *
- * <complexType name="UndeployVAppParamsType" /> - *- * * @author grkvlt@apache.org + * @see + * vCloud REST API - UndeployVAppParamsType * @since 0.9 */ @XmlRootElement(name = "UndeployVAppParams") @XmlType(name = "UndeployVAppParamsType") public class UndeployVAppParams { + public static final String MEDIA_TYPe = VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS; + + public static class PowerAction { + /** Power off the VMs. This is the default action if this attribute is missing or empty) */ + public static final String POWER_OFF = "powerOff"; + /** Suspend the VMs. */ + public static final String SUSPEND = "suspend"; + /** Shut down the VMs. */ + public static final String SHUTDOWN = "shutdown"; + /** Attempt to power off the VMs. */ + public static final String FORCE = "force"; + + public static final List
- * <complexType name="VAppCreationParams" /> - *- * * @author grkvlt@apache.org + * @see + * vCloud REST API - VAppCreationParamsType + * @since 0.9 */ @XmlType(name = "VAppCreationParamsType") public class VAppCreationParamsType extends ParamsType { @@ -43,6 +42,7 @@ public class VAppCreationParamsType extends ParamsType { return new ConcreteBuilder(); } + @Override public Builder> toBuilder() { return builder().fromVAppCreationParamsType(this); } @@ -148,28 +148,30 @@ public class VAppCreationParamsType extends ParamsType { protected Boolean powerOn; /** - * Gets the value of the vAppParent property. + * Reserved. + * + * Unimplemented. */ public Reference getVAppParent() { return vAppParent; } /** - * Gets the value of the instantiationParams property. + * Instantiation parameters of a VApp. */ public InstantiationParams getInstantiationParams() { return instantiationParams; } /** - * Gets the value of the deploy property. + * Flag to deploy the VApp after successful creation. */ public Boolean isDeploy() { return deploy; } /** - * Gets the value of the powerOn property. + * Flag to deploy and power on the VApp after successful creation. */ public Boolean isPowerOn() { return powerOn; diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java index a9281a2dbe..585f3fe063 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/features/VAppAsyncClient.java @@ -575,7 +575,7 @@ public interface VAppAsyncClient { @Consumes @JAXBResponseParser @ExceptionParser(ReturnNullOnNotFoundOr404.class) - ListenableFuture