Merge pull request #384 from danikov/vclouds-director-vdc

Issue 830: vCloud director vDC
This commit is contained in:
Adrian Cole 2012-02-23 07:19:56 -08:00
commit e80f6115a1
39 changed files with 7083 additions and 13 deletions

View File

@ -21,12 +21,18 @@ package org.jclouds.vcloud.director.v1_5;
import org.jclouds.ovf.Network; import org.jclouds.ovf.Network;
import org.jclouds.rest.annotations.Delegate; import org.jclouds.rest.annotations.Delegate;
import org.jclouds.vcloud.director.v1_5.domain.Org; import org.jclouds.vcloud.director.v1_5.domain.Org;
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
import org.jclouds.vcloud.director.v1_5.domain.Media;
import org.jclouds.vcloud.director.v1_5.domain.Org;
import org.jclouds.vcloud.director.v1_5.domain.Session; import org.jclouds.vcloud.director.v1_5.domain.Session;
import org.jclouds.vcloud.director.v1_5.domain.Task;
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
import org.jclouds.vcloud.director.v1_5.features.CatalogAsyncClient; import org.jclouds.vcloud.director.v1_5.features.CatalogAsyncClient;
import org.jclouds.vcloud.director.v1_5.features.NetworkAsyncClient; import org.jclouds.vcloud.director.v1_5.features.NetworkAsyncClient;
import org.jclouds.vcloud.director.v1_5.features.OrgAsyncClient; import org.jclouds.vcloud.director.v1_5.features.OrgAsyncClient;
import org.jclouds.vcloud.director.v1_5.features.QueryAsyncClient; import org.jclouds.vcloud.director.v1_5.features.QueryAsyncClient;
import org.jclouds.vcloud.director.v1_5.features.TaskAsyncClient; import org.jclouds.vcloud.director.v1_5.features.TaskAsyncClient;
import org.jclouds.vcloud.director.v1_5.features.VdcAsyncClient;
import com.google.inject.Provides; import com.google.inject.Provides;
@ -80,4 +86,10 @@ public interface VCloudDirectorAsyncClient {
*/ */
@Delegate @Delegate
CatalogAsyncClient getMediaClient(); CatalogAsyncClient getMediaClient();
/**
* @return asynchronous access to {@link Vdc} features
*/
@Delegate
VdcAsyncClient getVdcClient();
} }

View File

@ -24,13 +24,19 @@ import org.jclouds.concurrent.Timeout;
import org.jclouds.ovf.Network; import org.jclouds.ovf.Network;
import org.jclouds.rest.annotations.Delegate; import org.jclouds.rest.annotations.Delegate;
import org.jclouds.vcloud.director.v1_5.domain.Org; import org.jclouds.vcloud.director.v1_5.domain.Org;
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
import org.jclouds.vcloud.director.v1_5.domain.Media;
import org.jclouds.vcloud.director.v1_5.domain.Org;
import org.jclouds.vcloud.director.v1_5.domain.Session; import org.jclouds.vcloud.director.v1_5.domain.Session;
import org.jclouds.vcloud.director.v1_5.domain.Task;
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
import org.jclouds.vcloud.director.v1_5.features.CatalogClient; import org.jclouds.vcloud.director.v1_5.features.CatalogClient;
import org.jclouds.vcloud.director.v1_5.features.MediaClient; import org.jclouds.vcloud.director.v1_5.features.MediaClient;
import org.jclouds.vcloud.director.v1_5.features.NetworkClient; import org.jclouds.vcloud.director.v1_5.features.NetworkClient;
import org.jclouds.vcloud.director.v1_5.features.OrgClient; import org.jclouds.vcloud.director.v1_5.features.OrgClient;
import org.jclouds.vcloud.director.v1_5.features.QueryClient; import org.jclouds.vcloud.director.v1_5.features.QueryClient;
import org.jclouds.vcloud.director.v1_5.features.TaskClient; import org.jclouds.vcloud.director.v1_5.features.TaskClient;
import org.jclouds.vcloud.director.v1_5.features.VdcClient;
import com.google.inject.Provides; import com.google.inject.Provides;
@ -83,4 +89,10 @@ public interface VCloudDirectorClient {
*/ */
@Delegate @Delegate
MediaClient getMediaClient(); MediaClient getMediaClient();
/**
* @return synchronous access to {@link Vdc} features
*/
@Delegate
VdcClient getVdcClient();
} }

View File

@ -44,7 +44,7 @@ public class VCloudDirectorMediaType {
public static final String METADATA_ENTRY = "*/*"; // No media type (?) public static final String METADATA_ENTRY = "*/*"; // No media type (?)
public static final String METADATA_VALUE = "application/vnd.vmware.vcloud.metadata.value+xml";; public static final String METADATA_VALUE = "application/vnd.vmware.vcloud.metadata.value+xml";
public static final String ORG = "application/vnd.vmware.vcloud.org+xml"; public static final String ORG = "application/vnd.vmware.vcloud.org+xml";
@ -71,15 +71,40 @@ public class VCloudDirectorMediaType {
public static final String OWNER = "application/vnd.vmware.vcloud.owner+xml"; public static final String OWNER = "application/vnd.vmware.vcloud.owner+xml";
public static final String VDC = "application/vnd.vmware.vcloud.vdc+xml"; public static final String VDC = "application/vnd.vmware.vcloud.vdc+xml";
public static final String ADMIN_USER = "application/vnd.vmware.admin.user+xml";
public static final String ADMIN_USER = "application/vnd.vmware.admin.user+xml";
public static final String V_APP = "application/vnd.vmware.vcloud.vApp+xml";
public static final String V_APP_TEMPLATE = "application/vnd.vmware.vcloud.vAppTemplate+xml";
public static final String CAPTURE_VAPP_PARAMS =
"application/vnd.vmware.vcloud.captureVAppParams+xml";
public static final String CLONE_MEDIA_PARAMS =
"application/vnd.vmware.vcloud.cloneMediaParams+xml";
public static final String CLONE_V_APP_PARAMS =
"application/vnd.vmware.vcloud.cloneVAppParams+xml";
public static final String CLONE_V_APP_TEMPLATE_PARAMS =
"application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml";
public static final String COMPOSE_VAPP_PARAMS =
"application/vnd.vmware.vcloud.composeVAppParams+xml";
public static final String INSTANTIATE_VAPP_TEMPLATE_PARAMS =
"application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml";
public static final String UPLOAD_VAPP_TEMPLATE_PARAMS =
"application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml";
public static final String QUERY_RESULT_RECORDS = "application/vnd.vmware.vcloud.query.records+xml"; public static final String QUERY_RESULT_RECORDS = "application/vnd.vmware.vcloud.query.records+xml";
public static final String QUERY_RESULT_REFERENCES = "application/vnd.vmware.vcloud.query.references+xml"; public static final String QUERY_RESULT_REFERENCES = "application/vnd.vmware.vcloud.query.references+xml";
public static final String QUERY_RESULT_ID_RECORDS = "application/vnd.vmware.vcloud.query.idrecords+xml"; public static final String QUERY_RESULT_ID_RECORDS = "application/vnd.vmware.vcloud.query.idrecords+xml";
public static final String CONTROL_ACCESS = "application/vnd.vmware.vcloud.controlAccess+xml"; public static final String CONTROL_ACCESS = "application/vnd.vmware.vcloud.controlAccess+xml";
/** /**
@ -91,8 +116,11 @@ public class VCloudDirectorMediaType {
SESSION, ERROR, ORG_LIST, METADATA, METADATA_ENTRY, SESSION, ERROR, ORG_LIST, METADATA, METADATA_ENTRY,
METADATA_VALUE, ORG, TASKS_LIST, TASK, NETWORK, ORG_NETWORK, METADATA_VALUE, ORG, TASKS_LIST, TASK, NETWORK, ORG_NETWORK,
CATALOG, CATALOG_ITEM, CATALOG_ITEMS, CATALOGS_LIST, PROPERTY, CATALOG, CATALOG_ITEM, CATALOG_ITEMS, CATALOGS_LIST, PROPERTY,
MEDIA, OWNER, VDC, ADMIN_USER, QUERY_RESULT_RECORDS, MEDIA, OWNER, VDC, ADMIN_USER, V_APP, V_APP_TEMPLATE,
QUERY_RESULT_REFERENCES, QUERY_RESULT_ID_RECORDS, CAPTURE_VAPP_PARAMS, CLONE_V_APP_PARAMS, CLONE_V_APP_TEMPLATE_PARAMS,
COMPOSE_VAPP_PARAMS, INSTANTIATE_VAPP_TEMPLATE_PARAMS,
UPLOAD_VAPP_TEMPLATE_PARAMS,
QUERY_RESULT_RECORDS, QUERY_RESULT_REFERENCES, QUERY_RESULT_ID_RECORDS,
CONTROL_ACCESS CONTROL_ACCESS
); );
} }

View File

@ -54,6 +54,8 @@ import org.jclouds.vcloud.director.v1_5.features.QueryAsyncClient;
import org.jclouds.vcloud.director.v1_5.features.QueryClient; import org.jclouds.vcloud.director.v1_5.features.QueryClient;
import org.jclouds.vcloud.director.v1_5.features.TaskAsyncClient; import org.jclouds.vcloud.director.v1_5.features.TaskAsyncClient;
import org.jclouds.vcloud.director.v1_5.features.TaskClient; import org.jclouds.vcloud.director.v1_5.features.TaskClient;
import org.jclouds.vcloud.director.v1_5.features.VdcAsyncClient;
import org.jclouds.vcloud.director.v1_5.features.VdcClient;
import org.jclouds.vcloud.director.v1_5.functions.LoginUserInOrgWithPassword; import org.jclouds.vcloud.director.v1_5.functions.LoginUserInOrgWithPassword;
import org.jclouds.vcloud.director.v1_5.handlers.InvalidateSessionAndRetryOn401AndLogoutOnClose; import org.jclouds.vcloud.director.v1_5.handlers.InvalidateSessionAndRetryOn401AndLogoutOnClose;
import org.jclouds.vcloud.director.v1_5.handlers.VCloudDirectorErrorHandler; import org.jclouds.vcloud.director.v1_5.handlers.VCloudDirectorErrorHandler;
@ -87,6 +89,7 @@ public class VCloudDirectorRestClientModule extends RestClientModule<VCloudDirec
.put(QueryClient.class, QueryAsyncClient.class) .put(QueryClient.class, QueryAsyncClient.class)
.put(MediaClient.class, MediaAsyncClient.class) .put(MediaClient.class, MediaAsyncClient.class)
.put(TaskClient.class, TaskAsyncClient.class) .put(TaskClient.class, TaskAsyncClient.class)
.put(VdcClient.class, VdcAsyncClient.class)
.build(); .build();
public VCloudDirectorRestClientModule() { public VCloudDirectorRestClientModule() {

View File

@ -0,0 +1,167 @@
/**
* 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 static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.testng.collections.Lists;
import com.google.common.base.Objects;
/**
*
* Represents a list of references to available networks.
*
*
* <p>Java class for AvailableNetworks complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="AvailableNetworks">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="Network" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AvailableNetworks", propOrder = {
"networks"
})
public class AvailableNetworks {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromAvailableNetworks(this);
}
public static class Builder {
private List<Reference> networks = Lists.newArrayList();
/**
* @see AvailableNetworks#getNetworks()
*/
public Builder networks(List<Reference> networks) {
this.networks = Lists.newArrayList(checkNotNull(networks, "networks"));
return this;
}
/**
* @see AvailableNetworks#getNetworks()
*/
public Builder network(Reference network) {
networks.add(checkNotNull(network, "network"));
return this;
}
public AvailableNetworks build() {
AvailableNetworks availableNetworks = new AvailableNetworks(networks);
return availableNetworks;
}
public Builder fromAvailableNetworks(AvailableNetworks in) {
return networks(in.getNetworks());
}
}
private AvailableNetworks() {
// For JAXB and builder use
}
private AvailableNetworks(List<Reference> networks) {
this.networks = networks;
}
@XmlElement(name = "Network")
protected List<Reference> networks;
/**
* Gets the value of the network property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the network property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNetwork().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ReferenceType }
*
*
*/
public List<Reference> getNetworks() {
if (networks == null) {
networks = Lists.newArrayList();
}
return this.networks;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
AvailableNetworks that = AvailableNetworks.class.cast(o);
return equal(networks, that.networks);
}
@Override
public int hashCode() {
return Objects.hashCode(networks);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("network", networks).toString();
}
}

View File

@ -0,0 +1,148 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Collection of supported hardware capabilities.
*
*
* <p>Java class for Capabilities complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Capabilities">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="SupportedHardwareVersions" type="{http://www.vmware.com/vcloud/v1.5}SupportedHardwareVersionsType" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Capabilities", propOrder = {
"supportedHardwareVersions"
})
public class Capabilities {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromCapabilities(this);
}
public static class Builder {
private SupportedHardwareVersions supportedHardwareVersions;
/**
* @see Capabilities#getSupportedHardwareVersions()
*/
public Builder supportedHardwareVersions(SupportedHardwareVersions supportedHardwareVersions) {
this.supportedHardwareVersions = supportedHardwareVersions;
return this;
}
public Capabilities build() {
Capabilities capabilities = new Capabilities();
capabilities.setSupportedHardwareVersions(supportedHardwareVersions);
return capabilities;
}
public Builder fromCapabilities(Capabilities in) {
return supportedHardwareVersions(in.getSupportedHardwareVersions());
}
}
private Capabilities() {
// For JAXB and builder use
}
@XmlElement(name = "SupportedHardwareVersions")
protected SupportedHardwareVersions supportedHardwareVersions;
/**
* Gets the value of the supportedHardwareVersions property.
*
* @return
* possible object is
* {@link SupportedHardwareVersions }
*
*/
public SupportedHardwareVersions getSupportedHardwareVersions() {
return supportedHardwareVersions;
}
/**
* Sets the value of the supportedHardwareVersions property.
*
* @param value
* allowed object is
* {@link SupportedHardwareVersions }
*
*/
public void setSupportedHardwareVersions(SupportedHardwareVersions value) {
this.supportedHardwareVersions = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Capabilities that = Capabilities.class.cast(o);
return equal(supportedHardwareVersions, that.supportedHardwareVersions);
}
@Override
public int hashCode() {
return Objects.hashCode(supportedHardwareVersions);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("supportedHardwareVersions", supportedHardwareVersions).toString();
}
}

View File

@ -0,0 +1,233 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents a capacity of a given resource.
*
*
* <p>Java class for Capacity complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Capacity">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="Units" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Allocated" type="{http://www.w3.org/2001/XMLSchema}Long" minOccurs="0"/>
* &lt;element name="Limit" type="{http://www.w3.org/2001/XMLSchema}Long"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Capacity", propOrder = {
"units",
"allocated",
"limit"
})
@XmlSeeAlso({
// CapacityWithUsageType.class
})
public class CapacityType<T extends CapacityType<T>> {
public static <T extends CapacityType<T>> Builder<T> builder() {
return new Builder<T>();
}
public Builder<T> toBuilder() {
return new Builder<T>().fromCapacityType(this);
}
public static class Builder<T extends CapacityType<T>> {
protected String units;
protected Long allocated;
protected Long limit;
/**
* @see CapacityType#getUnits()
*/
public Builder<T> units(String units) {
this.units = units;
return this;
}
/**
* @see CapacityType#getAllocated()
*/
public Builder<T> allocated(Long allocated) {
this.allocated = allocated;
return this;
}
/**
* @see CapacityType#getLimit()
*/
public Builder<T> limit(Long limit) {
this.limit = limit;
return this;
}
public CapacityType<T> build() {
CapacityType<T> capacity = new CapacityType<T>();
capacity.setUnits(units);
capacity.setAllocated(allocated);
capacity.setLimit(limit);
return capacity;
}
public Builder<T> fromCapacityType(CapacityType<T> in) {
return units(in.getUnits())
.allocated(in.getAllocated())
.limit(in.getLimit());
}
}
protected CapacityType() {
// For JAXB and builder use
}
protected CapacityType(String units) {
this.units = units;
}
@XmlElement(name = "Units", required = true)
protected String units;
@XmlElement(name = "Allocated")
protected Long allocated;
@XmlElement(name = "Limit")
protected Long limit;
/**
* Gets the value of the units property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUnits() {
return units;
}
/**
* Sets the value of the units property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUnits(String value) {
this.units = value;
}
/**
* Gets the value of the allocated property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getAllocated() {
return allocated;
}
/**
* Sets the value of the allocated property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setAllocated(Long value) {
this.allocated = value;
}
/**
* Gets the value of the limit property.
*
*/
public Long getLimit() {
return limit;
}
/**
* Sets the value of the limit property.
*
*/
public void setLimit(Long value) {
this.limit = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
CapacityType<?> that = CapacityType.class.cast(o);
return equal(units, that.units) &&
equal(allocated, that.allocated) &&
equal(limit, that.limit);
}
@Override
public int hashCode() {
return Objects.hashCode(units,
allocated,
limit);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("units", units)
.add("allocated", allocated)
.add("limit", limit).toString();
}
}

View File

@ -0,0 +1,227 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.vcloud.director.v1_5.domain;
import static com.google.common.base.Objects.equal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents a capacity and usage of a given resource.
*
*
* <p>Java class for CapacityWithUsage complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CapacityWithUsage">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}CapacityType">
* &lt;sequence>
* &lt;element name="Used" type="{http://www.w3.org/2001/XMLSchema}Long" minOccurs="0"/>
* &lt;element name="Overhead" type="{http://www.w3.org/2001/XMLSchema}Long" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CapacityWithUsage", propOrder = {
"used",
"overhead"
})
public class CapacityWithUsage extends CapacityType<CapacityWithUsage>
{
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromCapacityWithUsage(this);
}
public static class Builder extends CapacityType.Builder<CapacityWithUsage> {
private Long used;
private Long overhead;
/**
* @see CapacityWithUsage#getUsed()
*/
public Builder used(Long used) {
this.used = used;
return this;
}
/**
* @see CapacityWithUsage#getOverhead()
*/
public Builder overhead(Long overhead) {
this.overhead = overhead;
return this;
}
public CapacityWithUsage build() {
CapacityWithUsage capacityWithUsage = new CapacityWithUsage(units);
capacityWithUsage.setUsed(used);
capacityWithUsage.setOverhead(overhead);
capacityWithUsage.setAllocated(allocated);
capacityWithUsage.setLimit(limit);
return capacityWithUsage;
}
/**
* @see CapacityType#getUnits()
*/
public Builder units(String units) {
this.units = units;
return this;
}
/**
* @see CapacityType#getAllocated()
*/
public Builder allocated(Long allocated) {
this.allocated = allocated;
return this;
}
/**
* @see CapacityType#getLimit()
*/
public Builder limit(Long limit) {
this.limit = limit;
return this;
}
@Override
public Builder fromCapacityType(CapacityType<CapacityWithUsage> in) {
return Builder.class.cast(super.fromCapacityType(in));
}
public Builder fromCapacityWithUsage(CapacityWithUsage in) {
return fromCapacityType(in)
.used(in.getUsed())
.overhead(in.getOverhead());
}
}
protected CapacityWithUsage() {
// For JAXB and builder use
}
public CapacityWithUsage(String units) {
super(units);
}
@XmlElement(name = "Used")
protected Long used;
@XmlElement(name = "Overhead")
protected Long overhead;
/**
* Gets the value of the used property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getUsed() {
return used;
}
/**
* Sets the value of the used property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setUsed(Long value) {
this.used = value;
}
/**
* Gets the value of the overhead property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getOverhead() {
return overhead;
}
/**
* Sets the value of the overhead property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setOverhead(Long value) {
this.overhead = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
CapacityWithUsage that = CapacityWithUsage.class.cast(o);
return equal(used, that.used) &&
equal(overhead, that.overhead);
}
@Override
public int hashCode() {
return Objects.hashCode(used,
overhead);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("used", used)
.add("overhead", overhead).toString();
}
}

View File

@ -0,0 +1,232 @@
/**
* 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.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.ovf.Section;
import com.google.common.base.Objects;
/**
*
* Represents the parameters for capturing a vApp to a vApp template.
*
*
* <p>Java class for CaptureVAppParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CaptureVAppParams">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}ParamsType">
* &lt;sequence>
* &lt;element name="Source" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType"/>
* &lt;element ref="{http://schemas.dmtf.org/ovf/envelope/1}Section" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CaptureVAppParams", propOrder = {
"source",
"section"
})
public class CaptureVAppParams
extends ParamsType<CaptureVAppParams>
{
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromCaptureVAppParams(this);
}
public static class Builder extends ParamsType.Builder<CaptureVAppParams> {
private Reference source;
private List<JAXBElement<? extends Section<?>>> sections;
/**
* @see CaptureVAppParams#getSource()
*/
public Builder source(Reference source) {
this.source = source;
return this;
}
/**
* @see CaptureVAppParams#getExtend()
*/
public Builder sections(List<JAXBElement<? extends Section<?>>> sections) {
this.sections = sections;
return this;
}
public CaptureVAppParams build() {
CaptureVAppParams captureVAppParams = new CaptureVAppParams(sections);
captureVAppParams.setSource(source);
return captureVAppParams;
}
@Override
public Builder fromParamsType(ParamsType<CaptureVAppParams> in) {
return Builder.class.cast(super.fromParamsType(in));
}
public Builder fromCaptureVAppParams(CaptureVAppParams in) {
return fromParamsType(in)
.source(in.getSource())
.sections(in.getSections());
}
}
private CaptureVAppParams() {
// For JAXB and builder use
}
private CaptureVAppParams(List<JAXBElement<? extends Section<?>>> sections) {
this.sections = sections;
}
@XmlElement(name = "Source", required = true)
protected Reference source;
@XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class)
protected List<JAXBElement<? extends Section<?>>> sections;
/**
* Gets the value of the source property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getSource() {
return source;
}
/**
* Sets the value of the source property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setSource(Reference value) {
this.source = value;
}
/**
*
* An ovf:Section to configure the captured vAppTemplate.
* Gets the value of the section property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the section property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSection().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link Section<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link VirtualHardwareSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link LeaseSettingsSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link EulaSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link RuntimeInfoSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link AnnotationSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link DeploymentOptionSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link StartupSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link ResourceAllocationSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link NetworkConnectionSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link CustomizationSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link ProductSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link GuestCustomizationSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link OperatingSystemSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link NetworkConfigSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link NetworkSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link DiskSection<?>> }{@code >}
* {@link JAXBElement }{@code <}{@link InstallSection<?>> }{@code >}
*
*
*/
public List<JAXBElement<? extends Section<?>>> getSections() {
if (sections == null) {
sections = new ArrayList<JAXBElement<? extends Section<?>>>();
}
return this.sections;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
CaptureVAppParams that = CaptureVAppParams.class.cast(o);
return equal(source, that.source) &&
equal(sections, that.sections);
}
@Override
public int hashCode() {
return Objects.hashCode(source,
sections);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("source", source)
.add("sections", sections).toString();
}
}

View File

@ -0,0 +1,200 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents parameters for copying a media resource and optionally
* deleting the source.
*
*
* <p>Java class for CloneMediaParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CloneMediaParams">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}ParamsType">
* &lt;sequence>
* &lt;element name="Source" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType"/>
* &lt;element name="IsSourceDelete" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CloneMediaParams", propOrder = {
"source",
"isSourceDelete"
})
public class CloneMediaParams
extends ParamsType<CloneMediaParams>
{
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromCloneMediaParams(this);
}
public static class Builder extends ParamsType.Builder<CloneMediaParams> {
private Reference source;
private Boolean isSourceDelete;
/**
* @see CloneMediaParams#getSource()
*/
public Builder source(Reference source) {
this.source = source;
return this;
}
/**
* @see CloneMediaParams#getIsSourceDelete()
*/
public Builder isSourceDelete(Boolean isSourceDelete) {
this.isSourceDelete = isSourceDelete;
return this;
}
public CloneMediaParams build() {
CloneMediaParams cloneMediaParams = new CloneMediaParams();
cloneMediaParams.setSource(source);
cloneMediaParams.setIsSourceDelete(isSourceDelete);
return cloneMediaParams;
}
@Override
public Builder fromParamsType(ParamsType<CloneMediaParams> in) {
return Builder.class.cast(super.fromParamsType(in));
}
public Builder fromCloneMediaParams(CloneMediaParams in) {
return fromParamsType(in)
.source(in.getSource())
.isSourceDelete(in.isSourceDelete());
}
}
private CloneMediaParams() {
// For JAXB and builder use
}
@XmlElement(name = "Source", required = true)
protected Reference source;
@XmlElement(name = "IsSourceDelete")
protected Boolean isSourceDelete;
/**
* Gets the value of the source property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getSource() {
return source;
}
/**
* Sets the value of the source property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setSource(Reference value) {
this.source = value;
}
/**
* Gets the value of the isSourceDelete property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isSourceDelete() {
return isSourceDelete;
}
/**
* Sets the value of the isSourceDelete property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setIsSourceDelete(Boolean value) {
this.isSourceDelete = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
CloneMediaParams that = CloneMediaParams.class.cast(o);
return equal(source, that.source) &&
equal(isSourceDelete, that.isSourceDelete);
}
@Override
public int hashCode() {
return Objects.hashCode(source,
isSourceDelete);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("source", source)
.add("isSourceDelete", isSourceDelete).toString();
}
}

View File

@ -0,0 +1,178 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents parameters for copying a vApp and optionally deleting the source.
*
*
* <p>Java class for CloneVAppParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CloneVAppParams">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}InstantiateVAppParamsType">
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CloneVAppParams")
public class CloneVAppParams
extends InstantiateVAppParamsType<CloneVAppParams>
{
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromCloneVAppParams(this);
}
public static class Builder extends InstantiateVAppParamsType.Builder<CloneVAppParams> {
public CloneVAppParams build() {
CloneVAppParams cloneVAppParams = new CloneVAppParams();
return cloneVAppParams;
}
/**
* @see ParamsType#getDescription()
*/
public Builder description(String description) {
super.description(description);
return this;
}
/**
* @see ParamsType#getName()
*/
public Builder name(String name) {
super.name(name);
return this;
}
/**
* @see VAppCreationParamsType#getVAppParent()
*/
public Builder vAppParent(Reference vAppParent) {
super.vAppParent(vAppParent);
return this;
}
/**
* @see VAppCreationParamsType#getInstantiationParams()
*/
public Builder instantiationParams(InstantiationParams instantiationParams) {
super.instantiationParams(instantiationParams);
return this;
}
/**
* @see VAppCreationParamsType#getDeploy()
*/
public Builder deploy(Boolean deploy) {
super.deploy(deploy);
return this;
}
/**
* @see VAppCreationParamsType#getPowerOn()
*/
public Builder powerOn(Boolean powerOn) {
super.powerOn(powerOn);
return this;
}
/**
* @see InstantiateVAppParamsType#getSource()
*/
public Builder source(Reference source) {
super.source(source);
return this;
}
/**
* @see InstantiateVAppParamsType#getIsSourceDelete()
*/
public Builder isSourceDelete(Boolean isSourceDelete) {
super.isSourceDelete(isSourceDelete);
return this;
}
/**
* @see InstantiateVAppParamsType#getLinkedClone()
*/
public Builder linkedClone(Boolean linkedClone) {
super.linkedClone(linkedClone);
return this;
}
@Override
public Builder fromInstantiateVAppParamsType(InstantiateVAppParamsType<CloneVAppParams> in) {
return Builder.class.cast(super.fromInstantiateVAppParamsType(in));
}
public Builder fromCloneVAppParams(CloneVAppParams in) {
return fromInstantiateVAppParamsType(in);
}
}
private CloneVAppParams() {
// For JAXB and builder use
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
CloneVAppParams that = CloneVAppParams.class.cast(o);
return super.equals(that);
}
@Override
public int hashCode() {
return super.hashCode() + Objects.hashCode("");
}
@Override
public String toString() {
return Objects.toStringHelper("").toString();
}
}

View File

@ -0,0 +1,200 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents parameters for copying a vApp template and optionally
* deleting the source.
*
*
* <p>Java class for CloneVAppTemplateParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CloneVAppTemplateParams">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}ParamsType">
* &lt;sequence>
* &lt;element name="Source" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType"/>
* &lt;element name="IsSourceDelete" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CloneVAppTemplateParams", propOrder = {
"source",
"isSourceDelete"
})
public class CloneVAppTemplateParams
extends ParamsType<CloneVAppTemplateParams>
{
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromCloneVAppTemplateParams(this);
}
public static class Builder extends ParamsType.Builder<CloneVAppTemplateParams> {
private Reference source;
private Boolean isSourceDelete;
/**
* @see CloneVAppTemplateParams#getSource()
*/
public Builder source(Reference source) {
this.source = source;
return this;
}
/**
* @see CloneVAppTemplateParams#getIsSourceDelete()
*/
public Builder isSourceDelete(Boolean isSourceDelete) {
this.isSourceDelete = isSourceDelete;
return this;
}
public CloneVAppTemplateParams build() {
CloneVAppTemplateParams cloneVAppTemplateParams = new CloneVAppTemplateParams();
cloneVAppTemplateParams.setSource(source);
cloneVAppTemplateParams.setIsSourceDelete(isSourceDelete);
return cloneVAppTemplateParams;
}
@Override
public Builder fromParamsType(ParamsType<CloneVAppTemplateParams> in) {
return Builder.class.cast(super.fromParamsType(in));
}
public Builder fromCloneVAppTemplateParams(CloneVAppTemplateParams in) {
return fromParamsType(in)
.source(in.getSource())
.isSourceDelete(in.isSourceDelete());
}
}
private CloneVAppTemplateParams() {
// For JAXB and builder use
}
@XmlElement(name = "Source", required = true)
protected Reference source;
@XmlElement(name = "IsSourceDelete")
protected Boolean isSourceDelete;
/**
* Gets the value of the source property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getSource() {
return source;
}
/**
* Sets the value of the source property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setSource(Reference value) {
this.source = value;
}
/**
* Gets the value of the isSourceDelete property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isSourceDelete() {
return isSourceDelete;
}
/**
* Sets the value of the isSourceDelete property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setIsSourceDelete(Boolean value) {
this.isSourceDelete = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
CloneVAppTemplateParams that = CloneVAppTemplateParams.class.cast(o);
return equal(source, that.source) &&
equal(isSourceDelete, that.isSourceDelete);
}
@Override
public int hashCode() {
return Objects.hashCode(source,
isSourceDelete);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("source", source)
.add("isSourceDelete", isSourceDelete).toString();
}
}

View File

@ -0,0 +1,261 @@
/**
* 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.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents vApp composition parameters.
*
*
* <p>Java class for ComposeVAppParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ComposeVAppParams">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VAppCreationParamsType">
* &lt;sequence>
* &lt;element name="SourcedItem" type="{http://www.vmware.com/vcloud/v1.5}SourcedCompositionItemParamType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element ref="{http://www.vmware.com/vcloud/v1.5}AllEULAsAccepted" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="linkedClone" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ComposeVAppParams", propOrder = {
"sourcedItem",
"allEULAsAccepted"
})
@XmlSeeAlso({
// RecomposeVAppParamsType.class
})
public class ComposeVAppParams
extends VAppCreationParamsType<ComposeVAppParams>
{
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromComposeVAppParams(this);
}
public static class Builder extends VAppCreationParamsType.Builder<ComposeVAppParams> {
private List<SourcedCompositionItemParam> sourcedItem;
private Boolean allEULAsAccepted;
private Boolean linkedClone;
/**
* @see ComposeVAppParams#getSourcedItem()
*/
public Builder sourcedItem(List<SourcedCompositionItemParam> sourcedItem) {
this.sourcedItem = sourcedItem;
return this;
}
/**
* @see ComposeVAppParams#getAllEULAsAccepted()
*/
public Builder allEULAsAccepted(Boolean allEULAsAccepted) {
this.allEULAsAccepted = allEULAsAccepted;
return this;
}
/**
* @see ComposeVAppParams#getLinkedClone()
*/
public Builder linkedClone(Boolean linkedClone) {
this.linkedClone = linkedClone;
return this;
}
public ComposeVAppParams build() {
ComposeVAppParams composeVAppParams = new ComposeVAppParams(sourcedItem);
composeVAppParams.setAllEULAsAccepted(allEULAsAccepted);
composeVAppParams.setLinkedClone(linkedClone);
return composeVAppParams;
}
@Override
public Builder fromVAppCreationParamsType(VAppCreationParamsType<ComposeVAppParams> in) {
return Builder.class.cast(super.fromVAppCreationParamsType(in));
}
public Builder fromComposeVAppParams(ComposeVAppParams in) {
return fromVAppCreationParamsType(in)
.sourcedItem(in.getSourcedItem())
.allEULAsAccepted(in.isAllEULAsAccepted())
.linkedClone(in.isLinkedClone());
}
}
private ComposeVAppParams() {
// For JAXB and builder use
}
private ComposeVAppParams(List<SourcedCompositionItemParam> sourcedItem) {
this.sourcedItem = sourcedItem;
}
@XmlElement(name = "SourcedItem")
protected List<SourcedCompositionItemParam> sourcedItem;
@XmlElement(name = "AllEULAsAccepted")
protected Boolean allEULAsAccepted;
@XmlAttribute
protected Boolean linkedClone;
/**
* Gets the value of the sourcedItem property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the sourcedItem property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSourcedItem().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link SourcedCompositionItemParamType }
*
*
*/
public List<SourcedCompositionItemParam> getSourcedItem() {
if (sourcedItem == null) {
sourcedItem = new ArrayList<SourcedCompositionItemParam>();
}
return this.sourcedItem;
}
/**
*
* Used to confirm acceptance of all EULAs in a
* vApp template. Instantiation fails if this
* element is missing, empty, or set to false
* and one or more EulaSection elements are
* present.
*
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isAllEULAsAccepted() {
return allEULAsAccepted;
}
/**
* Sets the value of the allEULAsAccepted property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setAllEULAsAccepted(Boolean value) {
this.allEULAsAccepted = value;
}
/**
* Gets the value of the linkedClone property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isLinkedClone() {
return linkedClone;
}
/**
* Sets the value of the linkedClone property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setLinkedClone(Boolean value) {
this.linkedClone = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ComposeVAppParams that = ComposeVAppParams.class.cast(o);
return equal(sourcedItem, that.sourcedItem) &&
equal(allEULAsAccepted, that.allEULAsAccepted) &&
equal(linkedClone, that.linkedClone);
}
@Override
public int hashCode() {
return Objects.hashCode(sourcedItem,
allEULAsAccepted,
linkedClone);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("sourcedItem", sourcedItem)
.add("allEULAsAccepted", allEULAsAccepted)
.add("linkedClone", linkedClone).toString();
}
}

View File

@ -0,0 +1,190 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents a compute capacity with units.
*
*
* <p>Java class for ComputeCapacity complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ComputeCapacity">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="Cpu" type="{http://www.vmware.com/vcloud/v1.5}CapacityWithUsageType"/>
* &lt;element name="Memory" type="{http://www.vmware.com/vcloud/v1.5}CapacityWithUsageType"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ComputeCapacity", propOrder = {
"cpu",
"memory"
})
public class ComputeCapacity {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromComputeCapacity(this);
}
public static class Builder {
private CapacityWithUsage cpu;
private CapacityWithUsage memory;
/**
* @see ComputeCapacity#getCpu()
*/
public Builder cpu(CapacityWithUsage cpu) {
this.cpu = cpu;
return this;
}
/**
* @see ComputeCapacity#getMemory()
*/
public Builder memory(CapacityWithUsage memory) {
this.memory = memory;
return this;
}
public ComputeCapacity build() {
ComputeCapacity computeCapacity = new ComputeCapacity();
computeCapacity.setCpu(cpu);
computeCapacity.setMemory(memory);
return computeCapacity;
}
public Builder fromComputeCapacity(ComputeCapacity in) {
return cpu(in.getCpu())
.memory(in.getMemory());
}
}
private ComputeCapacity() {
// For JAXB and builder use
}
@XmlElement(name = "Cpu", required = true)
protected CapacityWithUsage cpu;
@XmlElement(name = "Memory", required = true)
protected CapacityWithUsage memory;
/**
* Gets the value of the cpu property.
*
* @return
* possible object is
* {@link CapacityWithUsage }
*
*/
public CapacityWithUsage getCpu() {
return cpu;
}
/**
* Sets the value of the cpu property.
*
* @param value
* allowed object is
* {@link CapacityWithUsage }
*
*/
public void setCpu(CapacityWithUsage value) {
this.cpu = value;
}
/**
* Gets the value of the memory property.
*
* @return
* possible object is
* {@link CapacityWithUsage }
*
*/
public CapacityWithUsage getMemory() {
return memory;
}
/**
* Sets the value of the memory property.
*
* @param value
* allowed object is
* {@link CapacityWithUsage }
*
*/
public void setMemory(CapacityWithUsage value) {
this.memory = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ComputeCapacity that = ComputeCapacity.class.cast(o);
return equal(cpu, that.cpu) &&
equal(memory, that.memory);
}
@Override
public int hashCode() {
return Objects.hashCode(cpu,
memory);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("cpu", cpu)
.add("memory", memory).toString();
}
}

View File

@ -0,0 +1,158 @@
/**
* 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;
/**
* Parameters for Instantiating a vApp
*
* @author danikov
*/
public class InstantiateVAppParams
extends InstantiateVAppParamsType<InstantiateVAppParams> {
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
@Override
public Builder toBuilder() {
return new Builder();
}
public static class Builder
extends InstantiateVAppParamsType.Builder<InstantiateVAppParams> {
public InstantiateVAppParams build() {
InstantiateVAppParams instantiateVAppParams = new InstantiateVAppParams();
instantiateVAppParams.setSource(source);
instantiateVAppParams.setIsSourceDelete(isSourceDelete);
instantiateVAppParams.setLinkedClone(linkedClone);
instantiateVAppParams.setVAppParent(vAppParent);
instantiateVAppParams.setInstantiationParams(instantiationParams);
instantiateVAppParams.setDeploy(deploy);
instantiateVAppParams.setPowerOn(powerOn);
instantiateVAppParams.setDescription(description);
instantiateVAppParams.setName(name);
return instantiateVAppParams;
}
/**
* @see InstantiateVAppParams#getSource()
*/
public Builder source(Reference source) {
super.source(source);
return this;
}
/**
* @see InstantiateVAppParams#getIsSourceDelete()
*/
public Builder isSourceDelete(Boolean isSourceDelete) {
super.isSourceDelete(isSourceDelete);
return this;
}
/**
* @see InstantiateVAppParams#getLinkedClone()
*/
public Builder linkedClone(Boolean linkedClone) {
super.linkedClone(linkedClone);
return this;
}
/**
* @see ParamsType#getDescription()
*/
public Builder description(String description) {
super.description(description);
return this;
}
/**
* @see ParamsType#getName()
*/
public Builder name(String name) {
super.name(name);
return this;
}
/**
* @see VAppCreationParamsType#getVAppParent()
*/
public Builder vAppParent(Reference vAppParent) {
super.vAppParent(vAppParent);
return this;
}
/**
* @see VAppCreationParamsType#getInstantiationParams()
*/
public Builder instantiationParams(InstantiationParams instantiationParams) {
super.instantiationParams(instantiationParams);
return this;
}
/**
* @see VAppCreationParamsType#getDeploy()
*/
public Builder deploy(Boolean deploy) {
super.deploy(deploy);
return this;
}
/**
* @see VAppCreationParamsType#getPowerOn()
*/
public Builder powerOn(Boolean powerOn) {
super.powerOn(powerOn);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public Builder fromInstantiateVAppParamsType(
InstantiateVAppParamsType<InstantiateVAppParams> in) {
return Builder.class.cast(super.fromVAppCreationParamsType(in));
}
public Builder fromInstantiateVAppParams(InstantiateVAppParams in) {
return fromInstantiateVAppParamsType(in);
}
}
protected InstantiateVAppParams() {
// For JAXB and builder use
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
InstantiateVAppParams that = InstantiateVAppParams.class.cast(o);
return super.equals(that);
}
}

View File

@ -0,0 +1,302 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents vApp instantiation parameters.
*
*
* <p>Java class for InstantiateVAppParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="InstantiateVAppParams">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VAppCreationParamsType">
* &lt;sequence>
* &lt;element name="Source" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType"/>
* &lt;element name="IsSourceDelete" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="linkedClone" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "InstantiateVAppParams", propOrder = {
"source",
"isSourceDelete"
})
@XmlSeeAlso({
// InstantiateVAppTemplateParamsType.class,
// CloneVAppParamsType.class
})
public class InstantiateVAppParamsType<T extends InstantiateVAppParamsType<T>>
extends VAppCreationParamsType<T>
{
public static <T extends InstantiateVAppParamsType<T>> Builder<T> builder() {
return new Builder<T>();
}
public Builder<T> toBuilder() {
return new Builder<T>().fromInstantiateVAppParamsType(this);
}
public static class Builder<T extends InstantiateVAppParamsType<T>> extends VAppCreationParamsType.Builder<T> {
protected Reference source;
protected Boolean isSourceDelete;
protected Boolean linkedClone;
/**
* @see InstantiateVAppParamsType#getSource()
*/
public Builder<T> source(Reference source) {
this.source = source;
return this;
}
/**
* @see InstantiateVAppParamsType#getIsSourceDelete()
*/
public Builder<T> isSourceDelete(Boolean isSourceDelete) {
this.isSourceDelete = isSourceDelete;
return this;
}
/**
* @see InstantiateVAppParamsType#getLinkedClone()
*/
public Builder<T> linkedClone(Boolean linkedClone) {
this.linkedClone = linkedClone;
return this;
}
public InstantiateVAppParamsType<T> build() {
InstantiateVAppParamsType<T> instantiateVAppParams = new InstantiateVAppParamsType<T>();
instantiateVAppParams.setSource(source);
instantiateVAppParams.setIsSourceDelete(isSourceDelete);
instantiateVAppParams.setLinkedClone(linkedClone);
instantiateVAppParams.setVAppParent(vAppParent);
instantiateVAppParams.setInstantiationParams(instantiationParams);
instantiateVAppParams.setDeploy(deploy);
instantiateVAppParams.setPowerOn(powerOn);
instantiateVAppParams.setDescription(description);
instantiateVAppParams.setName(name);
return instantiateVAppParams;
}
/**
* @see ParamsType#getDescription()
*/
public Builder<T> description(String description) {
super.description(description);
return this;
}
/**
* @see ParamsType#getName()
*/
public Builder<T> name(String name) {
super.name(name);
return this;
}
/**
* @see VAppCreationParamsType#getVAppParent()
*/
public Builder<T> vAppParent(Reference vAppParent) {
super.vAppParent(vAppParent);
return this;
}
/**
* @see VAppCreationParamsType#getInstantiationParams()
*/
public Builder<T> instantiationParams(InstantiationParams instantiationParams) {
super.instantiationParams(instantiationParams);
return this;
}
/**
* @see VAppCreationParamsType#getDeploy()
*/
public Builder<T> deploy(Boolean deploy) {
super.deploy(deploy);
return this;
}
/**
* @see VAppCreationParamsType#getPowerOn()
*/
public Builder<T> powerOn(Boolean powerOn) {
super.powerOn(powerOn);
return this;
}
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public Builder<T> fromVAppCreationParamsType(VAppCreationParamsType<T> in) {
return Builder.class.cast(super.fromVAppCreationParamsType(in));
}
public Builder<T> fromInstantiateVAppParamsType(InstantiateVAppParamsType<T> in) {
return fromVAppCreationParamsType(in)
.source(in.getSource())
.isSourceDelete(in.isSourceDelete())
.linkedClone(in.isLinkedClone());
}
}
protected InstantiateVAppParamsType() {
// For JAXB and builder use
}
@XmlElement(name = "Source", required = true)
protected Reference source;
@XmlElement(name = "IsSourceDelete")
protected Boolean isSourceDelete;
@XmlAttribute
protected Boolean linkedClone;
/**
* Gets the value of the source property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getSource() {
return source;
}
/**
* Sets the value of the source property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setSource(Reference value) {
this.source = value;
}
/**
* Gets the value of the isSourceDelete property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isSourceDelete() {
return isSourceDelete;
}
/**
* Sets the value of the isSourceDelete property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setIsSourceDelete(Boolean value) {
this.isSourceDelete = value;
}
/**
* Gets the value of the linkedClone property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isLinkedClone() {
return linkedClone;
}
/**
* Sets the value of the linkedClone property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setLinkedClone(Boolean value) {
this.linkedClone = value;
}
@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 equal(source, that.source) &&
equal(isSourceDelete, that.isSourceDelete) &&
equal(linkedClone, that.linkedClone);
}
@Override
public int hashCode() {
return Objects.hashCode(source,
isSourceDelete,
linkedClone);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("source", source)
.add("isSourceDelete", isSourceDelete)
.add("linkedClone", linkedClone).toString();
}
}

View File

@ -0,0 +1,212 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents vApp template instantiation parameters.
*
*
* <p>Java class for InstantiateVAppTemplateParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="InstantiateVAppTemplateParams">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}InstantiateVAppParamsType">
* &lt;sequence>
* &lt;element ref="{http://www.vmware.com/vcloud/v1.5}AllEULAsAccepted" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "InstantiateVAppTemplateParams", propOrder = {
"allEULAsAccepted"
})
public class InstantiateVAppTemplateParams
extends InstantiateVAppParamsType<InstantiateVAppTemplateParams> {
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromInstantiateVAppTemplateParams(this);
}
public static class Builder extends InstantiateVAppParamsType.Builder<InstantiateVAppTemplateParams> {
private Boolean allEULAsAccepted;
/**
* @see InstantiateVAppTemplateParamsType#getAllEULAsAccepted()
*/
public Builder allEULAsAccepted(Boolean allEULAsAccepted) {
this.allEULAsAccepted = allEULAsAccepted;
return this;
}
public InstantiateVAppTemplateParams build() {
InstantiateVAppTemplateParams instantiateVAppTemplateParams = new InstantiateVAppTemplateParams();
instantiateVAppTemplateParams.setAllEULAsAccepted(allEULAsAccepted);
return instantiateVAppTemplateParams;
}
/**
* @see ParamsType#getDescription()
*/
public Builder description(String description) {
super.description(description);
return this;
}
/**
* @see ParamsType#getName()
*/
public Builder name(String name) {
super.name(name);
return this;
}
/**
* @see VAppCreationParamsType#getVAppParent()
*/
public Builder vAppParent(Reference vAppParent) {
super.vAppParent(vAppParent);
return this;
}
/**
* @see VAppCreationParamsType#getInstantiationParams()
*/
public Builder instantiationParams(InstantiationParams instantiationParams) {
super.instantiationParams(instantiationParams);
return this;
}
/**
* @see VAppCreationParamsType#getDeploy()
*/
public Builder deploy(Boolean deploy) {
super.deploy(deploy);
return this;
}
/**
* @see VAppCreationParamsType#getPowerOn()
*/
public Builder powerOn(Boolean powerOn) {
super.powerOn(powerOn);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public Builder fromInstantiateVAppParamsType(InstantiateVAppParamsType<InstantiateVAppTemplateParams> in) {
return Builder.class.cast(super.fromInstantiateVAppParamsType(in));
}
public Builder fromInstantiateVAppTemplateParams(InstantiateVAppTemplateParams in) {
return fromInstantiateVAppParamsType(in)
.allEULAsAccepted(in.isAllEULAsAccepted());
}
}
private InstantiateVAppTemplateParams() {
// For JAXB and builder use
}
@XmlElement(name = "AllEULAsAccepted")
protected Boolean allEULAsAccepted;
/**
*
* Used to confirm acceptance of all EULAs in a
* vApp template. Instantiation fails if this
* element is missing, empty, or set to false
* and one or more EulaSection elements are
* present.
*
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isAllEULAsAccepted() {
return allEULAsAccepted;
}
/**
* Sets the value of the allEULAsAccepted property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setAllEULAsAccepted(Boolean value) {
this.allEULAsAccepted = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
InstantiateVAppTemplateParams that = InstantiateVAppTemplateParams.class.cast(o);
return equal(allEULAsAccepted, that.allEULAsAccepted);
}
@Override
public int hashCode() {
return Objects.hashCode(allEULAsAccepted);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("allEULAsAccepted", allEULAsAccepted).toString();
}
}

View File

@ -0,0 +1,180 @@
/**
* 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.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.ovf.Section;
import com.google.common.base.Objects;
/**
*
* Represents a list of ovf:Section to configure for instantiating a VApp.
*
*
* <p>Java class for InstantiationParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="InstantiationParams">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element ref="{http://schemas.dmtf.org/ovf/envelope/1}Section" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "InstantiationParams", propOrder = {
"section"
})
public class InstantiationParams {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromInstantiationParams(this);
}
public static class Builder {
private List<JAXBElement<? extends Section<?>>> sections;
/**
* @see InstantiationParams#getExtend()
*/
public Builder sections(List<JAXBElement<? extends Section<?>>> sections) {
this.sections = sections;
return this;
}
public InstantiationParams build() {
InstantiationParams instantiationParams = new InstantiationParams(sections);
return instantiationParams;
}
public Builder fromInstantiationParams(InstantiationParams in) {
return sections(in.getSections());
}
}
private InstantiationParams() {
// For JAXB and builder use
}
private InstantiationParams(List<JAXBElement<? extends Section<?>>> sections) {
this.sections = sections;
}
@XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class)
protected List<JAXBElement<? extends Section<?>>> sections;
/**
*
* An ovf:Section to configure for instantiation.
* Gets the value of the section property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the section property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSection().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link SectionType }{@code >}
* {@link JAXBElement }{@code <}{@link VirtualHardwareSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link LeaseSettingsSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link EulaSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link RuntimeInfoSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link AnnotationSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link DeploymentOptionSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link StartupSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link ResourceAllocationSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link NetworkConnectionSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link CustomizationSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link ProductSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link GuestCustomizationSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link OperatingSystemSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link NetworkConfigSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link NetworkSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link DiskSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link InstallSectionType }{@code >}
*
*
*/
public List<JAXBElement<? extends Section<?>>> getSections() {
if (sections == null) {
sections = new ArrayList<JAXBElement<? extends Section<?>>>();
}
return this.sections;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
InstantiationParams that = InstantiationParams.class.cast(o);
return equal(sections, that.sections);
}
@Override
public int hashCode() {
return Objects.hashCode(sections);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("sections", sections).toString();
}
}

View File

@ -0,0 +1,188 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents mapping between a VM and vApp network.
*
*
* <p>Java class for NetworkAssignment complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="NetworkAssignment">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;attribute name="innerNetwork" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="containerNetwork" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "NetworkAssignment")
public class NetworkAssignment
{
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromNetworkAssignment(this);
}
public static class Builder {
private String innerNetwork;
private String containerNetwork;
/**
* @see NetworkAssignment#getInnerNetwork()
*/
public Builder innerNetwork(String innerNetwork) {
this.innerNetwork = innerNetwork;
return this;
}
/**
* @see NetworkAssignment#getContainerNetwork()
*/
public Builder containerNetwork(String containerNetwork) {
this.containerNetwork = containerNetwork;
return this;
}
public NetworkAssignment build() {
NetworkAssignment networkAssignment = new NetworkAssignment();
networkAssignment.setInnerNetwork(innerNetwork);
networkAssignment.setContainerNetwork(containerNetwork);
return networkAssignment;
}
public Builder fromNetworkAssignment(NetworkAssignment in) {
return innerNetwork(in.getInnerNetwork())
.containerNetwork(in.getContainerNetwork());
}
}
private NetworkAssignment() {
// For JAXB and builder use
}
@XmlAttribute(required = true)
protected String innerNetwork;
@XmlAttribute(required = true)
protected String containerNetwork;
/**
* Gets the value of the innerNetwork property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getInnerNetwork() {
return innerNetwork;
}
/**
* Sets the value of the innerNetwork property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setInnerNetwork(String value) {
this.innerNetwork = value;
}
/**
* Gets the value of the containerNetwork property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getContainerNetwork() {
return containerNetwork;
}
/**
* Sets the value of the containerNetwork property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setContainerNetwork(String value) {
this.containerNetwork = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
NetworkAssignment that = NetworkAssignment.class.cast(o);
return equal(innerNetwork, that.innerNetwork) &&
equal(containerNetwork, that.containerNetwork);
}
@Override
public int hashCode() {
return Objects.hashCode(innerNetwork,
containerNetwork);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("innerNetwork", innerNetwork)
.add("containerNetwork", containerNetwork).toString();
}
}

View File

@ -0,0 +1,201 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* A basic type used to specify parameters for operations.
*
*
* <p>Java class for Params complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Params">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="Description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Params", propOrder = {
"description"
})
@XmlSeeAlso({
// CaptureVAppParams.class,
// CloneVAppTemplateParams.class,
// CloneMediaParams.class,
// UploadVAppTemplateParams.class,
// ImportVmAsVAppTemplateParams.class,
// ImportMediaParams.class,
// UpdateResourcePoolSetParams.class,
// VAppCreationParams.class
})
public class ParamsType<T extends ParamsType<T>> {
public static <T extends ParamsType<T>> Builder<T> builder() {
return new Builder<T>();
}
public Builder<T> toBuilder() {
return new Builder<T>().fromParamsType(this);
}
public static class Builder<T extends ParamsType<T>>{
protected String description;
protected String name;
/**
* @see ParamsType#getDescription()
*/
public Builder<T> description(String description) {
this.description = description;
return this;
}
/**
* @see ParamsType#getName()
*/
public Builder<T> name(String name) {
this.name = name;
return this;
}
public ParamsType<T> build() {
ParamsType<T> params = new ParamsType<T>();
params.setDescription(description);
params.setName(name);
return params;
}
public Builder<T> fromParamsType(ParamsType<T> in) {
return description(in.getDescription())
.name(in.getName());
}
}
protected ParamsType() {
// For JAXB and builder use
}
@XmlElement(name = "Description")
protected String description;
@XmlAttribute
protected String name;
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ParamsType<?> that = ParamsType.class.cast(o);
return equal(description, that.description) &&
equal(name, that.name);
}
@Override
public int hashCode() {
return Objects.hashCode(description,
name);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("description", description)
.add("name", name).toString();
}
}

View File

@ -0,0 +1,167 @@
/**
* 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 static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.testng.collections.Lists;
import com.google.common.base.Objects;
/**
*
* Represents a list of references to resource entities.
*
*
* <p>Java class for ResourceEntities complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ResourceEntities">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="ResourceEntity" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ResourceEntities", propOrder = {
"resourceEntities"
})
public class ResourceEntities {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromResourceEntities(this);
}
public static class Builder {
private List<Reference> resourceEntities = Lists.newArrayList();
/**
* @see ResourceEntities#getResourceEntities()
*/
public Builder resourceEntities(List<Reference> resourceEntities) {
this.resourceEntities = Lists.newArrayList(checkNotNull(resourceEntities, "resourceEntities"));
return this;
}
/**
* @see ResourceEntities#getResourceEntities()
*/
public Builder resourceEntity(Reference resourceEntity) {
resourceEntities.add(checkNotNull(resourceEntity, "resourceEntity"));
return this;
}
public ResourceEntities build() {
ResourceEntities resourceEntities = new ResourceEntities(this.resourceEntities);
return resourceEntities;
}
public Builder fromResourceEntities(ResourceEntities in) {
return resourceEntities(in.getResourceEntities());
}
}
private ResourceEntities() {
// For JAXB and builder use
}
private ResourceEntities(List<Reference> resourceEntity) {
this.resourceEntities = resourceEntity;
}
@XmlElement(name = "ResourceEntity")
protected List<Reference> resourceEntities;
/**
* Gets the value of the resourceEntity property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the resourceEntity property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getResourceEntity().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ReferenceType }
*
*
*/
public List<Reference> getResourceEntities() {
if (resourceEntities == null) {
resourceEntities = Lists.newArrayList();
}
return this.resourceEntities;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ResourceEntities that = ResourceEntities.class.cast(o);
return equal(resourceEntities, that.resourceEntities);
}
@Override
public int hashCode() {
return Objects.hashCode(resourceEntities);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("resourceEntity", resourceEntities).toString();
}
}

View File

@ -0,0 +1,326 @@
/**
* 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.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents a composition item.
*
*
* <p>Java class for SourcedCompositionItemParam complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SourcedCompositionItemParam">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="Source" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType"/>
* &lt;element name="VAppScopedLocalId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="InstantiationParams" type="{http://www.vmware.com/vcloud/v1.5}InstantiationParamsType" minOccurs="0"/>
* &lt;element name="NetworkAssignment" type="{http://www.vmware.com/vcloud/v1.5}NetworkAssignmentType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="sourceDelete" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SourcedCompositionItemParam", propOrder = {
"source",
"vAppScopedLocalId",
"instantiationParams",
"networkAssignment"
})
public class SourcedCompositionItemParam {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromSourcedCompositionItemParam(this);
}
public static class Builder {
private Reference source;
private String vAppScopedLocalId;
private InstantiationParams instantiationParams;
private List<NetworkAssignment> networkAssignment;
private Boolean sourceDelete;
/**
* @see SourcedCompositionItemParam#getSource()
*/
public Builder source(Reference source) {
this.source = source;
return this;
}
/**
* @see SourcedCompositionItemParam#getVAppScopedLocalId()
*/
public Builder vAppScopedLocalId(String vAppScopedLocalId) {
this.vAppScopedLocalId = vAppScopedLocalId;
return this;
}
/**
* @see SourcedCompositionItemParam#getInstantiationParams()
*/
public Builder instantiationParams(InstantiationParams instantiationParams) {
this.instantiationParams = instantiationParams;
return this;
}
/**
* @see SourcedCompositionItemParam#getNetworkAssignment()
*/
public Builder networkAssignment(List<NetworkAssignment> networkAssignment) {
this.networkAssignment = networkAssignment;
return this;
}
/**
* @see SourcedCompositionItemParam#getSourceDelete()
*/
public Builder sourceDelete(Boolean sourceDelete) {
this.sourceDelete = sourceDelete;
return this;
}
public SourcedCompositionItemParam build() {
SourcedCompositionItemParam sourcedCompositionItemParam = new SourcedCompositionItemParam(networkAssignment);
sourcedCompositionItemParam.setSource(source);
sourcedCompositionItemParam.setVAppScopedLocalId(vAppScopedLocalId);
sourcedCompositionItemParam.setInstantiationParams(instantiationParams);
sourcedCompositionItemParam.setSourceDelete(sourceDelete);
return sourcedCompositionItemParam;
}
public Builder fromSourcedCompositionItemParam(SourcedCompositionItemParam in) {
return source(in.getSource())
.vAppScopedLocalId(in.getVAppScopedLocalId())
.instantiationParams(in.getInstantiationParams())
.networkAssignment(in.getNetworkAssignment())
.sourceDelete(in.isSourceDelete());
}
}
private SourcedCompositionItemParam() {
// For JAXB and builder use
}
private SourcedCompositionItemParam(List<NetworkAssignment> networkAssignment) {
this.networkAssignment = networkAssignment;
}
@XmlElement(name = "Source", required = true)
protected Reference source;
@XmlElement(name = "VAppScopedLocalId")
protected String vAppScopedLocalId;
@XmlElement(name = "InstantiationParams")
protected InstantiationParams instantiationParams;
@XmlElement(name = "NetworkAssignment")
protected List<NetworkAssignment> networkAssignment;
@XmlAttribute
protected Boolean sourceDelete;
/**
* Gets the value of the source property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getSource() {
return source;
}
/**
* Sets the value of the source property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setSource(Reference value) {
this.source = value;
}
/**
* Gets the value of the vAppScopedLocalId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVAppScopedLocalId() {
return vAppScopedLocalId;
}
/**
* Sets the value of the vAppScopedLocalId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVAppScopedLocalId(String value) {
this.vAppScopedLocalId = value;
}
/**
* Gets the value of the instantiationParams property.
*
* @return
* possible object is
* {@link InstantiationParams }
*
*/
public InstantiationParams getInstantiationParams() {
return instantiationParams;
}
/**
* Sets the value of the instantiationParams property.
*
* @param value
* allowed object is
* {@link InstantiationParams }
*
*/
public void setInstantiationParams(InstantiationParams value) {
this.instantiationParams = value;
}
/**
* Gets the value of the networkAssignment property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the networkAssignment property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNetworkAssignment().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link NetworkAssignmentType }
*
*
*/
public List<NetworkAssignment> getNetworkAssignment() {
if (networkAssignment == null) {
networkAssignment = new ArrayList<NetworkAssignment>();
}
return this.networkAssignment;
}
/**
* Gets the value of the sourceDelete property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isSourceDelete() {
return sourceDelete;
}
/**
* Sets the value of the sourceDelete property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setSourceDelete(Boolean value) {
this.sourceDelete = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
SourcedCompositionItemParam that = SourcedCompositionItemParam.class.cast(o);
return equal(source, that.source) &&
equal(vAppScopedLocalId, that.vAppScopedLocalId) &&
equal(instantiationParams, that.instantiationParams) &&
equal(networkAssignment, that.networkAssignment) &&
equal(sourceDelete, that.sourceDelete);
}
@Override
public int hashCode() {
return Objects.hashCode(source,
vAppScopedLocalId,
instantiationParams,
networkAssignment,
sourceDelete);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("source", source)
.add("vAppScopedLocalId", vAppScopedLocalId)
.add("instantiationParams", instantiationParams)
.add("networkAssignment", networkAssignment)
.add("sourceDelete", sourceDelete).toString();
}
}

View File

@ -0,0 +1,167 @@
/**
* 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 static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.testng.collections.Lists;
import com.google.common.base.Objects;
/**
*
* Represents a list of supported VM hardware versions.
*
*
* <p>Java class for SupportedHardwareVersions complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SupportedHardwareVersions">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="SupportedHardwareVersion" type="{http://www.vmware.com/vcloud/v1.5}SupportedHardwareVersionType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SupportedHardwareVersions", propOrder = {
"supportedHardwareVersions"
})
public class SupportedHardwareVersions {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromSupportedHardwareVersions(this);
}
public static class Builder {
private List<String> supportedHardwareVersions = Lists.newArrayList();
/**
* @see SupportedHardwareVersions#getSupportedHardwareVersions()
*/
public Builder supportedHardwareVersions(List<String> supportedHardwareVersions) {
this.supportedHardwareVersions = Lists.newArrayList(checkNotNull(supportedHardwareVersions, "supportedHardwareVersions"));
return this;
}
/**
* @see SupportedHardwareVersions#getSupportedHardwareVersions()
*/
public Builder supportedHardwareVersion(String supportedHardwareVersion) {
supportedHardwareVersions.add(checkNotNull(supportedHardwareVersion, "supportedHardwareVersion"));
return this;
}
public SupportedHardwareVersions build() {
SupportedHardwareVersions supportedHardwareVersions = new SupportedHardwareVersions(this.supportedHardwareVersions);
return supportedHardwareVersions;
}
public Builder fromSupportedHardwareVersions(SupportedHardwareVersions in) {
return supportedHardwareVersions(in.getSupportedHardwareVersions());
}
}
private SupportedHardwareVersions() {
// For JAXB and builder use
}
private SupportedHardwareVersions(List<String> supportedHardwareVersions) {
this.supportedHardwareVersions = supportedHardwareVersions;
}
@XmlElement(name = "SupportedHardwareVersion")
protected List<String> supportedHardwareVersions;
/**
* Gets the value of the supportedHardwareVersion property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the supportedHardwareVersion property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSupportedHardwareVersion().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getSupportedHardwareVersions() {
if (supportedHardwareVersions == null) {
supportedHardwareVersions = Lists.newArrayList();
}
return this.supportedHardwareVersions;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
SupportedHardwareVersions that = SupportedHardwareVersions.class.cast(o);
return equal(supportedHardwareVersions, that.supportedHardwareVersions);
}
@Override
public int hashCode() {
return Objects.hashCode(supportedHardwareVersions);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("supportedHardwareVersion", supportedHardwareVersions).toString();
}
}

View File

@ -0,0 +1,194 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents vApp Template upload parameters.
*
*
* <p>Java class for UploadVAppTemplateParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="UploadVAppTemplateParams">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}ParamsType">
* &lt;attribute name="transferFormat" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="manifestRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "UploadVAppTemplateParams")
public class UploadVAppTemplateParams
extends ParamsType<UploadVAppTemplateParams>
{
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromUploadVAppTemplateParams(this);
}
public static class Builder extends ParamsType.Builder<UploadVAppTemplateParams> {
private String transferFormat;
private Boolean manifestRequired;
/**
* @see UploadVAppTemplateParams#getTransferFormat()
*/
public Builder transferFormat(String transferFormat) {
this.transferFormat = transferFormat;
return this;
}
/**
* @see UploadVAppTemplateParams#getManifestRequired()
*/
public Builder manifestRequired(Boolean manifestRequired) {
this.manifestRequired = manifestRequired;
return this;
}
public UploadVAppTemplateParams build() {
UploadVAppTemplateParams uploadVAppTemplateParams = new UploadVAppTemplateParams();
uploadVAppTemplateParams.setTransferFormat(transferFormat);
uploadVAppTemplateParams.setManifestRequired(manifestRequired);
return uploadVAppTemplateParams;
}
@Override
public Builder fromParamsType(ParamsType<UploadVAppTemplateParams> in) {
return Builder.class.cast(super.fromParamsType(in));
}
public Builder fromUploadVAppTemplateParams(UploadVAppTemplateParams in) {
return fromParamsType(in)
.transferFormat(in.getTransferFormat())
.manifestRequired(in.isManifestRequired());
}
}
private UploadVAppTemplateParams() {
// For JAXB and builder use
}
@XmlAttribute
protected String transferFormat;
@XmlAttribute
protected Boolean manifestRequired;
/**
* Gets the value of the transferFormat property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTransferFormat() {
return transferFormat;
}
/**
* Sets the value of the transferFormat property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTransferFormat(String value) {
this.transferFormat = value;
}
/**
* Gets the value of the manifestRequired property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isManifestRequired() {
return manifestRequired;
}
/**
* Sets the value of the manifestRequired property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setManifestRequired(Boolean value) {
this.manifestRequired = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
UploadVAppTemplateParams that = UploadVAppTemplateParams.class.cast(o);
return equal(transferFormat, that.transferFormat) &&
equal(manifestRequired, that.manifestRequired);
}
@Override
public int hashCode() {
return Objects.hashCode(transferFormat,
manifestRequired);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("transferFormat", transferFormat)
.add("manifestRequired", manifestRequired).toString();
}
}

View File

@ -0,0 +1,5 @@
package org.jclouds.vcloud.director.v1_5.domain;
public class VApp {
// Placeholder for merge
}

View File

@ -0,0 +1,307 @@
/**
* 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 javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents vApp creation parameters.
*
*
* <p>Java class for VAppCreationParams complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="VAppCreationParams">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}ParamsType">
* &lt;sequence>
* &lt;element name="VAppParent" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" minOccurs="0"/>
* &lt;element name="InstantiationParams" type="{http://www.vmware.com/vcloud/v1.5}InstantiationParamsType" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="deploy" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="powerOn" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VAppCreationParams", propOrder = {
"vAppParent",
"instantiationParams"
})
@XmlSeeAlso({
// InstantiateOvfParamsType.class,
// ComposeVAppParamsType.class,
// InstantiateVAppParamsType.class,
// ImportVmAsVAppParamsType.class
})
public class VAppCreationParamsType<T extends VAppCreationParamsType<T>>
extends ParamsType<T>
{
public static <T extends VAppCreationParamsType<T>> Builder<T> builder() {
return new Builder<T>();
}
public Builder<T> toBuilder() {
return new Builder<T>().fromVAppCreationParamsType(this);
}
public static class Builder<T extends VAppCreationParamsType<T>> extends ParamsType.Builder<T> {
protected Reference vAppParent;
protected InstantiationParams instantiationParams;
protected Boolean deploy;
protected Boolean powerOn;
/**
* @see VAppCreationParamsType#getVAppParent()
*/
public Builder<T> vAppParent(Reference vAppParent) {
this.vAppParent = vAppParent;
return this;
}
/**
* @see VAppCreationParamsType#getInstantiationParams()
*/
public Builder<T> instantiationParams(InstantiationParams instantiationParams) {
this.instantiationParams = instantiationParams;
return this;
}
/**
* @see VAppCreationParamsType#getDeploy()
*/
public Builder<T> deploy(Boolean deploy) {
this.deploy = deploy;
return this;
}
/**
* @see VAppCreationParamsType#getPowerOn()
*/
public Builder<T> powerOn(Boolean powerOn) {
this.powerOn = powerOn;
return this;
}
public VAppCreationParamsType<T> build() {
VAppCreationParamsType<T> vAppCreationParams = new VAppCreationParamsType<T>();
vAppCreationParams.setVAppParent(vAppParent);
vAppCreationParams.setInstantiationParams(instantiationParams);
vAppCreationParams.setDeploy(deploy);
vAppCreationParams.setPowerOn(powerOn);
vAppCreationParams.setDescription(description);
vAppCreationParams.setName(name);
return vAppCreationParams;
}
/**
* @see ParamsType#getDescription()
*/
public Builder<T> description(String description) {
super.description(description);
return this;
}
/**
* @see ParamsType#getName()
*/
public Builder<T> name(String name) {
super.name(name);
return this;
}
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public Builder<T> fromParamsType(ParamsType<T> in) {
return Builder.class.cast(super.fromParamsType(in));
}
public Builder<T> fromVAppCreationParamsType(VAppCreationParamsType<T> in) {
return fromParamsType(in)
.vAppParent(in.getVAppParent())
.instantiationParams(in.getInstantiationParams())
.deploy(in.isDeploy())
.powerOn(in.isPowerOn());
}
}
protected VAppCreationParamsType() {
// For JAXB and builder use
}
@XmlElement(name = "VAppParent")
protected Reference vAppParent;
@XmlElement(name = "InstantiationParams")
protected InstantiationParams instantiationParams;
@XmlAttribute
protected Boolean deploy;
@XmlAttribute
protected Boolean powerOn;
/**
* Gets the value of the vAppParent property.
*
* @return
* possible object is
* {@link Reference }
*
*/
public Reference getVAppParent() {
return vAppParent;
}
/**
* Sets the value of the vAppParent property.
*
* @param value
* allowed object is
* {@link Reference }
*
*/
public void setVAppParent(Reference value) {
this.vAppParent = value;
}
/**
* Gets the value of the instantiationParams property.
*
* @return
* possible object is
* {@link InstantiationParams }
*
*/
public InstantiationParams getInstantiationParams() {
return instantiationParams;
}
/**
* Sets the value of the instantiationParams property.
*
* @param value
* allowed object is
* {@link InstantiationParams }
*
*/
public void setInstantiationParams(InstantiationParams value) {
this.instantiationParams = value;
}
/**
* Gets the value of the deploy property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isDeploy() {
return deploy;
}
/**
* Sets the value of the deploy property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setDeploy(Boolean value) {
this.deploy = value;
}
/**
* Gets the value of the powerOn property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isPowerOn() {
return powerOn;
}
/**
* Sets the value of the powerOn property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setPowerOn(Boolean value) {
this.powerOn = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
VAppCreationParamsType<?> that = VAppCreationParamsType.class.cast(o);
return equal(vAppParent, that.vAppParent) &&
equal(instantiationParams, that.instantiationParams) &&
equal(deploy, that.deploy) &&
equal(powerOn, that.powerOn);
}
@Override
public int hashCode() {
return Objects.hashCode(vAppParent,
instantiationParams,
deploy,
powerOn);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("vAppParent", vAppParent)
.add("instantiationParams", instantiationParams)
.add("deploy", deploy)
.add("powerOn", powerOn).toString();
}
}

View File

@ -0,0 +1,403 @@
/**
* 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.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.ovf.Section;
import com.google.common.base.Objects;
/**
*
* Represents a vApp template.
*
*
* <p>Java class for VAppTemplate complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="VAppTemplate">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}ResourceEntityType">
* &lt;sequence>
* &lt;element name="Owner" type="{http://www.vmware.com/vcloud/v1.5}OwnerType" minOccurs="0"/>
* &lt;element name="Children" type="{http://www.vmware.com/vcloud/v1.5}VAppTemplateChildrenType" minOccurs="0"/>
* &lt;element ref="{http://schemas.dmtf.org/ovf/envelope/1}Section" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element name="VAppScopedLocalId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="ovfDescriptorUploaded" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="goldMaster" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VAppTemplate", propOrder = {
"owner",
"children",
"section",
"vAppScopedLocalId"
})
public class VAppTemplate
extends ResourceEntityType<VAppTemplate>
{
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromVAppTemplate(this);
}
public static class Builder extends ResourceEntityType.Builder<VAppTemplate> {
private Owner owner;
private VAppTemplateChildren children;
private List<JAXBElement<? extends Section<?>>> sections;
private String vAppScopedLocalId;
private Boolean ovfDescriptorUploaded;
private Boolean goldMaster;
/**
* @see VAppTemplate#getOwner()
*/
public Builder owner(Owner owner) {
this.owner = owner;
return this;
}
/**
* @see VAppTemplate#getChildren()
*/
public Builder children(VAppTemplateChildren children) {
this.children = children;
return this;
}
/**
* @see VAppTemplate#getExtend()
*/
public Builder extend(List<JAXBElement<? extends Section<?>>> sections) {
this.sections = sections;
return this;
}
/**
* @see VAppTemplate#getVAppScopedLocalId()
*/
public Builder vAppScopedLocalId(String vAppScopedLocalId) {
this.vAppScopedLocalId = vAppScopedLocalId;
return this;
}
/**
* @see VAppTemplate#getOvfDescriptorUploaded()
*/
public Builder ovfDescriptorUploaded(Boolean ovfDescriptorUploaded) {
this.ovfDescriptorUploaded = ovfDescriptorUploaded;
return this;
}
/**
* @see VAppTemplate#getGoldMaster()
*/
public Builder goldMaster(Boolean goldMaster) {
this.goldMaster = goldMaster;
return this;
}
public VAppTemplate build() {
VAppTemplate vAppTemplate = new VAppTemplate(sections);
vAppTemplate.setOwner(owner);
vAppTemplate.setChildren(children);
vAppTemplate.setVAppScopedLocalId(vAppScopedLocalId);
vAppTemplate.setOvfDescriptorUploaded(ovfDescriptorUploaded);
vAppTemplate.setGoldMaster(goldMaster);
return vAppTemplate;
}
@Override
public Builder fromResourceEntityType(ResourceEntityType<VAppTemplate> in) {
return Builder.class.cast(super.fromResourceEntityType(in));
}
public Builder fromVAppTemplate(VAppTemplate in) {
return fromResourceEntityType(in)
.owner(in.getOwner())
.children(in.getChildren())
.extend(in.getSections())
.vAppScopedLocalId(in.getVAppScopedLocalId())
.ovfDescriptorUploaded(in.isOvfDescriptorUploaded())
.goldMaster(in.isGoldMaster());
}
}
private VAppTemplate() {
// For JAXB and builder use
}
private VAppTemplate(List<JAXBElement<? extends Section<?>>> sections) {
this.sections = sections;
}
@XmlElement(name = "Owner")
protected Owner owner;
@XmlElement(name = "Children")
protected VAppTemplateChildren children;
@XmlElementRef(name = "Section", namespace = "http://schemas.dmtf.org/ovf/envelope/1", type = JAXBElement.class)
protected List<JAXBElement<? extends Section<?>>> sections;
@XmlElement(name = "VAppScopedLocalId")
protected String vAppScopedLocalId;
@XmlAttribute
protected Boolean ovfDescriptorUploaded;
@XmlAttribute
protected Boolean goldMaster;
/**
* Gets the value of the owner property.
*
* @return
* possible object is
* {@link Owner }
*
*/
public Owner getOwner() {
return owner;
}
/**
* Sets the value of the owner property.
*
* @param value
* allowed object is
* {@link Owner }
*
*/
public void setOwner(Owner value) {
this.owner = value;
}
/**
* Gets the value of the children property.
*
* @return
* possible object is
* {@link VAppTemplateChildren }
*
*/
public VAppTemplateChildren getChildren() {
return children;
}
/**
* Sets the value of the children property.
*
* @param value
* allowed object is
* {@link VAppTemplateChildren }
*
*/
public void setChildren(VAppTemplateChildren value) {
this.children = value;
}
/**
*
* Contains ovf sections for vApp template.
* Gets the value of the section property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the section property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSection().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link SectionType }{@code >}
* {@link JAXBElement }{@code <}{@link VirtualHardwareSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link LeaseSettingsSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link EulaSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link RuntimeInfoSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link AnnotationSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link DeploymentOptionSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link StartupSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link ResourceAllocationSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link NetworkConnectionSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link CustomizationSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link ProductSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link GuestCustomizationSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link OperatingSystemSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link NetworkConfigSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link NetworkSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link DiskSectionType }{@code >}
* {@link JAXBElement }{@code <}{@link InstallSectionType }{@code >}
*
*
*/
public List<JAXBElement<? extends Section<?>>> getSections() {
if (sections == null) {
sections = new ArrayList<JAXBElement<? extends Section<?>>>();
}
return this.sections;
}
/**
* Gets the value of the vAppScopedLocalId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVAppScopedLocalId() {
return vAppScopedLocalId;
}
/**
* Sets the value of the vAppScopedLocalId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVAppScopedLocalId(String value) {
this.vAppScopedLocalId = value;
}
/**
* Gets the value of the ovfDescriptorUploaded property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isOvfDescriptorUploaded() {
return ovfDescriptorUploaded;
}
/**
* Sets the value of the ovfDescriptorUploaded property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setOvfDescriptorUploaded(Boolean value) {
this.ovfDescriptorUploaded = value;
}
/**
* Gets the value of the goldMaster property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public boolean isGoldMaster() {
if (goldMaster == null) {
return false;
} else {
return goldMaster;
}
}
/**
* Sets the value of the goldMaster property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setGoldMaster(Boolean value) {
this.goldMaster = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
VAppTemplate that = VAppTemplate.class.cast(o);
return equal(owner, that.owner) &&
equal(children, that.children) &&
equal(sections, that.sections) &&
equal(vAppScopedLocalId, that.vAppScopedLocalId) &&
equal(ovfDescriptorUploaded, that.ovfDescriptorUploaded) &&
equal(goldMaster, that.goldMaster);
}
@Override
public int hashCode() {
return Objects.hashCode(owner,
children,
sections,
vAppScopedLocalId,
ovfDescriptorUploaded,
goldMaster);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("owner", owner)
.add("children", children)
.add("sections", sections)
.add("vAppScopedLocalId", vAppScopedLocalId)
.add("ovfDescriptorUploaded", ovfDescriptorUploaded)
.add("goldMaster", goldMaster).toString();
}
}

View File

@ -0,0 +1,158 @@
/**
* 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.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
/**
*
* Represents vApp template children.
*
*
* <p>Java class for VAppTemplateChildren complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="VAppTemplateChildren">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
* &lt;sequence>
* &lt;element name="Vm" type="{http://www.vmware.com/vcloud/v1.5}VAppTemplateType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VAppTemplateChildren", propOrder = {
"vm"
})
public class VAppTemplateChildren {
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromVAppTemplateChildren(this);
}
public static class Builder {
private List<VAppTemplate> vm;
/**
* @see VAppTemplateChildren#getVm()
*/
public Builder vm(List<VAppTemplate> vm) {
this.vm = vm;
return this;
}
public VAppTemplateChildren build() {
VAppTemplateChildren vAppTemplateChildren = new VAppTemplateChildren(vm);
return vAppTemplateChildren;
}
public Builder fromVAppTemplateChildren(VAppTemplateChildren in) {
return vm(in.getVm());
}
}
private VAppTemplateChildren() {
// For JAXB and builder use
}
private VAppTemplateChildren(List<VAppTemplate> vm) {
this.vm = vm;
}
@XmlElement(name = "Vm")
protected List<VAppTemplate> vm;
/**
* Gets the value of the vm property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the vm property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getVm().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link VAppTemplateType }
*
*
*/
public List<VAppTemplate> getVm() {
if (vm == null) {
vm = new ArrayList<VAppTemplate>();
}
return this.vm;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
VAppTemplateChildren that = VAppTemplateChildren.class.cast(o);
return equal(vm, that.vm);
}
@Override
public int hashCode() {
return Objects.hashCode(vm);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("vm", vm).toString();
}
}

View File

@ -0,0 +1,641 @@
/**
* 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 static com.google.common.base.Preconditions.checkNotNull;
import java.net.URI;
import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import com.google.common.base.Objects;
import com.google.common.collect.Sets;
/**
*
* Represents a virtual data center (vDC).
*
*
* <p>Java class for Vdc complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Vdc">
* &lt;complexContent>
* &lt;extension base="{http://www.vmware.com/vcloud/v1.5}EntityType">
* &lt;sequence>
* &lt;element name="AllocationModel" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="StorageCapacity" type="{http://www.vmware.com/vcloud/v1.5}CapacityWithUsageType"/>
* &lt;element name="ComputeCapacity" type="{http://www.vmware.com/vcloud/v1.5}ComputeCapacityType"/>
* &lt;element name="ResourceEntities" type="{http://www.vmware.com/vcloud/v1.5}ResourceEntitiesType" minOccurs="0"/>
* &lt;element name="AvailableNetworks" type="{http://www.vmware.com/vcloud/v1.5}AvailableNetworksType" minOccurs="0"/>
* &lt;element name="Capabilities" type="{http://www.vmware.com/vcloud/v1.5}CapabilitiesType" minOccurs="0"/>
* &lt;element name="NicQuota" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="NetworkQuota" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="VmQuota" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* &lt;element name="IsEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="status" type="{http://www.w3.org/2001/XMLSchema}int" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "Vdc")
@XmlType(propOrder = {
"allocationModel",
"storageCapacity",
"computeCapacity",
"resourceEntities",
"availableNetworks",
"capabilities",
"nicQuota",
"networkQuota",
"vmQuota",
"isEnabled"
})
@XmlSeeAlso({
// AdminVdc.class
})
public class Vdc
extends EntityType<Vdc>
{
@SuppressWarnings("unchecked")
public static Builder builder() {
return new Builder();
}
public Builder toBuilder() {
return new Builder().fromVdc(this);
}
public static class Builder extends EntityType.Builder<Vdc> {
private String allocationModel;
private CapacityWithUsage storageCapacity;
private ComputeCapacity computeCapacity;
private ResourceEntities resourceEntities;
private AvailableNetworks availableNetworks;
private Capabilities capabilities;
private int nicQuota;
private int networkQuota;
private Integer vmQuota;
private Boolean isEnabled;
private Integer status;
/**
* @see Vdc#getAllocationModel()
*/
public Builder allocationModel(String allocationModel) {
this.allocationModel = allocationModel;
return this;
}
/**
* @see Vdc#getStorageCapacity()
*/
public Builder storageCapacity(CapacityWithUsage storageCapacity) {
this.storageCapacity = storageCapacity;
return this;
}
/**
* @see Vdc#getComputeCapacity()
*/
public Builder computeCapacity(ComputeCapacity computeCapacity) {
this.computeCapacity = computeCapacity;
return this;
}
/**
* @see Vdc#getResourceEntities()
*/
public Builder resourceEntities(ResourceEntities resourceEntities) {
this.resourceEntities = resourceEntities;
return this;
}
/**
* @see Vdc#getAvailableNetworks()
*/
public Builder availableNetworks(AvailableNetworks availableNetworks) {
this.availableNetworks = availableNetworks;
return this;
}
/**
* @see Vdc#getCapabilities()
*/
public Builder capabilities(Capabilities capabilities) {
this.capabilities = capabilities;
return this;
}
/**
* @see Vdc#getNicQuota()
*/
public Builder nicQuota(int nicQuota) {
this.nicQuota = nicQuota;
return this;
}
/**
* @see Vdc#getNetworkQuota()
*/
public Builder networkQuota(int networkQuota) {
this.networkQuota = networkQuota;
return this;
}
/**
* @see Vdc#getVmQuota()
*/
public Builder vmQuota(Integer vmQuota) {
this.vmQuota = vmQuota;
return this;
}
/**
* @see Vdc#isEnabled()
*/
public Builder isEnabled(Boolean isEnabled) {
this.isEnabled = isEnabled;
return this;
}
/**
* @see Vdc#getStatus()
*/
public Builder status(Integer status) {
this.status = status;
return this;
}
public Vdc build() {
Vdc vdc = new Vdc();
vdc.setAllocationModel(allocationModel);
vdc.setStorageCapacity(storageCapacity);
vdc.setComputeCapacity(computeCapacity);
vdc.setResourceEntities(resourceEntities);
vdc.setAvailableNetworks(availableNetworks);
vdc.setCapabilities(capabilities);
vdc.setNicQuota(nicQuota);
vdc.setNetworkQuota(networkQuota);
vdc.setVmQuota(vmQuota);
vdc.setIsEnabled(isEnabled);
vdc.setStatus(status);
return vdc;
}
/**
* @see EntityType#getName()
*/
public Builder name(String name) {
super.name(name);
return this;
}
/**
* @see EntityType#getDescription()
*/
public Builder description(String description) {
super.description(description);
return this;
}
/**
* @see EntityType#getId()
*/
@Override
public Builder id(String id) {
this.id = id;
return this;
}
/**
* @see EntityType#getTasksInProgress()
*/
@Override
public Builder tasksInProgress(TasksInProgress tasksInProgress) {
this.tasksInProgress = tasksInProgress;
return this;
}
/**
* @see ReferenceType#getHref()
*/
@Override
public Builder href(URI href) {
this.href = href;
return this;
}
/**
* @see ReferenceType#getType()
*/
@Override
public Builder type(String type) {
this.type = type;
return this;
}
/**
* @see ReferenceType#getLinks()
*/
@Override
public Builder links(Set<Link> links) {
this.links = Sets.newLinkedHashSet(checkNotNull(links, "links"));
return this;
}
/**
* @see ReferenceType#getLinks()
*/
@Override
public Builder link(Link link) {
this.links.add(checkNotNull(link, "link"));
return this;
}
@Override
public Builder fromEntityType(EntityType<Vdc> in) {
return Builder.class.cast(super.fromEntityType(in));
}
public Builder fromVdc(Vdc in) {
return fromEntityType(in)
.allocationModel(in.getAllocationModel())
.storageCapacity(in.getStorageCapacity())
.computeCapacity(in.getComputeCapacity())
.resourceEntities(in.getResourceEntities())
.availableNetworks(in.getAvailableNetworks())
.capabilities(in.getCapabilities())
.nicQuota(in.getNicQuota())
.networkQuota(in.getNetworkQuota())
.vmQuota(in.getVmQuota())
.isEnabled(in.isEnabled())
.status(in.getStatus());
}
}
private Vdc() {
// For JAXB and builder use
}
@XmlElement(name = "AllocationModel", required = true)
protected String allocationModel;
@XmlElement(name = "StorageCapacity", required = true)
protected CapacityWithUsage storageCapacity;
@XmlElement(name = "ComputeCapacity", required = true)
protected ComputeCapacity computeCapacity;
@XmlElement(name = "ResourceEntities")
protected ResourceEntities resourceEntities;
@XmlElement(name = "AvailableNetworks")
protected AvailableNetworks availableNetworks;
@XmlElement(name = "Capabilities")
protected Capabilities capabilities;
@XmlElement(name = "NicQuota")
protected int nicQuota;
@XmlElement(name = "NetworkQuota")
protected int networkQuota;
@XmlElement(name = "VmQuota")
protected Integer vmQuota;
@XmlElement(name = "IsEnabled")
protected Boolean isEnabled;
@XmlAttribute
protected Integer status;
/**
* Gets the value of the allocationModel property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAllocationModel() {
return allocationModel;
}
/**
* Sets the value of the allocationModel property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAllocationModel(String value) {
this.allocationModel = value;
}
/**
* Gets the value of the storageCapacity property.
*
* @return
* possible object is
* {@link CapacityWithUsage }
*
*/
public CapacityWithUsage getStorageCapacity() {
return storageCapacity;
}
/**
* Sets the value of the storageCapacity property.
*
* @param value
* allowed object is
* {@link CapacityWithUsage }
*
*/
public void setStorageCapacity(CapacityWithUsage value) {
this.storageCapacity = value;
}
/**
* Gets the value of the computeCapacity property.
*
* @return
* possible object is
* {@link ComputeCapacity }
*
*/
public ComputeCapacity getComputeCapacity() {
return computeCapacity;
}
/**
* Sets the value of the computeCapacity property.
*
* @param value
* allowed object is
* {@link ComputeCapacity }
*
*/
public void setComputeCapacity(ComputeCapacity value) {
this.computeCapacity = value;
}
/**
* Gets the value of the resourceEntities property.
*
* @return
* possible object is
* {@link ResourceEntities }
*
*/
public ResourceEntities getResourceEntities() {
return resourceEntities;
}
/**
* Sets the value of the resourceEntities property.
*
* @param value
* allowed object is
* {@link ResourceEntities }
*
*/
public void setResourceEntities(ResourceEntities value) {
this.resourceEntities = value;
}
/**
* Gets the value of the availableNetworks property.
*
* @return
* possible object is
* {@link AvailableNetworks }
*
*/
public AvailableNetworks getAvailableNetworks() {
return availableNetworks;
}
/**
* Sets the value of the availableNetworks property.
*
* @param value
* allowed object is
* {@link AvailableNetworks }
*
*/
public void setAvailableNetworks(AvailableNetworks value) {
this.availableNetworks = value;
}
/**
* Gets the value of the capabilities property.
*
* @return
* possible object is
* {@link Capabilities }
*
*/
public Capabilities getCapabilities() {
return capabilities;
}
/**
* Sets the value of the capabilities property.
*
* @param value
* allowed object is
* {@link Capabilities }
*
*/
public void setCapabilities(Capabilities value) {
this.capabilities = value;
}
/**
* Gets the value of the nicQuota property.
*
*/
public int getNicQuota() {
return nicQuota;
}
/**
* Sets the value of the nicQuota property.
*
*/
public void setNicQuota(int value) {
this.nicQuota = value;
}
/**
* Gets the value of the networkQuota property.
*
*/
public int getNetworkQuota() {
return networkQuota;
}
/**
* Sets the value of the networkQuota property.
*
*/
public void setNetworkQuota(int value) {
this.networkQuota = value;
}
/**
* Gets the value of the vmQuota property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getVmQuota() {
return vmQuota;
}
/**
* Sets the value of the vmQuota property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setVmQuota(Integer value) {
this.vmQuota = value;
}
/**
* Gets the value of the isEnabled property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isEnabled() {
return isEnabled;
}
/**
* Sets the value of the isEnabled property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setIsEnabled(Boolean value) {
this.isEnabled = value;
}
/**
* Gets the value of the status property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getStatus() {
return status;
}
/**
* Sets the value of the status property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setStatus(Integer value) {
this.status = value;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Vdc that = Vdc.class.cast(o);
return equal(allocationModel, that.allocationModel) &&
equal(storageCapacity, that.storageCapacity) &&
equal(computeCapacity, that.computeCapacity) &&
equal(resourceEntities, that.resourceEntities) &&
equal(availableNetworks, that.availableNetworks) &&
equal(capabilities, that.capabilities) &&
equal(nicQuota, that.nicQuota) &&
equal(networkQuota, that.networkQuota) &&
equal(vmQuota, that.vmQuota) &&
equal(isEnabled, that.isEnabled) &&
equal(status, that.status);
}
@Override
public int hashCode() {
return Objects.hashCode(allocationModel,
storageCapacity,
computeCapacity,
resourceEntities,
availableNetworks,
capabilities,
nicQuota,
networkQuota,
vmQuota,
isEnabled,
status);
}
@Override
public String toString() {
return Objects.toStringHelper("")
.add("allocationModel", allocationModel)
.add("storageCapacity", storageCapacity)
.add("computeCapacity", computeCapacity)
.add("resourceEntities", resourceEntities)
.add("availableNetworks", availableNetworks)
.add("capabilities", capabilities)
.add("nicQuota", nicQuota)
.add("networkQuota", networkQuota)
.add("vmQuota", vmQuota)
.add("isEnabled", isEnabled)
.add("status", status).toString();
}
}

View File

@ -0,0 +1,189 @@
/**
* 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.features;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.EndpointParam;
import org.jclouds.rest.annotations.ExceptionParser;
import org.jclouds.rest.annotations.JAXBResponseParser;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.binders.BindToXMLPayload;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.CaptureVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.InstantiateVAppParamsType;
import org.jclouds.vcloud.director.v1_5.domain.Media;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.UploadVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.VApp;
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
import org.jclouds.vcloud.director.v1_5.functions.ReferenceToEndpoint;
import org.jclouds.vcloud.director.v1_5.functions.ThrowVCloudErrorOn4xx;
import com.google.common.util.concurrent.ListenableFuture;
/**
* @see VdcClient
* @author danikov
*/
@RequestFilters(AddVCloudAuthorizationToRequest.class)
public interface VdcAsyncClient {
/**
* @see VdcClient#getVdc(Reference)
*/
@GET
@Consumes
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Vdc> getVdc(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef);
/**
* @see VdcClient#captureVApp(Reference, CaptureVAppParams)
*/
@POST
@Path("/action/captureVApp")
@Consumes(VCloudDirectorMediaType.V_APP_TEMPLATE)
@Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VAppTemplate> captureVApp(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef,
@BinderParam(BindToXMLPayload.class) CaptureVAppParams params);
/**
* @see VdcClient#cloneMedia(Reference, CloneMediaParams)
*/
@POST
@Path("/action/cloneMedia")
@Consumes(VCloudDirectorMediaType.MEDIA)
@Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Media> cloneMedia(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef,
@BinderParam(BindToXMLPayload.class) CloneMediaParams params);
/**
* @see VdcClient#cloneVApp(Reference, CloneVAppParams)
*/
@POST
@Path("/action/cloneVApp")
@Consumes(VCloudDirectorMediaType.V_APP)
@Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VApp> cloneVApp(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef,
@BinderParam(BindToXMLPayload.class) CloneVAppParams params);
/**
* @see VdcClient#cloneVAppTemplate(Reference, CloneVAppTemplateParams)
*/
@POST
@Path("/action/cloneVAppTemplate")
@Consumes(VCloudDirectorMediaType.V_APP_TEMPLATE)
@Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VAppTemplate> cloneVAppTemplate(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef,
@BinderParam(BindToXMLPayload.class) CloneVAppTemplateParams params);
/**
* @see VdcClient#composeVApp(Reference, ComposeVAppParams)
*/
@POST
@Path("/action/composeVApp")
@Consumes(VCloudDirectorMediaType.V_APP)
@Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VApp> composeVApp(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef,
@BinderParam(BindToXMLPayload.class) ComposeVAppParams params);
/**
* @see VdcClient#instantiateVApp(Reference, InstantiateVAppParamsType)
*/
@POST
@Path("/action/instantiateVApp")
@Consumes(VCloudDirectorMediaType.V_APP)
@Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VApp> instantiateVApp(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef,
@BinderParam(BindToXMLPayload.class) InstantiateVAppParamsType<?> params);
/**
* @see VdcClient#uploadVAppTemplate(Reference, UploadVAppTemplateParams)
*/
@POST
@Path("/action/uploadVAppTemplate")
@Consumes(VCloudDirectorMediaType.V_APP_TEMPLATE)
@Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<VAppTemplate> uploadVAppTemplate(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef,
@BinderParam(BindToXMLPayload.class) UploadVAppTemplateParams params);
/**
* @see VdcClient#createMedia(Reference, Media)
*/
@POST
@Path("/media")
@Consumes(VCloudDirectorMediaType.MEDIA)
@Produces(VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Media> createMedia(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef,
@BinderParam(BindToXMLPayload.class) Media media);
/**
* @see VdcClient#getMetadata(Reference)
*/
@GET
@Path("/metadata")
@Consumes
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<Metadata> getMetadata(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef);
/**
* @see VdcClient#getMetadataEntry(Reference, String)
*/
@GET
@Path("/metadata/{key}")
@Consumes
@JAXBResponseParser
@ExceptionParser(ThrowVCloudErrorOn4xx.class)
ListenableFuture<MetadataValue> getMetadataValue(@EndpointParam(parser = ReferenceToEndpoint.class) Reference vdcRef ,
@PathParam("key") String key);
}

View File

@ -0,0 +1,160 @@
/**
* 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.features;
import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout;
import org.jclouds.vcloud.director.v1_5.domain.CaptureVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.InstantiateVAppParamsType;
import org.jclouds.vcloud.director.v1_5.domain.Media;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.UploadVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.VApp;
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
/**
* Provides synchronous access to a vDC.
* <p/>
*
* @see VdcAsyncClient
* @see <a href= "http://support.theenterprisecloud.com/kb/default.asp?id=984&Lang=1&SID=" />
* @author danikov
*/
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
public interface VdcClient {
/**
* Retrieves a vdc.
*
* @return the vdc or null if not found
*/
Vdc getVdc(Reference vdcRef);
/**
* Captures a vApp into vApp template.
* The status of vApp template will be in UNRESOLVED(0) until the capture task is finished.
*
* @return a VApp resource which will contain a task.
* The user should should wait for this task to finish to be able to use the vApp.
*/
VAppTemplate captureVApp(Reference vdcRef, CaptureVAppParams params);
/**
* Clones a media into new one.
* The status of the returned media is UNRESOLVED(0) until the task for cloning finish.
*
* @return a Media resource which will contain a task.
* The user should monitor the contained task status in order to check when it is completed.
*/
Media cloneMedia(Reference vdcRef, CloneMediaParams params);
/**
* Clones a vApp into new one. The status of vApp will be in UNRESOLVED(0) until the clone task is finished.
*
* @return a VApp resource which will contain a task.
* The user should should wait for this task to finish to be able to use the vApp.
*/
VApp cloneVApp(Reference vdcRef, CloneVAppParams params);
/**
* Clones a vApp template into new one.
* The status of vApp template will be in UNRESOLVED(0) until the clone task is finished.
*
* @return a VAppTemplate resource which will contain a task.
* The user should should wait for this task to finish to be able to use the VAppTemplate.
*/
VAppTemplate cloneVAppTemplate(Reference vdcRef, CloneVAppTemplateParams params);
/**
* Composes a new vApp using VMs from other vApps or vApp templates. The vCloud API supports
* composing a vApp from any combination of vApp templates, vApps, or virtual machines.
* When you compose a vApp, all children of each composition source become peers in the
* Children collection of the composed vApp. To compose a vApp, a client makes a compose
* vApp request whose body is a ComposeVAppParams element, includes the following information:
* - An InstantiationParams element that applies to the composed vApp itself and any vApp
* templates referenced in Item elements. - A SourcedItem element for each virtual machine,
* vApp, or vAppTemplate to include in the composition. Each SourcedItem can contain the
* following elements: - A required Source element whose href attribute value is a reference
* to a vApp template, vApp, or VM to include in the composition. If the Source element
* references a VM, the Item must also include an InstantiationParams element specific to
* that VM. - An optional NetworkAssignment element that specifies how the network connections
* of child VM elements are mapped to vApp networks in the parent. - If any of the composition
* items is subject to a EULA, the ComposeVAppParams element must include an AllEULAsAccepted
* element that has a value of true, indicating that you accept the EULA. Otherwise, composition
* fails. The composed vApp must be deployed and powered on before it can be used. The status
* of vApp will be UNRESOLVED(0) until the compose task is finished.
*
* @return a VApp resource which will contain a task.
* The user should should wait for this task to finish to be able to use the vApp.
*/
VApp composeVApp(Reference vdcRef, ComposeVAppParams params);
/**
* Instantiate a vApp template into a new vApp.
* The status of vApp will be in UNRESOLVED(0) until the instantiate task is finished.
*
* @return a VApp resource which will contain a task.
* The user should should wait for this task to finish to be able to use the vApp.
*/
VApp instantiateVApp(Reference vdcRef, InstantiateVAppParamsType<?> params);
/**
* Uploading vApp template to a vDC. The operation is separate on several steps:
* 1. creating empty vApp template entity
* 2. uploading an OVF of vApp template
* 3. uploading disks described from the OVF
* 4. finishing task for uploading
* The status of vApp template will be NOT_READY(0) until the ovf and all disks are uploaded
* to the transfer site. After this a task will run on the vApp template uploading.
*
* @return a VAppTemplate resource which will contain a task.
* The user should should wait for this task to finish to be able to use the VAppTemplate.
*/
VAppTemplate uploadVAppTemplate(Reference vdcRef, UploadVAppTemplateParams params);
/**
* Creates a media (and present upload link for the floppy/iso file).
*
* @return The response will return a link to transfer site to be able to continue with uploading the media.
*/
Media createMedia(Reference vdcRef, Media media);
/**
* Retrieves an list of the vdc's metadata
*
* @return a list of metadata
*/
Metadata getMetadata(Reference vdcRef);
/**
* Retrieves a metadata value
*
* @return the metadata value, or null if not found
*/
MetadataValue getMetadataValue(Reference vdcRef, String key);
}

View File

@ -20,6 +20,8 @@ package org.jclouds.vcloud.director.v1_5.domain;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.CONDITION_FMT; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.CONDITION_FMT;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.MUST_BE_WELL_FORMED_FMT; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.MUST_BE_WELL_FORMED_FMT;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_ATTRB_REQ;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_EQ;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.MUST_CONTAIN_FMT; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.MUST_CONTAIN_FMT;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.NOT_NULL_OBJECT_FMT; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.NOT_NULL_OBJECT_FMT;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_GTE_0; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_GTE_0;
@ -269,19 +271,15 @@ public class Checks {
if (config.getIpScope() != null) { if (config.getIpScope() != null) {
checkIpScope(config.getIpScope()); checkIpScope(config.getIpScope());
} }
if (config.getParentNetwork() != null) { if (config.getParentNetwork() != null) {
checkReferenceType(config.getParentNetwork()); checkReferenceType(config.getParentNetwork());
} }
if (config.getNetworkFeatures() != null) { if (config.getNetworkFeatures() != null) {
checkNetworkFeatures(config.getNetworkFeatures()); checkNetworkFeatures(config.getNetworkFeatures());
} }
if (config.getSyslogServerSettings() != null) { if (config.getSyslogServerSettings() != null) {
checkSyslogServerSettings(config.getSyslogServerSettings()); checkSyslogServerSettings(config.getSyslogServerSettings());
} }
if (config.getRouterInfo() != null) { if (config.getRouterInfo() != null) {
checkRouterInfo(config.getRouterInfo()); checkRouterInfo(config.getRouterInfo());
} }
@ -327,7 +325,6 @@ public class Checks {
if (settings.getSyslogServerIp1() != null) { if (settings.getSyslogServerIp1() != null) {
checkIpAddress(settings.getSyslogServerIp1()); checkIpAddress(settings.getSyslogServerIp1());
} }
if (settings.getSyslogServerIp2() != null) { if (settings.getSyslogServerIp2() != null) {
checkIpAddress(settings.getSyslogServerIp2()); checkIpAddress(settings.getSyslogServerIp2());
} }
@ -370,6 +367,95 @@ public class Checks {
public static void checkIpAddress(String ip) { public static void checkIpAddress(String ip) {
InetAddresses.isInetAddress(ip); InetAddresses.isInetAddress(ip);
} }
public static void checkComputeCapacity(ComputeCapacity computeCapacity) {
// Check required fields
assertNotNull(computeCapacity.getCpu(), "The cpu attribute of a ComputeCapacity must be set");
checkCapacityWithUsage(computeCapacity.getCpu());
assertNotNull(computeCapacity.getMemory(), "The memory attribute of a ComputeCapacity must be set");
checkCapacityWithUsage(computeCapacity.getMemory());
}
public static void checkCapacityWithUsage(CapacityWithUsage capacityWithUsage) {
// Check optional fields
if (capacityWithUsage.getUsed() != null) {
assertTrue(capacityWithUsage.getUsed() >= 0, "used must be greater than or equal to 0");
}
if (capacityWithUsage.getOverhead() != null) {
assertTrue(capacityWithUsage.getOverhead() >= 0, "overhead must be greater than or equal to 0");
}
// Check parent type
checkCapacityType(capacityWithUsage);
}
public static void checkCapacityType(CapacityType<?> capacity) {
// Check required fields
assertNotNull(capacity.getUnits(), "The unit attribute of a CapacityWithUsage must be set");
assertNotNull(capacity.getLimit(), "The limit attribute of a CapacityWithUsage must be set");
assertTrue(capacity.getLimit() >= 0, "Limit must be greater than or equal to 0");
// Check optional fields
if (capacity.getAllocated() != null) {
assertTrue(capacity.getAllocated() >= 0, "allocated must be greater than or equal to 0");
}
}
public static void checkResourceEntities(ResourceEntities resourceEntities) {
for (Reference resourceEntity : resourceEntities.getResourceEntities()) {
checkReferenceType(resourceEntity);
}
}
public static void checkAvailableNetworks(AvailableNetworks availableNetworks) {
for (Reference network : availableNetworks.getNetworks()) {
checkReferenceType(network);
}
}
public static void checkCapabilities(Capabilities capabilities) {
// Check optional fields
if (capabilities.getSupportedHardwareVersions() != null) {
checkSupportedHardwareVersions(capabilities.getSupportedHardwareVersions());
}
}
public static void checkSupportedHardwareVersions(SupportedHardwareVersions supportedHardwareVersions) {
for (String supportedHardwareVersion : supportedHardwareVersions.getSupportedHardwareVersions()) {
// NOTE supportedHardwareVersion cannot be checked?
}
}
public static void checkMetadataFor(String client, Metadata metadata) {
for (MetadataEntry entry : metadata.getMetadataEntries()) {
// Check required fields
assertNotNull(entry.getKey(),
String.format(OBJ_FIELD_ATTRB_REQ, client, "MetadataEntry", entry.getKey(), "key"));
assertNotNull(entry.getValue(),
String.format(OBJ_FIELD_ATTRB_REQ, client, "MetadataEntry", entry.getValue(), "value"));
// Check parent type
checkResourceType(entry);
}
// Check parent type
checkResourceType(metadata);
}
public static void checkMetadataValueFor(String client, MetadataValue metadataValue) {
// Check required fields
String value = metadataValue.getValue();
assertNotNull(value,
String.format(OBJ_FIELD_ATTRB_REQ, client, "MetadataEntry",
metadataValue.toString(), "value"));
assertEquals(value, "value",
String.format(OBJ_FIELD_EQ, client, "metadataEntry.value", "value", value));
// Check parent type
checkResourceType(metadataValue);
}
public static void checkVApp(VApp vApp) { public static void checkVApp(VApp vApp) {
// TODO Auto-generated method stub // TODO Auto-generated method stub

View File

@ -65,7 +65,6 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
@BeforeClass(inheritGroups = true) @BeforeClass(inheritGroups = true)
@Override @Override
public void setupRequiredClients() { public void setupRequiredClients() {
String networkId = "a604f3c2-0343-453e-ae1f-cddac5b7bd94"; // TODO: inject
networkRef = Reference.builder() networkRef = Reference.builder()
.type("application/vnd.vmware.vcloud.orgNetwork+xml") .type("application/vnd.vmware.vcloud.orgNetwork+xml")
.name("") .name("")

View File

@ -0,0 +1,568 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
*(Link.builder().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(Link.builder().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.features;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.fail;
import java.net.URI;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.AvailableNetworks;
import org.jclouds.vcloud.director.v1_5.domain.Capabilities;
import org.jclouds.vcloud.director.v1_5.domain.CapacityWithUsage;
import org.jclouds.vcloud.director.v1_5.domain.CaptureVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.ComputeCapacity;
import org.jclouds.vcloud.director.v1_5.domain.Error;
import org.jclouds.vcloud.director.v1_5.domain.InstantiateVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.Link;
import org.jclouds.vcloud.director.v1_5.domain.Media;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.ResourceEntities;
import org.jclouds.vcloud.director.v1_5.domain.SupportedHardwareVersions;
import org.jclouds.vcloud.director.v1_5.domain.UploadVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.VApp;
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorRestClientExpectTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
/**
* Allows us to test a client via its side effects.
*
* @author danikov
*/
@Test(groups = { "unit", "apitests", "user" }, singleThreaded = true, testName = "VdcClientExpectTest")
public class VdcClientExpectTest extends BaseVCloudDirectorRestClientExpectTest {
private Reference vdcRef;
@BeforeClass
public void before() {
String vdcId = "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f";
vdcRef = Reference.builder()
.type("application/vnd.vmware.vcloud.vdc+xml")
.name("")
.href(URI.create(endpoint+"/vdc/"+vdcId))
.id(vdcId)
.build();
}
@Test
public void testGetVdc() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f")
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/vdc.xml", VCloudDirectorMediaType.VDC)
.httpResponseBuilder().build());
Vdc expected = getVdc();
assertEquals(client.getVdcClient().getVdc(vdcRef), expected);
}
@Test
public void testResponse400ForInvalidVdcId() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("GET", "/vdc/NOTAUUID")
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/error400.xml", VCloudDirectorMediaType.ERROR)
.httpResponseBuilder().statusCode(400).build());
Error expected = Error.builder()
.message("validation error : EntityRef has incorrect type, expected type is com.vmware.vcloud.entity.vdc.")
.majorErrorCode(400)
.minorErrorCode("BAD_REQUEST")
.build();
try {
client.getVdcClient().getVdc(vdcRef);
fail("Should give HTTP 400 error");
} catch (VCloudDirectorException vde) {
assertEquals(vde.getError(), expected);
} catch (Exception e) {
fail("Should have thrown a VCloudDirectorException");
}
}
@Test
public void testResponse403ForFakeVdcId() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("GET", "/vdc/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/error403-fake.xml", VCloudDirectorMediaType.ERROR)
.httpResponseBuilder().statusCode(403).build());
Error expected = Error.builder()
.message("No access to entity \"com.vmware.vcloud.entity.vdc:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\".")
.majorErrorCode(403)
.minorErrorCode("ACCESS_TO_RESOURCE_IS_FORBIDDEN")
.build();
try {
client.getVdcClient().getVdc(vdcRef);
fail("Should give HTTP 403 error");
} catch (VCloudDirectorException vde) {
assertEquals(vde.getError(), expected);
} catch (Exception e) {
fail("Should have thrown a VCloudDirectorException");
}
}
@Test(enabled = false)
public void testCaptureVApp() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/vdc.xml", VCloudDirectorMediaType.VDC)
.httpResponseBuilder().build());
VAppTemplate expected = captureVApp();
// TODO: configure params
CaptureVAppParams params = CaptureVAppParams.builder()
.build();
assertEquals(client.getVdcClient().captureVApp(vdcRef, params), expected);
}
@Test(enabled = false)
public void testResponse4xxForCaptureVAppNoParams() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/param/error400.xml", VCloudDirectorMediaType.ERROR)
.httpResponseBuilder().statusCode(400).build());
Error expected = Error.builder()
.message("?")
.majorErrorCode(400)
.minorErrorCode("BAD_REQUEST")
.build();
try {
client.getVdcClient().captureVApp(vdcRef, null);
fail("Should give HTTP 400 error");
} catch (VCloudDirectorException vde) {
assertEquals(vde.getError(), expected);
} catch (Exception e) {
fail("Should have thrown a VCloudDirectorException");
}
}
@Test
public void testCloneMedia() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
.xmlFilePayload("/vdc/params/cloneMedia.xml", VCloudDirectorMediaType.CLONE_MEDIA_PARAMS)
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/cloneMedia.xml", VCloudDirectorMediaType.MEDIA)
.httpResponseBuilder().build());
Media expected = cloneMedia();
// TODO: configure params
CloneMediaParams params = CloneMediaParams.builder()
.build();
assertEquals(client.getVdcClient().cloneMedia(vdcRef, params), expected);
}
@Test(enabled = false)
public void testCloneVApp() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVApp")
.xmlFilePayload("/vdc/params/cloneVApp.xml", VCloudDirectorMediaType.CLONE_V_APP_PARAMS)
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/cloneVApp.xml", VCloudDirectorMediaType.V_APP)
.httpResponseBuilder().build());
VApp expected = cloneVApp();
// TODO: configure params
CloneVAppParams params = CloneVAppParams.builder()
.build();
assertEquals(client.getVdcClient().cloneVApp(vdcRef, params), expected);
}
@Test(enabled = false)
public void testCloneVAppTemplate() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
.xmlFilePayload("/vdc/params/cloneVAppTemplate.xml", VCloudDirectorMediaType.CLONE_V_APP_TEMPLATE_PARAMS)
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/cloneVAppTemplate.xml", VCloudDirectorMediaType.V_APP_TEMPLATE)
.httpResponseBuilder().build());
VAppTemplate expected = cloneVAppTemplate();
// TODO: configure params
CloneVAppTemplateParams params = CloneVAppTemplateParams.builder()
.build();
assertEquals(client.getVdcClient().cloneVAppTemplate(vdcRef, params), expected);
}
@Test(enabled = false)
public void testComposeVApp() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/composeVApp")
.xmlFilePayload("/vdc/params/composeVApp.xml", VCloudDirectorMediaType.COMPOSE_VAPP_PARAMS)
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/composeVApp.xml", VCloudDirectorMediaType.V_APP)
.httpResponseBuilder().build());
VApp expected = composeVApp();
// TODO: configure params
ComposeVAppParams params = ComposeVAppParams.builder()
.build();
assertEquals(client.getVdcClient().composeVApp(vdcRef, params), expected);
}
@Test(enabled = false)
public void testInstantiateVAppTemplate() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/instantiateVAppTemplate")
.xmlFilePayload("/vdc/params/instantiateVAppTemplate.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/instantiateVAppTemplate.xml", VCloudDirectorMediaType.V_APP)
.httpResponseBuilder().build());
VApp expected = instantiateVAppTemplate();
// TODO: configure params
InstantiateVAppTemplateParams params = InstantiateVAppTemplateParams.builder()
.build();
assertEquals(client.getVdcClient().instantiateVApp(vdcRef, params), expected);
}
@Test(enabled = false)
public void testUploadVAppTemplate() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/uploadVAppTemplate")
.xmlFilePayload("/vdc/params/uploadVAppTemplate.xml", VCloudDirectorMediaType.UPLOAD_VAPP_TEMPLATE_PARAMS)
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/uploadVAppTemplate.xml", VCloudDirectorMediaType.V_APP_TEMPLATE)
.httpResponseBuilder().build());
VAppTemplate expected = uploadVAppTemplate();
// TODO: configure params
UploadVAppTemplateParams params = UploadVAppTemplateParams.builder()
.build();
assertEquals(client.getVdcClient().uploadVAppTemplate(vdcRef, params), expected);
}
@Test
public void testCreateMedia() {
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/media")
.xmlFilePayload("/vdc/params/createMedia.xml", VCloudDirectorMediaType.MEDIA)
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/createMedia.xml", VCloudDirectorMediaType.MEDIA)
.httpResponseBuilder().build());
Media expected = createMedia();
// TODO: configure params
Media createMedia = Media.builder()
.build();
assertEquals(client.getVdcClient().createMedia(vdcRef, createMedia), expected);
}
@Test
public void testGetMetadata() {
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata")
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/metadata.xml", VCloudDirectorMediaType.METADATA)
.httpResponseBuilder().build());
Reference mediaRef = Reference.builder().href(vdcUri).build();
Metadata expected = metadata();
assertEquals(client.getMediaClient().getMetadata(mediaRef), expected);
}
public void testGetMetadataValue() {
URI vdcUri = URI.create("https://vcloudbeta.bluelock.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
new VcloudHttpRequestPrimer()
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata/key")
.acceptAnyMedia()
.httpRequestBuilder().build(),
new VcloudHttpResponsePrimer()
.xmlFilePayload("/vdc/metadataValue.xml", VCloudDirectorMediaType.METADATA_VALUE)
.httpResponseBuilder().build());
MetadataValue expected = metadataValue();
Reference mediaRef = Reference.builder().href(vdcUri).build();
assertEquals(client.getVdcClient().getMetadataValue(mediaRef, "key"), expected);
}
public static Vdc getVdc() {
return Vdc.builder()
.status(1)
.name("orgVDC-cloudsoft-Tier1-PAYG")
.id("urn:vcloud:vdc:e9cd3387-ac57-4d27-a481-9bee75e0690f")
.type("application/vnd.vmware.vcloud.vdc+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f"))
.link(Link.builder()
.rel("up")
.type("application/vnd.vmware.vcloud.org+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/org/c076f90a-397a-49fa-89b8-b294c1599cd0"))
.build())
.link(Link.builder()
.rel("down")
.type("application/vnd.vmware.vcloud.metadata+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata"))
.build())
.link(Link.builder()
.rel("add")
.type("application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/uploadVAppTemplate"))
.build())
.link(Link.builder()
.rel("add")
.type("application/vnd.vmware.vcloud.media+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media"))
.build())
.link(Link.builder()
.rel("add")
.type("application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/instantiateVAppTemplate"))
.build())
.link(Link.builder()
.rel("add")
.type("application/vnd.vmware.vcloud.cloneVAppParams+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVApp"))
.build())
.link(Link.builder()
.rel("add")
.type("application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate"))
.build())
.link(Link.builder()
.rel("add")
.type("application/vnd.vmware.vcloud.cloneMediaParams+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia"))
.build())
.link(Link.builder()
.rel("add")
.type("application/vnd.vmware.vcloud.captureVAppParams+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp"))
.build())
.link(Link.builder()
.rel("add")
.type("application/vnd.vmware.vcloud.composeVAppParams+xml")
.href(URI.create("https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/composeVApp"))
.build())
.description("Pay As You go resources for organization cloudsoft ")
.allocationModel("AllocationVApp")
.storageCapacity(CapacityWithUsage.builder()
.units("MB")
.allocated(0l)
.limit(0l)
.used(4519l)
.overhead(0l)
.build())
.computeCapacity(ComputeCapacity.builder()
.cpu(CapacityWithUsage.builder()
.units("MHz")
.allocated(0l)
.limit(0l)
.used(0l)
.overhead(0l)
.build())
.memory(CapacityWithUsage.builder()
.units("MB")
.allocated(0l)
.limit(0l)
.used(0l)
.overhead(0l)
.build())
.build())
.resourceEntities(ResourceEntities.builder()
.resourceEntity(Reference.builder()
.type("application/vnd.vmware.vcloud.vApp+xml")
.name("vcdcap-db9")
.href(URI.create("https://mycloud.greenhousedata.com/api/vApp/vapp-e2a4ab74-ea62-4afa-8bb7-0c11259044fb"))
.build())
.resourceEntity(Reference.builder()
.type("application/vnd.vmware.vcloud.vAppTemplate+xml")
.name("adriancolecap")
.href(URI.create("https://mycloud.greenhousedata.com/api/vAppTemplate/vappTemplate-5571eb21-f532-4506-9737-01a4635a04cb"))
.build())
.resourceEntity(Reference.builder()
.type("application/vnd.vmware.vcloud.media+xml")
.name("DansTestMedia")
.href(URI.create("https://mycloud.greenhousedata.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1"))
.build())
.build())
.availableNetworks(AvailableNetworks.builder()
.network(Reference.builder()
.type("application/vnd.vmware.vcloud.network+xml")
.name("orgNet-cloudsoft-Isolated")
.href(URI.create("https://mycloud.greenhousedata.com/api/network/a604f3c2-0343-453e-ae1f-cddac5b7bd94"))
.build())
.network(Reference.builder()
.type("application/vnd.vmware.vcloud.network+xml")
.name("orgNet-cloudsoft-External")
.href(URI.create("https://mycloud.greenhousedata.com/api/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1"))
.build())
.network(Reference.builder()
.type("application/vnd.vmware.vcloud.network+xml")
.name("orgNet-cloudsoft-Internal-Routed")
.href(URI.create("https://mycloud.greenhousedata.com/api/network/6d7392e2-c816-43fb-99be-f9ebcd70abf6"))
.build())
.build())
.capabilities(Capabilities.builder()
.supportedHardwareVersions(SupportedHardwareVersions.builder()
.supportedHardwareVersion("vmx-04")
.supportedHardwareVersion("vmx-07")
.supportedHardwareVersion("vmx-08")
.build())
.build())
.nicQuota(0)
.networkQuota(10)
.vmQuota(10)
.isEnabled(true)
.build();
}
private VAppTemplate captureVApp() {
// TODO Auto-generated method stub
return null;
}
private Media cloneMedia() {
// TODO Auto-generated method stub
return null;
}
private VApp cloneVApp() {
// TODO Auto-generated method stub
return null;
}
private VAppTemplate cloneVAppTemplate() {
// TODO Auto-generated method stub
return null;
}
private VApp composeVApp() {
// TODO Auto-generated method stub
return null;
}
private VApp instantiateVAppTemplate() {
// TODO Auto-generated method stub
return null;
}
private VAppTemplate uploadVAppTemplate() {
// TODO Auto-generated method stub
return null;
}
private Media createMedia() {
// TODO Auto-generated method stub
return null;
}
private Metadata metadata() {
// TODO Auto-generated method stub
return null;
}
private MetadataValue metadataValue() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -0,0 +1,297 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
*(Link.builder().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(Link.builder().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.features;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_GTE_0;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_REQ;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_FIELD_REQ_LIVE;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.OBJ_REQ_LIVE;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorLiveTestConstants.REF_REQ_LIVE;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import java.net.URI;
import org.jclouds.vcloud.director.v1_5.domain.CaptureVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.Checks;
import org.jclouds.vcloud.director.v1_5.domain.CloneMediaParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.CloneVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.InstantiateVAppParams;
import org.jclouds.vcloud.director.v1_5.domain.Media;
import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.jclouds.vcloud.director.v1_5.domain.UploadVAppTemplateParams;
import org.jclouds.vcloud.director.v1_5.domain.VApp;
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.google.common.collect.Iterables;
/**
* Tests behavior of {@code VdcClient}
*
* @author danikov
*/
@Test(groups = { "live", "apitests", "user" }, testName = "VdcClientLiveTest")
public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
public static final String VDC = "vdc";
/*
* Convenience reference to API client.
*/
protected VdcClient vdcClient;
private Reference vdcRef;
@BeforeClass(inheritGroups = true)
@Override
public void setupRequiredClients() {
vdcRef = Reference.builder()
.type("application/vnd.vmware.vcloud.vdc+xml")
.name("")
.href(URI.create(endpoint+"/vdc/"+vDCId))
.id(vDCId)
.build();
vdcClient = context.getApi().getVdcClient();
}
@Test(testName = "GET /vdc/{id}")
public void testGetVdc() {
// required for testing
assertNotNull(vdcRef, String.format(REF_REQ_LIVE, VDC));
Vdc vdc = vdcClient.getVdc(vdcRef);
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
assertTrue(!vdc.getDescription().equals("DO NOT USE"), "vDC isn't to be used for testing");
// parent type
Checks.checkEntityType(vdc);
// required
assertNotNull(vdc.getAllocationModel(), String.format(OBJ_FIELD_REQ, VDC, "allocationModel"));
assertNotNull(vdc.getStorageCapacity(), String.format(OBJ_FIELD_REQ, VDC, "storageCapacity"));
Checks.checkCapacityWithUsage(vdc.getStorageCapacity());
assertNotNull(vdc.getComputeCapacity(), String.format(OBJ_FIELD_REQ, VDC, "computeCapacity"));
Checks.checkComputeCapacity(vdc.getComputeCapacity());
assertNotNull(vdc.getNicQuota(), String.format(OBJ_FIELD_REQ, VDC, "nicQuota"));
assertTrue(vdc.getNicQuota() >= 0, String.format(OBJ_FIELD_GTE_0, VDC, "nicQuota", vdc.getNicQuota()));
assertNotNull(vdc.getNetworkQuota(), String.format(OBJ_FIELD_REQ, VDC, "networkQuota"));
assertTrue(vdc.getNetworkQuota() >= 0, String.format(OBJ_FIELD_GTE_0, VDC, "networkQuota", vdc.getNetworkQuota()));
// optional
// NOTE isEnabled cannot be checked
if (vdc.getResourceEntities() != null) {
Checks.checkResourceEntities(vdc.getResourceEntities());
}
if (vdc.getAvailableNetworks() != null) {
Checks.checkAvailableNetworks(vdc.getAvailableNetworks());
}
if (vdc.getCapabilities() != null) {
Checks.checkCapabilities(vdc.getCapabilities());
}
if(vdc.getVmQuota() != null) {
assertTrue(vdc.getVmQuota() >= 0, String.format(OBJ_FIELD_GTE_0, VDC, "vmQuota", vdc.getVmQuota()));
}
if(vdc.getVmQuota() != null) {
assertTrue(vdc.getVmQuota() >= 0, String.format(OBJ_FIELD_GTE_0, VDC, "vmQuota", vdc.getVmQuota()));
}
}
@Test(testName = "POST /vdc/{id}/action/captureVApp", enabled = false)
public void testCaptureVApp() {
Reference templateSource = null; // TODO: vApp reference
VAppTemplate template = vdcClient.captureVApp(vdcRef, CaptureVAppParams.builder()
.source(templateSource)
// TODO: test optional params
//.name("")
//.description("")
//.sections(sections) // TODO: ovf sections
.build());
Checks.checkVAppTemplate(template);
// TODO: await task to complete
// TODO: make assertions that the task was successful
}
@Test(testName = "POST /vdc/{id}/action/cloneMedia")
public void testCloneMedia() {
Reference mediaSource = null; // TODO: media reference
Media media = vdcClient.cloneMedia(vdcRef, CloneMediaParams.builder()
.source(mediaSource)
// TODO: test optional params
//.name("")
//.description("")
//.isSourceDelete(true)
.build());
Checks.checkMediaFor(VDC, media);
// TODO: await task to complete
// TODO: make assertions that the task was successful
}
@Test(testName = "POST /vdc/{id}/action/cloneVApp", enabled = false)
public void testCloneVApp() {
Reference vAppSource = null; // TODO: vApp reference
VApp vApp = vdcClient.cloneVApp(vdcRef, CloneVAppParams.builder()
.source(vAppSource)
// TODO: test optional params
//.name("")
//.description("")
//.deploy(true)
//.isSourceDelete(true)
//.powerOn(true)
//.instantiationParams(InstantiationParams.builder()
// .sections(sections) // TODO: ovf sections? various tests?
// .build())
// Reserved. Unimplemented params; may test eventually when implemented
//.vAppParent(vAppParentRef)
//.linkedClone(true)
.build());
Checks.checkVApp(vApp);
// TODO: await task to complete
// TODO: make assertions that the task was successful
}
@Test(testName = "POST /vdc/{id}/action/cloneVAppTemplate", enabled = false)
public void testCloneVAppTemplate() {
Reference templateSource = null; // TODO: vAppTemplate reference
VAppTemplate template = vdcClient.cloneVAppTemplate(vdcRef, CloneVAppTemplateParams.builder()
.source(templateSource)
// TODO: test optional params
//.name("")
//.description("")
//.isSourceDelete(true)
//.sections(sections) // TODO: ovf sections
.build());
Checks.checkVAppTemplate(template);
// TODO: await task to complete
// TODO: make assertions that the task was successful
}
@Test(testName = "POST /vdc/{id}/action/composeVApp", enabled = false)
public void testComposeVApp() {
VApp vApp = vdcClient.composeVApp(vdcRef, ComposeVAppParams.builder()
// TODO: test optional params
//.name("")
//.description("")
//.deploy(true)
//.isSourceDelete(true)
//.powerOn(true)
//.instantiationParams(InstantiationParams.builder()
// .sections(sections) // TODO: ovf sections? various tests?
// .build())
// Reserved. Unimplemented params; may test eventually when implemented
//.linkedClone()
.build());
Checks.checkVApp(vApp);
// TODO: await task to complete
// TODO: make assertions that the task was successful
}
@Test(testName = "POST /vdc/{id}/action/instantiateVAppTemplate", enabled = false)
public void testInstantiateVAppTemplate() {
Reference templateSource = null; // TODO: vApp or vAppTemplate reference
VApp vApp = vdcClient.instantiateVApp(vdcRef, InstantiateVAppParams.builder()
.source(templateSource)
// TODO: test optional params
//.name("")
//.description("")
//.isSourceDelete(true)
.build());
Checks.checkVApp(vApp);
// TODO: await task to complete
// TODO: make assertions that the task was successful
}
@Test(testName = "POST /vdc/{id}/action/uploadVAppTemplate", enabled = false)
public void testUploadVAppTemplate() {
VAppTemplate template = vdcClient.uploadVAppTemplate(vdcRef, UploadVAppTemplateParams.builder()
// TODO: test optional params
//.name("")
//.description("")
//.transferFormat("")
//.manifestRequired(true)
.build());
Checks.checkVAppTemplate(template);
// TODO: await task to complete
// TODO: make assertions that the task was successful
}
@Test(testName = "POST /vdc/{id}/media")
public void testCreateMedia() {
Media media = vdcClient.createMedia(vdcRef, Media.builder()
.name("")
.imageType(Media.ImageType.ISO)
.size(0)
// TODO: test optional params
//.name("")
//.description("")
//.isSourceDelete(true)
.build());
Checks.checkMediaFor(VDC, media);
// TODO: await task to complete
// TODO: make assertions that the task was successful
}
@Test(testName = "GET /network/{id}/metadata")
public void testGetMetadata() {
Metadata metadata = vdcClient.getMetadata(vdcRef);
// required for testing
assertFalse(Iterables.isEmpty(metadata.getMetadataEntries()),
String.format(OBJ_FIELD_REQ_LIVE, VDC, "metadata.entries"));
Checks.checkMetadataFor(VDC, metadata);
}
@Test(testName = "GET /network/{id}/metadata/{key}")
public void testGetMetadataValue() {
MetadataValue metadataValue = vdcClient.getMetadataValue(vdcRef, "key");
Checks.checkMetadataValueFor(VDC, metadataValue);
}
}

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Error xmlns="http://www.vmware.com/vcloud/v1.5" minorErrorCode="BAD_REQUEST" message="validation error : EntityRef has incorrect type, expected type is com.vmware.vcloud.entity.vdc." majorErrorCode="400" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://mycloud.greenhousedata.com/api/v1.5/schema/master.xsd"></Error>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Error xmlns="http://www.vmware.com/vcloud/v1.5" minorErrorCode="ACCESS_TO_RESOURCE_IS_FORBIDDEN" message="No access to entity &quot;com.vmware.vcloud.entity.vdc:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee&quot;." majorErrorCode="403" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://mycloud.greenhousedata.com/api/v1.5/schema/master.xsd"></Error>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Metadata xmlns="http://www.vmware.com/vcloud/v1.5" type="application/vnd.vmware.vcloud.metadata+xml" href="https://vcloudbeta.bluelock.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata" xmlns:xsi="http://www.w3.vdc/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://vcloudbeta.bluelock.com/api/v1.5/schema/master.xsd">
<Link rel="up" type="application/vnd.vmware.vcloud.vdc+xml" href="https://vcloudbeta.bluelock.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f"/>
<MetadataEntry>
<Key>key</Key>
<Value>value</Value>
</MetadataEntry>
</Metadata>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<Vdc xmlns="http://www.vmware.com/vcloud/v1.5" status="1" name="orgVDC-cloudsoft-Tier1-PAYG" id="urn:vcloud:vdc:e9cd3387-ac57-4d27-a481-9bee75e0690f" type="application/vnd.vmware.vcloud.vdc+xml" href="https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://mycloud.greenhousedata.com/api/v1.5/schema/master.xsd">
<Link rel="up" type="application/vnd.vmware.vcloud.org+xml" href="https://mycloud.greenhousedata.com/api/org/c076f90a-397a-49fa-89b8-b294c1599cd0"/>
<Link rel="down" type="application/vnd.vmware.vcloud.metadata+xml" href="https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata"/>
<Link rel="add" type="application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml" href="https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/uploadVAppTemplate"/>
<Link rel="add" type="application/vnd.vmware.vcloud.media+xml" href="https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media"/>
<Link rel="add" type="application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml" href="https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/instantiateVAppTemplate"/>
<Link rel="add" type="application/vnd.vmware.vcloud.cloneVAppParams+xml" href="https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVApp"/>
<Link rel="add" type="application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml" href="https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate"/>
<Link rel="add" type="application/vnd.vmware.vcloud.cloneMediaParams+xml" href="https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia"/>
<Link rel="add" type="application/vnd.vmware.vcloud.captureVAppParams+xml" href="https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp"/>
<Link rel="add" type="application/vnd.vmware.vcloud.composeVAppParams+xml" href="https://mycloud.greenhousedata.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/composeVApp"/>
<Description>Pay As You go resources for organization cloudsoft </Description>
<AllocationModel>AllocationVApp</AllocationModel>
<StorageCapacity>
<Units>MB</Units>
<Allocated>0</Allocated>
<Limit>0</Limit>
<Used>4519</Used>
<Overhead>0</Overhead>
</StorageCapacity>
<ComputeCapacity>
<Cpu>
<Units>MHz</Units>
<Allocated>0</Allocated>
<Limit>0</Limit>
<Used>0</Used>
<Overhead>0</Overhead>
</Cpu>
<Memory>
<Units>MB</Units>
<Allocated>0</Allocated>
<Limit>0</Limit>
<Used>0</Used>
<Overhead>0</Overhead>
</Memory>
</ComputeCapacity>
<ResourceEntities>
<ResourceEntity type="application/vnd.vmware.vcloud.vApp+xml" name="vcdcap-db9" href="https://mycloud.greenhousedata.com/api/vApp/vapp-e2a4ab74-ea62-4afa-8bb7-0c11259044fb"/>
<ResourceEntity type="application/vnd.vmware.vcloud.vAppTemplate+xml" name="adriancolecap" href="https://mycloud.greenhousedata.com/api/vAppTemplate/vappTemplate-5571eb21-f532-4506-9737-01a4635a04cb"/>
<ResourceEntity type="application/vnd.vmware.vcloud.media+xml" name="DansTestMedia" href="https://mycloud.greenhousedata.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1"/>
</ResourceEntities>
<AvailableNetworks>
<Network type="application/vnd.vmware.vcloud.network+xml" name="orgNet-cloudsoft-Isolated" href="https://mycloud.greenhousedata.com/api/network/a604f3c2-0343-453e-ae1f-cddac5b7bd94"/>
<Network type="application/vnd.vmware.vcloud.network+xml" name="orgNet-cloudsoft-External" href="https://mycloud.greenhousedata.com/api/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1"/>
<Network type="application/vnd.vmware.vcloud.network+xml" name="orgNet-cloudsoft-Internal-Routed" href="https://mycloud.greenhousedata.com/api/network/6d7392e2-c816-43fb-99be-f9ebcd70abf6"/>
</AvailableNetworks>
<Capabilities>
<SupportedHardwareVersions>
<SupportedHardwareVersion>vmx-04</SupportedHardwareVersion>
<SupportedHardwareVersion>vmx-07</SupportedHardwareVersion>
<SupportedHardwareVersion>vmx-08</SupportedHardwareVersion>
</SupportedHardwareVersions>
</Capabilities>
<NicQuota>0</NicQuota>
<NetworkQuota>10</NetworkQuota>
<VmQuota>10</VmQuota>
<IsEnabled>true</IsEnabled>
</Vdc>