mirror of https://github.com/apache/jclouds.git
Issue 1022:Move naming convention to Api from Client or Services:: vcloud-director
This commit is contained in:
parent
05fd64af44
commit
6d13652338
|
@ -30,8 +30,8 @@ import java.util.Properties;
|
||||||
import org.jclouds.apis.ApiMetadata;
|
import org.jclouds.apis.ApiMetadata;
|
||||||
import org.jclouds.rest.internal.BaseRestApiMetadata;
|
import org.jclouds.rest.internal.BaseRestApiMetadata;
|
||||||
import org.jclouds.vcloud.director.v1_5.config.VCloudDirectorRestClientModule;
|
import org.jclouds.vcloud.director.v1_5.config.VCloudDirectorRestClientModule;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
|
|
||||||
import com.google.common.reflect.TypeToken;
|
import com.google.common.reflect.TypeToken;
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ public class VCloudDirectorApiMetadata extends BaseRestApiMetadata {
|
||||||
BaseRestApiMetadata.Builder {
|
BaseRestApiMetadata.Builder {
|
||||||
|
|
||||||
protected Builder() {
|
protected Builder() {
|
||||||
super(VCloudDirectorClient.class, VCloudDirectorAsyncClient.class);
|
super(VCloudDirectorApi.class, VCloudDirectorAsyncApi.class);
|
||||||
id("vcloud-director")
|
id("vcloud-director")
|
||||||
.name("vCloud Director 1.5 API")
|
.name("vCloud Director 1.5 API")
|
||||||
.identityName("User at Organization (user@org)")
|
.identityName("User at Organization (user@org)")
|
||||||
|
|
|
@ -19,19 +19,19 @@
|
||||||
package org.jclouds.vcloud.director.v1_5;
|
package org.jclouds.vcloud.director.v1_5;
|
||||||
|
|
||||||
import org.jclouds.rest.RestContext;
|
import org.jclouds.rest.RestContext;
|
||||||
import org.jclouds.vcloud.director.v1_5.login.SessionAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.login.SessionAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.login.SessionClient;
|
import org.jclouds.vcloud.director.v1_5.login.SessionApi;
|
||||||
|
|
||||||
import com.google.common.reflect.TypeToken;
|
import com.google.common.reflect.TypeToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants used by VCloudDirector clients
|
* Constants used by VCloudDirector apis
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
public class VCloudDirectorConstants {
|
public class VCloudDirectorConstants {
|
||||||
|
|
||||||
/** The XML namespace used by the clients. */
|
/** The XML namespace used by the apis. */
|
||||||
public static final String VCLOUD_1_5_NS = "http://www.vmware.com/vcloud/v1.5";
|
public static final String VCLOUD_1_5_NS = "http://www.vmware.com/vcloud/v1.5";
|
||||||
|
|
||||||
public static final String VCLOUD_VMW_NS = "http://www.vmware.com/schema/ovf";
|
public static final String VCLOUD_VMW_NS = "http://www.vmware.com/schema/ovf";
|
||||||
|
@ -71,8 +71,8 @@ public class VCloudDirectorConstants {
|
||||||
public static final String PROPERTY_NS_NAME_LEN_MAX = "jclouds.dns_name_length_max";
|
public static final String PROPERTY_NS_NAME_LEN_MAX = "jclouds.dns_name_length_max";
|
||||||
|
|
||||||
/** TODO javadoc */
|
/** TODO javadoc */
|
||||||
public static final TypeToken<RestContext<SessionClient, SessionAsyncClient>> SESSION_CONTEXT_TYPE =
|
public static final TypeToken<RestContext<SessionApi, SessionAsyncApi>> SESSION_CONTEXT_TYPE =
|
||||||
new TypeToken<RestContext<SessionClient, SessionAsyncClient>>() {
|
new TypeToken<RestContext<SessionApi, SessionAsyncApi>>() {
|
||||||
/** The serialVersionUID */
|
/** The serialVersionUID */
|
||||||
private static final long serialVersionUID = -3625362618882122604L;
|
private static final long serialVersionUID = -3625362618882122604L;
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
package org.jclouds.vcloud.director.v1_5;
|
package org.jclouds.vcloud.director.v1_5;
|
||||||
|
|
||||||
import org.jclouds.rest.RestContext;
|
import org.jclouds.rest.RestContext;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorContextImpl;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorContextImpl;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
|
|
||||||
import com.google.inject.ImplementedBy;
|
import com.google.inject.ImplementedBy;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ import com.google.inject.ImplementedBy;
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@ImplementedBy(VCloudDirectorContextImpl.class)
|
@ImplementedBy(VCloudDirectorContextImpl.class)
|
||||||
public interface VCloudDirectorContext extends RestContext<VCloudDirectorClient, VCloudDirectorAsyncClient> {
|
public interface VCloudDirectorContext extends RestContext<VCloudDirectorApi, VCloudDirectorAsyncApi> {
|
||||||
|
|
||||||
RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> getAdminContext();
|
RestContext<VCloudDirectorAdminApi, VCloudDirectorAdminAsyncApi> getAdminContext();
|
||||||
}
|
}
|
|
@ -22,67 +22,67 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.jclouds.concurrent.Timeout;
|
import org.jclouds.concurrent.Timeout;
|
||||||
import org.jclouds.rest.annotations.Delegate;
|
import org.jclouds.rest.annotations.Delegate;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminNetworkClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminNetworkApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminOrgClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminOrgApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.GroupClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.GroupApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.UserClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.UserApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to VCloudDirector Admin.
|
* Provides synchronous access to VCloudDirector Admin.
|
||||||
*
|
*
|
||||||
* @see VCloudDirectorAsyncClient
|
* @see VCloudDirectorAsyncApi
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface VCloudDirectorAdminClient extends VCloudDirectorClient {
|
public interface VCloudDirectorAdminApi extends VCloudDirectorApi {
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to admin query features
|
* @return asynchronous access to admin query features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
AdminQueryClient getQueryClient();
|
AdminQueryApi getQueryApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link Catalog} admin features
|
* @return synchronous access to {@link Catalog} admin features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
AdminCatalogClient getCatalogClient();
|
AdminCatalogApi getCatalogApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to admin {@link Group} features
|
* @return synchronous access to admin {@link Group} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
GroupClient getGroupClient();
|
GroupApi getGroupApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link AdminOrg} features
|
* @return synchronous access to {@link AdminOrg} features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
AdminOrgClient getOrgClient();
|
AdminOrgApi getOrgApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link User} features
|
* @return synchronous access to {@link User} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
UserClient getUserClient();
|
UserApi getUserApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link AdminVdc} features
|
* @return synchronous access to {@link AdminVdc} features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
AdminVdcClient getVdcClient();
|
AdminVdcApi getVdcApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to admin {@link Network} features
|
* @return synchronous access to admin {@link Network} features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
AdminNetworkClient getNetworkClient();
|
AdminNetworkApi getNetworkApi();
|
||||||
}
|
}
|
|
@ -19,28 +19,28 @@
|
||||||
package org.jclouds.vcloud.director.v1_5.admin;
|
package org.jclouds.vcloud.director.v1_5.admin;
|
||||||
|
|
||||||
import org.jclouds.rest.annotations.Delegate;
|
import org.jclouds.rest.annotations.Delegate;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminNetworkAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminNetworkAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminOrgAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminOrgAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.GroupAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.GroupAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.UserAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.UserAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides asynchronous access to VCloudDirector Admin via their REST API.
|
* Provides asynchronous access to VCloudDirector Admin via their REST API.
|
||||||
*
|
*
|
||||||
* @see VCloudDirectorAdminClient
|
* @see VCloudDirectorAdminApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
public interface VCloudDirectorAdminAsyncClient extends VCloudDirectorAsyncClient {
|
public interface VCloudDirectorAdminAsyncApi extends VCloudDirectorAsyncApi {
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to admin query features
|
* @return asynchronous access to admin query features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
AdminQueryAsyncClient getQueryClient();
|
AdminQueryAsyncApi getQueryApi();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,38 +48,38 @@ public interface VCloudDirectorAdminAsyncClient extends VCloudDirectorAsyncClien
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
AdminCatalogAsyncClient getCatalogClient();
|
AdminCatalogAsyncApi getCatalogApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to admin {@link Group} features
|
* @return asynchronous access to admin {@link Group} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
GroupAsyncClient getGroupClient();
|
GroupAsyncApi getGroupApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link AdminOrg} features
|
* @return asynchronous access to {@link AdminOrg} features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
AdminOrgAsyncClient getOrgClient();
|
AdminOrgAsyncApi getOrgApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link User} features
|
* @return asynchronous access to {@link User} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
UserAsyncClient getUserClient();
|
UserAsyncApi getUserApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link AdminVdc} features
|
* @return asynchronous access to {@link AdminVdc} features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
AdminVdcAsyncClient getVdcClient();
|
AdminVdcAsyncApi getVdcApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to admin {@link Network} features
|
* @return asynchronous access to admin {@link Network} features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
AdminNetworkAsyncClient getNetworkClient();
|
AdminNetworkAsyncApi getNetworkApi();
|
||||||
}
|
}
|
|
@ -41,56 +41,56 @@ import org.jclouds.rest.config.BinderUtils;
|
||||||
import org.jclouds.rest.config.RestClientModule;
|
import org.jclouds.rest.config.RestClientModule;
|
||||||
import org.jclouds.rest.internal.RestContextImpl;
|
import org.jclouds.rest.internal.RestContextImpl;
|
||||||
import org.jclouds.util.Suppliers2;
|
import org.jclouds.util.Suppliers2;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.annotations.Login;
|
import org.jclouds.vcloud.director.v1_5.annotations.Login;
|
||||||
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.SessionWithToken;
|
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.CatalogAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.CatalogAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.CatalogClient;
|
import org.jclouds.vcloud.director.v1_5.features.CatalogApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MediaAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.MediaAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MediaClient;
|
import org.jclouds.vcloud.director.v1_5.features.MediaApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.NetworkAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.NetworkAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.NetworkClient;
|
import org.jclouds.vcloud.director.v1_5.features.NetworkApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.OrgAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.OrgAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.OrgClient;
|
import org.jclouds.vcloud.director.v1_5.features.OrgApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.QueryAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.QueryAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.QueryClient;
|
import org.jclouds.vcloud.director.v1_5.features.QueryApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.TaskAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.TaskAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.TaskClient;
|
import org.jclouds.vcloud.director.v1_5.features.TaskApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.UploadAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.UploadAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.UploadClient;
|
import org.jclouds.vcloud.director.v1_5.features.UploadApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.VAppAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppClient;
|
import org.jclouds.vcloud.director.v1_5.features.VAppApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateClient;
|
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VdcAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.VdcAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VdcClient;
|
import org.jclouds.vcloud.director.v1_5.features.VdcApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VmAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.VmAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VmClient;
|
import org.jclouds.vcloud.director.v1_5.features.VmApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminNetworkAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminNetworkAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminNetworkClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminNetworkApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminOrgAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminOrgAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminOrgClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminOrgApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminQueryApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminVdcApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.GroupAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.GroupAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.GroupClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.GroupApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.UserAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.UserAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.UserClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.UserApi;
|
||||||
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;
|
||||||
import org.jclouds.vcloud.director.v1_5.login.SessionAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.login.SessionAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.login.SessionClient;
|
import org.jclouds.vcloud.director.v1_5.login.SessionApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Supplier;
|
import com.google.common.base.Supplier;
|
||||||
|
@ -109,49 +109,49 @@ import com.google.inject.name.Named;
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@ConfiguresRestClient
|
@ConfiguresRestClient
|
||||||
public class VCloudDirectorRestClientModule extends RestClientModule<VCloudDirectorClient, VCloudDirectorAsyncClient> {
|
public class VCloudDirectorRestClientModule extends RestClientModule<VCloudDirectorApi, VCloudDirectorAsyncApi> {
|
||||||
|
|
||||||
public static final Map<Class<?>, Class<?>> USER_DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>>builder()
|
public static final Map<Class<?>, Class<?>> USER_DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>>builder()
|
||||||
.put(CatalogClient.class, CatalogAsyncClient.class)
|
.put(CatalogApi.class, CatalogAsyncApi.class)
|
||||||
.put(MediaClient.class, MediaAsyncClient.class)
|
.put(MediaApi.class, MediaAsyncApi.class)
|
||||||
.put(MetadataClient.Readable.class, MetadataAsyncClient.Readable.class)
|
.put(MetadataApi.Readable.class, MetadataAsyncApi.Readable.class)
|
||||||
.put(MetadataClient.Writeable.class, MetadataAsyncClient.Writeable.class)
|
.put(MetadataApi.Writeable.class, MetadataAsyncApi.Writeable.class)
|
||||||
.put(NetworkClient.class, NetworkAsyncClient.class)
|
.put(NetworkApi.class, NetworkAsyncApi.class)
|
||||||
.put(OrgClient.class, OrgAsyncClient.class)
|
.put(OrgApi.class, OrgAsyncApi.class)
|
||||||
.put(QueryClient.class, QueryAsyncClient.class)
|
.put(QueryApi.class, QueryAsyncApi.class)
|
||||||
.put(TaskClient.class, TaskAsyncClient.class)
|
.put(TaskApi.class, TaskAsyncApi.class)
|
||||||
.put(UploadClient.class, UploadAsyncClient.class)
|
.put(UploadApi.class, UploadAsyncApi.class)
|
||||||
.put(VAppClient.class, VAppAsyncClient.class)
|
.put(VAppApi.class, VAppAsyncApi.class)
|
||||||
.put(VAppTemplateClient.class, VAppTemplateAsyncClient.class)
|
.put(VAppTemplateApi.class, VAppTemplateAsyncApi.class)
|
||||||
.put(VdcClient.class, VdcAsyncClient.class)
|
.put(VdcApi.class, VdcAsyncApi.class)
|
||||||
.put(VmClient.class, VmAsyncClient.class)
|
.put(VmApi.class, VmAsyncApi.class)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public static final Map<Class<?>, Class<?>> ADMIN_DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>>builder()
|
public static final Map<Class<?>, Class<?>> ADMIN_DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>>builder()
|
||||||
.putAll(USER_DELEGATE_MAP)
|
.putAll(USER_DELEGATE_MAP)
|
||||||
.put(AdminCatalogClient.class, AdminCatalogAsyncClient.class)
|
.put(AdminCatalogApi.class, AdminCatalogAsyncApi.class)
|
||||||
.put(AdminNetworkClient.class, AdminNetworkAsyncClient.class)
|
.put(AdminNetworkApi.class, AdminNetworkAsyncApi.class)
|
||||||
.put(AdminOrgClient.class, AdminOrgAsyncClient.class)
|
.put(AdminOrgApi.class, AdminOrgAsyncApi.class)
|
||||||
.put(AdminQueryClient.class, AdminQueryAsyncClient.class)
|
.put(AdminQueryApi.class, AdminQueryAsyncApi.class)
|
||||||
.put(AdminVdcClient.class, AdminVdcAsyncClient.class)
|
.put(AdminVdcApi.class, AdminVdcAsyncApi.class)
|
||||||
.put(GroupClient.class, GroupAsyncClient.class)
|
.put(GroupApi.class, GroupAsyncApi.class)
|
||||||
.put(UserClient.class, UserAsyncClient.class)
|
.put(UserApi.class, UserAsyncApi.class)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void bindAsyncClient() {
|
protected void bindAsyncClient() {
|
||||||
// bind the user client (default)
|
// bind the user api (default)
|
||||||
super.bindAsyncClient();
|
super.bindAsyncClient();
|
||||||
// bind the admin client
|
// bind the admin api
|
||||||
BinderUtils.bindAsyncClient(binder(), VCloudDirectorAdminAsyncClient.class);
|
BinderUtils.bindAsyncClient(binder(), VCloudDirectorAdminAsyncApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void bindClient() {
|
protected void bindClient() {
|
||||||
// bind the user client (default)
|
// bind the user api (default)
|
||||||
super.bindClient();
|
super.bindClient();
|
||||||
// bind the admin client
|
// bind the admin api
|
||||||
BinderUtils.bindClient(binder(), VCloudDirectorAdminClient.class, VCloudDirectorAdminAsyncClient.class, ADMIN_DELEGATE_MAP);
|
BinderUtils.bindClient(binder(), VCloudDirectorAdminApi.class, VCloudDirectorAdminAsyncApi.class, ADMIN_DELEGATE_MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
public VCloudDirectorRestClientModule() {
|
public VCloudDirectorRestClientModule() {
|
||||||
|
@ -160,16 +160,16 @@ public class VCloudDirectorRestClientModule extends RestClientModule<VCloudDirec
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure() {
|
protected void configure() {
|
||||||
bind(new TypeLiteral<RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient>>() {
|
bind(new TypeLiteral<RestContext<VCloudDirectorAdminApi, VCloudDirectorAdminAsyncApi>>() {
|
||||||
}).to(new TypeLiteral<RestContextImpl<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient>>() {
|
}).to(new TypeLiteral<RestContextImpl<VCloudDirectorAdminApi, VCloudDirectorAdminAsyncApi>>() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Bind clients that are used directly in Functions, Predicates and other circumstances
|
// Bind apis that are used directly in Functions, Predicates and other circumstances
|
||||||
bindClientAndAsyncClient(binder(), OrgClient.class, OrgAsyncClient.class);
|
bindClientAndAsyncClient(binder(), OrgApi.class, OrgAsyncApi.class);
|
||||||
bindClientAndAsyncClient(binder(), SessionClient.class, SessionAsyncClient.class);
|
bindClientAndAsyncClient(binder(), SessionApi.class, SessionAsyncApi.class);
|
||||||
bindClientAndAsyncClient(binder(), TaskClient.class, TaskAsyncClient.class);
|
bindClientAndAsyncClient(binder(), TaskApi.class, TaskAsyncApi.class);
|
||||||
bindClientAndAsyncClient(binder(), VAppClient.class, VAppAsyncClient.class);
|
bindClientAndAsyncClient(binder(), VAppApi.class, VAppAsyncApi.class);
|
||||||
bindClientAndAsyncClient(binder(), VmClient.class, VmAsyncClient.class);
|
bindClientAndAsyncClient(binder(), VmApi.class, VmAsyncApi.class);
|
||||||
|
|
||||||
bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(InvalidateSessionAndRetryOn401AndLogoutOnClose.class);
|
bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(InvalidateSessionAndRetryOn401AndLogoutOnClose.class);
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ public class VCloudDirectorRestClientModule extends RestClientModule<VCloudDirec
|
||||||
@Provides
|
@Provides
|
||||||
@Login
|
@Login
|
||||||
protected Supplier<URI> loginUrl(@Provider Supplier<URI> provider) {
|
protected Supplier<URI> loginUrl(@Provider Supplier<URI> provider) {
|
||||||
// TODO: technically, we should implement version client, but this will work
|
// TODO: technically, we should implement version api, but this will work
|
||||||
return Suppliers2.compose(new Function<URI, URI>() {
|
return Suppliers2.compose(new Function<URI, URI>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -163,7 +163,7 @@ public class Reference {
|
||||||
* the object, and is never reused. The value of the href attribute is a reference to a view of
|
* the object, and is never reused. The value of the href attribute is a reference to a view of
|
||||||
* the object, and can be used to access a representation of the object that is valid in a
|
* the object, and can be used to access a representation of the object that is valid in a
|
||||||
* particular context. Although URLs have a well-known syntax and a well-understood
|
* particular context. Although URLs have a well-known syntax and a well-understood
|
||||||
* interpretation, a client should treat each href as an opaque string. The rules that govern how
|
* interpretation, a api should treat each href as an opaque string. The rules that govern how
|
||||||
* the server constructs href strings might change in future releases.
|
* the server constructs href strings might change in future releases.
|
||||||
*
|
*
|
||||||
* @return an opaque reference and should never be parsed
|
* @return an opaque reference and should never be parsed
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class Resource {
|
||||||
* the object, and is never reused. The value of the href attribute is a reference to a view of
|
* the object, and is never reused. The value of the href attribute is a reference to a view of
|
||||||
* the object, and can be used to access a representation of the object that is valid in a
|
* the object, and can be used to access a representation of the object that is valid in a
|
||||||
* particular context. Although URLs have a well-known syntax and a well-understood
|
* particular context. Although URLs have a well-known syntax and a well-understood
|
||||||
* interpretation, a client should treat each href as an opaque string. The rules that govern how
|
* interpretation, a api should treat each href as an opaque string. The rules that govern how
|
||||||
* the server constructs href strings might change in future releases.
|
* the server constructs href strings might change in future releases.
|
||||||
*
|
*
|
||||||
* @return an opaque reference and should never be parsed
|
* @return an opaque reference and should never be parsed
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class SessionWithToken {
|
||||||
* the object, and is never reused. The value of the token attribute is a reference to a view of
|
* the object, and is never reused. The value of the token attribute is a reference to a view of
|
||||||
* the object, and can be used to access a representation of the object that is valid in a
|
* the object, and can be used to access a representation of the object that is valid in a
|
||||||
* particular context. Although URLs have a well-known syntax and a well-understood
|
* particular context. Although URLs have a well-known syntax and a well-understood
|
||||||
* interpretation, a client should treat each token as an opaque string. The rules that govern
|
* interpretation, a api should treat each token as an opaque string. The rules that govern
|
||||||
* how the server constructs token strings might change in future releases.
|
* how the server constructs token strings might change in future releases.
|
||||||
*
|
*
|
||||||
* @return an opaque reference and should never be parsed
|
* @return an opaque reference and should never be parsed
|
||||||
|
|
|
@ -174,7 +174,7 @@ public class QueryResultRecordType {
|
||||||
* portion of the id attribute value, it uniquely identifies the object, persists for the life of the object, and is never
|
* portion of the id attribute value, it uniquely identifies the object, persists for the life of the object, and is never
|
||||||
* reused. The value of the href attribute is a reference to a view of the object, and can be used to access a representation of
|
* reused. The value of the href attribute is a reference to a view of the object, and can be used to access a representation of
|
||||||
* the object that is valid in a particular context. Although URLs have a well-known syntax and a well-understood interpretation,
|
* the object that is valid in a particular context. Although URLs have a well-known syntax and a well-understood interpretation,
|
||||||
* a client should treat each href as an opaque string. The rules that govern how the server constructs href strings might change
|
* a api should treat each href as an opaque string. The rules that govern how the server constructs href strings might change
|
||||||
* in future releases.
|
* in future releases.
|
||||||
*
|
*
|
||||||
* @return an opaque reference and should never be parsed
|
* @return an opaque reference and should never be parsed
|
||||||
|
|
|
@ -29,11 +29,11 @@ import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link Catalog} objects.
|
* Provides synchronous access to {@link Catalog} objects.
|
||||||
*
|
*
|
||||||
* @see CatalogAsyncClient
|
* @see CatalogAsyncApi
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface CatalogClient {
|
public interface CatalogApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a catalog.
|
* Retrieves a catalog.
|
||||||
|
@ -100,12 +100,12 @@ public interface CatalogClient {
|
||||||
* @return synchronous access to {@link Metadata.Readable} features
|
* @return synchronous access to {@link Metadata.Readable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Readable getMetadataClient();
|
MetadataApi.Readable getMetadataApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link Metadata.Writeable} features for CatalogItems
|
* @return synchronous access to {@link Metadata.Writeable} features for CatalogItems
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Writeable getCatalogItemMetadataClient();
|
MetadataApi.Writeable getCatalogItemMetadataApi();
|
||||||
|
|
||||||
}
|
}
|
|
@ -44,11 +44,11 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see CatalogClient
|
* @see CatalogApi
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface CatalogAsyncClient {
|
public interface CatalogAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a catalog.
|
* Retrieves a catalog.
|
||||||
|
@ -101,11 +101,11 @@ public interface CatalogAsyncClient {
|
||||||
* @return asynchronous access to {@link Metadata.Readable} features
|
* @return asynchronous access to {@link Metadata.Readable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Readable getMetadataClient();
|
MetadataAsyncApi.Readable getMetadataApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link Metadata.Writeable} features for CatalogItems
|
* @return asynchronous access to {@link Metadata.Writeable} features for CatalogItems
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Writeable getCatalogItemMetadataClient();
|
MetadataAsyncApi.Writeable getCatalogItemMetadataApi();
|
||||||
}
|
}
|
|
@ -31,11 +31,11 @@ import org.jclouds.vcloud.director.v1_5.domain.params.CloneMediaParams;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link Media}.
|
* Provides synchronous access to {@link Media}.
|
||||||
*
|
*
|
||||||
* @see MediaAsyncClient
|
* @see MediaAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface MediaClient {
|
public interface MediaApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a media.
|
* Retrieves a media.
|
||||||
|
@ -84,6 +84,6 @@ public interface MediaClient {
|
||||||
* @return synchronous access to {@link Metadata.Writeable} features
|
* @return synchronous access to {@link Metadata.Writeable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Writeable getMetadataClient();
|
MetadataApi.Writeable getMetadataApi();
|
||||||
|
|
||||||
}
|
}
|
|
@ -46,14 +46,14 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MediaClient
|
* @see MediaApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface MediaAsyncClient {
|
public interface MediaAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MediaClient#getMedia(URI)
|
* @see MediaApi#getMedia(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -62,7 +62,7 @@ public interface MediaAsyncClient {
|
||||||
ListenableFuture<Media> getMedia(@EndpointParam URI uri);
|
ListenableFuture<Media> getMedia(@EndpointParam URI uri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MediaClient#createMedia(URI, Media)
|
* @see MediaApi#createMedia(URI, Media)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Consumes(VCloudDirectorMediaType.MEDIA)
|
@Consumes(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -73,7 +73,7 @@ public interface MediaAsyncClient {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MediaClient#cloneMedia(URI, CloneMediaParams)
|
* @see MediaApi#cloneMedia(URI, CloneMediaParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/cloneMedia")
|
@Path("/action/cloneMedia")
|
||||||
|
@ -84,7 +84,7 @@ public interface MediaAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) CloneMediaParams params);
|
@BinderParam(BindToXMLPayload.class) CloneMediaParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MediaClient#updateMedia(URI, Media))
|
* @see MediaApi#updateMedia(URI, Media))
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Consumes(VCloudDirectorMediaType.TASK)
|
@Consumes(VCloudDirectorMediaType.TASK)
|
||||||
|
@ -93,7 +93,7 @@ public interface MediaAsyncClient {
|
||||||
ListenableFuture<Task> updateMedia(@EndpointParam URI uri, @BinderParam(BindToXMLPayload.class) Media media);
|
ListenableFuture<Task> updateMedia(@EndpointParam URI uri, @BinderParam(BindToXMLPayload.class) Media media);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MediaClient#deleteMedia(URI))
|
* @see MediaApi#deleteMedia(URI))
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Consumes(VCloudDirectorMediaType.TASK)
|
@Consumes(VCloudDirectorMediaType.TASK)
|
||||||
|
@ -101,7 +101,7 @@ public interface MediaAsyncClient {
|
||||||
ListenableFuture<Task> deleteMedia(@EndpointParam URI uri);
|
ListenableFuture<Task> deleteMedia(@EndpointParam URI uri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MediaClient#getOwner(URI)
|
* @see MediaApi#getOwner(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/owner")
|
@Path("/owner")
|
||||||
|
@ -114,5 +114,5 @@ public interface MediaAsyncClient {
|
||||||
* @return asynchronous access to {@link Metadata.Writeable} features
|
* @return asynchronous access to {@link Metadata.Writeable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Writeable getMetadataClient();
|
MetadataAsyncApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -29,13 +29,13 @@ import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@linkl Metadata}.
|
* Provides synchronous access to {@linkl Metadata}.
|
||||||
*
|
*
|
||||||
* @see MetadataAsyncClient
|
* @see MetadataAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
public interface MetadataClient {
|
public interface MetadataApi {
|
||||||
|
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public static interface Readable extends MetadataClient {
|
public static interface Readable extends MetadataApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves an list of metadata
|
* Retrieves an list of metadata
|
|
@ -45,16 +45,16 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MetadataClient
|
* @see MetadataApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
public interface MetadataAsyncClient {
|
public interface MetadataAsyncApi {
|
||||||
|
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public static interface Readable extends MetadataAsyncClient {
|
public static interface Readable extends MetadataAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MetadataClient.Readable#getMetadata(URISupplier)
|
* @see MetadataApi.Readable#getMetadata(URISupplier)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/metadata")
|
@Path("/metadata")
|
||||||
|
@ -64,7 +64,7 @@ public interface MetadataAsyncClient {
|
||||||
ListenableFuture<Metadata> getMetadata(@EndpointParam URI metaDataUri);
|
ListenableFuture<Metadata> getMetadata(@EndpointParam URI metaDataUri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MetadataClient.Readable#getMetadataValue(URI, String)
|
* @see MetadataApi.Readable#getMetadataValue(URI, String)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/metadata/{key}")
|
@Path("/metadata/{key}")
|
||||||
|
@ -78,7 +78,7 @@ public interface MetadataAsyncClient {
|
||||||
public static interface Writeable extends Readable {
|
public static interface Writeable extends Readable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MetadataClient.Writable#mergeMetadata(URI, Metadata))
|
* @see MetadataApi.Writable#mergeMetadata(URI, Metadata))
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/metadata")
|
@Path("/metadata")
|
||||||
|
@ -88,7 +88,7 @@ public interface MetadataAsyncClient {
|
||||||
ListenableFuture<Task> mergeMetadata(@EndpointParam URI metaDataUri, @BinderParam(BindToXMLPayload.class) Metadata metadata);
|
ListenableFuture<Task> mergeMetadata(@EndpointParam URI metaDataUri, @BinderParam(BindToXMLPayload.class) Metadata metadata);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MetadataClient.Writable#setMetadata(URI, String, MetadataEntry))
|
* @see MetadataApi.Writable#setMetadata(URI, String, MetadataEntry))
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/metadata/{key}")
|
@Path("/metadata/{key}")
|
||||||
|
@ -100,7 +100,7 @@ public interface MetadataAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) MetadataValue metadataValue);
|
@BinderParam(BindToXMLPayload.class) MetadataValue metadataValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see MetadataClient.Writable#deleteMetadataEntry(URISupplier, String))
|
* @see MetadataApi.Writable#deleteMetadataEntry(URISupplier, String))
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("/metadata/{key}")
|
@Path("/metadata/{key}")
|
|
@ -28,11 +28,11 @@ import org.jclouds.vcloud.director.v1_5.domain.network.Network;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link Network}.
|
* Provides synchronous access to {@link Network}.
|
||||||
*
|
*
|
||||||
* @see NetworkAsyncClient
|
* @see NetworkAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface NetworkClient {
|
public interface NetworkApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a network.
|
* Retrieves a network.
|
||||||
|
@ -45,5 +45,5 @@ public interface NetworkClient {
|
||||||
* @return synchronous access to {@link Metadata.Readable} features
|
* @return synchronous access to {@link Metadata.Readable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Readable getMetadataClient();
|
MetadataApi.Readable getMetadataApi();
|
||||||
}
|
}
|
|
@ -35,14 +35,14 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkClient
|
* @see NetworkApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface NetworkAsyncClient {
|
public interface NetworkAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NetworkClient#getNetwork(URI)
|
* @see NetworkApi#getNetwork(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -54,6 +54,6 @@ public interface NetworkAsyncClient {
|
||||||
* @return asynchronous access to {@link Metadata.Readable} features
|
* @return asynchronous access to {@link Metadata.Readable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Readable getMetadataClient();
|
MetadataAsyncApi.Readable getMetadataApi();
|
||||||
|
|
||||||
}
|
}
|
|
@ -30,11 +30,11 @@ import org.jclouds.vcloud.director.v1_5.domain.params.ControlAccessParams;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link Org}.
|
* Provides synchronous access to {@link Org}.
|
||||||
*
|
*
|
||||||
* @see OrgAsyncClient
|
* @see OrgAsyncApi
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface OrgClient {
|
public interface OrgApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a list of organizations.
|
* Retrieves a list of organizations.
|
||||||
|
@ -84,5 +84,5 @@ public interface OrgClient {
|
||||||
* @return synchronous access to {@link Metadata.Readable} features
|
* @return synchronous access to {@link Metadata.Readable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Readable getMetadataClient();
|
MetadataApi.Readable getMetadataApi();
|
||||||
}
|
}
|
|
@ -45,14 +45,14 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgClient
|
* @see OrgApi
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface OrgAsyncClient {
|
public interface OrgAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgClient#getOrgList()
|
* @see OrgApi#getOrgList()
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/org/")
|
@Path("/org/")
|
||||||
|
@ -61,7 +61,7 @@ public interface OrgAsyncClient {
|
||||||
ListenableFuture<OrgList> getOrgList();
|
ListenableFuture<OrgList> getOrgList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgClient#getOrg(URI)
|
* @see OrgApi#getOrg(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -70,7 +70,7 @@ public interface OrgAsyncClient {
|
||||||
ListenableFuture<? extends Org> getOrg(@EndpointParam URI orgUri);
|
ListenableFuture<? extends Org> getOrg(@EndpointParam URI orgUri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgClient#modifyControlAccess(URI, URI, ControlAccessParams)
|
* @see OrgApi#modifyControlAccess(URI, URI, ControlAccessParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/catalog/{catalogId}/action/controlAccess")
|
@Path("/catalog/{catalogId}/action/controlAccess")
|
||||||
|
@ -82,7 +82,7 @@ public interface OrgAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) ControlAccessParams params);
|
@BinderParam(BindToXMLPayload.class) ControlAccessParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see OrgClient#getControlAccess(URI, URI, ControlAccessParams)
|
* @see OrgApi#getControlAccess(URI, URI, ControlAccessParams)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/catalog/{catalogId}/controlAccess")
|
@Path("/catalog/{catalogId}/controlAccess")
|
||||||
|
@ -96,5 +96,5 @@ public interface OrgAsyncClient {
|
||||||
* @return asynchronous access to {@link Metadata.Readable} features
|
* @return asynchronous access to {@link Metadata.Readable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Readable getMetadataClient();
|
MetadataAsyncApi.Readable getMetadataApi();
|
||||||
}
|
}
|
|
@ -35,11 +35,11 @@ import org.jclouds.vcloud.director.v1_5.domain.query.VAppReferences;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to the REST API query interface.
|
* Provides synchronous access to the REST API query interface.
|
||||||
*
|
*
|
||||||
* @see QueryAsyncClient
|
* @see QueryAsyncApi
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface QueryClient {
|
public interface QueryApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redirects to the URL of an entity with the given VCD ID.
|
* Redirects to the URL of an entity with the given VCD ID.
|
|
@ -41,15 +41,15 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryClient
|
* @see QueryApi
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
@SkipEncoding({ '=' })
|
@SkipEncoding({ '=' })
|
||||||
public interface QueryAsyncClient {
|
public interface QueryAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see QueryClient#entity(String)
|
* @see QueryApi#entity(String)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/entity/{id}")
|
@Path("/entity/{id}")
|
|
@ -28,11 +28,11 @@ import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link Task} objects.
|
* Provides synchronous access to {@link Task} objects.
|
||||||
*
|
*
|
||||||
* @see TaskAsyncClient
|
* @see TaskAsyncApi
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface TaskClient {
|
public interface TaskApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a list of tasks.
|
* Retrieves a list of tasks.
|
|
@ -38,14 +38,14 @@ import org.jclouds.vcloud.director.v1_5.functions.OrgReferenceToTaskListEndpoint
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see TaskClient
|
* @see TaskApi
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface TaskAsyncClient {
|
public interface TaskAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see TaskClient#getTaskList(URISupplier)
|
* @see TaskApi#getTaskList(URISupplier)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -54,7 +54,7 @@ public interface TaskAsyncClient {
|
||||||
ListenableFuture<TasksList> getTaskList(@EndpointParam(parser = OrgReferenceToTaskListEndpoint.class) URI orgURI);
|
ListenableFuture<TasksList> getTaskList(@EndpointParam(parser = OrgReferenceToTaskListEndpoint.class) URI orgURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see TaskClient#getTask(URI)
|
* @see TaskApi#getTask(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -63,7 +63,7 @@ public interface TaskAsyncClient {
|
||||||
ListenableFuture<Task> getTask(@EndpointParam URI taskURI);
|
ListenableFuture<Task> getTask(@EndpointParam URI taskURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see TaskClient#cancelTask(URI)
|
* @see TaskApi#cancelTask(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/cancel")
|
@Path("/action/cancel")
|
|
@ -27,11 +27,11 @@ import org.jclouds.io.Payload;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to upload.
|
* Provides synchronous access to upload.
|
||||||
*
|
*
|
||||||
* @see UploadAsyncClient
|
* @see UploadAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface UploadClient {
|
public interface UploadApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return eTag
|
* @return eTag
|
|
@ -30,14 +30,14 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UploadClient
|
* @see UploadApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface UploadAsyncClient {
|
public interface UploadAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UploadClient#put
|
* @see UploadApi#put
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
ListenableFuture<Void> upload(@EndpointParam URI location, Payload payload);
|
ListenableFuture<Void> upload(@EndpointParam URI location, Payload payload);
|
|
@ -41,11 +41,11 @@ import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection;
|
||||||
* Provides synchronous access to {@link VApp} objects.
|
* Provides synchronous access to {@link VApp} objects.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
* @see VAppAsyncClient
|
* @see VAppAsyncApi
|
||||||
* @version 1.5
|
* @version 1.5
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface VAppClient {
|
public interface VAppApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a {@link VApp}.
|
* Retrieves a {@link VApp}.
|
||||||
|
@ -186,7 +186,7 @@ public interface VAppClient {
|
||||||
*
|
*
|
||||||
* To remove VMs you should put their references in elements. The way you add
|
* To remove VMs you should put their references in elements. The way you add
|
||||||
* VMs is the same as described in compose vApp operation
|
* VMs is the same as described in compose vApp operation
|
||||||
* {@link VdcClient#composeVApp(URI, org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams)}.
|
* {@link VdcApi#composeVApp(URI, org.jclouds.vcloud.director.v1_5.domain.ComposeVAppParams)}.
|
||||||
* The status of vApp will be in {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED}
|
* The status of vApp will be in {@link org.jclouds.vcloud.director.v1_5.domain.ResourceEntityType.Status#UNRESOLVED}
|
||||||
* until the recompose task is finished.
|
* until the recompose task is finished.
|
||||||
*
|
*
|
||||||
|
@ -434,5 +434,5 @@ public interface VAppClient {
|
||||||
* Synchronous access to {@link VApp} {@link Metadata} features.
|
* Synchronous access to {@link VApp} {@link Metadata} features.
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Writeable getMetadataClient();
|
MetadataApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -66,13 +66,13 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
* @see VAppClient
|
* @see VAppApi
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface VAppAsyncClient {
|
public interface VAppAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#getVApp(URI)
|
* @see VAppApi#getVApp(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(VAPP)
|
@Consumes(VAPP)
|
||||||
|
@ -81,7 +81,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<VApp> getVApp(@EndpointParam URI vAppURI);
|
ListenableFuture<VApp> getVApp(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#modifyVApp(URI, VApp)
|
* @see VAppApi#modifyVApp(URI, VApp)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Produces(VAPP)
|
@Produces(VAPP)
|
||||||
|
@ -91,7 +91,7 @@ public interface VAppAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) VApp vApp);
|
@BinderParam(BindToXMLPayload.class) VApp vApp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#deleteVApp(URI)
|
* @see VAppApi#deleteVApp(URI)
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Consumes(TASK)
|
@Consumes(TASK)
|
||||||
|
@ -99,7 +99,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Task> deleteVApp(@EndpointParam URI vAppURI);
|
ListenableFuture<Task> deleteVApp(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#modifyControlAccess(URI, ControlAccessParams)
|
* @see VAppApi#modifyControlAccess(URI, ControlAccessParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/controlAccess")
|
@Path("/action/controlAccess")
|
||||||
|
@ -110,7 +110,7 @@ public interface VAppAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) ControlAccessParams params);
|
@BinderParam(BindToXMLPayload.class) ControlAccessParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#deploy(URI, DeployVAppParams)
|
* @see VAppApi#deploy(URI, DeployVAppParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/deploy")
|
@Path("/action/deploy")
|
||||||
|
@ -121,7 +121,7 @@ public interface VAppAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) DeployVAppParams params);
|
@BinderParam(BindToXMLPayload.class) DeployVAppParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#discardSuspendedState(URI)
|
* @see VAppApi#discardSuspendedState(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/discardSuspendedState")
|
@Path("/action/discardSuspendedState")
|
||||||
|
@ -130,7 +130,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Task> discardSuspendedState(@EndpointParam URI vAppURI);
|
ListenableFuture<Task> discardSuspendedState(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#enterMaintenanceMode(URI)
|
* @see VAppApi#enterMaintenanceMode(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/enterMaintenanceMode")
|
@Path("/action/enterMaintenanceMode")
|
||||||
|
@ -139,7 +139,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Void> enterMaintenanceMode(@EndpointParam URI vAppURI);
|
ListenableFuture<Void> enterMaintenanceMode(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#exitMaintenanceMode(URI)
|
* @see VAppApi#exitMaintenanceMode(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/exitMaintenanceMode")
|
@Path("/action/exitMaintenanceMode")
|
||||||
|
@ -148,7 +148,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Void> exitMaintenanceMode(@EndpointParam URI vAppURI);
|
ListenableFuture<Void> exitMaintenanceMode(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#recompose(URI, RecomposeVAppParams)
|
* @see VAppApi#recompose(URI, RecomposeVAppParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/recomposeVApp")
|
@Path("/action/recomposeVApp")
|
||||||
|
@ -159,7 +159,7 @@ public interface VAppAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) RecomposeVAppParams params);
|
@BinderParam(BindToXMLPayload.class) RecomposeVAppParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#undeploy(URI, UndeployVAppParams)
|
* @see VAppApi#undeploy(URI, UndeployVAppParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/undeploy")
|
@Path("/action/undeploy")
|
||||||
|
@ -170,7 +170,7 @@ public interface VAppAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) UndeployVAppParams params);
|
@BinderParam(BindToXMLPayload.class) UndeployVAppParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#getControlAccess(URI)
|
* @see VAppApi#getControlAccess(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/controlAccess")
|
@Path("/controlAccess")
|
||||||
|
@ -180,7 +180,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<ControlAccessParams> getControlAccess(@EndpointParam URI vAppURI);
|
ListenableFuture<ControlAccessParams> getControlAccess(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#powerOff(URI)
|
* @see VAppApi#powerOff(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/powerOff")
|
@Path("/power/action/powerOff")
|
||||||
|
@ -189,7 +189,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Task> powerOff(@EndpointParam URI vAppURI);
|
ListenableFuture<Task> powerOff(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#powerOn(URI)
|
* @see VAppApi#powerOn(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/powerOn")
|
@Path("/power/action/powerOn")
|
||||||
|
@ -198,7 +198,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Task> powerOn(@EndpointParam URI vAppURI);
|
ListenableFuture<Task> powerOn(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#reboot(URI)
|
* @see VAppApi#reboot(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/powerOff")
|
@Path("/power/action/powerOff")
|
||||||
|
@ -207,7 +207,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Task> reboot(@EndpointParam URI vAppURI);
|
ListenableFuture<Task> reboot(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#reset(URI)
|
* @see VAppApi#reset(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/reset")
|
@Path("/power/action/reset")
|
||||||
|
@ -216,7 +216,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Task> reset(@EndpointParam URI vAppURI);
|
ListenableFuture<Task> reset(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#shutdown(URI)
|
* @see VAppApi#shutdown(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/shutdown")
|
@Path("/power/action/shutdown")
|
||||||
|
@ -225,7 +225,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Task> shutdown(@EndpointParam URI vAppURI);
|
ListenableFuture<Task> shutdown(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#suspend(URI)
|
* @see VAppApi#suspend(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/suspend")
|
@Path("/power/action/suspend")
|
||||||
|
@ -234,7 +234,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Task> suspend(@EndpointParam URI vAppURI);
|
ListenableFuture<Task> suspend(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#getLeaseSettingsSection(URI)
|
* @see VAppApi#getLeaseSettingsSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/leaseSettingsSection")
|
@Path("/leaseSettingsSection")
|
||||||
|
@ -244,7 +244,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<LeaseSettingsSection> getLeaseSettingsSection(@EndpointParam URI vAppURI);
|
ListenableFuture<LeaseSettingsSection> getLeaseSettingsSection(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#modifyLeaseSettingsSection(URI, LeaseSettingsSection)
|
* @see VAppApi#modifyLeaseSettingsSection(URI, LeaseSettingsSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/leaseSettingsSection")
|
@Path("/leaseSettingsSection")
|
||||||
|
@ -255,7 +255,7 @@ public interface VAppAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) LeaseSettingsSection section);
|
@BinderParam(BindToXMLPayload.class) LeaseSettingsSection section);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#getNetworkConfigSection(URI)
|
* @see VAppApi#getNetworkConfigSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/networkConfigSection")
|
@Path("/networkConfigSection")
|
||||||
|
@ -265,7 +265,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<NetworkConfigSection> getNetworkConfigSection(@EndpointParam URI vAppURI);
|
ListenableFuture<NetworkConfigSection> getNetworkConfigSection(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#modifyNetworkConfigSection(URI, NetworkConfigSection)
|
* @see VAppApi#modifyNetworkConfigSection(URI, NetworkConfigSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/networkConfigSection")
|
@Path("/networkConfigSection")
|
||||||
|
@ -276,7 +276,7 @@ public interface VAppAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) NetworkConfigSection section);
|
@BinderParam(BindToXMLPayload.class) NetworkConfigSection section);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#getNetworkSection(URI)
|
* @see VAppApi#getNetworkSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/networkSection")
|
@Path("/networkSection")
|
||||||
|
@ -286,7 +286,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<NetworkSection> getNetworkSection(@EndpointParam URI vAppURI);
|
ListenableFuture<NetworkSection> getNetworkSection(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#getOwner(URI)
|
* @see VAppApi#getOwner(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/owner")
|
@Path("/owner")
|
||||||
|
@ -296,7 +296,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<Owner> getOwner(@EndpointParam URI vAppURI);
|
ListenableFuture<Owner> getOwner(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#modifyOwner(URI, Owner)
|
* @see VAppApi#modifyOwner(URI, Owner)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/owner")
|
@Path("/owner")
|
||||||
|
@ -307,7 +307,7 @@ public interface VAppAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) Owner owner);
|
@BinderParam(BindToXMLPayload.class) Owner owner);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#getProductSections(URI)
|
* @see VAppApi#getProductSections(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/productSections")
|
@Path("/productSections")
|
||||||
|
@ -317,7 +317,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<ProductSectionList> getProductSections(@EndpointParam URI vAppURI);
|
ListenableFuture<ProductSectionList> getProductSections(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#modifyProductSections(URI, ProductSectionList)
|
* @see VAppApi#modifyProductSections(URI, ProductSectionList)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/productSections")
|
@Path("/productSections")
|
||||||
|
@ -329,7 +329,7 @@ public interface VAppAsyncClient {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#getStartupSection(URI)
|
* @see VAppApi#getStartupSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/startupSection")
|
@Path("/startupSection")
|
||||||
|
@ -339,7 +339,7 @@ public interface VAppAsyncClient {
|
||||||
ListenableFuture<StartupSection> getStartupSection(@EndpointParam URI vAppURI);
|
ListenableFuture<StartupSection> getStartupSection(@EndpointParam URI vAppURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#modifyStartupSection(URI, StartupSection)
|
* @see VAppApi#modifyStartupSection(URI, StartupSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/startupSection")
|
@Path("/startupSection")
|
||||||
|
@ -353,5 +353,5 @@ public interface VAppAsyncClient {
|
||||||
* Asynchronous access to {@link VApp} {@link Metadata} features
|
* Asynchronous access to {@link VApp} {@link Metadata} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Writeable getMetadataClient();
|
MetadataAsyncApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -41,10 +41,10 @@ import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConnectionSection;
|
||||||
* Provides synchronous access to {@link VAppTemplate} objects.
|
* Provides synchronous access to {@link VAppTemplate} objects.
|
||||||
*
|
*
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
* @see org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncClient
|
* @see org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncApi
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface VAppTemplateClient {
|
public interface VAppTemplateApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a vApp template (can be used also to retrieve a VM from a vApp Template).
|
* Retrieves a vApp template (can be used also to retrieve a VM from a vApp Template).
|
||||||
|
@ -362,5 +362,5 @@ public interface VAppTemplateClient {
|
||||||
* @return synchronous access to {@link Metadata} features
|
* @return synchronous access to {@link Metadata} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Writeable getMetadataClient();
|
MetadataApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -67,13 +67,13 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
* @see org.jclouds.vcloud.director.v1_5.features.VAppTemplateClient
|
* @see org.jclouds.vcloud.director.v1_5.features.VAppTemplateApi
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface VAppTemplateAsyncClient {
|
public interface VAppTemplateAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getVAppTemplate(URI)
|
* @see VAppTemplateApi#getVAppTemplate(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(VAPP_TEMPLATE)
|
@Consumes(VAPP_TEMPLATE)
|
||||||
|
@ -83,7 +83,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#modifyVAppTemplate(URI, VAppTemplate)
|
* @see VAppTemplateApi#modifyVAppTemplate(URI, VAppTemplate)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Produces(VAPP_TEMPLATE)
|
@Produces(VAPP_TEMPLATE)
|
||||||
|
@ -93,7 +93,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) VAppTemplate template);
|
@BinderParam(BindToXMLPayload.class) VAppTemplate template);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#deleteVappTemplate(URI)
|
* @see VAppTemplateApi#deleteVappTemplate(URI)
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Consumes(TASK)
|
@Consumes(TASK)
|
||||||
|
@ -101,7 +101,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<Task> deleteVappTemplate(@EndpointParam URI templateUri);
|
ListenableFuture<Task> deleteVappTemplate(@EndpointParam URI templateUri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#consolidateVm(URI)
|
* @see VAppTemplateApi#consolidateVm(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Consumes(TASK)
|
@Consumes(TASK)
|
||||||
|
@ -110,7 +110,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<Task> consolidateVm(@EndpointParam URI templateURI);
|
ListenableFuture<Task> consolidateVm(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#disableDownload(URI)
|
* @see VAppTemplateApi#disableDownload(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/disableDownload")
|
@Path("/action/disableDownload")
|
||||||
|
@ -118,7 +118,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<Void> disableDownload(@EndpointParam URI templateURI);
|
ListenableFuture<Void> disableDownload(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#enableDownloadVappTemplate(URI)
|
* @see VAppTemplateApi#enableDownloadVappTemplate(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Consumes(TASK)
|
@Consumes(TASK)
|
||||||
|
@ -127,7 +127,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<Task> enableDownload(@EndpointParam URI templateURI);
|
ListenableFuture<Task> enableDownload(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#relocateVm(URI, RelocateParams)
|
* @see VAppTemplateApi#relocateVm(URI, RelocateParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Produces(RELOCATE_TEMPLATE)
|
@Produces(RELOCATE_TEMPLATE)
|
||||||
|
@ -138,7 +138,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) RelocateParams params);
|
@BinderParam(BindToXMLPayload.class) RelocateParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getCustomizationSection(URI)
|
* @see VAppTemplateApi#getCustomizationSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(CUSTOMIZATION_SECTION)
|
@Consumes(CUSTOMIZATION_SECTION)
|
||||||
|
@ -148,7 +148,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<CustomizationSection> getCustomizationSection(@EndpointParam URI templateURI);
|
ListenableFuture<CustomizationSection> getCustomizationSection(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#modifyCustomizationSection(URI, CustomizationSection)
|
* @see VAppTemplateApi#modifyCustomizationSection(URI, CustomizationSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Produces(CUSTOMIZATION_SECTION)
|
@Produces(CUSTOMIZATION_SECTION)
|
||||||
|
@ -159,7 +159,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) CustomizationSection sectionType);
|
@BinderParam(BindToXMLPayload.class) CustomizationSection sectionType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getGuestCustomizationSection(URI)
|
* @see VAppTemplateApi#getGuestCustomizationSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(GUEST_CUSTOMIZATION_SECTION)
|
@Consumes(GUEST_CUSTOMIZATION_SECTION)
|
||||||
|
@ -169,7 +169,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<GuestCustomizationSection> getGuestCustomizationSection(@EndpointParam URI templateURI);
|
ListenableFuture<GuestCustomizationSection> getGuestCustomizationSection(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#modifyGuestCustomizationSection(URI, org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection)
|
* @see VAppTemplateApi#modifyGuestCustomizationSection(URI, org.jclouds.vcloud.director.v1_5.domain.GuestCustomizationSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Produces(GUEST_CUSTOMIZATION_SECTION)
|
@Produces(GUEST_CUSTOMIZATION_SECTION)
|
||||||
|
@ -180,7 +180,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) GuestCustomizationSection section);
|
@BinderParam(BindToXMLPayload.class) GuestCustomizationSection section);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getLeaseSettingsSection(URI)
|
* @see VAppTemplateApi#getLeaseSettingsSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(LEASE_SETTINGS_SECTION)
|
@Consumes(LEASE_SETTINGS_SECTION)
|
||||||
|
@ -190,7 +190,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<LeaseSettingsSection> getLeaseSettingsSection(@EndpointParam URI templateURI);
|
ListenableFuture<LeaseSettingsSection> getLeaseSettingsSection(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#modifyLeaseSettingsSection(URI, LeaseSettingsSection)
|
* @see VAppTemplateApi#modifyLeaseSettingsSection(URI, LeaseSettingsSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Produces(LEASE_SETTINGS_SECTION)
|
@Produces(LEASE_SETTINGS_SECTION)
|
||||||
|
@ -201,7 +201,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) LeaseSettingsSection settingsSection);
|
@BinderParam(BindToXMLPayload.class) LeaseSettingsSection settingsSection);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getNetworkConnectionSection(URI)
|
* @see VAppTemplateApi#getNetworkConnectionSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(NETWORK_CONNECTION_SECTION)
|
@Consumes(NETWORK_CONNECTION_SECTION)
|
||||||
|
@ -211,7 +211,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<NetworkConnectionSection> getNetworkConnectionSection(@EndpointParam URI templateURI);
|
ListenableFuture<NetworkConnectionSection> getNetworkConnectionSection(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getNetworkConfigSection(URI)
|
* @see VAppTemplateApi#getNetworkConfigSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(NETWORK_CONFIG_SECTION)
|
@Consumes(NETWORK_CONFIG_SECTION)
|
||||||
|
@ -221,7 +221,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<NetworkConfigSection> getNetworkConfigSection(@EndpointParam URI templateURI);
|
ListenableFuture<NetworkConfigSection> getNetworkConfigSection(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#modifyNetworkConfigSection(URI, NetworkConfigSection)
|
* @see VAppTemplateApi#modifyNetworkConfigSection(URI, NetworkConfigSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Produces(NETWORK_CONFIG_SECTION)
|
@Produces(NETWORK_CONFIG_SECTION)
|
||||||
|
@ -232,7 +232,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) NetworkConfigSection section);
|
@BinderParam(BindToXMLPayload.class) NetworkConfigSection section);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getNetworkConnectionSection(URI)
|
* @see VAppTemplateApi#getNetworkConnectionSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(NETWORK_CONNECTION_SECTION)
|
@Consumes(NETWORK_CONNECTION_SECTION)
|
||||||
|
@ -242,7 +242,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<NetworkConnectionSection> getVAppTemplateNetworkConnectionSection(@EndpointParam URI templateURI);
|
ListenableFuture<NetworkConnectionSection> getVAppTemplateNetworkConnectionSection(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#modifyNetworkConnectionSection(URI, NetworkConnectionSection)
|
* @see VAppTemplateApi#modifyNetworkConnectionSection(URI, NetworkConnectionSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Produces(NETWORK_CONNECTION_SECTION)
|
@Produces(NETWORK_CONNECTION_SECTION)
|
||||||
|
@ -253,7 +253,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) NetworkConnectionSection section);
|
@BinderParam(BindToXMLPayload.class) NetworkConnectionSection section);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getNetworkSection(URI)
|
* @see VAppTemplateApi#getNetworkSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(NETWORK_SECTION)
|
@Consumes(NETWORK_SECTION)
|
||||||
|
@ -263,7 +263,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<NetworkSection> getNetworkSection(@EndpointParam URI templateURI);
|
ListenableFuture<NetworkSection> getNetworkSection(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getOvf(URI)
|
* @see VAppTemplateApi#getOvf(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -273,7 +273,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<Envelope> getOvf(@EndpointParam URI templateURI);
|
ListenableFuture<Envelope> getOvf(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getOwnerOfVAppTemplate(URI)
|
* @see VAppTemplateApi#getOwnerOfVAppTemplate(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(OWNER)
|
@Consumes(OWNER)
|
||||||
|
@ -283,7 +283,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<Owner> getOwner(@EndpointParam URI templateURI);
|
ListenableFuture<Owner> getOwner(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getProductSectionsForVAppTemplate(URI)
|
* @see VAppTemplateApi#getProductSectionsForVAppTemplate(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(PRODUCT_SECTION_LIST)
|
@Consumes(PRODUCT_SECTION_LIST)
|
||||||
|
@ -293,7 +293,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
ListenableFuture<ProductSectionList> getProductSections(@EndpointParam URI templateURI);
|
ListenableFuture<ProductSectionList> getProductSections(@EndpointParam URI templateURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#modifyProductSections(URI, ProductSectionList)
|
* @see VAppTemplateApi#modifyProductSections(URI, ProductSectionList)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Produces(PRODUCT_SECTION_LIST)
|
@Produces(PRODUCT_SECTION_LIST)
|
||||||
|
@ -304,7 +304,7 @@ public interface VAppTemplateAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) ProductSectionList sections);
|
@BinderParam(BindToXMLPayload.class) ProductSectionList sections);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppTemplateClient#getShadowVms(URI)
|
* @see VAppTemplateApi#getShadowVms(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -317,5 +317,5 @@ public interface VAppTemplateAsyncClient {
|
||||||
* @return asynchronous access to {@link Metadata} features
|
* @return asynchronous access to {@link Metadata} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Writeable getMetadataClient();
|
MetadataAsyncApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -39,12 +39,12 @@ import org.jclouds.vcloud.director.v1_5.domain.params.UploadVAppTemplateParams;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to a vDC.
|
* Provides synchronous access to a vDC.
|
||||||
*
|
*
|
||||||
* @see VdcAsyncClient
|
* @see VdcAsyncApi
|
||||||
* @see <a href= "http://support.theenterprisecloud.com/kb/default.asp?id=984&Lang=1&SID=" />
|
* @see <a href= "http://support.theenterprisecloud.com/kb/default.asp?id=984&Lang=1&SID=" />
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface VdcClient {
|
public interface VdcApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a vdc.
|
* Retrieves a vdc.
|
||||||
|
@ -105,7 +105,7 @@ public interface VdcClient {
|
||||||
*
|
*
|
||||||
* The vCloud API supports composing a vApp from any combination of vApp templates, vApps,
|
* 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
|
* 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
|
* become peers in the Children collection of the composed vApp. To compose a vApp, a api
|
||||||
* makes a compose vApp request whose body is a ComposeVAppParams element, includes the
|
* makes a compose vApp request whose body is a ComposeVAppParams element, includes the
|
||||||
* following information:
|
* following information:
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -179,6 +179,6 @@ public interface VdcClient {
|
||||||
* @return synchronous access to {@link Metadata.Readable} features
|
* @return synchronous access to {@link Metadata.Readable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Readable getMetadataClient();
|
MetadataApi.Readable getMetadataApi();
|
||||||
|
|
||||||
}
|
}
|
|
@ -51,14 +51,14 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VdcClient
|
* @see VdcApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface VdcAsyncClient {
|
public interface VdcAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VdcClient#getVdc(URI)
|
* @see VdcApi#getVdc(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -67,7 +67,7 @@ public interface VdcAsyncClient {
|
||||||
ListenableFuture<? extends Vdc> getVdc(@EndpointParam URI vdcURI);
|
ListenableFuture<? extends Vdc> getVdc(@EndpointParam URI vdcURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VdcClient#captureVApp(URI, CaptureVAppParams)
|
* @see VdcApi#captureVApp(URI, CaptureVAppParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/captureVApp")
|
@Path("/action/captureVApp")
|
||||||
|
@ -78,7 +78,7 @@ public interface VdcAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) CaptureVAppParams params);
|
@BinderParam(BindToXMLPayload.class) CaptureVAppParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VdcClient#cloneMedia(URI, CloneMediaParams)
|
* @see VdcApi#cloneMedia(URI, CloneMediaParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/cloneMedia")
|
@Path("/action/cloneMedia")
|
||||||
|
@ -89,7 +89,7 @@ public interface VdcAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) CloneMediaParams params);
|
@BinderParam(BindToXMLPayload.class) CloneMediaParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VdcClient#cloneVApp(URI, CloneVAppParams)
|
* @see VdcApi#cloneVApp(URI, CloneVAppParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/cloneVApp")
|
@Path("/action/cloneVApp")
|
||||||
|
@ -100,7 +100,7 @@ public interface VdcAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) CloneVAppParams params);
|
@BinderParam(BindToXMLPayload.class) CloneVAppParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VdcClient#cloneVAppTemplate(URI, CloneVAppTemplateParams)
|
* @see VdcApi#cloneVAppTemplate(URI, CloneVAppTemplateParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/cloneVAppTemplate")
|
@Path("/action/cloneVAppTemplate")
|
||||||
|
@ -111,7 +111,7 @@ public interface VdcAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) CloneVAppTemplateParams params);
|
@BinderParam(BindToXMLPayload.class) CloneVAppTemplateParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VdcClient#composeVApp(URI, ComposeVAppParams)
|
* @see VdcApi#composeVApp(URI, ComposeVAppParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/composeVApp")
|
@Path("/action/composeVApp")
|
||||||
|
@ -122,7 +122,7 @@ public interface VdcAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) ComposeVAppParams params);
|
@BinderParam(BindToXMLPayload.class) ComposeVAppParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VdcClient#instantiateVApp(URI, InstantiateVAppParamsType)
|
* @see VdcApi#instantiateVApp(URI, InstantiateVAppParamsType)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/instantiateVAppTemplate")
|
@Path("/action/instantiateVAppTemplate")
|
||||||
|
@ -133,7 +133,7 @@ public interface VdcAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) InstantiateVAppParams params);
|
@BinderParam(BindToXMLPayload.class) InstantiateVAppParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VdcClient#uploadVAppTemplate(URI, UploadVAppTemplateParams)
|
* @see VdcApi#uploadVAppTemplate(URI, UploadVAppTemplateParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/uploadVAppTemplate")
|
@Path("/action/uploadVAppTemplate")
|
||||||
|
@ -144,7 +144,7 @@ public interface VdcAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) UploadVAppTemplateParams params);
|
@BinderParam(BindToXMLPayload.class) UploadVAppTemplateParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VdcClient#createMedia(URI, Media)
|
* @see VdcApi#createMedia(URI, Media)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/media")
|
@Path("/media")
|
||||||
|
@ -158,6 +158,6 @@ public interface VdcAsyncClient {
|
||||||
* @return asynchronous access to {@link Metadata.Readable} features
|
* @return asynchronous access to {@link Metadata.Readable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Readable getMetadataClient();
|
MetadataAsyncApi.Readable getMetadataApi();
|
||||||
|
|
||||||
}
|
}
|
|
@ -46,17 +46,17 @@ import org.jclouds.vcloud.director.v1_5.domain.section.VirtualHardwareSection;
|
||||||
* Provides synchronous access to {@link Vm} objects.
|
* Provides synchronous access to {@link Vm} objects.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
* @see VmAsyncClient
|
* @see VmAsyncApi
|
||||||
* @version 1.5
|
* @version 1.5
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface VmClient {
|
public interface VmApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a {@link Vm}.
|
* Retrieves a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#getVApp(URI)
|
* @see VAppApi#getVApp(URI)
|
||||||
*/
|
*/
|
||||||
Vm getVm(URI vmURI);
|
Vm getVm(URI vmURI);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public interface VmClient {
|
||||||
* Modifies the name/description of a {@link Vm}.
|
* Modifies the name/description of a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#modifyVApp(URI, VApp)
|
* @see VAppApi#modifyVApp(URI, VApp)
|
||||||
*/
|
*/
|
||||||
Task modifyVm(URI vmURI, Vm vm);
|
Task modifyVm(URI vmURI, Vm vm);
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public interface VmClient {
|
||||||
* Deletes a {@link Vm}.
|
* Deletes a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#deleteVApp(URI)
|
* @see VAppApi#deleteVApp(URI)
|
||||||
*/
|
*/
|
||||||
Task deleteVm(URI vmURI);
|
Task deleteVm(URI vmURI);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public interface VmClient {
|
||||||
* Deploys a {@link Vm}.
|
* Deploys a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#deploy(URI, DeployVAppParams)
|
* @see VAppApi#deploy(URI, DeployVAppParams)
|
||||||
*/
|
*/
|
||||||
Task deploy(URI vmURI, DeployVAppParams params);
|
Task deploy(URI vmURI, DeployVAppParams params);
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public interface VmClient {
|
||||||
* Discard suspended state of a {@link Vm}.
|
* Discard suspended state of a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#discardSuspendedState(URI)
|
* @see VAppApi#discardSuspendedState(URI)
|
||||||
*/
|
*/
|
||||||
Task discardSuspendedState(URI vmURI);
|
Task discardSuspendedState(URI vmURI);
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ public interface VmClient {
|
||||||
* Undeploy a {@link Vm}.
|
* Undeploy a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#undeploy(URI, UndeployVAppParams)
|
* @see VAppApi#undeploy(URI, UndeployVAppParams)
|
||||||
*/
|
*/
|
||||||
Task undeploy(URI vmURI, UndeployVAppParams params);
|
Task undeploy(URI vmURI, UndeployVAppParams params);
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ public interface VmClient {
|
||||||
* Powers off a {@link Vm}.
|
* Powers off a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#powerOff(URI)
|
* @see VAppApi#powerOff(URI)
|
||||||
*/
|
*/
|
||||||
Task powerOff(URI vmURI);
|
Task powerOff(URI vmURI);
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ public interface VmClient {
|
||||||
* Powers on a {@link Vm}.
|
* Powers on a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#powerOn(URI)
|
* @see VAppApi#powerOn(URI)
|
||||||
*/
|
*/
|
||||||
Task powerOn(URI vmURI);
|
Task powerOn(URI vmURI);
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ public interface VmClient {
|
||||||
* Reboots a {@link Vm}.
|
* Reboots a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#reboot(URI)
|
* @see VAppApi#reboot(URI)
|
||||||
*/
|
*/
|
||||||
Task reboot(URI vmURI);
|
Task reboot(URI vmURI);
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ public interface VmClient {
|
||||||
* Resets a {@link Vm}.
|
* Resets a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#reset(URI)
|
* @see VAppApi#reset(URI)
|
||||||
*/
|
*/
|
||||||
Task reset(URI vmURI);
|
Task reset(URI vmURI);
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ public interface VmClient {
|
||||||
* Shuts down a {@link Vm}.
|
* Shuts down a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#shutdown(URI)
|
* @see VAppApi#shutdown(URI)
|
||||||
*/
|
*/
|
||||||
Task shutdown(URI vmURI);
|
Task shutdown(URI vmURI);
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ public interface VmClient {
|
||||||
* Suspends a {@link Vm}.
|
* Suspends a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 0.9
|
* @since 0.9
|
||||||
* @see VAppClient#suspend(URI)
|
* @see VAppApi#suspend(URI)
|
||||||
*/
|
*/
|
||||||
Task suspend(URI vmURI);
|
Task suspend(URI vmURI);
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ public interface VmClient {
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
* @see VAppClient#
|
* @see VAppApi#
|
||||||
*/
|
*/
|
||||||
GuestCustomizationSection getGuestCustomizationSection(URI vmURI);
|
GuestCustomizationSection getGuestCustomizationSection(URI vmURI);
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ public interface VmClient {
|
||||||
* Retrieves {@link Vm} product sections.
|
* Retrieves {@link Vm} product sections.
|
||||||
*
|
*
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
* @see VAppClient#getProductSections(URI)
|
* @see VAppApi#getProductSections(URI)
|
||||||
*/
|
*/
|
||||||
ProductSectionList getProductSections(URI vmURI);
|
ProductSectionList getProductSections(URI vmURI);
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ public interface VmClient {
|
||||||
* Modifies the product section information of a {@link Vm}.
|
* Modifies the product section information of a {@link Vm}.
|
||||||
*
|
*
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
* @see VAppClient#modifyProductSections(URI, ProductSectionList)
|
* @see VAppApi#modifyProductSections(URI, ProductSectionList)
|
||||||
*/
|
*/
|
||||||
Task modifyProductSections(URI vmURI, ProductSectionList sectionList);
|
Task modifyProductSections(URI vmURI, ProductSectionList sectionList);
|
||||||
|
|
||||||
|
@ -514,5 +514,5 @@ public interface VmClient {
|
||||||
* Synchronous access to {@link Vm} {@link Metadata} features.
|
* Synchronous access to {@link Vm} {@link Metadata} features.
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Writeable getMetadataClient();
|
MetadataApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -77,13 +77,13 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
* @see VmClient
|
* @see VmApi
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface VmAsyncClient {
|
public interface VmAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getVm(URI)
|
* @see VmApi#getVm(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes(VM)
|
@Consumes(VM)
|
||||||
|
@ -92,7 +92,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Vm> getVm(@EndpointParam URI vmURI);
|
ListenableFuture<Vm> getVm(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyVm(URI, Vm)
|
* @see VmApi#modifyVm(URI, Vm)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Produces(VM)
|
@Produces(VM)
|
||||||
|
@ -102,7 +102,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) Vm vApp);
|
@BinderParam(BindToXMLPayload.class) Vm vApp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#deleteVm(URI)
|
* @see VmApi#deleteVm(URI)
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Consumes(TASK)
|
@Consumes(TASK)
|
||||||
|
@ -110,7 +110,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> deleteVm(@EndpointParam URI vmURI);
|
ListenableFuture<Task> deleteVm(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#consolidateVm(URI)
|
* @see VmApi#consolidateVm(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/consolidate")
|
@Path("/action/consolidate")
|
||||||
|
@ -119,7 +119,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> consolidateVm(@EndpointParam URI vmURI);
|
ListenableFuture<Task> consolidateVm(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#deploy(URI, DeployVAppParams)
|
* @see VmApi#deploy(URI, DeployVAppParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/deploy")
|
@Path("/action/deploy")
|
||||||
|
@ -130,7 +130,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) DeployVAppParams params);
|
@BinderParam(BindToXMLPayload.class) DeployVAppParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#discardSuspendedState(URI)
|
* @see VmApi#discardSuspendedState(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/discardSuspendedState")
|
@Path("/action/discardSuspendedState")
|
||||||
|
@ -139,7 +139,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> discardSuspendedState(@EndpointParam URI vmURI);
|
ListenableFuture<Task> discardSuspendedState(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#installVMwareTools(URI)
|
* @see VmApi#installVMwareTools(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/installVMwareTools")
|
@Path("/action/installVMwareTools")
|
||||||
|
@ -148,7 +148,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> installVMwareTools(@EndpointParam URI vmURI);
|
ListenableFuture<Task> installVMwareTools(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#relocateVm(URI, RelocateParams)
|
* @see VmApi#relocateVm(URI, RelocateParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/relocate")
|
@Path("/action/relocate")
|
||||||
|
@ -159,7 +159,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) RelocateParams params);
|
@BinderParam(BindToXMLPayload.class) RelocateParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#undeploy(URI, UndeployVAppParams)
|
* @see VmApi#undeploy(URI, UndeployVAppParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/undeploy")
|
@Path("/action/undeploy")
|
||||||
|
@ -170,7 +170,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) UndeployVAppParams params);
|
@BinderParam(BindToXMLPayload.class) UndeployVAppParams params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#upgradeHardwareVersion(URI)
|
* @see VmApi#upgradeHardwareVersion(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/upgradeHardwareVersion")
|
@Path("/action/upgradeHardwareVersion")
|
||||||
|
@ -179,7 +179,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> upgradeHardwareVersion(@EndpointParam URI vmURI);
|
ListenableFuture<Task> upgradeHardwareVersion(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#powerOff(URI)
|
* @see VmApi#powerOff(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/powerOff")
|
@Path("/power/action/powerOff")
|
||||||
|
@ -188,7 +188,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> powerOff(@EndpointParam URI vmURI);
|
ListenableFuture<Task> powerOff(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#powerOn(URI)
|
* @see VmApi#powerOn(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/powerOn")
|
@Path("/power/action/powerOn")
|
||||||
|
@ -197,7 +197,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> powerOn(@EndpointParam URI vmURI);
|
ListenableFuture<Task> powerOn(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#reboot(URI)
|
* @see VmApi#reboot(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/powerOff")
|
@Path("/power/action/powerOff")
|
||||||
|
@ -206,7 +206,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> reboot(@EndpointParam URI vmURI);
|
ListenableFuture<Task> reboot(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#reset(URI)
|
* @see VmApi#reset(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/reset")
|
@Path("/power/action/reset")
|
||||||
|
@ -215,7 +215,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> reset(@EndpointParam URI vmURI);
|
ListenableFuture<Task> reset(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#shutdown(URI)
|
* @see VmApi#shutdown(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/shutdown")
|
@Path("/power/action/shutdown")
|
||||||
|
@ -224,7 +224,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> shutdown(@EndpointParam URI vmURI);
|
ListenableFuture<Task> shutdown(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#suspend(URI)
|
* @see VmApi#suspend(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/power/action/suspend")
|
@Path("/power/action/suspend")
|
||||||
|
@ -233,7 +233,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<Task> suspend(@EndpointParam URI vmURI);
|
ListenableFuture<Task> suspend(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getGuestCustomizationSection(URI)
|
* @see VmApi#getGuestCustomizationSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/guestCustomizationSection")
|
@Path("/guestCustomizationSection")
|
||||||
|
@ -243,7 +243,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<GuestCustomizationSection> getGuestCustomizationSection(@EndpointParam URI vmURI);
|
ListenableFuture<GuestCustomizationSection> getGuestCustomizationSection(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyGuestCustomizationSection(URI, GuestCustomizationSection)
|
* @see VmApi#modifyGuestCustomizationSection(URI, GuestCustomizationSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/guestCustomizationSection")
|
@Path("/guestCustomizationSection")
|
||||||
|
@ -254,7 +254,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) GuestCustomizationSection section);
|
@BinderParam(BindToXMLPayload.class) GuestCustomizationSection section);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#ejectMedia(URI, MediaInsertOrEjectParams)
|
* @see VmApi#ejectMedia(URI, MediaInsertOrEjectParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/media/action/ejectMedia")
|
@Path("/media/action/ejectMedia")
|
||||||
|
@ -265,7 +265,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams);
|
@BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#insertMedia(URI, MediaInsertOrEjectParams)
|
* @see VmApi#insertMedia(URI, MediaInsertOrEjectParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/media/action/insertMedia")
|
@Path("/media/action/insertMedia")
|
||||||
|
@ -276,7 +276,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams);
|
@BinderParam(BindToXMLPayload.class) MediaInsertOrEjectParams mediaParams);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getNetworkConnectionSection(URI)
|
* @see VmApi#getNetworkConnectionSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/networkConnectionSection")
|
@Path("/networkConnectionSection")
|
||||||
|
@ -286,7 +286,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<NetworkConnectionSection> getNetworkConnectionSection(@EndpointParam URI vmURI);
|
ListenableFuture<NetworkConnectionSection> getNetworkConnectionSection(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyNetworkConnectionSection(URI, NetworkConnectionSection)
|
* @see VmApi#modifyNetworkConnectionSection(URI, NetworkConnectionSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/networkConnectionSection")
|
@Path("/networkConnectionSection")
|
||||||
|
@ -297,7 +297,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) NetworkConnectionSection section);
|
@BinderParam(BindToXMLPayload.class) NetworkConnectionSection section);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getOperatingSystemSection(URI)
|
* @see VmApi#getOperatingSystemSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/operatingSystemSection")
|
@Path("/operatingSystemSection")
|
||||||
|
@ -307,7 +307,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<OperatingSystemSection> getOperatingSystemSection(@EndpointParam URI vmURI);
|
ListenableFuture<OperatingSystemSection> getOperatingSystemSection(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyOperatingSystemSection(URI, OperatingSystemSection)
|
* @see VmApi#modifyOperatingSystemSection(URI, OperatingSystemSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/operatingSystemSection")
|
@Path("/operatingSystemSection")
|
||||||
|
@ -318,7 +318,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) OperatingSystemSection section);
|
@BinderParam(BindToXMLPayload.class) OperatingSystemSection section);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getProductSections(URI)
|
* @see VmApi#getProductSections(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/productSections")
|
@Path("/productSections")
|
||||||
|
@ -328,7 +328,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<ProductSectionList> getProductSections(@EndpointParam URI vmURI);
|
ListenableFuture<ProductSectionList> getProductSections(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyProductSections(URI, ProductSectionList)
|
* @see VmApi#modifyProductSections(URI, ProductSectionList)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/productSections")
|
@Path("/productSections")
|
||||||
|
@ -339,7 +339,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) ProductSectionList sectionList);
|
@BinderParam(BindToXMLPayload.class) ProductSectionList sectionList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getPendingQuestion(URI)
|
* @see VmApi#getPendingQuestion(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/question")
|
@Path("/question")
|
||||||
|
@ -349,7 +349,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<VmPendingQuestion> getPendingQuestion(@EndpointParam URI vmURI);
|
ListenableFuture<VmPendingQuestion> getPendingQuestion(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#answerQuestion(URI, VmQuestionAnswer)
|
* @see VmApi#answerQuestion(URI, VmQuestionAnswer)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/question/action/answer")
|
@Path("/question/action/answer")
|
||||||
|
@ -360,7 +360,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) VmQuestionAnswer answer);
|
@BinderParam(BindToXMLPayload.class) VmQuestionAnswer answer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getRuntimeInfoSection(URI)
|
* @see VmApi#getRuntimeInfoSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/runtimeInfoSection")
|
@Path("/runtimeInfoSection")
|
||||||
|
@ -370,7 +370,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<RuntimeInfoSection> getRuntimeInfoSection(@EndpointParam URI vmURI);
|
ListenableFuture<RuntimeInfoSection> getRuntimeInfoSection(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getScreenImage(URI)
|
* @see VmApi#getScreenImage(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/screen")
|
@Path("/screen")
|
||||||
|
@ -380,7 +380,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<byte[]> getScreenImage(@EndpointParam URI vmURI);
|
ListenableFuture<byte[]> getScreenImage(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getScreenTicket(URI)
|
* @see VmApi#getScreenTicket(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/screen/action/acquireTicket")
|
@Path("/screen/action/acquireTicket")
|
||||||
|
@ -390,7 +390,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<ScreenTicket> getScreenTicket(@EndpointParam URI vmURI);
|
ListenableFuture<ScreenTicket> getScreenTicket(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getVirtualHardwareSection(URI)
|
* @see VmApi#getVirtualHardwareSection(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/virtualHardwareSection")
|
@Path("/virtualHardwareSection")
|
||||||
|
@ -400,7 +400,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<VirtualHardwareSection> getVirtualHardwareSection(@EndpointParam URI vmURI);
|
ListenableFuture<VirtualHardwareSection> getVirtualHardwareSection(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyVirtualHardwareSection(URI, VirtualHardwareSection)
|
* @see VmApi#modifyVirtualHardwareSection(URI, VirtualHardwareSection)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/virtualHardwareSection")
|
@Path("/virtualHardwareSection")
|
||||||
|
@ -411,7 +411,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) VirtualHardwareSection section);
|
@BinderParam(BindToXMLPayload.class) VirtualHardwareSection section);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getVirtualHardwareSectionCpu(URI)
|
* @see VmApi#getVirtualHardwareSectionCpu(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/virtualHardwareSection/cpu")
|
@Path("/virtualHardwareSection/cpu")
|
||||||
|
@ -421,7 +421,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<RasdItem> getVirtualHardwareSectionCpu(@EndpointParam URI vmURI);
|
ListenableFuture<RasdItem> getVirtualHardwareSectionCpu(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyVirtualHardwareSectionCpu(URI, ResourceAllocationSettingData)
|
* @see VmApi#modifyVirtualHardwareSectionCpu(URI, ResourceAllocationSettingData)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/virtualHardwareSection/cpu")
|
@Path("/virtualHardwareSection/cpu")
|
||||||
|
@ -432,7 +432,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) RasdItem rasd);
|
@BinderParam(BindToXMLPayload.class) RasdItem rasd);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getVirtualHardwareSectionDisks(URI)
|
* @see VmApi#getVirtualHardwareSectionDisks(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/virtualHardwareSection/disks")
|
@Path("/virtualHardwareSection/disks")
|
||||||
|
@ -442,7 +442,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<RasdItemsList> getVirtualHardwareSectionDisks(@EndpointParam URI vmURI);
|
ListenableFuture<RasdItemsList> getVirtualHardwareSectionDisks(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyVirtualHardwareSectionDisks(URI, RasdItemsList)
|
* @see VmApi#modifyVirtualHardwareSectionDisks(URI, RasdItemsList)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/virtualHardwareSection/disks")
|
@Path("/virtualHardwareSection/disks")
|
||||||
|
@ -453,7 +453,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList);
|
@BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getVirtualHardwareSectionMedia(URI)
|
* @see VmApi#getVirtualHardwareSectionMedia(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/virtualHardwareSection/media")
|
@Path("/virtualHardwareSection/media")
|
||||||
|
@ -463,7 +463,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<RasdItemsList> getVirtualHardwareSectionMedia(@EndpointParam URI vmURI);
|
ListenableFuture<RasdItemsList> getVirtualHardwareSectionMedia(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getVirtualHardwareSectionMemory(URI)
|
* @see VmApi#getVirtualHardwareSectionMemory(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/virtualHardwareSection/memory")
|
@Path("/virtualHardwareSection/memory")
|
||||||
|
@ -473,7 +473,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<RasdItem> getVirtualHardwareSectionMemory(@EndpointParam URI vmURI);
|
ListenableFuture<RasdItem> getVirtualHardwareSectionMemory(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyVirtualHardwareSectionMemory(URI, ResourceAllocationSettingData)
|
* @see VmApi#modifyVirtualHardwareSectionMemory(URI, ResourceAllocationSettingData)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/virtualHardwareSection/memory")
|
@Path("/virtualHardwareSection/memory")
|
||||||
|
@ -484,7 +484,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) RasdItem rasd);
|
@BinderParam(BindToXMLPayload.class) RasdItem rasd);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getVirtualHardwareSectionNetworkCards(URI)
|
* @see VmApi#getVirtualHardwareSectionNetworkCards(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/virtualHardwareSection/networkCards")
|
@Path("/virtualHardwareSection/networkCards")
|
||||||
|
@ -494,7 +494,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<RasdItemsList> getVirtualHardwareSectionNetworkCards(@EndpointParam URI vmURI);
|
ListenableFuture<RasdItemsList> getVirtualHardwareSectionNetworkCards(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyVirtualHardwareSectionNetworkCards(URI, RasdItemsList)
|
* @see VmApi#modifyVirtualHardwareSectionNetworkCards(URI, RasdItemsList)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/virtualHardwareSection/networkCards")
|
@Path("/virtualHardwareSection/networkCards")
|
||||||
|
@ -505,7 +505,7 @@ public interface VmAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList);
|
@BinderParam(BindToXMLPayload.class) RasdItemsList rasdItemsList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getVirtualHardwareSectionSerialPorts(URI)
|
* @see VmApi#getVirtualHardwareSectionSerialPorts(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/virtualHardwareSection/serialPorts")
|
@Path("/virtualHardwareSection/serialPorts")
|
||||||
|
@ -515,7 +515,7 @@ public interface VmAsyncClient {
|
||||||
ListenableFuture<RasdItemsList> getVirtualHardwareSectionSerialPorts(@EndpointParam URI vmURI);
|
ListenableFuture<RasdItemsList> getVirtualHardwareSectionSerialPorts(@EndpointParam URI vmURI);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyVirtualHardwareSectionSerialPorts(URI, RasdItemsList)
|
* @see VmApi#modifyVirtualHardwareSectionSerialPorts(URI, RasdItemsList)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/virtualHardwareSection/serialPorts")
|
@Path("/virtualHardwareSection/serialPorts")
|
||||||
|
@ -529,5 +529,5 @@ public interface VmAsyncClient {
|
||||||
* Asynchronous access to {@Vm} {@link Metadata} features.
|
* Asynchronous access to {@Vm} {@link Metadata} features.
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Writeable getMetadataClient();
|
MetadataAsyncApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -26,17 +26,17 @@ import org.jclouds.rest.annotations.Delegate;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
|
import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.PublishCatalogParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.PublishCatalogParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.CatalogClient;
|
import org.jclouds.vcloud.director.v1_5.features.CatalogApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link AdminCatalog} objects.
|
* Provides synchronous access to {@link AdminCatalog} objects.
|
||||||
*
|
*
|
||||||
* @see AdminCatalogAsyncClient
|
* @see AdminCatalogAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface AdminCatalogClient extends CatalogClient {
|
public interface AdminCatalogApi extends CatalogApi {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,5 +118,5 @@ public interface AdminCatalogClient extends CatalogClient {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Writeable getMetadataClient();
|
MetadataApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -40,21 +40,21 @@ import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
|
import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.PublishCatalogParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.PublishCatalogParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.CatalogAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.CatalogAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminCatalogClient
|
* @see AdminCatalogApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
|
public interface AdminCatalogAsyncApi extends CatalogAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminClient#createCatalog(URI, AdminCatalog)
|
* @see AdminApi#createCatalog(URI, AdminCatalog)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/catalogs")
|
@Path("/catalogs")
|
||||||
|
@ -65,7 +65,7 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) AdminCatalog catalog);
|
@BinderParam(BindToXMLPayload.class) AdminCatalog catalog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminClient#getCatalog(URI)
|
* @see AdminApi#getCatalog(URI)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@GET
|
@GET
|
||||||
|
@ -75,7 +75,7 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
|
||||||
ListenableFuture<AdminCatalog> getCatalog(@EndpointParam URI catalogRef);
|
ListenableFuture<AdminCatalog> getCatalog(@EndpointParam URI catalogRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminClient#getCatalog(URI)
|
* @see AdminApi#getCatalog(URI)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Consumes(VCloudDirectorMediaType.ADMIN_CATALOG)
|
@Consumes(VCloudDirectorMediaType.ADMIN_CATALOG)
|
||||||
|
@ -85,7 +85,7 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) AdminCatalog catalog);
|
@BinderParam(BindToXMLPayload.class) AdminCatalog catalog);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminClient#deleteCatalog(URI)
|
* @see AdminApi#deleteCatalog(URI)
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -93,7 +93,7 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
|
||||||
ListenableFuture<Void> deleteCatalog(@EndpointParam URI catalogRef);
|
ListenableFuture<Void> deleteCatalog(@EndpointParam URI catalogRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminClient#getOwner(URI)
|
* @see AdminApi#getOwner(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/owner")
|
@Path("/owner")
|
||||||
|
@ -103,7 +103,7 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
|
||||||
ListenableFuture<Owner> getOwner(@EndpointParam URI catalogRef);
|
ListenableFuture<Owner> getOwner(@EndpointParam URI catalogRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminClient#setOwner(URI, Owner)
|
* @see AdminApi#setOwner(URI, Owner)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/owner")
|
@Path("/owner")
|
||||||
|
@ -114,7 +114,7 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) Owner newOwner);
|
@BinderParam(BindToXMLPayload.class) Owner newOwner);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminClient#AdminClient(URI, PublishCatalogParams)
|
* @see AdminApi#AdminApi(URI, PublishCatalogParams)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/publish")
|
@Path("/action/publish")
|
||||||
|
@ -129,6 +129,6 @@ public interface AdminCatalogAsyncClient extends CatalogAsyncClient {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Writeable getMetadataClient();
|
MetadataAsyncApi.Writeable getMetadataApi();
|
||||||
|
|
||||||
}
|
}
|
|
@ -26,17 +26,17 @@ import org.jclouds.rest.annotations.Delegate;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.network.Network;
|
import org.jclouds.vcloud.director.v1_5.domain.network.Network;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.NetworkClient;
|
import org.jclouds.vcloud.director.v1_5.features.NetworkApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to admin {@link Network} objects.
|
* Provides synchronous access to admin {@link Network} objects.
|
||||||
*
|
*
|
||||||
* @see AdminNetworkAsyncClient
|
* @see AdminNetworkAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface AdminNetworkClient extends NetworkClient {
|
public interface AdminNetworkApi extends NetworkApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets admin representation of network. This operation could return admin
|
* Gets admin representation of network. This operation could return admin
|
||||||
|
@ -86,10 +86,10 @@ public interface AdminNetworkClient extends NetworkClient {
|
||||||
Task resetNetwork(URI networkRef);
|
Task resetNetwork(URI networkRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to admin {@link MetadataClient.Writeable} features
|
* @return synchronous access to admin {@link MetadataApi.Writeable} features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Writeable getMetadataClient();
|
MetadataApi.Writeable getMetadataApi();
|
||||||
|
|
||||||
}
|
}
|
|
@ -39,21 +39,21 @@ import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.network.ExternalNetwork;
|
import org.jclouds.vcloud.director.v1_5.domain.network.ExternalNetwork;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.NetworkAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.NetworkAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminNetworkClient
|
* @see AdminNetworkApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface AdminNetworkAsyncClient extends NetworkAsyncClient {
|
public interface AdminNetworkAsyncApi extends NetworkAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminNetworkClient#getNetwork(URI)
|
* @see AdminNetworkApi#getNetwork(URI)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@GET
|
@GET
|
||||||
|
@ -63,7 +63,7 @@ public interface AdminNetworkAsyncClient extends NetworkAsyncClient {
|
||||||
ListenableFuture<ExternalNetwork> getNetwork(@EndpointParam URI networkRef);
|
ListenableFuture<ExternalNetwork> getNetwork(@EndpointParam URI networkRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminNetworkClient#updateNetwork(URI, OrgNetwork)
|
* @see AdminNetworkApi#updateNetwork(URI, OrgNetwork)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Consumes(VCloudDirectorMediaType.TASK)
|
@Consumes(VCloudDirectorMediaType.TASK)
|
||||||
|
@ -73,7 +73,7 @@ public interface AdminNetworkAsyncClient extends NetworkAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) OrgNetwork network);
|
@BinderParam(BindToXMLPayload.class) OrgNetwork network);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminNetworkClient#resetNetwork(URI)
|
* @see AdminNetworkApi#resetNetwork(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/reset")
|
@Path("/action/reset")
|
||||||
|
@ -82,9 +82,9 @@ public interface AdminNetworkAsyncClient extends NetworkAsyncClient {
|
||||||
ListenableFuture<Task> resetNetwork(@EndpointParam URI networkRef);
|
ListenableFuture<Task> resetNetwork(@EndpointParam URI networkRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to admin {@link MetadataAsyncClient.Writeable} features
|
* @return asynchronous access to admin {@link MetadataAsyncApi.Writeable} features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Writeable getMetadataClient();
|
MetadataAsyncApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -31,17 +31,17 @@ import org.jclouds.vcloud.director.v1_5.domain.org.OrgLeaseSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgPasswordPolicySettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgPasswordPolicySettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgVAppTemplateLeaseSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgVAppTemplateLeaseSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.OrgClient;
|
import org.jclouds.vcloud.director.v1_5.features.OrgApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link Org} objects.
|
* Provides synchronous access to {@link Org} objects.
|
||||||
*
|
*
|
||||||
* @see GroupAsyncClient
|
* @see GroupAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface AdminOrgClient extends OrgClient {
|
public interface AdminOrgApi extends OrgApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves an admin view of an organization.
|
* Retrieves an admin view of an organization.
|
||||||
|
@ -220,10 +220,10 @@ public interface AdminOrgClient extends OrgClient {
|
||||||
OrgVAppTemplateLeaseSettings newSettings);
|
OrgVAppTemplateLeaseSettings newSettings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to admin {@link MetadataClient.Writeable} features
|
* @return synchronous access to admin {@link MetadataApi.Writeable} features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Writeable getMetadataClient();
|
MetadataApi.Writeable getMetadataApi();
|
||||||
|
|
||||||
}
|
}
|
|
@ -43,21 +43,21 @@ import org.jclouds.vcloud.director.v1_5.domain.org.OrgLeaseSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgPasswordPolicySettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgPasswordPolicySettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgVAppTemplateLeaseSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgVAppTemplateLeaseSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.OrgAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.OrgAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient
|
* @see AdminOrgApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
public interface AdminOrgAsyncApi extends OrgAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#getOrg(URI)
|
* @see AdminOrgApi#getOrg(URI)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@GET
|
@GET
|
||||||
|
@ -67,7 +67,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
ListenableFuture<AdminOrg> getOrg(@EndpointParam URI orgRef);
|
ListenableFuture<AdminOrg> getOrg(@EndpointParam URI orgRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#getSettings(URI)
|
* @see AdminOrgApi#getSettings(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/settings")
|
@Path("/settings")
|
||||||
|
@ -77,7 +77,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
ListenableFuture<OrgSettings> getSettings(@EndpointParam URI orgRef);
|
ListenableFuture<OrgSettings> getSettings(@EndpointParam URI orgRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#updateSettings(URI, OrgSettings)
|
* @see AdminOrgApi#updateSettings(URI, OrgSettings)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/settings")
|
@Path("/settings")
|
||||||
|
@ -88,7 +88,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) OrgSettings settings);
|
@BinderParam(BindToXMLPayload.class) OrgSettings settings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#getEmailSettings(URI)
|
* @see AdminOrgApi#getEmailSettings(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/settings/email")
|
@Path("/settings/email")
|
||||||
|
@ -98,7 +98,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
ListenableFuture<OrgEmailSettings> getEmailSettings(@EndpointParam URI orgRef);
|
ListenableFuture<OrgEmailSettings> getEmailSettings(@EndpointParam URI orgRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#updateEmailSettings(URI, OrgEmailSettings)
|
* @see AdminOrgApi#updateEmailSettings(URI, OrgEmailSettings)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/settings/email")
|
@Path("/settings/email")
|
||||||
|
@ -109,7 +109,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) OrgEmailSettings settings);
|
@BinderParam(BindToXMLPayload.class) OrgEmailSettings settings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#getGeneralSettings(URI)
|
* @see AdminOrgApi#getGeneralSettings(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/settings/general")
|
@Path("/settings/general")
|
||||||
|
@ -119,7 +119,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
ListenableFuture<OrgGeneralSettings> getGeneralSettings(@EndpointParam URI orgRef);
|
ListenableFuture<OrgGeneralSettings> getGeneralSettings(@EndpointParam URI orgRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#updateGeneralSettings(URI, OrgGeneralSettings)
|
* @see AdminOrgApi#updateGeneralSettings(URI, OrgGeneralSettings)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/settings/general")
|
@Path("/settings/general")
|
||||||
|
@ -131,7 +131,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) OrgGeneralSettings settings);
|
@BinderParam(BindToXMLPayload.class) OrgGeneralSettings settings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#getPasswordPolicy(URI)
|
* @see AdminOrgApi#getPasswordPolicy(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/settings/ldap")
|
@Path("/settings/ldap")
|
||||||
|
@ -141,7 +141,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
ListenableFuture<OrgLdapSettings> getLdapSettings(@EndpointParam URI orgRef);
|
ListenableFuture<OrgLdapSettings> getLdapSettings(@EndpointParam URI orgRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#getPasswordPolicy(URI)
|
* @see AdminOrgApi#getPasswordPolicy(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/settings/passwordPolicy")
|
@Path("/settings/passwordPolicy")
|
||||||
|
@ -151,7 +151,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
ListenableFuture<OrgPasswordPolicySettings> getPasswordPolicy(@EndpointParam URI orgRef);
|
ListenableFuture<OrgPasswordPolicySettings> getPasswordPolicy(@EndpointParam URI orgRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#updatePasswordPolicy(URI, OrgPasswordPolicySettings)
|
* @see AdminOrgApi#updatePasswordPolicy(URI, OrgPasswordPolicySettings)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/settings/passwordPolicy")
|
@Path("/settings/passwordPolicy")
|
||||||
|
@ -162,7 +162,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) OrgPasswordPolicySettings settings);
|
@BinderParam(BindToXMLPayload.class) OrgPasswordPolicySettings settings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#getVAppLeaseSettings(URI)
|
* @see AdminOrgApi#getVAppLeaseSettings(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/settings/vAppLeaseSettings")
|
@Path("/settings/vAppLeaseSettings")
|
||||||
|
@ -172,7 +172,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
ListenableFuture<OrgLeaseSettings> getVAppLeaseSettings(@EndpointParam URI orgRef);
|
ListenableFuture<OrgLeaseSettings> getVAppLeaseSettings(@EndpointParam URI orgRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#updateVAppLeaseSettings(URI, OrgVAppLeaseSettings)
|
* @see AdminOrgApi#updateVAppLeaseSettings(URI, OrgVAppLeaseSettings)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/settings/vAppLeaseSettings")
|
@Path("/settings/vAppLeaseSettings")
|
||||||
|
@ -183,7 +183,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) OrgLeaseSettings settings);
|
@BinderParam(BindToXMLPayload.class) OrgLeaseSettings settings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#getVAppTemplateLeaseSettings(URI)
|
* @see AdminOrgApi#getVAppTemplateLeaseSettings(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/settings/vAppTemplateLeaseSettings")
|
@Path("/settings/vAppTemplateLeaseSettings")
|
||||||
|
@ -193,7 +193,7 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
ListenableFuture<OrgVAppTemplateLeaseSettings> getVAppTemplateLeaseSettings(@EndpointParam URI orgRef);
|
ListenableFuture<OrgVAppTemplateLeaseSettings> getVAppTemplateLeaseSettings(@EndpointParam URI orgRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminOrgClient#updateVAppTemplateLeaseSettings(URI, OrgVAppTemplateLeaseSettings)
|
* @see AdminOrgApi#updateVAppTemplateLeaseSettings(URI, OrgVAppTemplateLeaseSettings)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Path("/settings/vAppTemplateLeaseSettings")
|
@Path("/settings/vAppTemplateLeaseSettings")
|
||||||
|
@ -204,9 +204,9 @@ public interface AdminOrgAsyncClient extends OrgAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) OrgVAppTemplateLeaseSettings settings);
|
@BinderParam(BindToXMLPayload.class) OrgVAppTemplateLeaseSettings settings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to admin {@link MetadataAsyncClient.Writeable} features
|
* @return asynchronous access to admin {@link MetadataAsyncApi.Writeable} features
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Writeable getMetadataClient();
|
MetadataAsyncApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -23,16 +23,16 @@ import java.util.concurrent.TimeUnit;
|
||||||
import org.jclouds.concurrent.Timeout;
|
import org.jclouds.concurrent.Timeout;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.RoleReferences;
|
import org.jclouds.vcloud.director.v1_5.domain.RoleReferences;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.QueryClient;
|
import org.jclouds.vcloud.director.v1_5.features.QueryApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link AdminQuery} objects.
|
* Provides synchronous access to {@link AdminQuery} objects.
|
||||||
*
|
*
|
||||||
* @see AdminQueryAsyncClient
|
* @see AdminQueryAsyncApi
|
||||||
* @author Aled Sage
|
* @author Aled Sage
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface AdminQueryClient extends QueryClient {
|
public interface AdminQueryApi extends QueryApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a list of {@link Group}s for organization the org admin belongs to by using REST API general QueryHandler
|
* Retrieves a list of {@link Group}s for organization the org admin belongs to by using REST API general QueryHandler
|
|
@ -31,7 +31,7 @@ import org.jclouds.rest.annotations.QueryParams;
|
||||||
import org.jclouds.rest.annotations.RequestFilters;
|
import org.jclouds.rest.annotations.RequestFilters;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.RoleReferences;
|
import org.jclouds.vcloud.director.v1_5.domain.RoleReferences;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.QueryAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.QueryAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
@ -39,12 +39,12 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||||
/**
|
/**
|
||||||
* Provides asynchronous access to {@link AdminQuery} objects.
|
* Provides asynchronous access to {@link AdminQuery} objects.
|
||||||
*
|
*
|
||||||
* @see AdminQueryClient
|
* @see AdminQueryApi
|
||||||
* @author Aled Sage
|
* @author Aled Sage
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface AdminQueryAsyncClient extends QueryAsyncClient {
|
public interface AdminQueryAsyncApi extends QueryAsyncApi {
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/admin/groups/query")
|
@Path("/admin/groups/query")
|
|
@ -26,17 +26,17 @@ import org.jclouds.rest.annotations.Delegate;
|
||||||
import org.jclouds.rest.annotations.EndpointParam;
|
import org.jclouds.rest.annotations.EndpointParam;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.AdminVdc;
|
import org.jclouds.vcloud.director.v1_5.domain.AdminVdc;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VdcClient;
|
import org.jclouds.vcloud.director.v1_5.features.VdcApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link AdminVdc}.
|
* Provides synchronous access to {@link AdminVdc}.
|
||||||
*
|
*
|
||||||
* @see AdminVdcAsyncClient
|
* @see AdminVdcAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface AdminVdcClient extends VdcClient {
|
public interface AdminVdcApi extends VdcApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves an admin view of virtual data center. The redwood admin can disable an
|
* Retrieves an admin view of virtual data center. The redwood admin can disable an
|
||||||
|
@ -80,5 +80,5 @@ public interface AdminVdcClient extends VdcClient {
|
||||||
* @return synchronous access to {@link Writeable} features
|
* @return synchronous access to {@link Writeable} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataClient.Writeable getMetadataClient();
|
MetadataApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -37,18 +37,18 @@ import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.AdminVdc;
|
import org.jclouds.vcloud.director.v1_5.domain.AdminVdc;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VdcAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.VdcAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AdminVdcClient
|
* @see AdminVdcApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface AdminVdcAsyncClient extends VdcAsyncClient {
|
public interface AdminVdcAsyncApi extends VdcAsyncApi {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@GET
|
@GET
|
||||||
|
@ -85,5 +85,5 @@ public interface AdminVdcAsyncClient extends VdcAsyncClient {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Delegate
|
@Delegate
|
||||||
MetadataAsyncClient.Writeable getMetadataClient();
|
MetadataAsyncApi.Writeable getMetadataApi();
|
||||||
}
|
}
|
|
@ -27,11 +27,11 @@ import org.jclouds.vcloud.director.v1_5.domain.Group;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link Group} objects.
|
* Provides synchronous access to {@link Group} objects.
|
||||||
*
|
*
|
||||||
* @see GroupAsyncClient
|
* @see GroupAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface GroupClient {
|
public interface GroupApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Imports a group in an organization.
|
* Imports a group in an organization.
|
|
@ -42,11 +42,11 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see GroupClient
|
* @see GroupApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface GroupAsyncClient {
|
public interface GroupAsyncApi {
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/groups")
|
@Path("/groups")
|
||||||
|
@ -57,7 +57,7 @@ public interface GroupAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) Group group);
|
@BinderParam(BindToXMLPayload.class) Group group);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see GroupClient#getGroup(URI)
|
* @see GroupApi#getGroup(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -66,7 +66,7 @@ public interface GroupAsyncClient {
|
||||||
ListenableFuture<Group> getGroup(@EndpointParam URI groupUri);
|
ListenableFuture<Group> getGroup(@EndpointParam URI groupUri);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see GroupClient#updateGroup(URI, Group)
|
* @see GroupApi#updateGroup(URI, Group)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Consumes(VCloudDirectorMediaType.GROUP)
|
@Consumes(VCloudDirectorMediaType.GROUP)
|
||||||
|
@ -76,7 +76,7 @@ public interface GroupAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) Group group);
|
@BinderParam(BindToXMLPayload.class) Group group);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see GroupClient#deleteGroup(URI)
|
* @see GroupApi#deleteGroup(URI)
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Consumes
|
@Consumes
|
|
@ -27,11 +27,11 @@ import org.jclouds.vcloud.director.v1_5.domain.User;
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to {@link Group} objects.
|
* Provides synchronous access to {@link Group} objects.
|
||||||
*
|
*
|
||||||
* @see GroupAsyncClient
|
* @see GroupAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface UserClient {
|
public interface UserApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates or imports a user in an organization. The user could be enabled or disabled.
|
* Creates or imports a user in an organization. The user could be enabled or disabled.
|
|
@ -42,14 +42,14 @@ import org.jclouds.vcloud.director.v1_5.filters.AddVCloudAuthorizationToRequest;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UserClient
|
* @see UserApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
@RequestFilters(AddVCloudAuthorizationToRequest.class)
|
||||||
public interface UserAsyncClient {
|
public interface UserAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UserClient#createUser(URI, User)
|
* @see UserApi#createUser(URI, User)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/users")
|
@Path("/users")
|
||||||
|
@ -60,7 +60,7 @@ public interface UserAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) User user);
|
@BinderParam(BindToXMLPayload.class) User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UserClient#getUser(URI)
|
* @see UserApi#getUser(URI)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -69,7 +69,7 @@ public interface UserAsyncClient {
|
||||||
ListenableFuture<User> getUser(@EndpointParam URI userRef);
|
ListenableFuture<User> getUser(@EndpointParam URI userRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UserClient#updateUser(URI, User)
|
* @see UserApi#updateUser(URI, User)
|
||||||
*/
|
*/
|
||||||
@PUT
|
@PUT
|
||||||
@Consumes(VCloudDirectorMediaType.USER)
|
@Consumes(VCloudDirectorMediaType.USER)
|
||||||
|
@ -79,7 +79,7 @@ public interface UserAsyncClient {
|
||||||
@BinderParam(BindToXMLPayload.class) User user);
|
@BinderParam(BindToXMLPayload.class) User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UserClient#deleteUser(URI)
|
* @see UserApi#deleteUser(URI)
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -87,7 +87,7 @@ public interface UserAsyncClient {
|
||||||
ListenableFuture<Void> deleteUser(@EndpointParam URI userRef);
|
ListenableFuture<Void> deleteUser(@EndpointParam URI userRef);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UserClient#unlockUser(URI)
|
* @see UserApi#unlockUser(URI)
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path("/action/unlock")
|
@Path("/action/unlock")
|
|
@ -35,7 +35,7 @@ import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
|
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
|
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
@ -48,12 +48,12 @@ public class AllCatalogItemsInCatalog implements Function<Catalog, Iterable<? ex
|
||||||
@Resource
|
@Resource
|
||||||
public Logger logger = Logger.NULL;
|
public Logger logger = Logger.NULL;
|
||||||
|
|
||||||
private final VCloudDirectorAsyncClient aclient;
|
private final VCloudDirectorAsyncApi aapi;
|
||||||
private final ExecutorService executor;
|
private final ExecutorService executor;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
AllCatalogItemsInCatalog(VCloudDirectorAsyncClient aclient, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
AllCatalogItemsInCatalog(VCloudDirectorAsyncApi aapi, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
||||||
this.aclient = aclient;
|
this.aapi = aapi;
|
||||||
this.executor = executor;
|
this.executor = executor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class AllCatalogItemsInCatalog implements Function<Catalog, Iterable<? ex
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Future<CatalogItem> apply(Reference from) {
|
public Future<CatalogItem> apply(Reference from) {
|
||||||
return aclient.getCatalogClient().getCatalogItem(from.getHref());
|
return aapi.getCatalogApi().getCatalogItem(from.getHref());
|
||||||
}
|
}
|
||||||
|
|
||||||
}, executor, null, logger, "catalogItems in " + from.getHref());
|
}, executor, null, logger, "catalogItems in " + from.getHref());
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.jclouds.logging.Logger;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
|
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.AdminOrg;
|
import org.jclouds.vcloud.director.v1_5.domain.org.AdminOrg;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
|
|
||||||
|
@ -44,12 +44,12 @@ public class AllCatalogsInOrg implements Function<AdminOrg, Iterable<? extends C
|
||||||
@Resource
|
@Resource
|
||||||
public Logger logger = Logger.NULL;
|
public Logger logger = Logger.NULL;
|
||||||
|
|
||||||
private final VCloudDirectorAsyncClient aclient;
|
private final VCloudDirectorAsyncApi aapi;
|
||||||
private final ExecutorService executor;
|
private final ExecutorService executor;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
AllCatalogsInOrg(VCloudDirectorAsyncClient aclient, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
AllCatalogsInOrg(VCloudDirectorAsyncApi aapi, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
||||||
this.aclient = aclient;
|
this.aapi = aapi;
|
||||||
this.executor = executor;
|
this.executor = executor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class AllCatalogsInOrg implements Function<AdminOrg, Iterable<? extends C
|
||||||
new Function<Reference, Future<? extends Catalog>>() {
|
new Function<Reference, Future<? extends Catalog>>() {
|
||||||
@Override
|
@Override
|
||||||
public Future<? extends Catalog> apply(Reference from) {
|
public Future<? extends Catalog> apply(Reference from) {
|
||||||
return aclient.getCatalogClient().getCatalog(from.getHref());
|
return aapi.getCatalogApi().getCatalog(from.getHref());
|
||||||
}
|
}
|
||||||
|
|
||||||
}, executor, null, logger, "catalogs in " + org.getName());
|
}, executor, null, logger, "catalogs in " + org.getName());
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.jclouds.logging.Logger;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
|
import org.jclouds.vcloud.director.v1_5.domain.Vdc;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.AdminOrg;
|
import org.jclouds.vcloud.director.v1_5.domain.org.AdminOrg;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
|
|
||||||
|
@ -45,12 +45,12 @@ public class AllVdcsInOrg implements Function<AdminOrg, Iterable<? extends Vdc>>
|
||||||
@Resource
|
@Resource
|
||||||
public Logger logger = Logger.NULL;
|
public Logger logger = Logger.NULL;
|
||||||
|
|
||||||
private final VCloudDirectorAsyncClient aclient;
|
private final VCloudDirectorAsyncApi aapi;
|
||||||
private final ExecutorService executor;
|
private final ExecutorService executor;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
AllVdcsInOrg(VCloudDirectorAsyncClient aclient, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
AllVdcsInOrg(VCloudDirectorAsyncApi aapi, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
||||||
this.aclient = aclient;
|
this.aapi = aapi;
|
||||||
this.executor = executor;
|
this.executor = executor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public class AllVdcsInOrg implements Function<AdminOrg, Iterable<? extends Vdc>>
|
||||||
new Function<Reference, Future<? extends Vdc>>() {
|
new Function<Reference, Future<? extends Vdc>>() {
|
||||||
@Override
|
@Override
|
||||||
public Future<? extends Vdc> apply(Reference from) {
|
public Future<? extends Vdc> apply(Reference from) {
|
||||||
return aclient.getVdcClient().getVdc(from.getHref());
|
return aapi.getVdcApi().getVdc(from.getHref());
|
||||||
}
|
}
|
||||||
|
|
||||||
}, executor, null, logger, "vdcs in org " + org.getName());
|
}, executor, null, logger, "vdcs in org " + org.getName());
|
||||||
|
|
|
@ -26,19 +26,19 @@ import javax.inject.Singleton;
|
||||||
import org.jclouds.domain.Credentials;
|
import org.jclouds.domain.Credentials;
|
||||||
import org.jclouds.vcloud.director.v1_5.annotations.Login;
|
import org.jclouds.vcloud.director.v1_5.annotations.Login;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
||||||
import org.jclouds.vcloud.director.v1_5.login.SessionClient;
|
import org.jclouds.vcloud.director.v1_5.login.SessionApi;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Supplier;
|
import com.google.common.base.Supplier;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class LoginUserInOrgWithPassword implements Function<Credentials, SessionWithToken> {
|
public class LoginUserInOrgWithPassword implements Function<Credentials, SessionWithToken> {
|
||||||
private final SessionClient client;
|
private final SessionApi api;
|
||||||
private final Supplier<URI> loginUrl;
|
private final Supplier<URI> loginUrl;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public LoginUserInOrgWithPassword(SessionClient client, @Login Supplier<URI> loginUrl) {
|
public LoginUserInOrgWithPassword(SessionApi api, @Login Supplier<URI> loginUrl) {
|
||||||
this.client = client;
|
this.api = api;
|
||||||
this.loginUrl = loginUrl;
|
this.loginUrl = loginUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class LoginUserInOrgWithPassword implements Function<Credentials, Session
|
||||||
String org = input.identity.substring(input.identity.lastIndexOf('@') + 1);
|
String org = input.identity.substring(input.identity.lastIndexOf('@') + 1);
|
||||||
String password = input.credential;
|
String password = input.credential;
|
||||||
|
|
||||||
return client.loginUserInOrgWithPassword(loginUrl.get(), user, org, password);
|
return api.loginUserInOrgWithPassword(loginUrl.get(), user, org, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.jclouds.rest.ResourceNotFoundException;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.Org;
|
import org.jclouds.vcloud.director.v1_5.domain.org.Org;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.OrgClient;
|
import org.jclouds.vcloud.director.v1_5.features.OrgApi;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
@ -37,11 +37,11 @@ import com.google.common.base.Preconditions;
|
||||||
*/
|
*/
|
||||||
@Singleton
|
@Singleton
|
||||||
public class OrgReferenceToTaskListEndpoint implements Function<Object, URI> {
|
public class OrgReferenceToTaskListEndpoint implements Function<Object, URI> {
|
||||||
private final OrgClient client;
|
private final OrgApi api;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public OrgReferenceToTaskListEndpoint(OrgClient client) {
|
public OrgReferenceToTaskListEndpoint(OrgApi api) {
|
||||||
this.client = client;
|
this.api = api;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -49,7 +49,7 @@ public class OrgReferenceToTaskListEndpoint implements Function<Object, URI> {
|
||||||
Preconditions.checkNotNull(input);
|
Preconditions.checkNotNull(input);
|
||||||
Preconditions.checkArgument(input instanceof URI);
|
Preconditions.checkArgument(input instanceof URI);
|
||||||
URI reference = (URI) input;
|
URI reference = (URI) input;
|
||||||
Org org = client.getOrg(reference);
|
Org org = api.getOrg(reference);
|
||||||
if (org == null) {
|
if (org == null) {
|
||||||
throw new ResourceNotFoundException();
|
throw new ResourceNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.jclouds.domain.Location;
|
||||||
import org.jclouds.domain.LocationScope;
|
import org.jclouds.domain.LocationScope;
|
||||||
import org.jclouds.logging.Logger;
|
import org.jclouds.logging.Logger;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.Org;
|
import org.jclouds.vcloud.director.v1_5.domain.org.Org;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
@ -49,12 +49,12 @@ import com.google.common.collect.Sets;
|
||||||
public class OrgsForLocations implements Function<Iterable<Location>, Iterable<? extends Org>> {
|
public class OrgsForLocations implements Function<Iterable<Location>, Iterable<? extends Org>> {
|
||||||
@Resource
|
@Resource
|
||||||
public Logger logger = Logger.NULL;
|
public Logger logger = Logger.NULL;
|
||||||
private final VCloudDirectorAsyncClient aclient;
|
private final VCloudDirectorAsyncApi aapi;
|
||||||
private final ExecutorService executor;
|
private final ExecutorService executor;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
OrgsForLocations(VCloudDirectorAsyncClient aclient, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
OrgsForLocations(VCloudDirectorAsyncApi aapi, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
||||||
this.aclient = aclient;
|
this.aapi = aapi;
|
||||||
this.executor = executor;
|
this.executor = executor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class OrgsForLocations implements Function<Iterable<Location>, Iterable<?
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Future<? extends Org> apply(URI from) {
|
public Future<? extends Org> apply(URI from) {
|
||||||
return aclient.getOrgClient().getOrg(from);
|
return aapi.getOrgApi().getOrg(from);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, executor, null, logger, "organizations for uris");
|
}, executor, null, logger, "organizations for uris");
|
||||||
|
|
|
@ -34,8 +34,8 @@ import org.jclouds.Constants;
|
||||||
import org.jclouds.logging.Logger;
|
import org.jclouds.logging.Logger;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.Org;
|
import org.jclouds.vcloud.director.v1_5.domain.org.Org;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
@ -47,28 +47,28 @@ import com.google.common.collect.Iterables;
|
||||||
public class OrgsForNames implements Function<Iterable<String>, Iterable<? extends Org>> {
|
public class OrgsForNames implements Function<Iterable<String>, Iterable<? extends Org>> {
|
||||||
@Resource
|
@Resource
|
||||||
public Logger logger = Logger.NULL;
|
public Logger logger = Logger.NULL;
|
||||||
private final VCloudDirectorAsyncClient aclient;
|
private final VCloudDirectorAsyncApi aapi;
|
||||||
private final VCloudDirectorClient sclient;
|
private final VCloudDirectorApi sapi;
|
||||||
private final ExecutorService executor;
|
private final ExecutorService executor;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
OrgsForNames(VCloudDirectorAsyncClient aclient,
|
OrgsForNames(VCloudDirectorAsyncApi aapi,
|
||||||
VCloudDirectorClient sclient,
|
VCloudDirectorApi sapi,
|
||||||
@Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
@Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
||||||
this.aclient = aclient;
|
this.aapi = aapi;
|
||||||
this.sclient = sclient;
|
this.sapi = sapi;
|
||||||
this.executor = executor;
|
this.executor = executor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterable<? extends Org> apply(Iterable<String> from) {
|
public Iterable<? extends Org> apply(Iterable<String> from) {
|
||||||
final Set<Reference> orgs = sclient.getOrgClient().getOrgList().getOrgs();
|
final Set<Reference> orgs = sapi.getOrgApi().getOrgList().getOrgs();
|
||||||
|
|
||||||
return transformParallel(from, new Function<String, Future<? extends Org>>() {
|
return transformParallel(from, new Function<String, Future<? extends Org>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Future<? extends Org> apply(String from) {
|
public Future<? extends Org> apply(String from) {
|
||||||
return aclient.getOrgClient().getOrg(Iterables.find(orgs, nameEquals(from)).getHref());
|
return aapi.getOrgApi().getOrg(Iterables.find(orgs, nameEquals(from)).getHref());
|
||||||
}
|
}
|
||||||
|
|
||||||
}, executor, null, logger, "organizations for names");
|
}, executor, null, logger, "organizations for names");
|
||||||
|
|
|
@ -38,7 +38,7 @@ import org.jclouds.rest.AuthorizationException;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
|
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
|
import org.jclouds.vcloud.director.v1_5.domain.VAppTemplate;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
@ -52,7 +52,7 @@ public class VAppTemplatesForCatalogItems implements Function<Iterable<CatalogIt
|
||||||
@Resource
|
@Resource
|
||||||
@Named(ComputeServiceConstants.COMPUTE_LOGGER)
|
@Named(ComputeServiceConstants.COMPUTE_LOGGER)
|
||||||
public Logger logger = Logger.NULL;
|
public Logger logger = Logger.NULL;
|
||||||
private final VCloudDirectorAsyncClient aclient;
|
private final VCloudDirectorAsyncApi aapi;
|
||||||
private final ExecutorService executor;
|
private final ExecutorService executor;
|
||||||
private final ReturnNullOnAuthorizationException returnNullOnAuthorizationException;
|
private final ReturnNullOnAuthorizationException returnNullOnAuthorizationException;
|
||||||
|
|
||||||
|
@ -68,10 +68,10 @@ public class VAppTemplatesForCatalogItems implements Function<Iterable<CatalogIt
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
VAppTemplatesForCatalogItems(VCloudDirectorAsyncClient aclient,
|
VAppTemplatesForCatalogItems(VCloudDirectorAsyncApi aapi,
|
||||||
@Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor,
|
@Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor,
|
||||||
ReturnNullOnAuthorizationException returnNullOnAuthorizationException) {
|
ReturnNullOnAuthorizationException returnNullOnAuthorizationException) {
|
||||||
this.aclient = aclient;
|
this.aapi = aapi;
|
||||||
this.executor = executor;
|
this.executor = executor;
|
||||||
this.returnNullOnAuthorizationException = returnNullOnAuthorizationException;
|
this.returnNullOnAuthorizationException = returnNullOnAuthorizationException;
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,8 @@ public class VAppTemplatesForCatalogItems implements Function<Iterable<CatalogIt
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Future<? extends VAppTemplate> apply(CatalogItem from) {
|
public Future<? extends VAppTemplate> apply(CatalogItem from) {
|
||||||
return new ExceptionParsingListenableFuture<VAppTemplate>(Futures.makeListenable(VCloudDirectorAsyncClient.class
|
return new ExceptionParsingListenableFuture<VAppTemplate>(Futures.makeListenable(VCloudDirectorAsyncApi.class
|
||||||
.cast(aclient).getVAppTemplateClient().getVAppTemplate(from.getEntity().getHref()), executor),
|
.cast(aapi).getVAppTemplateApi().getVAppTemplate(from.getEntity().getHref()), executor),
|
||||||
returnNullOnAuthorizationException);
|
returnNullOnAuthorizationException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.http.handlers.BackoffLimitedRetryHandler;
|
import org.jclouds.http.handlers.BackoffLimitedRetryHandler;
|
||||||
import org.jclouds.logging.Logger;
|
import org.jclouds.logging.Logger;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
||||||
import org.jclouds.vcloud.director.v1_5.login.SessionClient;
|
import org.jclouds.vcloud.director.v1_5.login.SessionApi;
|
||||||
|
|
||||||
import com.google.common.cache.LoadingCache;
|
import com.google.common.cache.LoadingCache;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
@ -39,7 +39,7 @@ import com.google.inject.Singleton;
|
||||||
/**
|
/**
|
||||||
* If the credentials supplied in the authentication header are invalid, or if the token has
|
* If the credentials supplied in the authentication header are invalid, or if the token has
|
||||||
* expired, the server returns HTTP response code 401. The token expires after a configurable
|
* expired, the server returns HTTP response code 401. The token expires after a configurable
|
||||||
* interval of client inactivity. The default is 30 minutes after the token is created. After the
|
* interval of api inactivity. The default is 30 minutes after the token is created. After the
|
||||||
* token expires, you must log in again to obtain a new token.
|
* token expires, you must log in again to obtain a new token.
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
|
@ -51,13 +51,13 @@ public class InvalidateSessionAndRetryOn401AndLogoutOnClose extends BackoffLimit
|
||||||
protected Logger logger = Logger.NULL;
|
protected Logger logger = Logger.NULL;
|
||||||
|
|
||||||
private final LoadingCache<Credentials, SessionWithToken> authenticationResponseCache;
|
private final LoadingCache<Credentials, SessionWithToken> authenticationResponseCache;
|
||||||
private final SessionClient sessionClient;
|
private final SessionApi sessionApi;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
protected InvalidateSessionAndRetryOn401AndLogoutOnClose(
|
protected InvalidateSessionAndRetryOn401AndLogoutOnClose(
|
||||||
LoadingCache<Credentials, SessionWithToken> authenticationResponseCache, SessionClient sessionClient) {
|
LoadingCache<Credentials, SessionWithToken> authenticationResponseCache, SessionApi sessionApi) {
|
||||||
this.authenticationResponseCache = authenticationResponseCache;
|
this.authenticationResponseCache = authenticationResponseCache;
|
||||||
this.sessionClient = sessionClient;
|
this.sessionApi = sessionApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -83,7 +83,7 @@ public class InvalidateSessionAndRetryOn401AndLogoutOnClose extends BackoffLimit
|
||||||
public void logoutOnClose() {
|
public void logoutOnClose() {
|
||||||
for (SessionWithToken s : authenticationResponseCache.asMap().values()) {
|
for (SessionWithToken s : authenticationResponseCache.asMap().values()) {
|
||||||
try {
|
try {
|
||||||
sessionClient.logoutSessionWithToken(s.getSession().getHref(), s.getToken());
|
sessionApi.logoutSessionWithToken(s.getSession().getHref(), s.getToken());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e, "error logging out session %s", s.getSession());
|
logger.error(e, "error logging out session %s", s.getSession());
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,10 +28,10 @@ import org.jclouds.rest.Utils;
|
||||||
import org.jclouds.rest.annotations.Identity;
|
import org.jclouds.rest.annotations.Identity;
|
||||||
import org.jclouds.rest.internal.RestContextImpl;
|
import org.jclouds.rest.internal.RestContextImpl;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorContext;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorContext;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
|
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
import com.google.inject.TypeLiteral;
|
import com.google.inject.TypeLiteral;
|
||||||
|
@ -40,20 +40,20 @@ import com.google.inject.TypeLiteral;
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Singleton
|
@Singleton
|
||||||
public class VCloudDirectorContextImpl extends RestContextImpl<VCloudDirectorClient, VCloudDirectorAsyncClient> implements
|
public class VCloudDirectorContextImpl extends RestContextImpl<VCloudDirectorApi, VCloudDirectorAsyncApi> implements
|
||||||
VCloudDirectorContext {
|
VCloudDirectorContext {
|
||||||
private final RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> adminContext;
|
private final RestContext<VCloudDirectorAdminApi, VCloudDirectorAdminAsyncApi> adminContext;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
VCloudDirectorContextImpl(ProviderMetadata providerMetadata, @Identity String identity, Utils utils, Closer closer,
|
VCloudDirectorContextImpl(ProviderMetadata providerMetadata, @Identity String identity, Utils utils, Closer closer,
|
||||||
Injector injector, RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> adminContext) {
|
Injector injector, RestContext<VCloudDirectorAdminApi, VCloudDirectorAdminAsyncApi> adminContext) {
|
||||||
super(providerMetadata, identity, utils, closer, injector, TypeLiteral.get(VCloudDirectorClient.class),
|
super(providerMetadata, identity, utils, closer, injector, TypeLiteral.get(VCloudDirectorApi.class),
|
||||||
TypeLiteral.get(VCloudDirectorAsyncClient.class));
|
TypeLiteral.get(VCloudDirectorAsyncApi.class));
|
||||||
this.adminContext = adminContext;
|
this.adminContext = adminContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RestContext<VCloudDirectorAdminClient, VCloudDirectorAdminAsyncClient> getAdminContext() {
|
public RestContext<VCloudDirectorAdminApi, VCloudDirectorAdminAsyncApi> getAdminContext() {
|
||||||
return adminContext;
|
return adminContext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,11 @@ import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
||||||
* Provides synchronous access to Session.
|
* Provides synchronous access to Session.
|
||||||
* <p/>
|
* <p/>
|
||||||
*
|
*
|
||||||
* @see SessionAsyncClient
|
* @see SessionAsyncApi
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface SessionClient {
|
public interface SessionApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* TODO
|
|
@ -42,13 +42,13 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||||
* Provides asynchronous access to Session via their REST API.
|
* Provides asynchronous access to Session via their REST API.
|
||||||
* <p/>
|
* <p/>
|
||||||
*
|
*
|
||||||
* @see SessionClient
|
* @see SessionApi
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public interface SessionAsyncClient {
|
public interface SessionAsyncApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SessionClient#loginUserInOrgWithPassword
|
* @see SessionApi#loginUserInOrgWithPassword
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -59,7 +59,7 @@ public interface SessionAsyncClient {
|
||||||
@PayloadParam("password") String password);
|
@PayloadParam("password") String password);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SessionClient#getSessionWithToken
|
* @see SessionApi#getSessionWithToken
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Consumes
|
@Consumes
|
||||||
|
@ -68,7 +68,7 @@ public interface SessionAsyncClient {
|
||||||
@HeaderParam("x-vcloud-authorization") String authenticationToken);
|
@HeaderParam("x-vcloud-authorization") String authenticationToken);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SessionClient#logoutSessionWithToken
|
* @see SessionApi#logoutSessionWithToken
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Consumes
|
@Consumes
|
|
@ -30,7 +30,7 @@ import org.jclouds.logging.Logger;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task.Status;
|
import org.jclouds.vcloud.director.v1_5.domain.Task.Status;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.TaskClient;
|
import org.jclouds.vcloud.director.v1_5.features.TaskApi;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
@ -42,7 +42,7 @@ import com.google.common.collect.Iterables;
|
||||||
*/
|
*/
|
||||||
public class TaskStatusEquals implements Predicate<Task> {
|
public class TaskStatusEquals implements Predicate<Task> {
|
||||||
|
|
||||||
private final TaskClient taskClient;
|
private final TaskApi taskApi;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
protected Logger logger = Logger.NULL;
|
protected Logger logger = Logger.NULL;
|
||||||
|
@ -50,12 +50,12 @@ public class TaskStatusEquals implements Predicate<Task> {
|
||||||
private Collection<Status> expectedStatuses;
|
private Collection<Status> expectedStatuses;
|
||||||
private Collection<Status> failingStatuses;
|
private Collection<Status> failingStatuses;
|
||||||
|
|
||||||
public TaskStatusEquals(TaskClient taskClient, Status expectedStatus, Set<Status> failingStatuses) {
|
public TaskStatusEquals(TaskApi taskApi, Status expectedStatus, Set<Status> failingStatuses) {
|
||||||
this(taskClient, Collections.singleton(expectedStatus), failingStatuses);
|
this(taskApi, Collections.singleton(expectedStatus), failingStatuses);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TaskStatusEquals(TaskClient taskClient, Set<Status> expectedStatuses, Set<Status> failingStatuses) {
|
public TaskStatusEquals(TaskApi taskApi, Set<Status> expectedStatuses, Set<Status> failingStatuses) {
|
||||||
this.taskClient = taskClient;
|
this.taskApi = taskApi;
|
||||||
this.expectedStatuses = expectedStatuses;
|
this.expectedStatuses = expectedStatuses;
|
||||||
this.failingStatuses = failingStatuses;
|
this.failingStatuses = failingStatuses;
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ public class TaskStatusEquals implements Predicate<Task> {
|
||||||
logger.trace("looking for status on task %s", task);
|
logger.trace("looking for status on task %s", task);
|
||||||
|
|
||||||
// TODO shouldn't we see if it's already done before getting it from API server?
|
// TODO shouldn't we see if it's already done before getting it from API server?
|
||||||
task = taskClient.getTask(task.getHref());
|
task = taskApi.getTask(task.getHref());
|
||||||
|
|
||||||
// perhaps task isn't available, yet
|
// perhaps task isn't available, yet
|
||||||
if (task == null) return false;
|
if (task == null) return false;
|
||||||
|
|
|
@ -29,7 +29,7 @@ import javax.inject.Singleton;
|
||||||
import org.jclouds.logging.Logger;
|
import org.jclouds.logging.Logger;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorException;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.TaskClient;
|
import org.jclouds.vcloud.director.v1_5.features.TaskApi;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
|
||||||
|
@ -41,14 +41,14 @@ import com.google.common.base.Predicate;
|
||||||
@Singleton
|
@Singleton
|
||||||
public class TaskSuccess implements Predicate<Task> {
|
public class TaskSuccess implements Predicate<Task> {
|
||||||
|
|
||||||
private final TaskClient taskClient;
|
private final TaskApi taskApi;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
protected Logger logger = Logger.NULL;
|
protected Logger logger = Logger.NULL;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TaskSuccess(TaskClient taskClient) {
|
public TaskSuccess(TaskApi taskApi) {
|
||||||
this.taskClient = taskClient;
|
this.taskApi = taskApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @see Predicate#apply(Object) */
|
/** @see Predicate#apply(Object) */
|
||||||
|
@ -58,7 +58,7 @@ public class TaskSuccess implements Predicate<Task> {
|
||||||
logger.trace("looking for status on task %s", task.getOperationName());
|
logger.trace("looking for status on task %s", task.getOperationName());
|
||||||
|
|
||||||
// TODO shouldn't we see if it's already done before getting it from API server?
|
// TODO shouldn't we see if it's already done before getting it from API server?
|
||||||
task = taskClient.getTask(task.getHref());
|
task = taskApi.getTask(task.getHref());
|
||||||
|
|
||||||
// perhaps task isn't available, yet
|
// perhaps task isn't available, yet
|
||||||
if (task == null) return false;
|
if (task == null) return false;
|
||||||
|
|
|
@ -23,28 +23,28 @@ import java.util.concurrent.TimeUnit;
|
||||||
import org.jclouds.concurrent.Timeout;
|
import org.jclouds.concurrent.Timeout;
|
||||||
import org.jclouds.rest.annotations.Delegate;
|
import org.jclouds.rest.annotations.Delegate;
|
||||||
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.features.CatalogClient;
|
import org.jclouds.vcloud.director.v1_5.features.CatalogApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MediaClient;
|
import org.jclouds.vcloud.director.v1_5.features.MediaApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.NetworkClient;
|
import org.jclouds.vcloud.director.v1_5.features.NetworkApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.OrgClient;
|
import org.jclouds.vcloud.director.v1_5.features.OrgApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.QueryClient;
|
import org.jclouds.vcloud.director.v1_5.features.QueryApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.TaskClient;
|
import org.jclouds.vcloud.director.v1_5.features.TaskApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.UploadClient;
|
import org.jclouds.vcloud.director.v1_5.features.UploadApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppClient;
|
import org.jclouds.vcloud.director.v1_5.features.VAppApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateClient;
|
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VdcClient;
|
import org.jclouds.vcloud.director.v1_5.features.VdcApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VmClient;
|
import org.jclouds.vcloud.director.v1_5.features.VmApi;
|
||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides synchronous access to VCloudDirector.
|
* Provides synchronous access to VCloudDirector.
|
||||||
*
|
*
|
||||||
* @see VCloudDirectorAdminAsyncClient
|
* @see VCloudDirectorAdminAsyncApi
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||||
public interface VCloudDirectorClient {
|
public interface VCloudDirectorApi {
|
||||||
/**
|
/**
|
||||||
* @return the current login session
|
* @return the current login session
|
||||||
*/
|
*/
|
||||||
|
@ -55,65 +55,65 @@ public interface VCloudDirectorClient {
|
||||||
* @return asynchronous access to query features
|
* @return asynchronous access to query features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
QueryClient getQueryClient();
|
QueryApi getQueryApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link Org} features
|
* @return synchronous access to {@link Org} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
OrgClient getOrgClient();
|
OrgApi getOrgApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link Task} features
|
* @return synchronous access to {@link Task} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
TaskClient getTaskClient();
|
TaskApi getTaskApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link Network} features
|
* @return synchronous access to {@link Network} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
NetworkClient getNetworkClient();
|
NetworkApi getNetworkApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link Catalog} features
|
* @return synchronous access to {@link Catalog} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
CatalogClient getCatalogClient();
|
CatalogApi getCatalogApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link Media} features
|
* @return synchronous access to {@link Media} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
MediaClient getMediaClient();
|
MediaApi getMediaApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link Vdc} features
|
* @return synchronous access to {@link Vdc} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
VdcClient getVdcClient();
|
VdcApi getVdcApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to upload features
|
* @return synchronous access to upload features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
UploadClient getUploadClient();
|
UploadApi getUploadApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link VApp} features
|
* @return synchronous access to {@link VApp} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
VAppClient getVAppClient();
|
VAppApi getVAppApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link VAppTemplate} features
|
* @return synchronous access to {@link VAppTemplate} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
VAppTemplateClient getVAppTemplateClient();
|
VAppTemplateApi getVAppTemplateApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return synchronous access to {@link Vm} features
|
* @return synchronous access to {@link Vm} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
VmClient getVmClient();
|
VmApi getVmApi();
|
||||||
}
|
}
|
|
@ -20,26 +20,26 @@ package org.jclouds.vcloud.director.v1_5.user;
|
||||||
|
|
||||||
import org.jclouds.rest.annotations.Delegate;
|
import org.jclouds.rest.annotations.Delegate;
|
||||||
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.features.CatalogAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.CatalogAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.NetworkAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.NetworkAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.OrgAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.OrgAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.QueryAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.QueryAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.TaskAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.TaskAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.UploadAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.UploadAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.VAppAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VdcAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.VdcAsyncApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VmAsyncClient;
|
import org.jclouds.vcloud.director.v1_5.features.VmAsyncApi;
|
||||||
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides asynchronous access to VCloudDirector via their REST API.
|
* Provides asynchronous access to VCloudDirector via their REST API.
|
||||||
*
|
*
|
||||||
* @see VCloudDirectorClient
|
* @see VCloudDirectorApi
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public interface VCloudDirectorAsyncClient {
|
public interface VCloudDirectorAsyncApi {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return the current login session
|
* @return the current login session
|
||||||
|
@ -51,65 +51,65 @@ public interface VCloudDirectorAsyncClient {
|
||||||
* @return asynchronous access to query features
|
* @return asynchronous access to query features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
QueryAsyncClient getQueryClient();
|
QueryAsyncApi getQueryApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link Org} features
|
* @return asynchronous access to {@link Org} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
OrgAsyncClient getOrgClient();
|
OrgAsyncApi getOrgApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link Task} features
|
* @return asynchronous access to {@link Task} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
TaskAsyncClient getTaskClient();
|
TaskAsyncApi getTaskApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link Network} features
|
* @return asynchronous access to {@link Network} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
NetworkAsyncClient getNetworkClient();
|
NetworkAsyncApi getNetworkApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link Catalog} features
|
* @return asynchronous access to {@link Catalog} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
CatalogAsyncClient getCatalogClient();
|
CatalogAsyncApi getCatalogApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link Media} features
|
* @return asynchronous access to {@link Media} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
CatalogAsyncClient getMediaClient();
|
CatalogAsyncApi getMediaApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link Vdc} features
|
* @return asynchronous access to {@link Vdc} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
VdcAsyncClient getVdcClient();
|
VdcAsyncApi getVdcApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to Upload features
|
* @return asynchronous access to Upload features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
UploadAsyncClient getUploadClient();
|
UploadAsyncApi getUploadApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link VApp} features
|
* @return asynchronous access to {@link VApp} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
VAppAsyncClient getVAppClient();
|
VAppAsyncApi getVAppApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link VAppTemplate} features
|
* @return asynchronous access to {@link VAppTemplate} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
VAppTemplateAsyncClient getVAppTemplateClient();
|
VAppTemplateAsyncApi getVAppTemplateApi();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return asynchronous access to {@link Vm} features
|
* @return asynchronous access to {@link Vm} features
|
||||||
*/
|
*/
|
||||||
@Delegate
|
@Delegate
|
||||||
VmAsyncClient getVmClient();
|
VmAsyncApi getVmApi();
|
||||||
}
|
}
|
|
@ -49,14 +49,14 @@ import org.jclouds.vcloud.director.v1_5.domain.Vm;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.dmtf.RasdItem;
|
import org.jclouds.vcloud.director.v1_5.domain.dmtf.RasdItem;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.GuestCustomizationSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.GuestCustomizationSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConnectionSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConnectionSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.CatalogClient;
|
import org.jclouds.vcloud.director.v1_5.features.CatalogApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.QueryClient;
|
import org.jclouds.vcloud.director.v1_5.features.QueryApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppClient;
|
import org.jclouds.vcloud.director.v1_5.features.VAppApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateClient;
|
import org.jclouds.vcloud.director.v1_5.features.VAppTemplateApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VdcClient;
|
import org.jclouds.vcloud.director.v1_5.features.VdcApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VmClient;
|
import org.jclouds.vcloud.director.v1_5.features.VmApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.predicates.ReferencePredicates;
|
import org.jclouds.vcloud.director.v1_5.predicates.ReferencePredicates;
|
||||||
import org.jclouds.xml.internal.JAXBParser;
|
import org.jclouds.xml.internal.JAXBParser;
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
|
@ -72,11 +72,11 @@ import com.google.common.base.Throwables;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shared code to test the behaviour of {@link VAppClient} and {@link VAppTemplateClient}.
|
* Shared code to test the behaviour of {@link VAppApi} and {@link VAppTemplateApi}.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public abstract class AbstractVAppApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
public static final String VAPP = "VApp";
|
public static final String VAPP = "VApp";
|
||||||
public static final String VAPP_TEMPLATE = "VAppTemplate";
|
public static final String VAPP_TEMPLATE = "VAppTemplate";
|
||||||
|
@ -84,16 +84,16 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
public static final String VM = "Vm";
|
public static final String VM = "Vm";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience reference to API clients.
|
* Convenience reference to API apis.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected CatalogClient catalogClient;
|
protected CatalogApi catalogApi;
|
||||||
protected QueryClient queryClient;
|
protected QueryApi queryApi;
|
||||||
protected VAppClient vAppClient;
|
protected VAppApi vAppApi;
|
||||||
protected VAppTemplateClient vAppTemplateClient;
|
protected VAppTemplateApi vAppTemplateApi;
|
||||||
protected VdcClient vdcClient;
|
protected VdcApi vdcApi;
|
||||||
protected VmClient vmClient;
|
protected VmApi vmApi;
|
||||||
protected MetadataClient.Writeable metadataClient;
|
protected MetadataApi.Writeable metadataApi;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Objects shared between tests.
|
* Objects shared between tests.
|
||||||
|
@ -107,21 +107,21 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
protected URI vAppURI;
|
protected URI vAppURI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the required clients from the REST API context
|
* Retrieves the required apis from the REST API context
|
||||||
*
|
*
|
||||||
* @see BaseVCloudDirectorClientLiveTest#setupRequiredClients()
|
* @see BaseVCloudDirectorApiLiveTest#setupRequiredApis()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true, description = "Retrieves the required clients from the REST API context")
|
@BeforeClass(alwaysRun = true, description = "Retrieves the required apis from the REST API context")
|
||||||
protected void setupRequiredClients() {
|
protected void setupRequiredApis() {
|
||||||
assertNotNull(context.getApi());
|
assertNotNull(context.getApi());
|
||||||
|
|
||||||
catalogClient = context.getApi().getCatalogClient();
|
catalogApi = context.getApi().getCatalogApi();
|
||||||
queryClient = context.getApi().getQueryClient();
|
queryApi = context.getApi().getQueryApi();
|
||||||
vAppClient = context.getApi().getVAppClient();
|
vAppApi = context.getApi().getVAppApi();
|
||||||
vAppTemplateClient = context.getApi().getVAppTemplateClient();
|
vAppTemplateApi = context.getApi().getVAppTemplateApi();
|
||||||
vdcClient = context.getApi().getVdcClient();
|
vdcApi = context.getApi().getVdcApi();
|
||||||
vmClient = context.getApi().getVmClient();
|
vmApi = context.getApi().getVmApi();
|
||||||
|
|
||||||
setupEnvironment();
|
setupEnvironment();
|
||||||
}
|
}
|
||||||
|
@ -132,11 +132,11 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
*/
|
*/
|
||||||
protected void setupEnvironment() {
|
protected void setupEnvironment() {
|
||||||
// Get the configured Vdc for the tests
|
// Get the configured Vdc for the tests
|
||||||
vdc = vdcClient.getVdc(vdcURI);
|
vdc = vdcApi.getVdc(vdcURI);
|
||||||
assertNotNull(vdc, String.format(ENTITY_NON_NULL, VDC));
|
assertNotNull(vdc, String.format(ENTITY_NON_NULL, VDC));
|
||||||
|
|
||||||
// Get the configured VAppTemplate for the tests
|
// Get the configured VAppTemplate for the tests
|
||||||
vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
|
vAppTemplate = vAppTemplateApi.getVAppTemplate(vAppTemplateURI);
|
||||||
assertNotNull(vAppTemplate, String.format(ENTITY_NON_NULL, VAPP_TEMPLATE));
|
assertNotNull(vAppTemplate, String.format(ENTITY_NON_NULL, VAPP_TEMPLATE));
|
||||||
|
|
||||||
// Instantiate a new VApp
|
// Instantiate a new VApp
|
||||||
|
@ -149,7 +149,7 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
assertTrue(retryTaskSuccessLong.apply(instantiateTask), String.format(TASK_COMPLETE_TIMELY, "instantiateTask"));
|
assertTrue(retryTaskSuccessLong.apply(instantiateTask), String.format(TASK_COMPLETE_TIMELY, "instantiateTask"));
|
||||||
|
|
||||||
// Get the instantiated VApp
|
// Get the instantiated VApp
|
||||||
vApp = vAppClient.getVApp(vAppURI);
|
vApp = vAppApi.getVApp(vAppURI);
|
||||||
|
|
||||||
// Get the Vm
|
// Get the Vm
|
||||||
List<Vm> vms = vApp.getChildren().getVms();
|
List<Vm> vms = vApp.getChildren().getVms();
|
||||||
|
@ -190,7 +190,7 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
|
|
||||||
@AfterClass(alwaysRun = true, description = "Cleans up the environment by deleting created VApps")
|
@AfterClass(alwaysRun = true, description = "Cleans up the environment by deleting created VApps")
|
||||||
protected void cleanUpEnvironment() {
|
protected void cleanUpEnvironment() {
|
||||||
vdc = vdcClient.getVdc(vdcURI); // Refresh
|
vdc = vdcApi.getVdc(vdcURI); // Refresh
|
||||||
|
|
||||||
// Find references in the Vdc with the VApp type and in the list of instantiated VApp names
|
// Find references in the Vdc with the VApp type and in the list of instantiated VApp names
|
||||||
Iterable<Reference> vApps = Iterables.filter(vdc.getResourceEntities(),
|
Iterable<Reference> vApps = Iterables.filter(vdc.getResourceEntities(),
|
||||||
|
@ -248,13 +248,13 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
* Power on a {@link VApp}.
|
* Power on a {@link VApp}.
|
||||||
*/
|
*/
|
||||||
protected VApp powerOnVApp(final URI testVAppURI) {
|
protected VApp powerOnVApp(final URI testVAppURI) {
|
||||||
VApp test = vAppClient.getVApp(testVAppURI);
|
VApp test = vAppApi.getVApp(testVAppURI);
|
||||||
Status status = test.getStatus();
|
Status status = test.getStatus();
|
||||||
if (status != Status.POWERED_ON) {
|
if (status != Status.POWERED_ON) {
|
||||||
Task powerOn = vAppClient.powerOn(vm.getHref());
|
Task powerOn = vAppApi.powerOn(vm.getHref());
|
||||||
assertTaskSucceedsLong(powerOn);
|
assertTaskSucceedsLong(powerOn);
|
||||||
}
|
}
|
||||||
test = vAppClient.getVApp(testVAppURI);
|
test = vAppApi.getVApp(testVAppURI);
|
||||||
assertStatus(VAPP, test, Status.POWERED_ON);
|
assertStatus(VAPP, test, Status.POWERED_ON);
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
@ -263,13 +263,13 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
* Power on a {@link Vm}.
|
* Power on a {@link Vm}.
|
||||||
*/
|
*/
|
||||||
protected Vm powerOnVm(final URI testVmURI) {
|
protected Vm powerOnVm(final URI testVmURI) {
|
||||||
Vm test = vmClient.getVm(testVmURI);
|
Vm test = vmApi.getVm(testVmURI);
|
||||||
Status status = test.getStatus();
|
Status status = test.getStatus();
|
||||||
if (status != Status.POWERED_ON) {
|
if (status != Status.POWERED_ON) {
|
||||||
Task powerOn = vmClient.powerOn(vm.getHref());
|
Task powerOn = vmApi.powerOn(vm.getHref());
|
||||||
assertTaskSucceedsLong(powerOn);
|
assertTaskSucceedsLong(powerOn);
|
||||||
}
|
}
|
||||||
test = vmClient.getVm(testVmURI);
|
test = vmApi.getVm(testVmURI);
|
||||||
assertStatus(VM, test, Status.POWERED_ON);
|
assertStatus(VM, test, Status.POWERED_ON);
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
@ -278,13 +278,13 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
* Power off a {@link VApp}.
|
* Power off a {@link VApp}.
|
||||||
*/
|
*/
|
||||||
protected VApp powerOffVApp(final URI testVAppURI) {
|
protected VApp powerOffVApp(final URI testVAppURI) {
|
||||||
VApp test = vAppClient.getVApp(testVAppURI);
|
VApp test = vAppApi.getVApp(testVAppURI);
|
||||||
Status status = test.getStatus();
|
Status status = test.getStatus();
|
||||||
if (status != Status.POWERED_OFF) {
|
if (status != Status.POWERED_OFF) {
|
||||||
Task powerOff = vAppClient.powerOff(vm.getHref());
|
Task powerOff = vAppApi.powerOff(vm.getHref());
|
||||||
assertTaskSucceedsLong(powerOff);
|
assertTaskSucceedsLong(powerOff);
|
||||||
}
|
}
|
||||||
test = vAppClient.getVApp(testVAppURI);
|
test = vAppApi.getVApp(testVAppURI);
|
||||||
assertStatus(VAPP, test, Status.POWERED_OFF);
|
assertStatus(VAPP, test, Status.POWERED_OFF);
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
@ -293,13 +293,13 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
* Power off a {@link Vm}.
|
* Power off a {@link Vm}.
|
||||||
*/
|
*/
|
||||||
protected Vm powerOffVm(final URI testVmURI) {
|
protected Vm powerOffVm(final URI testVmURI) {
|
||||||
Vm test = vmClient.getVm(testVmURI);
|
Vm test = vmApi.getVm(testVmURI);
|
||||||
Status status = test.getStatus();
|
Status status = test.getStatus();
|
||||||
if (status != Status.POWERED_OFF) {
|
if (status != Status.POWERED_OFF) {
|
||||||
Task powerOff = vmClient.powerOff(vm.getHref());
|
Task powerOff = vmApi.powerOff(vm.getHref());
|
||||||
assertTaskSucceedsLong(powerOff);
|
assertTaskSucceedsLong(powerOff);
|
||||||
}
|
}
|
||||||
test = vmClient.getVm(testVmURI);
|
test = vmApi.getVm(testVmURI);
|
||||||
assertStatus(VM, test, Status.POWERED_OFF);
|
assertStatus(VM, test, Status.POWERED_OFF);
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
@ -308,13 +308,13 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
* Suspend a {@link VApp}.
|
* Suspend a {@link VApp}.
|
||||||
*/
|
*/
|
||||||
protected VApp suspendVApp(final URI testVAppURI) {
|
protected VApp suspendVApp(final URI testVAppURI) {
|
||||||
VApp test = vAppClient.getVApp(testVAppURI);
|
VApp test = vAppApi.getVApp(testVAppURI);
|
||||||
Status status = test.getStatus();
|
Status status = test.getStatus();
|
||||||
if (status != Status.SUSPENDED) {
|
if (status != Status.SUSPENDED) {
|
||||||
Task suspend = vAppClient.suspend(vm.getHref());
|
Task suspend = vAppApi.suspend(vm.getHref());
|
||||||
assertTaskSucceedsLong(suspend);
|
assertTaskSucceedsLong(suspend);
|
||||||
}
|
}
|
||||||
test = vAppClient.getVApp(testVAppURI);
|
test = vAppApi.getVApp(testVAppURI);
|
||||||
assertStatus(VAPP, test, Status.SUSPENDED);
|
assertStatus(VAPP, test, Status.SUSPENDED);
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
@ -323,13 +323,13 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
* Suspend a {@link Vm}.
|
* Suspend a {@link Vm}.
|
||||||
*/
|
*/
|
||||||
protected Vm suspendVm(final URI testVmURI) {
|
protected Vm suspendVm(final URI testVmURI) {
|
||||||
Vm test = vmClient.getVm(testVmURI);
|
Vm test = vmApi.getVm(testVmURI);
|
||||||
Status status = test.getStatus();
|
Status status = test.getStatus();
|
||||||
if (status != Status.SUSPENDED) {
|
if (status != Status.SUSPENDED) {
|
||||||
Task suspend = vmClient.suspend(vm.getHref());
|
Task suspend = vmApi.suspend(vm.getHref());
|
||||||
assertTaskSucceedsLong(suspend);
|
assertTaskSucceedsLong(suspend);
|
||||||
}
|
}
|
||||||
test = vmClient.getVm(testVmURI);
|
test = vmApi.getVm(testVmURI);
|
||||||
assertStatus(VM, test, Status.SUSPENDED);
|
assertStatus(VM, test, Status.SUSPENDED);
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
@ -338,7 +338,7 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
* Check the {@link VApp}s current status.
|
* Check the {@link VApp}s current status.
|
||||||
*/
|
*/
|
||||||
protected void assertVAppStatus(final URI testVAppURI, final Status status) {
|
protected void assertVAppStatus(final URI testVAppURI, final Status status) {
|
||||||
VApp testVApp = vAppClient.getVApp(testVAppURI);
|
VApp testVApp = vAppApi.getVApp(testVAppURI);
|
||||||
assertStatus(VAPP, testVApp, status);
|
assertStatus(VAPP, testVApp, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ public abstract class AbstractVAppClientLiveTest extends BaseVCloudDirectorClien
|
||||||
* Check the {@link Vm}s current status.
|
* Check the {@link Vm}s current status.
|
||||||
*/
|
*/
|
||||||
protected void assertVmStatus(final URI testVmURI, final Status status) {
|
protected void assertVmStatus(final URI testVmURI, final Status status) {
|
||||||
Vm testVm = vmClient.getVm(testVmURI);
|
Vm testVm = vmApi.getVm(testVmURI);
|
||||||
assertStatus(VM, testVm, status);
|
assertStatus(VM, testVm, status);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.jclouds.rest.HttpClient;
|
||||||
import org.jclouds.util.Strings2;
|
import org.jclouds.util.Strings2;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
import org.jclouds.vcloud.director.v1_5.domain.SessionWithToken;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgList;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgList;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.jclouds.xml.internal.JAXBParser;
|
import org.jclouds.xml.internal.JAXBParser;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
@ -44,13 +44,13 @@ import com.google.common.collect.Iterables;
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "HttpClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "HttpClientLiveTest")
|
||||||
public class HttpClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class HttpClientLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
private JAXBParser parser = new JAXBParser("true");
|
private JAXBParser parser = new JAXBParser("true");
|
||||||
private SessionWithToken sessionWithToken;
|
private SessionWithToken sessionWithToken;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setupRequiredClients() {
|
protected void setupRequiredApis() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "POST /login")
|
@Test(description = "POST /login")
|
||||||
|
@ -87,7 +87,7 @@ public class HttpClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
assertTrue(orgList.getOrgs().size() > 0, "must have orgs");
|
assertTrue(orgList.getOrgs().size() > 0, "must have orgs");
|
||||||
|
|
||||||
context.getApi().getOrgClient().getOrg(Iterables.getLast(orgList.getOrgs()).getHref());
|
context.getApi().getOrgApi().getOrg(Iterables.getLast(orgList.getOrgs()).getHref());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /schema/{schemaFileName}", dependsOnMethods = { "testPostLogin", "testGetLogin" })
|
@Test(description = "GET /schema/{schemaFileName}", dependsOnMethods = { "testPostLogin", "testGetLogin" })
|
||||||
|
|
|
@ -20,21 +20,21 @@ package org.jclouds.vcloud.director.v1_5;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.login.SessionClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.login.SessionApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Test(groups = "unit", testName = "VCloudDirectorClient")
|
@Test(groups = "unit", testName = "VCloudDirectorApi")
|
||||||
public class VCloudDirectorClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class VCloudDirectorApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
public void testRestClientModuleWorksProperly() throws Exception {
|
public void testRestClientModuleWorksProperly() throws Exception {
|
||||||
|
|
||||||
VCloudDirectorClient clientWhenSessionsExist = requestSendsResponse(loginRequest, sessionResponse);
|
VCloudDirectorApi apiWhenSessionsExist = requestSendsResponse(loginRequest, sessionResponse);
|
||||||
|
|
||||||
assertEquals(clientWhenSessionsExist.getCurrentSession(), SessionClientExpectTest.SESSION);
|
assertEquals(apiWhenSessionsExist.getCurrentSession(), SessionApiExpectTest.SESSION);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -21,7 +21,7 @@ package org.jclouds.vcloud.director.v1_5;
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
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.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ import org.testng.annotations.Test;
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Test(groups = "live", testName = "VCloudDirectorClientExperimentLiveTest")
|
@Test(groups = "live", testName = "VCloudDirectorApiExperimentLiveTest")
|
||||||
public class VCloudDirectorClientExperimentLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class VCloudDirectorApiExperimentLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
public void testImplicitSession() {
|
public void testImplicitSession() {
|
||||||
Session session = context.getApi().getCurrentSession();
|
Session session = context.getApi().getCurrentSession();
|
||||||
|
@ -40,10 +40,10 @@ public class VCloudDirectorClientExperimentLiveTest extends BaseVCloudDirectorCl
|
||||||
/**
|
/**
|
||||||
* No operation.
|
* No operation.
|
||||||
*
|
*
|
||||||
* @see BaseVCloudDirectorClientLiveTest#setupRequiredClients()
|
* @see BaseVCloudDirectorApiLiveTest#setupRequiredApis()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() { }
|
public void setupRequiredApis() { }
|
||||||
|
|
||||||
}
|
}
|
|
@ -566,13 +566,13 @@ public class Checks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkMetadataFor(String client, Metadata metadata) {
|
public static void checkMetadataFor(String api, Metadata metadata) {
|
||||||
for (MetadataEntry entry : metadata.getMetadataEntries()) {
|
for (MetadataEntry entry : metadata.getMetadataEntries()) {
|
||||||
// Check required fields
|
// Check required fields
|
||||||
assertNotNull(entry.getKey(),
|
assertNotNull(entry.getKey(),
|
||||||
String.format(OBJ_FIELD_ATTRB_REQ, client, "MetadataEntry", entry.getKey(), "key"));
|
String.format(OBJ_FIELD_ATTRB_REQ, api, "MetadataEntry", entry.getKey(), "key"));
|
||||||
assertNotNull(entry.getValue(),
|
assertNotNull(entry.getValue(),
|
||||||
String.format(OBJ_FIELD_ATTRB_REQ, client, "MetadataEntry", entry.getValue(), "value"));
|
String.format(OBJ_FIELD_ATTRB_REQ, api, "MetadataEntry", entry.getValue(), "value"));
|
||||||
|
|
||||||
// Check parent type
|
// Check parent type
|
||||||
checkResourceType(entry);
|
checkResourceType(entry);
|
||||||
|
@ -582,33 +582,33 @@ public class Checks {
|
||||||
checkResourceType(metadata);
|
checkResourceType(metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkMetadataValueFor(String client, MetadataValue metadataValue) {
|
public static void checkMetadataValueFor(String api, MetadataValue metadataValue) {
|
||||||
checkMetadataValueFor(client, metadataValue, "value");
|
checkMetadataValueFor(api, metadataValue, "value");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkMetadataValueFor(String client, MetadataValue metadataValue, String expectedValue) {
|
public static void checkMetadataValueFor(String api, MetadataValue metadataValue, String expectedValue) {
|
||||||
// Check required fields
|
// Check required fields
|
||||||
String value = metadataValue.getValue();
|
String value = metadataValue.getValue();
|
||||||
assertNotNull(value,
|
assertNotNull(value,
|
||||||
String.format(OBJ_FIELD_ATTRB_REQ, client, "MetadataEntry",
|
String.format(OBJ_FIELD_ATTRB_REQ, api, "MetadataEntry",
|
||||||
metadataValue.toString(), "value"));
|
metadataValue.toString(), "value"));
|
||||||
assertEquals(value, expectedValue,
|
assertEquals(value, expectedValue,
|
||||||
String.format(OBJ_FIELD_EQ, client, "metadataEntry.value", expectedValue, value));
|
String.format(OBJ_FIELD_EQ, api, "metadataEntry.value", expectedValue, value));
|
||||||
|
|
||||||
// Check parent type
|
// Check parent type
|
||||||
checkResourceType(metadataValue);
|
checkResourceType(metadataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkMetadataKeyAbsentFor(String client, Metadata metadata, String key) {
|
public static void checkMetadataKeyAbsentFor(String api, Metadata metadata, String key) {
|
||||||
Map<String,String> metadataMap = metadataToMap(metadata);
|
Map<String,String> metadataMap = metadataToMap(metadata);
|
||||||
assertFalse(metadataMap.containsKey(key),
|
assertFalse(metadataMap.containsKey(key),
|
||||||
String.format(OBJ_DEL, client+" metadata key", key));
|
String.format(OBJ_DEL, api+" metadata key", key));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkMetadataFor(String client, Metadata metadata, Map<String, String> expectedMap) {
|
public static void checkMetadataFor(String api, Metadata metadata, Map<String, String> expectedMap) {
|
||||||
Map<String,String> actualMap = Checks.metadataToMap(metadata);
|
Map<String,String> actualMap = Checks.metadataToMap(metadata);
|
||||||
assertEquals(actualMap, expectedMap,
|
assertEquals(actualMap, expectedMap,
|
||||||
String.format(OBJ_FIELD_EQ, client, "metadata entries", expectedMap, actualMap));
|
String.format(OBJ_FIELD_EQ, api, "metadata entries", expectedMap, actualMap));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Map<String,String> metadataToMap(Metadata metadata) {
|
public static Map<String,String> metadataToMap(Metadata metadata) {
|
||||||
|
@ -802,13 +802,13 @@ public class Checks {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkMediaFor(String client, Media media) {
|
public static void checkMediaFor(String api, Media media) {
|
||||||
// required
|
// required
|
||||||
assertNotNull(media.getImageType(), String.format(OBJ_FIELD_REQ, client, "imageType"));
|
assertNotNull(media.getImageType(), String.format(OBJ_FIELD_REQ, api, "imageType"));
|
||||||
assertTrue(Media.ImageType.ALL.contains(media.getImageType()),
|
assertTrue(Media.ImageType.ALL.contains(media.getImageType()),
|
||||||
"The Image type of a Media must be one of the allowed list");
|
"The Image type of a Media must be one of the allowed list");
|
||||||
assertNotNull(media.getSize(), String.format(OBJ_FIELD_REQ, client, "size"));
|
assertNotNull(media.getSize(), String.format(OBJ_FIELD_REQ, api, "size"));
|
||||||
assertTrue(media.getSize() >= 0, String.format(OBJ_FIELD_GTE_0, client, "size", media.getSize()));
|
assertTrue(media.getSize() >= 0, String.format(OBJ_FIELD_GTE_0, api, "size", media.getSize()));
|
||||||
|
|
||||||
// parent type
|
// parent type
|
||||||
checkResourceEntityType(media);
|
checkResourceEntityType(media);
|
||||||
|
@ -940,29 +940,29 @@ public class Checks {
|
||||||
// NOTE groupSearchBase cannot be checked
|
// NOTE groupSearchBase cannot be checked
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkUserAttributes(String client, OrgLdapUserAttributes attributes) {
|
public static void checkUserAttributes(String api, OrgLdapUserAttributes attributes) {
|
||||||
// required
|
// required
|
||||||
assertNotNull(attributes.getObjectClass(), String.format(OBJ_FIELD_REQ, client, "objectClass"));
|
assertNotNull(attributes.getObjectClass(), String.format(OBJ_FIELD_REQ, api, "objectClass"));
|
||||||
assertNotNull(attributes.getObjectIdentifier(), String.format(OBJ_FIELD_REQ, client, "objectIdentifier"));
|
assertNotNull(attributes.getObjectIdentifier(), String.format(OBJ_FIELD_REQ, api, "objectIdentifier"));
|
||||||
assertNotNull(attributes.getUserName(), String.format(OBJ_FIELD_REQ, client, "userName"));
|
assertNotNull(attributes.getUserName(), String.format(OBJ_FIELD_REQ, api, "userName"));
|
||||||
assertNotNull(attributes.getEmail(), String.format(OBJ_FIELD_REQ, client, "email"));
|
assertNotNull(attributes.getEmail(), String.format(OBJ_FIELD_REQ, api, "email"));
|
||||||
assertNotNull(attributes.getFullName(), String.format(OBJ_FIELD_REQ, client, "fullName"));
|
assertNotNull(attributes.getFullName(), String.format(OBJ_FIELD_REQ, api, "fullName"));
|
||||||
assertNotNull(attributes.getGivenName(), String.format(OBJ_FIELD_REQ, client, "givenName"));
|
assertNotNull(attributes.getGivenName(), String.format(OBJ_FIELD_REQ, api, "givenName"));
|
||||||
assertNotNull(attributes.getSurname(), String.format(OBJ_FIELD_REQ, client, "surname"));
|
assertNotNull(attributes.getSurname(), String.format(OBJ_FIELD_REQ, api, "surname"));
|
||||||
assertNotNull(attributes.getTelephone(), String.format(OBJ_FIELD_REQ, client, "telephone"));
|
assertNotNull(attributes.getTelephone(), String.format(OBJ_FIELD_REQ, api, "telephone"));
|
||||||
assertNotNull(attributes.getGroupMembershipIdentifier(), String.format(OBJ_FIELD_REQ, client, "groupMembershipIdentifier"));
|
assertNotNull(attributes.getGroupMembershipIdentifier(), String.format(OBJ_FIELD_REQ, api, "groupMembershipIdentifier"));
|
||||||
|
|
||||||
// optional
|
// optional
|
||||||
// NOTE groupBackLinkIdentifier cannot be checked
|
// NOTE groupBackLinkIdentifier cannot be checked
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkGroupAttributes(String client, OrgLdapGroupAttributes attributes) {
|
public static void checkGroupAttributes(String api, OrgLdapGroupAttributes attributes) {
|
||||||
// required
|
// required
|
||||||
assertNotNull(attributes.getObjectClass(), String.format(OBJ_FIELD_REQ, client, "objectClass"));
|
assertNotNull(attributes.getObjectClass(), String.format(OBJ_FIELD_REQ, api, "objectClass"));
|
||||||
assertNotNull(attributes.getObjectIdentifier(), String.format(OBJ_FIELD_REQ, client, "objectIdentifier"));
|
assertNotNull(attributes.getObjectIdentifier(), String.format(OBJ_FIELD_REQ, api, "objectIdentifier"));
|
||||||
assertNotNull(attributes.getGroupName(), String.format(OBJ_FIELD_REQ, client, "groupName"));
|
assertNotNull(attributes.getGroupName(), String.format(OBJ_FIELD_REQ, api, "groupName"));
|
||||||
assertNotNull(attributes.getMembership(), String.format(OBJ_FIELD_REQ, client, "membership"));
|
assertNotNull(attributes.getMembership(), String.format(OBJ_FIELD_REQ, api, "membership"));
|
||||||
assertNotNull(attributes.getMembershipIdentifier(), String.format(OBJ_FIELD_REQ, client, "membershipIdentifier"));
|
assertNotNull(attributes.getMembershipIdentifier(), String.format(OBJ_FIELD_REQ, api, "membershipIdentifier"));
|
||||||
|
|
||||||
// optional
|
// optional
|
||||||
// NOTE backLinkIdentifier cannot be checked
|
// NOTE backLinkIdentifier cannot be checked
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.net.URI;
|
||||||
|
|
||||||
import org.jclouds.http.HttpRequest;
|
import org.jclouds.http.HttpRequest;
|
||||||
import org.jclouds.http.HttpResponse;
|
import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
|
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
|
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
|
||||||
|
@ -34,18 +34,18 @@ import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
|
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.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the {@link CatalogClient} by observing its side effects.
|
* Test the {@link CatalogApi} by observing its side effects.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "CatalogClientExpectTest")
|
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "CatalogApiExpectTest")
|
||||||
public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
public class CatalogApiExpectTest extends VCloudDirectorApiExpectTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetCatalog() {
|
public void testGetCatalog() {
|
||||||
|
@ -60,12 +60,12 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/catalog.xml", VCloudDirectorMediaType.CATALOG + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/catalog/catalog.xml", VCloudDirectorMediaType.CATALOG + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogRequest, catalogResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogRequest, catalogResponse);
|
||||||
|
|
||||||
Catalog expected = catalog();
|
Catalog expected = catalog();
|
||||||
|
|
||||||
URI catalogURI = URI.create(endpoint + "/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4");
|
URI catalogURI = URI.create(endpoint + "/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4");
|
||||||
assertEquals(client.getCatalogClient().getCatalog(catalogURI), expected);
|
assertEquals(api.getCatalogApi().getCatalog(catalogURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -83,7 +83,7 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/createdCatalogItem.xml", VCloudDirectorMediaType.CATALOG_ITEM + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/catalog/createdCatalogItem.xml", VCloudDirectorMediaType.CATALOG_ITEM + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
||||||
|
|
||||||
URI catalogURI = URI.create(endpoint + "/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4");
|
URI catalogURI = URI.create(endpoint + "/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4");
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
|
|
||||||
CatalogItem expected = createdCatalogItem();
|
CatalogItem expected = createdCatalogItem();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().addCatalogItem(catalogURI, newItem), expected);
|
assertEquals(api.getCatalogApi().addCatalogItem(catalogURI, newItem), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -112,7 +112,7 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/catalogMetadata.xml", VCloudDirectorMediaType.METADATA))
|
.payload(payloadFromResourceWithContentType("/catalog/catalogMetadata.xml", VCloudDirectorMediaType.METADATA))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogRequest, catalogResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogRequest, catalogResponse);
|
||||||
|
|
||||||
URI catalogURI = URI.create(endpoint + "/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4");
|
URI catalogURI = URI.create(endpoint + "/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4");
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.entries(ImmutableSet.of(metadataEntry()))
|
.entries(ImmutableSet.of(metadataEntry()))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().getMetadataClient().getMetadata(catalogURI), expected);
|
assertEquals(api.getCatalogApi().getMetadataApi().getMetadata(catalogURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -144,13 +144,13 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/catalogMetadataValue.xml", VCloudDirectorMediaType.METADATA_VALUE))
|
.payload(payloadFromResourceWithContentType("/catalog/catalogMetadataValue.xml", VCloudDirectorMediaType.METADATA_VALUE))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogRequest, catalogResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogRequest, catalogResponse);
|
||||||
|
|
||||||
URI catalogURI = URI.create(endpoint + "/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4");
|
URI catalogURI = URI.create(endpoint + "/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4");
|
||||||
|
|
||||||
MetadataValue expected = metadataValue();
|
MetadataValue expected = metadataValue();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().getMetadataClient().getMetadataValue(catalogURI, "KEY"), expected);
|
assertEquals(api.getCatalogApi().getMetadataApi().getMetadataValue(catalogURI, "KEY"), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -167,13 +167,13 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/catalogItem.xml", VCloudDirectorMediaType.CATALOG_ITEM))
|
.payload(payloadFromResourceWithContentType("/catalog/catalogItem.xml", VCloudDirectorMediaType.CATALOG_ITEM))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
||||||
|
|
||||||
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
||||||
|
|
||||||
CatalogItem expected = catalogItem();
|
CatalogItem expected = catalogItem();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().getCatalogItem(catalogItemURI), expected);
|
assertEquals(api.getCatalogApi().getCatalogItem(catalogItemURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -191,12 +191,12 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/updateCatalogItem.xml", VCloudDirectorMediaType.CATALOG_ITEM + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/catalog/updateCatalogItem.xml", VCloudDirectorMediaType.CATALOG_ITEM + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
||||||
|
|
||||||
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
||||||
CatalogItem expected = catalogItem();
|
CatalogItem expected = catalogItem();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().updateCatalogItem(catalogItemURI, expected), expected);
|
assertEquals(api.getCatalogApi().updateCatalogItem(catalogItemURI, expected), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -212,11 +212,11 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.statusCode(200)
|
.statusCode(200)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
||||||
|
|
||||||
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
||||||
|
|
||||||
client.getCatalogClient().deleteCatalogItem(catalogItemURI);
|
api.getCatalogApi().deleteCatalogItem(catalogItemURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -233,7 +233,7 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/catalogItemMetadata.xml", VCloudDirectorMediaType.METADATA))
|
.payload(payloadFromResourceWithContentType("/catalog/catalogItemMetadata.xml", VCloudDirectorMediaType.METADATA))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
||||||
|
|
||||||
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.entries(ImmutableSet.of(itemMetadataEntry()))
|
.entries(ImmutableSet.of(itemMetadataEntry()))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().getMetadataClient().getMetadata(catalogItemURI), expected);
|
assertEquals(api.getCatalogApi().getMetadataApi().getMetadata(catalogItemURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -266,7 +266,7 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/mergeMetadataTask.xml", VCloudDirectorMediaType.TASK + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/catalog/mergeMetadataTask.xml", VCloudDirectorMediaType.TASK + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
||||||
|
|
||||||
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
|
|
||||||
Task expected = mergeMetadataTask();
|
Task expected = mergeMetadataTask();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().getCatalogItemMetadataClient().mergeMetadata(catalogItemURI, metadata), expected);
|
assertEquals(api.getCatalogApi().getCatalogItemMetadataApi().mergeMetadata(catalogItemURI, metadata), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -291,13 +291,13 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/catalogItemMetadataValue.xml", VCloudDirectorMediaType.METADATA_VALUE + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/catalog/catalogItemMetadataValue.xml", VCloudDirectorMediaType.METADATA_VALUE + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
||||||
|
|
||||||
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
||||||
|
|
||||||
MetadataValue expected = itemMetadataValue();
|
MetadataValue expected = itemMetadataValue();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().getMetadataClient().getMetadataValue(catalogItemURI, "KEY"), expected);
|
assertEquals(api.getCatalogApi().getMetadataApi().getMetadataValue(catalogItemURI, "KEY"), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -315,7 +315,7 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/setMetadataValueTask.xml", VCloudDirectorMediaType.TASK + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/catalog/setMetadataValueTask.xml", VCloudDirectorMediaType.TASK + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
||||||
|
|
||||||
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
|
|
||||||
Task expected = setMetadataValueTask();
|
Task expected = setMetadataValueTask();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().getCatalogItemMetadataClient().setMetadata(catalogItemURI, "KEY", value), expected);
|
assertEquals(api.getCatalogApi().getCatalogItemMetadataApi().setMetadata(catalogItemURI, "KEY", value), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -340,13 +340,13 @@ public class CatalogClientExpectTest extends VCloudDirectorClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/catalog/deleteMetadataEntryTask.xml", VCloudDirectorMediaType.TASK))
|
.payload(payloadFromResourceWithContentType("/catalog/deleteMetadataEntryTask.xml", VCloudDirectorMediaType.TASK))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, catalogItemRequest, catalogItemResponse);
|
||||||
|
|
||||||
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
URI catalogItemURI = URI.create("https://vcloudbeta.bluelock.com/api/catalogItem/a36fdac9-b8c2-43e2-9a4c-2ffaf3ee13df");
|
||||||
|
|
||||||
Task expected = deleteMetadataEntryTask();
|
Task expected = deleteMetadataEntryTask();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().getCatalogItemMetadataClient().deleteMetadataEntry(catalogItemURI, "KEY"), expected);
|
assertEquals(api.getCatalogApi().getCatalogItemMetadataApi().deleteMetadataEntry(catalogItemURI, "KEY"), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Catalog catalog() {
|
public static final Catalog catalog() {
|
|
@ -48,8 +48,8 @@ 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.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
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.domain.Vdc;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogClient;
|
import org.jclouds.vcloud.director.v1_5.features.admin.AdminCatalogApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
@ -57,17 +57,17 @@ import com.google.common.base.Predicate;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests live behavior of {@link CatalogClient}.
|
* Tests live behavior of {@link CatalogApi}.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "CatalogClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "CatalogApiLiveTest")
|
||||||
public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class CatalogApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience references to API clients.
|
* Convenience references to API apis.
|
||||||
*/
|
*/
|
||||||
private CatalogClient catalogClient;
|
private CatalogApi catalogApi;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shared state between dependant tests.
|
* Shared state between dependant tests.
|
||||||
|
@ -79,29 +79,29 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
private Reference catalogRef;
|
private Reference catalogRef;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setupRequiredClients() {
|
protected void setupRequiredApis() {
|
||||||
// TODO why do I need a guard clause here?
|
// TODO why do I need a guard clause here?
|
||||||
if (adminCatalog != null) return;
|
if (adminCatalog != null) return;
|
||||||
catalogClient = context.getApi().getCatalogClient();
|
catalogApi = context.getApi().getCatalogApi();
|
||||||
Reference orgRef = Iterables.getFirst(context.getApi().getOrgClient().getOrgList().getOrgs(), null).toAdminReference(endpoint);
|
Reference orgRef = Iterables.getFirst(context.getApi().getOrgApi().getOrgList().getOrgs(), null).toAdminReference(endpoint);
|
||||||
|
|
||||||
if (adminContext != null) {
|
if (adminContext != null) {
|
||||||
AdminCatalog newCatalog = AdminCatalog.builder()
|
AdminCatalog newCatalog = AdminCatalog.builder()
|
||||||
.name(name("Test Catalog "))
|
.name(name("Test Catalog "))
|
||||||
.description("created by CatalogClientLiveTest")
|
.description("created by CatalogApiLiveTest")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
AdminCatalogClient adminCatalogClient = adminContext.getApi().getCatalogClient();
|
AdminCatalogApi adminCatalogApi = adminContext.getApi().getCatalogApi();
|
||||||
adminCatalog = adminCatalogClient.createCatalog(orgRef.getHref(), newCatalog);
|
adminCatalog = adminCatalogApi.createCatalog(orgRef.getHref(), newCatalog);
|
||||||
catalogRef = find(adminCatalog.getLinks(), and(relEquals("alternate"), typeEquals(VCloudDirectorMediaType.CATALOG)));
|
catalogRef = find(adminCatalog.getLinks(), and(relEquals("alternate"), typeEquals(VCloudDirectorMediaType.CATALOG)));
|
||||||
|
|
||||||
Metadata newMetadata = Metadata.builder()
|
Metadata newMetadata = Metadata.builder()
|
||||||
.entry(MetadataEntry.builder().entry("KEY", "MARMALADE").build())
|
.entry(MetadataEntry.builder().entry("KEY", "MARMALADE").build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Task mergeCatalogMetadata = adminCatalogClient.getMetadataClient().mergeMetadata(adminCatalog.getHref(), newMetadata);
|
Task mergeCatalogMetadata = adminCatalogApi.getMetadataApi().mergeMetadata(adminCatalog.getHref(), newMetadata);
|
||||||
checkTask(mergeCatalogMetadata);
|
checkTask(mergeCatalogMetadata);
|
||||||
assertTrue(retryTaskSuccess.apply(mergeCatalogMetadata), String.format(TASK_COMPLETE_TIMELY, "setupRequiredClients"));
|
assertTrue(retryTaskSuccess.apply(mergeCatalogMetadata), String.format(TASK_COMPLETE_TIMELY, "setupRequiredApis"));
|
||||||
} else {
|
} else {
|
||||||
catalogRef = Reference.builder().href(catalogURI).build();
|
catalogRef = Reference.builder().href(catalogURI).build();
|
||||||
}
|
}
|
||||||
|
@ -111,14 +111,14 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
if (catalogItem != null) {
|
if (catalogItem != null) {
|
||||||
try {
|
try {
|
||||||
catalogClient.deleteCatalogItem(catalogItem.getHref());
|
catalogApi.deleteCatalogItem(catalogItem.getHref());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting catalog item '%s'", catalogItem.getName());
|
logger.warn(e, "Error when deleting catalog item '%s'", catalogItem.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (media != null) {
|
if (media != null) {
|
||||||
try {
|
try {
|
||||||
Task delete = context.getApi().getMediaClient().deleteMedia(media.getHref());
|
Task delete = context.getApi().getMediaApi().deleteMedia(media.getHref());
|
||||||
taskDoneEventually(delete);
|
taskDoneEventually(delete);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting media '%s'", media.getName());
|
logger.warn(e, "Error when deleting media '%s'", media.getName());
|
||||||
|
@ -126,7 +126,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
}
|
}
|
||||||
if (adminContext != null && adminCatalog != null) {
|
if (adminContext != null && adminCatalog != null) {
|
||||||
try {
|
try {
|
||||||
adminContext.getApi().getCatalogClient().deleteCatalog(adminCatalog.getHref());
|
adminContext.getApi().getCatalogApi().deleteCatalog(adminCatalog.getHref());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting catalog '%s'", adminCatalog.getName());
|
logger.warn(e, "Error when deleting catalog '%s'", adminCatalog.getName());
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /catalog/{id}")
|
@Test(description = "GET /catalog/{id}")
|
||||||
public void testGetCatalog() {
|
public void testGetCatalog() {
|
||||||
Catalog catalog = catalogClient.getCatalog(catalogRef.getHref());
|
Catalog catalog = catalogApi.getCatalog(catalogRef.getHref());
|
||||||
assertNotNull(catalog);
|
assertNotNull(catalog);
|
||||||
// Double check it's pointing at the correct catalog
|
// Double check it's pointing at the correct catalog
|
||||||
assertEquals(catalog.getHref(), catalogRef.getHref());
|
assertEquals(catalog.getHref(), catalogRef.getHref());
|
||||||
|
@ -144,7 +144,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
|
@Test(description = "GET /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
|
||||||
public void testGetCatalogItem() {
|
public void testGetCatalogItem() {
|
||||||
CatalogItem catalogItem = catalogClient.getCatalogItem(this.catalogItem.getHref());
|
CatalogItem catalogItem = catalogApi.getCatalogItem(this.catalogItem.getHref());
|
||||||
checkCatalogItem(catalogItem);
|
checkCatalogItem(catalogItem);
|
||||||
assertEquals(catalogItem.getEntity().getHref(), this.catalogItem.getEntity().getHref());
|
assertEquals(catalogItem.getEntity().getHref(), this.catalogItem.getEntity().getHref());
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
|
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
|
||||||
|
|
||||||
byte[] iso = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
|
byte[] iso = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
|
||||||
Vdc vdc = context.getApi().getVdcClient().getVdc(vdcURI);
|
Vdc vdc = context.getApi().getVdcApi().getVdc(vdcURI);
|
||||||
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
|
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
|
||||||
Link addMedia = find(vdc.getLinks(), and(relEquals("add"), typeEquals(VCloudDirectorMediaType.MEDIA)));
|
Link addMedia = find(vdc.getLinks(), and(relEquals("add"), typeEquals(VCloudDirectorMediaType.MEDIA)));
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.imageType(Media.ImageType.ISO)
|
.imageType(Media.ImageType.ISO)
|
||||||
.description("Test media generated by testCreateMedia()")
|
.description("Test media generated by testCreateMedia()")
|
||||||
.build();
|
.build();
|
||||||
media = context.getApi().getMediaClient().createMedia(addMedia.getHref(), sourceMedia);
|
media = context.getApi().getMediaApi().createMedia(addMedia.getHref(), sourceMedia);
|
||||||
|
|
||||||
Checks.checkMediaFor(VCloudDirectorMediaType.MEDIA, media);
|
Checks.checkMediaFor(VCloudDirectorMediaType.MEDIA, media);
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.type(VCloudDirectorMediaType.CATALOG_ITEM)
|
.type(VCloudDirectorMediaType.CATALOG_ITEM)
|
||||||
.entity(Reference.builder().href(media.getHref()).build())
|
.entity(Reference.builder().href(media.getHref()).build())
|
||||||
.build();
|
.build();
|
||||||
catalogItem = catalogClient.addCatalogItem(catalogRef.getHref(), editedCatalogItem);
|
catalogItem = catalogApi.addCatalogItem(catalogRef.getHref(), editedCatalogItem);
|
||||||
checkCatalogItem(catalogItem);
|
checkCatalogItem(catalogItem);
|
||||||
assertEquals(catalogItem.getName(), "newitem");
|
assertEquals(catalogItem.getName(), "newitem");
|
||||||
assertEquals(catalogItem.getDescription(), "New Item");
|
assertEquals(catalogItem.getDescription(), "New Item");
|
||||||
|
@ -184,7 +184,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "PUT /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
|
@Test(description = "PUT /catalogItem/{id}", dependsOnMethods = "testAddCatalogItem")
|
||||||
public void testUpdateCatalogItem() {
|
public void testUpdateCatalogItem() {
|
||||||
CatalogItem updatedCatalogItem = CatalogItem.builder().fromCatalogItem(catalogItem).name("UPDATEDNAME").build();
|
CatalogItem updatedCatalogItem = CatalogItem.builder().fromCatalogItem(catalogItem).name("UPDATEDNAME").build();
|
||||||
catalogItem = catalogClient.updateCatalogItem(catalogItem.getHref(), updatedCatalogItem);
|
catalogItem = catalogApi.updateCatalogItem(catalogItem.getHref(), updatedCatalogItem);
|
||||||
checkCatalogItem(catalogItem);
|
checkCatalogItem(catalogItem);
|
||||||
assertEquals(catalogItem.getName(), "UPDATEDNAME");
|
assertEquals(catalogItem.getName(), "UPDATEDNAME");
|
||||||
}
|
}
|
||||||
|
@ -192,27 +192,27 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
// Note this runs after all the metadata tests
|
// Note this runs after all the metadata tests
|
||||||
@Test(description = "DELETE /catalogItem/{id}", dependsOnMethods = "testDeleteCatalogItemMetadataValue")
|
@Test(description = "DELETE /catalogItem/{id}", dependsOnMethods = "testDeleteCatalogItemMetadataValue")
|
||||||
public void testDeleteCatalogItem() {
|
public void testDeleteCatalogItem() {
|
||||||
catalogClient.deleteCatalogItem(catalogItem.getHref());
|
catalogApi.deleteCatalogItem(catalogItem.getHref());
|
||||||
catalogItem = catalogClient.getCatalogItem(catalogItem.getHref());
|
catalogItem = catalogApi.getCatalogItem(catalogItem.getHref());
|
||||||
assertNull(catalogItem);
|
assertNull(catalogItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /catalog/{id}/metadata")
|
@Test(description = "GET /catalog/{id}/metadata")
|
||||||
public void testGetCatalogMetadata() {
|
public void testGetCatalogMetadata() {
|
||||||
Metadata catalogMetadata = catalogClient.getMetadataClient().getMetadata(catalogRef.getHref());
|
Metadata catalogMetadata = catalogApi.getMetadataApi().getMetadata(catalogRef.getHref());
|
||||||
checkMetadata(catalogMetadata);
|
checkMetadata(catalogMetadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /catalog/{id}/metadata/{key}")
|
@Test(description = "GET /catalog/{id}/metadata/{key}")
|
||||||
public void testGetCatalogMetadataValue() {
|
public void testGetCatalogMetadataValue() {
|
||||||
Metadata catalogMetadata = catalogClient.getMetadataClient().getMetadata(catalogRef.getHref());
|
Metadata catalogMetadata = catalogApi.getMetadataApi().getMetadata(catalogRef.getHref());
|
||||||
MetadataEntry existingMetadataEntry = Iterables.find(catalogMetadata.getMetadataEntries(), new Predicate<MetadataEntry>() {
|
MetadataEntry existingMetadataEntry = Iterables.find(catalogMetadata.getMetadataEntries(), new Predicate<MetadataEntry>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(MetadataEntry input) {
|
public boolean apply(MetadataEntry input) {
|
||||||
return input.getKey().equals("KEY");
|
return input.getKey().equals("KEY");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
MetadataValue metadataValue = catalogClient.getMetadataClient().getMetadataValue(catalogRef.getHref(), "KEY");
|
MetadataValue metadataValue = catalogApi.getMetadataApi().getMetadataValue(catalogRef.getHref(), "KEY");
|
||||||
assertEquals(metadataValue.getValue(), existingMetadataEntry.getValue(),
|
assertEquals(metadataValue.getValue(), existingMetadataEntry.getValue(),
|
||||||
String.format(CORRECT_VALUE_OBJECT_FMT, "Value", "MetadataValue", existingMetadataEntry.getValue(), metadataValue.getValue()));
|
String.format(CORRECT_VALUE_OBJECT_FMT, "Value", "MetadataValue", existingMetadataEntry.getValue(), metadataValue.getValue()));
|
||||||
checkMetadataValue(metadataValue);
|
checkMetadataValue(metadataValue);
|
||||||
|
@ -220,7 +220,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /catalogItem/{id}/metadata", dependsOnMethods = "testAddCatalogItem")
|
@Test(description = "GET /catalogItem/{id}/metadata", dependsOnMethods = "testAddCatalogItem")
|
||||||
public void testGetCatalogItemMetadata() {
|
public void testGetCatalogItemMetadata() {
|
||||||
Metadata catalogItemMetadata = catalogClient.getCatalogItemMetadataClient().getMetadata(catalogItem.getHref());
|
Metadata catalogItemMetadata = catalogApi.getCatalogItemMetadataApi().getMetadata(catalogItem.getHref());
|
||||||
checkMetadata(catalogItemMetadata);
|
checkMetadata(catalogItemMetadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,22 +231,22 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.entry(MetadataEntry.builder().entry("VEGIMITE", "VALUE").build())
|
.entry(MetadataEntry.builder().entry("VEGIMITE", "VALUE").build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Metadata before = catalogClient.getCatalogItemMetadataClient().getMetadata(catalogItem.getHref());
|
Metadata before = catalogApi.getCatalogItemMetadataApi().getMetadata(catalogItem.getHref());
|
||||||
|
|
||||||
Task mergeCatalogItemMetadata = catalogClient.getCatalogItemMetadataClient().mergeMetadata(catalogItem.getHref(), newMetadata);
|
Task mergeCatalogItemMetadata = catalogApi.getCatalogItemMetadataApi().mergeMetadata(catalogItem.getHref(), newMetadata);
|
||||||
checkTask(mergeCatalogItemMetadata);
|
checkTask(mergeCatalogItemMetadata);
|
||||||
assertTrue(retryTaskSuccess.apply(mergeCatalogItemMetadata),
|
assertTrue(retryTaskSuccess.apply(mergeCatalogItemMetadata),
|
||||||
String.format(TASK_COMPLETE_TIMELY, "mergeCatalogItemMetadata"));
|
String.format(TASK_COMPLETE_TIMELY, "mergeCatalogItemMetadata"));
|
||||||
Metadata mergedCatalogItemMetadata = catalogClient.getCatalogItemMetadataClient().getMetadata(catalogItem.getHref());
|
Metadata mergedCatalogItemMetadata = catalogApi.getCatalogItemMetadataApi().getMetadata(catalogItem.getHref());
|
||||||
|
|
||||||
assertTrue(mergedCatalogItemMetadata.getMetadataEntries().size() > before.getMetadataEntries().size(),
|
assertTrue(mergedCatalogItemMetadata.getMetadataEntries().size() > before.getMetadataEntries().size(),
|
||||||
"Should have added at least one other MetadataEntry to the CatalogItem");
|
"Should have added at least one other MetadataEntry to the CatalogItem");
|
||||||
|
|
||||||
MetadataValue keyMetadataValue = catalogClient.getCatalogItemMetadataClient().getMetadataValue(catalogItem.getHref(), "KEY");
|
MetadataValue keyMetadataValue = catalogApi.getCatalogItemMetadataApi().getMetadataValue(catalogItem.getHref(), "KEY");
|
||||||
assertEquals(keyMetadataValue.getValue(), "MARMALADE", "The Value of the MetadataValue for KEY should have changed");
|
assertEquals(keyMetadataValue.getValue(), "MARMALADE", "The Value of the MetadataValue for KEY should have changed");
|
||||||
checkMetadataValue(keyMetadataValue);
|
checkMetadataValue(keyMetadataValue);
|
||||||
|
|
||||||
MetadataValue newKeyMetadataValue = catalogClient.getCatalogItemMetadataClient().getMetadataValue(catalogItem.getHref(), "VEGIMITE");
|
MetadataValue newKeyMetadataValue = catalogApi.getCatalogItemMetadataApi().getMetadataValue(catalogItem.getHref(), "VEGIMITE");
|
||||||
|
|
||||||
assertEquals(newKeyMetadataValue.getValue(), "VALUE", "The Value of the MetadataValue for NEW_KEY should have been set");
|
assertEquals(newKeyMetadataValue.getValue(), "VALUE", "The Value of the MetadataValue for NEW_KEY should have been set");
|
||||||
checkMetadataValue(newKeyMetadataValue);
|
checkMetadataValue(newKeyMetadataValue);
|
||||||
|
@ -254,7 +254,7 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testSetCatalogItemMetadataValue")
|
@Test(description = "GET /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testSetCatalogItemMetadataValue")
|
||||||
public void testGetCatalogItemMetadataValue() {
|
public void testGetCatalogItemMetadataValue() {
|
||||||
MetadataValue metadataValue = catalogClient.getCatalogItemMetadataClient().getMetadataValue(catalogItem.getHref(), "KEY");
|
MetadataValue metadataValue = catalogApi.getCatalogItemMetadataApi().getMetadataValue(catalogItem.getHref(), "KEY");
|
||||||
checkMetadataValue(metadataValue);
|
checkMetadataValue(metadataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,12 +262,12 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
public void testSetCatalogItemMetadataValue() {
|
public void testSetCatalogItemMetadataValue() {
|
||||||
MetadataValue newMetadataValue = MetadataValue.builder().value("NEW").build();
|
MetadataValue newMetadataValue = MetadataValue.builder().value("NEW").build();
|
||||||
|
|
||||||
Task setCatalogItemMetadataValue = catalogClient.getCatalogItemMetadataClient().setMetadata(catalogItem.getHref(), "KEY", newMetadataValue);
|
Task setCatalogItemMetadataValue = catalogApi.getCatalogItemMetadataApi().setMetadata(catalogItem.getHref(), "KEY", newMetadataValue);
|
||||||
checkTask(setCatalogItemMetadataValue);
|
checkTask(setCatalogItemMetadataValue);
|
||||||
assertTrue(retryTaskSuccess.apply(setCatalogItemMetadataValue),
|
assertTrue(retryTaskSuccess.apply(setCatalogItemMetadataValue),
|
||||||
String.format(TASK_COMPLETE_TIMELY, "setCatalogItemMetadataValue"));
|
String.format(TASK_COMPLETE_TIMELY, "setCatalogItemMetadataValue"));
|
||||||
|
|
||||||
MetadataValue updatedMetadataValue = catalogClient.getCatalogItemMetadataClient().getMetadataValue(catalogItem.getHref(), "KEY");
|
MetadataValue updatedMetadataValue = catalogApi.getCatalogItemMetadataApi().getMetadataValue(catalogItem.getHref(), "KEY");
|
||||||
assertEquals(updatedMetadataValue.getValue(), newMetadataValue.getValue(),
|
assertEquals(updatedMetadataValue.getValue(), newMetadataValue.getValue(),
|
||||||
String.format(CORRECT_VALUE_OBJECT_FMT, "Value", "MetadataValue", newMetadataValue.getValue(), updatedMetadataValue.getValue()));
|
String.format(CORRECT_VALUE_OBJECT_FMT, "Value", "MetadataValue", newMetadataValue.getValue(), updatedMetadataValue.getValue()));
|
||||||
checkMetadataValue(updatedMetadataValue);
|
checkMetadataValue(updatedMetadataValue);
|
||||||
|
@ -275,11 +275,11 @@ public class CatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "DELETE /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testGetCatalogItemMetadataValue")
|
@Test(description = "DELETE /catalogItem/{id}/metadata/{key}", dependsOnMethods = "testGetCatalogItemMetadataValue")
|
||||||
public void testDeleteCatalogItemMetadataValue() {
|
public void testDeleteCatalogItemMetadataValue() {
|
||||||
Task deleteCatalogItemMetadataValue = catalogClient.getCatalogItemMetadataClient().deleteMetadataEntry(catalogItem.getHref(), "KEY");
|
Task deleteCatalogItemMetadataValue = catalogApi.getCatalogItemMetadataApi().deleteMetadataEntry(catalogItem.getHref(), "KEY");
|
||||||
checkTask(deleteCatalogItemMetadataValue);
|
checkTask(deleteCatalogItemMetadataValue);
|
||||||
assertTrue(retryTaskSuccess.apply(deleteCatalogItemMetadataValue),
|
assertTrue(retryTaskSuccess.apply(deleteCatalogItemMetadataValue),
|
||||||
String.format(TASK_COMPLETE_TIMELY, "deleteCatalogItemMetadataValue"));
|
String.format(TASK_COMPLETE_TIMELY, "deleteCatalogItemMetadataValue"));
|
||||||
MetadataValue deleted = catalogClient.getMetadataClient().getMetadataValue(catalogItem.getHref(), "KEY");
|
MetadataValue deleted = catalogApi.getMetadataApi().getMetadataValue(catalogItem.getHref(), "KEY");
|
||||||
assertNull(deleted);
|
assertNull(deleted);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -38,25 +38,25 @@ import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.CloneMediaParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.CloneMediaParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the {@link MediaClient} via its side effects.
|
* Test the {@link MediaApi} via its side effects.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "MediaClientExpectTest")
|
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "MediaApiExpectTest")
|
||||||
public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class MediaApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateMedia() {
|
public void testCreateMedia() {
|
||||||
URI uploadLink = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media");
|
URI uploadLink = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media")
|
||||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -75,14 +75,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build();
|
.build();
|
||||||
Media expected = createMedia();
|
Media expected = createMedia();
|
||||||
|
|
||||||
assertEquals(client.getMediaClient().createMedia(uploadLink, source), expected);
|
assertEquals(api.getMediaApi().createMedia(uploadLink, source), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCloneMedia() {
|
public void testCloneMedia() {
|
||||||
URI vdcURI = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
URI vdcURI = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
|
||||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -105,14 +105,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build();
|
.build();
|
||||||
Media expected = cloneMedia();
|
Media expected = cloneMedia();
|
||||||
|
|
||||||
assertEquals(client.getMediaClient().cloneMedia(vdcURI, params), expected);
|
assertEquals(api.getMediaApi().cloneMedia(vdcURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetMedia() {
|
public void testGetMedia() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -122,14 +122,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.httpResponseBuilder().build());
|
.httpResponseBuilder().build());
|
||||||
|
|
||||||
Media expected = getMedia();
|
Media expected = getMedia();
|
||||||
assertEquals(client.getMediaClient().getMedia(mediaUri), expected);
|
assertEquals(api.getMediaApi().getMedia(mediaUri), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResponse400ForInvalidMedia() {
|
public void testResponse400ForInvalidMedia() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/NOTAUUID");
|
URI mediaUri = URI.create(endpoint + "/media/NOTAUUID");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/NOTAUUID")
|
.apiCommand("GET", "/media/NOTAUUID")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -145,7 +145,7 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
client.getMediaClient().getMedia(mediaUri);
|
api.getMediaApi().getMedia(mediaUri);
|
||||||
fail("Should give HTTP 400 error");
|
fail("Should give HTTP 400 error");
|
||||||
} catch (VCloudDirectorException vde) {
|
} catch (VCloudDirectorException vde) {
|
||||||
assertEquals(vde.getError(), expected);
|
assertEquals(vde.getError(), expected);
|
||||||
|
@ -158,7 +158,7 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
public void testNullResponseForCatalogIdUsedAsMediaId() {
|
public void testNullResponseForCatalogIdUsedAsMediaId() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
URI mediaUri = URI.create(endpoint + "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f")
|
.apiCommand("GET", "/media/e9cd3387-ac57-4d27-a481-9bee75e0690f")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -167,14 +167,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.xmlFilePayload("/media/error403-catalog.xml", VCloudDirectorMediaType.ERROR)
|
.xmlFilePayload("/media/error403-catalog.xml", VCloudDirectorMediaType.ERROR)
|
||||||
.httpResponseBuilder().statusCode(403).build());
|
.httpResponseBuilder().statusCode(403).build());
|
||||||
|
|
||||||
assertNull(client.getMediaClient().getMedia(mediaUri));
|
assertNull(api.getMediaApi().getMedia(mediaUri));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResponse403ForFakeMediaId() {
|
public void testResponse403ForFakeMediaId() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
URI mediaUri = URI.create(endpoint + "/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
.apiCommand("GET", "/media/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -183,14 +183,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.xmlFilePayload("/media/error403-fake.xml", VCloudDirectorMediaType.ERROR)
|
.xmlFilePayload("/media/error403-fake.xml", VCloudDirectorMediaType.ERROR)
|
||||||
.httpResponseBuilder().statusCode(403).build());
|
.httpResponseBuilder().statusCode(403).build());
|
||||||
|
|
||||||
assertNull(client.getMediaClient().getMedia(mediaUri));
|
assertNull(api.getMediaApi().getMedia(mediaUri));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateMedia() {
|
public void testUpdateMedia() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
||||||
.xmlFilePayload("/media/updateMedia.xml", VCloudDirectorMediaType.MEDIA)
|
.xmlFilePayload("/media/updateMedia.xml", VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -203,14 +203,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
Media update = updateMedia();
|
Media update = updateMedia();
|
||||||
Task expected = updateMediaTask();
|
Task expected = updateMediaTask();
|
||||||
|
|
||||||
assertEquals(client.getMediaClient().updateMedia(mediaUri, update), expected);
|
assertEquals(api.getMediaApi().updateMedia(mediaUri, update), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDeleteMedia() {
|
public void testDeleteMedia() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("DELETE", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
.apiCommand("DELETE", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1")
|
||||||
.acceptMedia(VCloudDirectorMediaType.TASK)
|
.acceptMedia(VCloudDirectorMediaType.TASK)
|
||||||
|
@ -221,14 +221,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = deleteMediaTask();
|
Task expected = deleteMediaTask();
|
||||||
|
|
||||||
assertEquals(client.getMediaClient().deleteMedia(mediaUri), expected);
|
assertEquals(api.getMediaApi().deleteMedia(mediaUri), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetMetadata() {
|
public void testGetMetadata() {
|
||||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata")
|
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -240,14 +240,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Metadata expected = metadata();
|
Metadata expected = metadata();
|
||||||
|
|
||||||
assertEquals(client.getMediaClient().getMetadataClient().getMetadata(mediaUri), expected);
|
assertEquals(api.getMediaApi().getMetadataApi().getMetadata(mediaUri), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMergeMetadata() {
|
public void testMergeMetadata() {
|
||||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata")
|
.apiCommand("POST", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata")
|
||||||
.xmlFilePayload("/media/mergeMetadata.xml", VCloudDirectorMediaType.METADATA)
|
.xmlFilePayload("/media/mergeMetadata.xml", VCloudDirectorMediaType.METADATA)
|
||||||
|
@ -260,13 +260,13 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
Metadata inputMetadata = metadata();
|
Metadata inputMetadata = metadata();
|
||||||
Task expectedTask = mergeMetadataTask();
|
Task expectedTask = mergeMetadataTask();
|
||||||
|
|
||||||
assertEquals(client.getMediaClient().getMetadataClient().mergeMetadata(mediaUri, inputMetadata), expectedTask);
|
assertEquals(api.getMediaApi().getMetadataApi().mergeMetadata(mediaUri, inputMetadata), expectedTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGetMetadataValue() {
|
public void testGetMetadataValue() {
|
||||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -278,14 +278,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
MetadataValue expected = metadataValue();
|
MetadataValue expected = metadataValue();
|
||||||
|
|
||||||
|
|
||||||
assertEquals(client.getMediaClient().getMetadataClient().getMetadataValue(mediaUri, "key"), expected);
|
assertEquals(api.getMediaApi().getMetadataApi().getMetadataValue(mediaUri, "key"), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSetMetadataValue() {
|
public void testSetMetadataValue() {
|
||||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
.apiCommand("PUT", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
||||||
.xmlFilePayload("/media/setMetadataValue.xml", VCloudDirectorMediaType.METADATA_VALUE)
|
.xmlFilePayload("/media/setMetadataValue.xml", VCloudDirectorMediaType.METADATA_VALUE)
|
||||||
|
@ -299,14 +299,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expectedTask = setMetadataEntryTask();
|
Task expectedTask = setMetadataEntryTask();
|
||||||
|
|
||||||
assertEquals(client.getMediaClient().getMetadataClient().setMetadata(mediaUri, "key", inputMetadataValue), expectedTask);
|
assertEquals(api.getMediaApi().getMetadataApi().setMetadata(mediaUri, "key", inputMetadataValue), expectedTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDeleteMetadataValue() {
|
public void testDeleteMetadataValue() {
|
||||||
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create("https://vcloudbeta.bluelock.com/api/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("DELETE", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
.apiCommand("DELETE", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/metadata/key")
|
||||||
.acceptMedia(VCloudDirectorMediaType.TASK)
|
.acceptMedia(VCloudDirectorMediaType.TASK)
|
||||||
|
@ -317,14 +317,14 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expectedTask = deleteMetadataEntryTask();
|
Task expectedTask = deleteMetadataEntryTask();
|
||||||
|
|
||||||
assertEquals(client.getMediaClient().getMetadataClient().deleteMetadataEntry(mediaUri, "key"), expectedTask);
|
assertEquals(api.getMediaApi().getMetadataApi().deleteMetadataEntry(mediaUri, "key"), expectedTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOwner() {
|
public void testGetOwner() {
|
||||||
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
URI mediaUri = URI.create(endpoint + "/media/794eb334-754e-4917-b5a0-5df85cbd61d1");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/owner")
|
.apiCommand("GET", "/media/794eb334-754e-4917-b5a0-5df85cbd61d1/owner")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -341,7 +341,7 @@ public class MediaClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getMediaClient().getOwner(mediaUri), expected);
|
assertEquals(api.getMediaApi().getOwner(mediaUri), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Media createMedia() {
|
static Media createMedia() {
|
|
@ -63,7 +63,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
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.domain.Vdc;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.CloneMediaParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.CloneMediaParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.predicates.LinkPredicates;
|
import org.jclouds.vcloud.director.v1_5.predicates.LinkPredicates;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
|
@ -74,21 +74,21 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests behavior of {@code MediaClient}
|
* Tests behavior of {@code MediaApi}
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "MediaClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "MediaApiLiveTest")
|
||||||
public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class MediaApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
public static final String MEDIA = "media";
|
public static final String MEDIA = "media";
|
||||||
public static final String VDC = "vdc";
|
public static final String VDC = "vdc";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience references to API clients.
|
* Convenience references to API apis.
|
||||||
*/
|
*/
|
||||||
protected VdcClient vdcClient;
|
protected VdcApi vdcApi;
|
||||||
protected MediaClient mediaClient;
|
protected MediaApi mediaApi;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shared state between dependent tests.
|
* Shared state between dependent tests.
|
||||||
|
@ -101,16 +101,16 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() {
|
public void setupRequiredApis() {
|
||||||
vdcClient = context.getApi().getVdcClient();
|
vdcApi = context.getApi().getVdcApi();
|
||||||
mediaClient = context.getApi().getMediaClient();
|
mediaApi = context.getApi().getMediaApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass(alwaysRun = true)
|
@AfterClass(alwaysRun = true)
|
||||||
protected void tidyUp() {
|
protected void tidyUp() {
|
||||||
if (media != null) {
|
if (media != null) {
|
||||||
try {
|
try {
|
||||||
Task delete = mediaClient.deleteMedia(media.getHref());
|
Task delete = mediaApi.deleteMedia(media.getHref());
|
||||||
taskDoneEventually(delete);
|
taskDoneEventually(delete);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting media '%s': %s", media.getName());
|
logger.warn(e, "Error when deleting media '%s': %s", media.getName());
|
||||||
|
@ -118,7 +118,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
}
|
}
|
||||||
if (oldMedia != null) {
|
if (oldMedia != null) {
|
||||||
try {
|
try {
|
||||||
Task delete = mediaClient.deleteMedia(oldMedia.getHref());
|
Task delete = mediaApi.deleteMedia(oldMedia.getHref());
|
||||||
taskDoneEventually(delete);
|
taskDoneEventually(delete);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting media '%s': %s", oldMedia.getName());
|
logger.warn(e, "Error when deleting media '%s': %s", oldMedia.getName());
|
||||||
|
@ -129,7 +129,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "POST /vdc/{id}/media")
|
@Test(description = "POST /vdc/{id}/media")
|
||||||
public void testCreateMedia() throws URISyntaxException {
|
public void testCreateMedia() throws URISyntaxException {
|
||||||
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
|
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
|
||||||
Vdc vdc = vdcClient.getVdc(vdcURI);
|
Vdc vdc = vdcApi.getVdc(vdcURI);
|
||||||
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
|
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
|
||||||
Link addMedia = find(vdc.getLinks(), and(relEquals("add"), typeEquals(VCloudDirectorMediaType.MEDIA)));
|
Link addMedia = find(vdc.getLinks(), and(relEquals("add"), typeEquals(VCloudDirectorMediaType.MEDIA)));
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.imageType(Media.ImageType.ISO)
|
.imageType(Media.ImageType.ISO)
|
||||||
.description("Test media generated by testCreateMedia()")
|
.description("Test media generated by testCreateMedia()")
|
||||||
.build();
|
.build();
|
||||||
media = mediaClient.createMedia(addMedia.getHref(), sourceMedia);
|
media = mediaApi.createMedia(addMedia.getHref(), sourceMedia);
|
||||||
|
|
||||||
Checks.checkMediaFor(MEDIA, media);
|
Checks.checkMediaFor(MEDIA, media);
|
||||||
|
|
||||||
|
@ -162,21 +162,21 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
String.format(OBJ_FIELD_REQ, MEDIA, "uploadFile.links.first"));
|
String.format(OBJ_FIELD_REQ, MEDIA, "uploadFile.links.first"));
|
||||||
|
|
||||||
Link uploadLink = Iterables.find(links, LinkPredicates.relEquals(Link.Rel.UPLOAD_DEFAULT));
|
Link uploadLink = Iterables.find(links, LinkPredicates.relEquals(Link.Rel.UPLOAD_DEFAULT));
|
||||||
context.getApi().getUploadClient().upload(uploadLink.getHref(), Payloads.newByteArrayPayload(iso));
|
context.getApi().getUploadApi().upload(uploadLink.getHref(), Payloads.newByteArrayPayload(iso));
|
||||||
|
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
if (media.getTasks().size() == 1) {
|
if (media.getTasks().size() == 1) {
|
||||||
Task uploadTask = Iterables.getOnlyElement(media.getTasks());
|
Task uploadTask = Iterables.getOnlyElement(media.getTasks());
|
||||||
Checks.checkTask(uploadTask);
|
Checks.checkTask(uploadTask);
|
||||||
assertEquals(uploadTask.getStatus(), Task.Status.RUNNING);
|
assertEquals(uploadTask.getStatus(), Task.Status.RUNNING);
|
||||||
assertTrue(retryTaskSuccess.apply(uploadTask), String.format(TASK_COMPLETE_TIMELY, "uploadTask"));
|
assertTrue(retryTaskSuccess.apply(uploadTask), String.format(TASK_COMPLETE_TIMELY, "uploadTask"));
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /media/{id}", dependsOnMethods = { "testCreateMedia" })
|
@Test(description = "GET /media/{id}", dependsOnMethods = { "testCreateMedia" })
|
||||||
public void testGetMedia() {
|
public void testGetMedia() {
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
assertNotNull(media, String.format(OBJ_REQ_LIVE, MEDIA));
|
assertNotNull(media, String.format(OBJ_REQ_LIVE, MEDIA));
|
||||||
|
|
||||||
owner = media.getOwner();
|
owner = media.getOwner();
|
||||||
|
@ -188,7 +188,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /media/{id}/owner", dependsOnMethods = { "testGetMedia" })
|
@Test(description = "GET /media/{id}/owner", dependsOnMethods = { "testGetMedia" })
|
||||||
public void testGetMediaOwner() {
|
public void testGetMediaOwner() {
|
||||||
Owner directOwner = mediaClient.getOwner(media.getHref());
|
Owner directOwner = mediaApi.getOwner(media.getHref());
|
||||||
assertEquals(owner.toBuilder()
|
assertEquals(owner.toBuilder()
|
||||||
.user(owner.getUser().toBuilder().id(null).build())
|
.user(owner.getUser().toBuilder().id(null).build())
|
||||||
.build(),
|
.build(),
|
||||||
|
@ -207,7 +207,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "POST /vdc/{id}/action/cloneMedia", dependsOnMethods = { "testGetMediaOwner" })
|
@Test(description = "POST /vdc/{id}/action/cloneMedia", dependsOnMethods = { "testGetMediaOwner" })
|
||||||
public void testCloneMedia() {
|
public void testCloneMedia() {
|
||||||
oldMedia = media;
|
oldMedia = media;
|
||||||
media = vdcClient.cloneMedia(vdcURI, CloneMediaParams.builder()
|
media = vdcApi.cloneMedia(vdcURI, CloneMediaParams.builder()
|
||||||
.source(Reference.builder().fromEntity(media).build())
|
.source(Reference.builder().fromEntity(media).build())
|
||||||
.name("copied "+media.getName())
|
.name("copied "+media.getName())
|
||||||
.description("copied by testCloneMedia()")
|
.description("copied by testCloneMedia()")
|
||||||
|
@ -220,7 +220,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
if (copyTask != null) {
|
if (copyTask != null) {
|
||||||
Checks.checkTask(copyTask);
|
Checks.checkTask(copyTask);
|
||||||
assertTrue(retryTaskSuccess.apply(copyTask), String.format(TASK_COMPLETE_TIMELY, "copyTask"));
|
assertTrue(retryTaskSuccess.apply(copyTask), String.format(TASK_COMPLETE_TIMELY, "copyTask"));
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,9 +228,9 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
assertTrue(media.clone(oldMedia), String.format(OBJ_FIELD_CLONE, MEDIA, "copied media",
|
assertTrue(media.clone(oldMedia), String.format(OBJ_FIELD_CLONE, MEDIA, "copied media",
|
||||||
media.toString(), oldMedia.toString()));
|
media.toString(), oldMedia.toString()));
|
||||||
|
|
||||||
mediaClient.getMetadataClient().setMetadata(media.getHref(), "key", MetadataValue.builder().value("value").build());
|
mediaApi.getMetadataApi().setMetadata(media.getHref(), "key", MetadataValue.builder().value("value").build());
|
||||||
|
|
||||||
media = vdcClient.cloneMedia(vdcURI, CloneMediaParams.builder()
|
media = vdcApi.cloneMedia(vdcURI, CloneMediaParams.builder()
|
||||||
.source(Reference.builder().fromEntity(media).build())
|
.source(Reference.builder().fromEntity(media).build())
|
||||||
.name("moved test media")
|
.name("moved test media")
|
||||||
.description("moved by testCloneMedia()")
|
.description("moved by testCloneMedia()")
|
||||||
|
@ -244,7 +244,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
if (copyTask != null) {
|
if (copyTask != null) {
|
||||||
Checks.checkTask(copyTask);
|
Checks.checkTask(copyTask);
|
||||||
assertTrue(retryTaskSuccess.apply(copyTask), String.format(TASK_COMPLETE_TIMELY, "copyTask"));
|
assertTrue(retryTaskSuccess.apply(copyTask), String.format(TASK_COMPLETE_TIMELY, "copyTask"));
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,10 +261,10 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
String newDescription = "new "+oldDescription;
|
String newDescription = "new "+oldDescription;
|
||||||
media = media.toBuilder().name(newName).description(newDescription).build();
|
media = media.toBuilder().name(newName).description(newDescription).build();
|
||||||
|
|
||||||
Task updateMedia = mediaClient.updateMedia(media.getHref(), media);
|
Task updateMedia = mediaApi.updateMedia(media.getHref(), media);
|
||||||
Checks.checkTask(updateMedia);
|
Checks.checkTask(updateMedia);
|
||||||
assertTrue(retryTaskSuccess.apply(updateMedia), String.format(TASK_COMPLETE_TIMELY, "updateMedia"));
|
assertTrue(retryTaskSuccess.apply(updateMedia), String.format(TASK_COMPLETE_TIMELY, "updateMedia"));
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
|
|
||||||
assertTrue(equal(media.getName(), newName), String.format(OBJ_FIELD_UPDATABLE, MEDIA, "name"));
|
assertTrue(equal(media.getName(), newName), String.format(OBJ_FIELD_UPDATABLE, MEDIA, "name"));
|
||||||
assertTrue(equal(media.getDescription(), newDescription),
|
assertTrue(equal(media.getDescription(), newDescription),
|
||||||
|
@ -276,15 +276,15 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
media = media.toBuilder().name(oldName).description(oldDescription).build();
|
media = media.toBuilder().name(oldName).description(oldDescription).build();
|
||||||
|
|
||||||
updateMedia = mediaClient.updateMedia(media.getHref(), media);
|
updateMedia = mediaApi.updateMedia(media.getHref(), media);
|
||||||
Checks.checkTask(updateMedia);
|
Checks.checkTask(updateMedia);
|
||||||
assertTrue(retryTaskSuccess.apply(updateMedia), String.format(TASK_COMPLETE_TIMELY, "updateMedia"));
|
assertTrue(retryTaskSuccess.apply(updateMedia), String.format(TASK_COMPLETE_TIMELY, "updateMedia"));
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /media/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" })
|
@Test(description = "GET /media/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" })
|
||||||
public void testGetMetadata() {
|
public void testGetMetadata() {
|
||||||
metadata = mediaClient.getMetadataClient().getMetadata(media.getHref());
|
metadata = mediaApi.getMetadataApi().getMetadata(media.getHref());
|
||||||
// required for testing
|
// required for testing
|
||||||
assertFalse(isEmpty(metadata.getMetadataEntries()),
|
assertFalse(isEmpty(metadata.getMetadataEntries()),
|
||||||
String.format(OBJ_FIELD_REQ_LIVE, MEDIA, "metadata.entries"));
|
String.format(OBJ_FIELD_REQ_LIVE, MEDIA, "metadata.entries"));
|
||||||
|
@ -300,14 +300,14 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.entries(inputEntries)
|
.entries(inputEntries)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Task mergeMetadata = mediaClient.getMetadataClient().mergeMetadata(media.getHref(), inputMetadata);
|
Task mergeMetadata = mediaApi.getMetadataApi().mergeMetadata(media.getHref(), inputMetadata);
|
||||||
Checks.checkTask(mergeMetadata);
|
Checks.checkTask(mergeMetadata);
|
||||||
assertTrue(retryTaskSuccess.apply(mergeMetadata), String.format(TASK_COMPLETE_TIMELY, "mergeMetadata(new)"));
|
assertTrue(retryTaskSuccess.apply(mergeMetadata), String.format(TASK_COMPLETE_TIMELY, "mergeMetadata(new)"));
|
||||||
metadata = mediaClient.getMetadataClient().getMetadata(media.getHref());
|
metadata = mediaApi.getMetadataApi().getMetadata(media.getHref());
|
||||||
Checks.checkMetadataFor(MEDIA, metadata);
|
Checks.checkMetadataFor(MEDIA, metadata);
|
||||||
checkMetadataContainsEntries(metadata, inputEntries);
|
checkMetadataContainsEntries(metadata, inputEntries);
|
||||||
|
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
Checks.checkMediaFor(MEDIA, media);
|
Checks.checkMediaFor(MEDIA, media);
|
||||||
|
|
||||||
// test modify
|
// test modify
|
||||||
|
@ -316,14 +316,14 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.entries(inputEntries)
|
.entries(inputEntries)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
mergeMetadata = mediaClient.getMetadataClient().mergeMetadata(media.getHref(), inputMetadata);
|
mergeMetadata = mediaApi.getMetadataApi().mergeMetadata(media.getHref(), inputMetadata);
|
||||||
Checks.checkTask(mergeMetadata);
|
Checks.checkTask(mergeMetadata);
|
||||||
assertTrue(retryTaskSuccess.apply(mergeMetadata), String.format(TASK_COMPLETE_TIMELY, "mergeMetadata(modify)"));
|
assertTrue(retryTaskSuccess.apply(mergeMetadata), String.format(TASK_COMPLETE_TIMELY, "mergeMetadata(modify)"));
|
||||||
metadata = mediaClient.getMetadataClient().getMetadata(media.getHref());
|
metadata = mediaApi.getMetadataApi().getMetadata(media.getHref());
|
||||||
Checks.checkMetadataFor(MEDIA, metadata);
|
Checks.checkMetadataFor(MEDIA, metadata);
|
||||||
checkMetadataContainsEntries(metadata, inputEntries);
|
checkMetadataContainsEntries(metadata, inputEntries);
|
||||||
|
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
Checks.checkMediaFor(MEDIA, media);
|
Checks.checkMediaFor(MEDIA, media);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /media/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" })
|
@Test(description = "GET /media/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" })
|
||||||
public void testGetMetadataValue() {
|
public void testGetMetadataValue() {
|
||||||
metadataValue = mediaClient.getMetadataClient().getMetadataValue(media.getHref(), "key");
|
metadataValue = mediaApi.getMetadataApi().getMetadataValue(media.getHref(), "key");
|
||||||
Checks.checkMetadataValueFor(MEDIA, metadataValue);
|
Checks.checkMetadataValueFor(MEDIA, metadataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,44 +355,44 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
metadataEntryValue = "value";
|
metadataEntryValue = "value";
|
||||||
MetadataValue newValue = MetadataValue.builder().value(metadataEntryValue).build();
|
MetadataValue newValue = MetadataValue.builder().value(metadataEntryValue).build();
|
||||||
|
|
||||||
Task setMetadataEntry = mediaClient.getMetadataClient().setMetadata(media.getHref(), "key", newValue);
|
Task setMetadataEntry = mediaApi.getMetadataApi().setMetadata(media.getHref(), "key", newValue);
|
||||||
Checks.checkTask(setMetadataEntry);
|
Checks.checkTask(setMetadataEntry);
|
||||||
assertTrue(retryTaskSuccess.apply(setMetadataEntry),
|
assertTrue(retryTaskSuccess.apply(setMetadataEntry),
|
||||||
String.format(TASK_COMPLETE_TIMELY, "setMetadataEntry"));
|
String.format(TASK_COMPLETE_TIMELY, "setMetadataEntry"));
|
||||||
metadataValue = mediaClient.getMetadataClient().getMetadataValue(media.getHref(), "key");
|
metadataValue = mediaApi.getMetadataApi().getMetadataValue(media.getHref(), "key");
|
||||||
Checks.checkMetadataValueFor(MEDIA, metadataValue);
|
Checks.checkMetadataValueFor(MEDIA, metadataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "DELETE /media/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata", "testGetMetadataValue" } )
|
@Test(description = "DELETE /media/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata", "testGetMetadataValue" } )
|
||||||
public void testDeleteMetadata() {
|
public void testDeleteMetadata() {
|
||||||
Task deleteMetadataEntry = mediaClient.getMetadataClient().deleteMetadataEntry(media.getHref(), "testKey");
|
Task deleteMetadataEntry = mediaApi.getMetadataApi().deleteMetadataEntry(media.getHref(), "testKey");
|
||||||
Checks.checkTask(deleteMetadataEntry);
|
Checks.checkTask(deleteMetadataEntry);
|
||||||
assertTrue(retryTaskSuccess.apply(deleteMetadataEntry),
|
assertTrue(retryTaskSuccess.apply(deleteMetadataEntry),
|
||||||
String.format(TASK_COMPLETE_TIMELY, "deleteMetadataEntry"));
|
String.format(TASK_COMPLETE_TIMELY, "deleteMetadataEntry"));
|
||||||
|
|
||||||
metadataValue = mediaClient.getMetadataClient().getMetadataValue(media.getHref(), "testKey");
|
metadataValue = mediaApi.getMetadataApi().getMetadataValue(media.getHref(), "testKey");
|
||||||
assertNull(metadataValue, String.format(OBJ_FIELD_ATTRB_DEL, MEDIA,
|
assertNull(metadataValue, String.format(OBJ_FIELD_ATTRB_DEL, MEDIA,
|
||||||
"Metadata", metadataValue != null ? metadataValue.toString() : "",
|
"Metadata", metadataValue != null ? metadataValue.toString() : "",
|
||||||
"MetadataEntry", metadataValue != null ? metadataValue.toString() : ""));
|
"MetadataEntry", metadataValue != null ? metadataValue.toString() : ""));
|
||||||
|
|
||||||
metadataValue = mediaClient.getMetadataClient().getMetadataValue(media.getHref(), "key");
|
metadataValue = mediaApi.getMetadataApi().getMetadataValue(media.getHref(), "key");
|
||||||
Checks.checkMetadataValueFor(MEDIA, metadataValue);
|
Checks.checkMetadataValueFor(MEDIA, metadataValue);
|
||||||
|
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
Checks.checkMediaFor(MEDIA, media);
|
Checks.checkMediaFor(MEDIA, media);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "DELETE /media/{id}", dependsOnMethods = { "testDeleteMetadata" } )
|
@Test(description = "DELETE /media/{id}", dependsOnMethods = { "testDeleteMetadata" } )
|
||||||
public void testDeleteMedia() {
|
public void testDeleteMedia() {
|
||||||
Task deleteMedia = mediaClient.deleteMedia(media.getHref());
|
Task deleteMedia = mediaApi.deleteMedia(media.getHref());
|
||||||
Checks.checkTask(deleteMedia);
|
Checks.checkTask(deleteMedia);
|
||||||
assertTrue(retryTaskSuccess.apply(deleteMedia),
|
assertTrue(retryTaskSuccess.apply(deleteMedia),
|
||||||
String.format(TASK_COMPLETE_TIMELY, "deleteMedia"));
|
String.format(TASK_COMPLETE_TIMELY, "deleteMedia"));
|
||||||
|
|
||||||
media = mediaClient.getMedia(media.getHref());
|
media = mediaApi.getMedia(media.getHref());
|
||||||
assertNull(media, String.format(OBJ_DEL, MEDIA, media != null ? media.toString() : ""));
|
assertNull(media, String.format(OBJ_DEL, MEDIA, media != null ? media.toString() : ""));
|
||||||
|
|
||||||
deleteMedia = mediaClient.deleteMedia(oldMedia.getHref());
|
deleteMedia = mediaApi.deleteMedia(oldMedia.getHref());
|
||||||
Checks.checkTask(deleteMedia);
|
Checks.checkTask(deleteMedia);
|
||||||
assertTrue(retryTaskSuccess.apply(deleteMedia), String.format(TASK_COMPLETE_TIMELY, "deleteMedia"));
|
assertTrue(retryTaskSuccess.apply(deleteMedia), String.format(TASK_COMPLETE_TIMELY, "deleteMedia"));
|
||||||
oldMedia = null;
|
oldMedia = null;
|
|
@ -42,25 +42,25 @@ import org.jclouds.vcloud.director.v1_5.domain.network.NetworkConfiguration;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.network.NetworkFeatures;
|
import org.jclouds.vcloud.director.v1_5.domain.network.NetworkFeatures;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.network.SyslogServerSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.network.SyslogServerSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the {@link NetworkClient} via its side effects.
|
* Test the {@link NetworkApi} via its side effects.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "NetworkClientExpectTest")
|
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "NetworkApiExpectTest")
|
||||||
public class NetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class NetworkApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetNetwork() {
|
public void testGetNetwork() {
|
||||||
URI networkUri = URI.create(endpoint + "/network/f3ba8256-6f48-4512-aad6-600e85b4dc38");
|
URI networkUri = URI.create(endpoint + "/network/f3ba8256-6f48-4512-aad6-600e85b4dc38");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/f3ba8256-6f48-4512-aad6-600e85b4dc38")
|
.apiCommand("GET", "/network/f3ba8256-6f48-4512-aad6-600e85b4dc38")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -70,14 +70,14 @@ public class NetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest
|
||||||
.httpResponseBuilder().build());
|
.httpResponseBuilder().build());
|
||||||
|
|
||||||
OrgNetwork expected = orgNetwork();
|
OrgNetwork expected = orgNetwork();
|
||||||
assertEquals(Network.<OrgNetwork>toSubType(client.getNetworkClient().getNetwork(networkUri)), expected);
|
assertEquals(Network.<OrgNetwork>toSubType(api.getNetworkApi().getNetwork(networkUri)), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetNetworkWithInvalidId() {
|
public void testGetNetworkWithInvalidId() {
|
||||||
URI networkUri = URI.create(endpoint + "/network/NOTAUUID");
|
URI networkUri = URI.create(endpoint + "/network/NOTAUUID");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/NOTAUUID")
|
.apiCommand("GET", "/network/NOTAUUID")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -93,7 +93,7 @@ public class NetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
client.getNetworkClient().getNetwork(networkUri);
|
api.getNetworkApi().getNetwork(networkUri);
|
||||||
fail("Should give HTTP 400 error");
|
fail("Should give HTTP 400 error");
|
||||||
} catch (VCloudDirectorException vde) {
|
} catch (VCloudDirectorException vde) {
|
||||||
assertEquals(vde.getError(), expected);
|
assertEquals(vde.getError(), expected);
|
||||||
|
@ -106,7 +106,7 @@ public class NetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest
|
||||||
public void testGetNetworkWithCatalogId() {
|
public void testGetNetworkWithCatalogId() {
|
||||||
URI networkUri = URI.create(endpoint + "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c");
|
URI networkUri = URI.create(endpoint + "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c")
|
.apiCommand("GET", "/network/9e08c2f6-077a-42ce-bece-d5332e2ebb5c")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -115,14 +115,14 @@ public class NetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest
|
||||||
.xmlFilePayload("/network/error403-catalog.xml", VCloudDirectorMediaType.ERROR)
|
.xmlFilePayload("/network/error403-catalog.xml", VCloudDirectorMediaType.ERROR)
|
||||||
.httpResponseBuilder().statusCode(403).build());
|
.httpResponseBuilder().statusCode(403).build());
|
||||||
|
|
||||||
assertNull(client.getNetworkClient().getNetwork(networkUri));
|
assertNull(api.getNetworkApi().getNetwork(networkUri));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetNetworkWithFakeId() {
|
public void testGetNetworkWithFakeId() {
|
||||||
URI networkUri = URI.create(endpoint + "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
URI networkUri = URI.create(endpoint + "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
.apiCommand("GET", "/network/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -131,14 +131,14 @@ public class NetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest
|
||||||
.xmlFilePayload("/network/error403-fake.xml", VCloudDirectorMediaType.ERROR)
|
.xmlFilePayload("/network/error403-fake.xml", VCloudDirectorMediaType.ERROR)
|
||||||
.httpResponseBuilder().statusCode(403).build());
|
.httpResponseBuilder().statusCode(403).build());
|
||||||
|
|
||||||
assertNull(client.getNetworkClient().getNetwork(networkUri));
|
assertNull(api.getNetworkApi().getNetwork(networkUri));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetMetadata() {
|
public void testGetMetadata() {
|
||||||
URI networkUri = URI.create(endpoint + "/network/55a677cf-ab3f-48ae-b880-fab90421980c");
|
URI networkUri = URI.create(endpoint + "/network/55a677cf-ab3f-48ae-b880-fab90421980c");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata")
|
.apiCommand("GET", "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -158,14 +158,14 @@ public class NetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest
|
||||||
.entries(ImmutableSet.of(MetadataEntry.builder().entry("key", "value").build()))
|
.entries(ImmutableSet.of(MetadataEntry.builder().entry("key", "value").build()))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getNetworkClient().getMetadataClient().getMetadata(networkUri), expected);
|
assertEquals(api.getNetworkApi().getMetadataApi().getMetadata(networkUri), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetMetadataValue() {
|
public void testGetMetadataValue() {
|
||||||
URI networkUri = URI.create("https://vcloudbeta.bluelock.com/api/network/55a677cf-ab3f-48ae-b880-fab90421980c");
|
URI networkUri = URI.create("https://vcloudbeta.bluelock.com/api/network/55a677cf-ab3f-48ae-b880-fab90421980c");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata/KEY")
|
.apiCommand("GET", "/network/55a677cf-ab3f-48ae-b880-fab90421980c/metadata/KEY")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -184,7 +184,7 @@ public class NetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest
|
||||||
.value("value")
|
.value("value")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getNetworkClient().getMetadataClient().getMetadataValue(networkUri, "KEY"), expected);
|
assertEquals(api.getNetworkApi().getMetadataApi().getMetadataValue(networkUri, "KEY"), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OrgNetwork orgNetwork() {
|
public static OrgNetwork orgNetwork() {
|
|
@ -37,7 +37,7 @@ import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.network.Network;
|
import org.jclouds.vcloud.director.v1_5.domain.network.Network;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -45,33 +45,33 @@ import org.testng.annotations.Test;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests behavior of {@link NetworkClient}
|
* Tests behavior of {@link NetworkApi}
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "NetworkClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "NetworkApiLiveTest")
|
||||||
public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class NetworkApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
public static final String NETWORK = "network";
|
public static final String NETWORK = "network";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience reference to API client.
|
* Convenience reference to API api.
|
||||||
*/
|
*/
|
||||||
protected NetworkClient networkClient;
|
protected NetworkApi networkApi;
|
||||||
|
|
||||||
private boolean metadataSet = false;
|
private boolean metadataSet = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() {
|
public void setupRequiredApis() {
|
||||||
networkClient = context.getApi().getNetworkClient();
|
networkApi = context.getApi().getNetworkApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass(alwaysRun = true)
|
@AfterClass(alwaysRun = true)
|
||||||
public void cleanUp() {
|
public void cleanUp() {
|
||||||
if (metadataSet) {
|
if (metadataSet) {
|
||||||
try {
|
try {
|
||||||
Task delete = adminContext.getApi().getNetworkClient().getMetadataClient().deleteMetadataEntry(toAdminUri(networkURI), "key");
|
Task delete = adminContext.getApi().getNetworkApi().getMetadataApi().deleteMetadataEntry(toAdminUri(networkURI), "key");
|
||||||
taskDoneEventually(delete);
|
taskDoneEventually(delete);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting metadata");
|
logger.warn(e, "Error when deleting metadata");
|
||||||
|
@ -84,7 +84,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
// required for testing
|
// required for testing
|
||||||
assertNotNull(networkURI, String.format(REF_REQ_LIVE, NETWORK));
|
assertNotNull(networkURI, String.format(REF_REQ_LIVE, NETWORK));
|
||||||
|
|
||||||
Network abstractNetwork = networkClient.getNetwork(networkURI);
|
Network abstractNetwork = networkApi.getNetwork(networkURI);
|
||||||
assertTrue(abstractNetwork instanceof OrgNetwork, String.format(REQUIRED_VALUE_OBJECT_FMT,
|
assertTrue(abstractNetwork instanceof OrgNetwork, String.format(REQUIRED_VALUE_OBJECT_FMT,
|
||||||
".class", NETWORK, abstractNetwork.getClass(),"OrgNetwork"));
|
".class", NETWORK, abstractNetwork.getClass(),"OrgNetwork"));
|
||||||
OrgNetwork network = Network.toSubType(abstractNetwork);
|
OrgNetwork network = Network.toSubType(abstractNetwork);
|
||||||
|
@ -95,7 +95,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupMetadata() {
|
private void setupMetadata() {
|
||||||
adminContext.getApi().getNetworkClient().getMetadataClient().setMetadata(toAdminUri(networkURI),
|
adminContext.getApi().getNetworkApi().getMetadataApi().setMetadata(toAdminUri(networkURI),
|
||||||
"key", MetadataValue.builder().value("value").build());
|
"key", MetadataValue.builder().value("value").build());
|
||||||
metadataSet = true;
|
metadataSet = true;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
setupMetadata();
|
setupMetadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
Metadata metadata = networkClient.getMetadataClient().getMetadata(networkURI);
|
Metadata metadata = networkApi.getMetadataApi().getMetadata(networkURI);
|
||||||
// required for testing
|
// required for testing
|
||||||
assertFalse(Iterables.isEmpty(metadata.getMetadataEntries()),
|
assertFalse(Iterables.isEmpty(metadata.getMetadataEntries()),
|
||||||
String.format(OBJ_FIELD_REQ_LIVE, NETWORK, "metadata.entries"));
|
String.format(OBJ_FIELD_REQ_LIVE, NETWORK, "metadata.entries"));
|
||||||
|
@ -117,9 +117,9 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
for (MetadataEntry entry : metadata.getMetadataEntries()) {
|
for (MetadataEntry entry : metadata.getMetadataEntries()) {
|
||||||
// required elements and attributes
|
// required elements and attributes
|
||||||
assertNotNull(entry.getKey(),
|
assertNotNull(entry.getKey(),
|
||||||
String.format(OBJ_FIELD_ATTRB_REQ, networkClient, "MetadataEntry", entry.getKey(), "key"));
|
String.format(OBJ_FIELD_ATTRB_REQ, networkApi, "MetadataEntry", entry.getKey(), "key"));
|
||||||
assertNotNull(entry.getValue(),
|
assertNotNull(entry.getValue(),
|
||||||
String.format(OBJ_FIELD_ATTRB_REQ, networkClient, "MetadataEntry", entry.getValue(), "value"));
|
String.format(OBJ_FIELD_ATTRB_REQ, networkApi, "MetadataEntry", entry.getValue(), "value"));
|
||||||
|
|
||||||
// parent type
|
// parent type
|
||||||
checkResourceType(entry);
|
checkResourceType(entry);
|
||||||
|
@ -128,7 +128,7 @@ public class NetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /network/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" })
|
@Test(description = "GET /network/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" })
|
||||||
public void testGetMetadataValue() {
|
public void testGetMetadataValue() {
|
||||||
MetadataValue metadataValue = networkClient.getMetadataClient().getMetadataValue(networkURI, "key");
|
MetadataValue metadataValue = networkApi.getMetadataApi().getMetadataValue(networkURI, "key");
|
||||||
|
|
||||||
// Check parent type
|
// Check parent type
|
||||||
checkResourceType(metadataValue);
|
checkResourceType(metadataValue);
|
|
@ -34,24 +34,24 @@ 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.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.Org;
|
import org.jclouds.vcloud.director.v1_5.domain.org.Org;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgList;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgList;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows us to test the {@link OrgClient} via its side effects.
|
* Allows us to test the {@link OrgApi} via its side effects.
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "OrgClientExpectTest")
|
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "OrgApiExpectTest")
|
||||||
public class OrgClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class OrgApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOrgList() {
|
public void testGetOrgList() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
getStandardRequest("GET", "/org/"),
|
getStandardRequest("GET", "/org/"),
|
||||||
getStandardPayloadResponse("/org/orglist.xml", VCloudDirectorMediaType.ORG_LIST));
|
getStandardPayloadResponse("/org/orglist.xml", VCloudDirectorMediaType.ORG_LIST));
|
||||||
|
|
||||||
|
@ -63,44 +63,44 @@ public class OrgClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getOrgList(), expected);
|
assertEquals(api.getOrgApi().getOrgList(), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOrgFromOrgListReference() {
|
public void testGetOrgFromOrgListReference() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
getStandardRequest("GET", "/org/"),
|
getStandardRequest("GET", "/org/"),
|
||||||
getStandardPayloadResponse("/org/orglist.xml", VCloudDirectorMediaType.ORG_LIST));
|
getStandardPayloadResponse("/org/orglist.xml", VCloudDirectorMediaType.ORG_LIST));
|
||||||
|
|
||||||
Reference org = Iterables.getOnlyElement(client.getOrgClient().getOrgList().getOrgs());
|
Reference org = Iterables.getOnlyElement(api.getOrgApi().getOrgList().getOrgs());
|
||||||
|
|
||||||
client = requestsSendResponses(loginRequest, sessionResponse,
|
api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
getStandardRequest("GET", org.getHref()),
|
getStandardRequest("GET", org.getHref()),
|
||||||
getStandardPayloadResponse("/org/org.xml", VCloudDirectorMediaType.ORG));
|
getStandardPayloadResponse("/org/org.xml", VCloudDirectorMediaType.ORG));
|
||||||
|
|
||||||
Org expected = org();
|
Org expected = org();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getOrg(org.getHref()), expected);
|
assertEquals(api.getOrgApi().getOrg(org.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOrg() {
|
public void testGetOrg() {
|
||||||
URI orgUri = URI.create(endpoint + "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
URI orgUri = URI.create(endpoint + "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
getStandardRequest("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0"),
|
getStandardRequest("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0"),
|
||||||
getStandardPayloadResponse("/org/org.xml", VCloudDirectorMediaType.ORG));
|
getStandardPayloadResponse("/org/org.xml", VCloudDirectorMediaType.ORG));
|
||||||
|
|
||||||
Org expected = org();
|
Org expected = org();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getOrg(orgUri), expected);
|
assertEquals(api.getOrgApi().getOrg(orgUri), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOrgFailOnInvalidOrgId() {
|
public void testGetOrgFailOnInvalidOrgId() {
|
||||||
URI orgUri = URI.create(endpoint + "/org/NOTAUUID");
|
URI orgUri = URI.create(endpoint + "/org/NOTAUUID");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
getStandardRequest("GET", "/org/NOTAUUID"),
|
getStandardRequest("GET", "/org/NOTAUUID"),
|
||||||
getStandardPayloadResponse(400, "/org/error400.xml", VCloudDirectorMediaType.ERROR));
|
getStandardPayloadResponse(400, "/org/error400.xml", VCloudDirectorMediaType.ERROR));
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ public class OrgClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
client.getOrgClient().getOrg(orgUri);
|
api.getOrgApi().getOrg(orgUri);
|
||||||
fail("Should give HTTP 400 error");
|
fail("Should give HTTP 400 error");
|
||||||
} catch (VCloudDirectorException vde) {
|
} catch (VCloudDirectorException vde) {
|
||||||
assertEquals(vde.getError(), expected);
|
assertEquals(vde.getError(), expected);
|
||||||
|
@ -124,29 +124,29 @@ public class OrgClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
public void testGetOrgFailOnWrongOrgId() {
|
public void testGetOrgFailOnWrongOrgId() {
|
||||||
URI orgUri = URI.create(endpoint + "/org/9e08c2f6-077a-42ce-bece-d5332e2ebb5c");
|
URI orgUri = URI.create(endpoint + "/org/9e08c2f6-077a-42ce-bece-d5332e2ebb5c");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
getStandardRequest("GET", "/org/9e08c2f6-077a-42ce-bece-d5332e2ebb5c"),
|
getStandardRequest("GET", "/org/9e08c2f6-077a-42ce-bece-d5332e2ebb5c"),
|
||||||
getStandardPayloadResponse(403, "/org/error403-catalog.xml", VCloudDirectorMediaType.ERROR));
|
getStandardPayloadResponse(403, "/org/error403-catalog.xml", VCloudDirectorMediaType.ERROR));
|
||||||
|
|
||||||
assertNull(client.getOrgClient().getOrg(orgUri));
|
assertNull(api.getOrgApi().getOrg(orgUri));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOrgFailOnFakeOrgId() {
|
public void testGetOrgFailOnFakeOrgId() {
|
||||||
URI orgUri = URI.create(endpoint + "/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
URI orgUri = URI.create(endpoint + "/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
getStandardRequest("GET", "/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
|
getStandardRequest("GET", "/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"),
|
||||||
getStandardPayloadResponse(403, "/org/error403-fake.xml", VCloudDirectorMediaType.ERROR));
|
getStandardPayloadResponse(403, "/org/error403-fake.xml", VCloudDirectorMediaType.ERROR));
|
||||||
|
|
||||||
assertNull(client.getOrgClient().getOrg(orgUri));
|
assertNull(api.getOrgApi().getOrg(orgUri));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOrgMetadata() {
|
public void testGetOrgMetadata() {
|
||||||
URI orgUri = URI.create(endpoint + "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
URI orgUri = URI.create(endpoint + "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/metadata")
|
.apiCommand("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/metadata")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -166,14 +166,14 @@ public class OrgClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.entries(ImmutableSet.of(metadataEntry()))
|
.entries(ImmutableSet.of(metadataEntry()))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getMetadataClient().getMetadata(orgUri), expected);
|
assertEquals(api.getOrgApi().getMetadataApi().getMetadata(orgUri), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOrgMetadataValue() {
|
public void testGetOrgMetadataValue() {
|
||||||
URI orgUri = URI.create("https://vcloudbeta.bluelock.com/api/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
URI orgUri = URI.create("https://vcloudbeta.bluelock.com/api/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/metadata/KEY")
|
.apiCommand("GET", "/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/metadata/KEY")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -184,7 +184,7 @@ public class OrgClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
MetadataValue expected = metadataValue();
|
MetadataValue expected = metadataValue();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getMetadataClient().getMetadataValue(orgUri, "KEY"), expected);
|
assertEquals(api.getOrgApi().getMetadataApi().getMetadataValue(orgUri, "KEY"), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Org org() {
|
public static Org org() {
|
|
@ -41,7 +41,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.Org;
|
import org.jclouds.vcloud.director.v1_5.domain.org.Org;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgList;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgList;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.ControlAccessParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.ControlAccessParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -49,25 +49,25 @@ import org.testng.annotations.Test;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests live behavior of {@link OrgClient}.
|
* Tests live behavior of {@link OrgApi}.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "OrgClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "OrgApiLiveTest")
|
||||||
public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class OrgApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience references to API clients.
|
* Convenience references to API apis.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private OrgClient orgClient;
|
private OrgApi orgApi;
|
||||||
private URI catalogRef;
|
private URI catalogRef;
|
||||||
private String testCatalogId;
|
private String testCatalogId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() {
|
public void setupRequiredApis() {
|
||||||
orgClient = context.getApi().getOrgClient();
|
orgApi = context.getApi().getOrgApi();
|
||||||
testCatalogId = catalogId;
|
testCatalogId = catalogId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,13 +75,13 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
public void cleanUp() throws Exception {
|
public void cleanUp() throws Exception {
|
||||||
if (adminMembersSet) {
|
if (adminMembersSet) {
|
||||||
try {
|
try {
|
||||||
Task delete = adminContext.getApi().getOrgClient().getMetadataClient().deleteMetadataEntry(toAdminUri(orgURI), "KEY");
|
Task delete = adminContext.getApi().getOrgApi().getMetadataApi().deleteMetadataEntry(toAdminUri(orgURI), "KEY");
|
||||||
taskDoneEventually(delete);
|
taskDoneEventually(delete);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting metadata entry");
|
logger.warn(e, "Error when deleting metadata entry");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
adminContext.getApi().getCatalogClient().deleteCatalog(catalogRef);
|
adminContext.getApi().getCatalogApi().deleteCatalog(catalogRef);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting catalog'%s': %s", catalogRef);
|
logger.warn(e, "Error when deleting catalog'%s': %s", catalogRef);
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /org")
|
@Test(description = "GET /org")
|
||||||
public void testGetOrgList() {
|
public void testGetOrgList() {
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
orgList = orgClient.getOrgList();
|
orgList = orgApi.getOrgList();
|
||||||
|
|
||||||
// NOTE The environment MUST have at least one organisation configured
|
// NOTE The environment MUST have at least one organisation configured
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
orgURI = orgRef.getHref();
|
orgURI = orgRef.getHref();
|
||||||
|
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
org = orgClient.getOrg(orgURI);
|
org = orgApi.getOrg(orgURI);
|
||||||
|
|
||||||
checkOrg(org);
|
checkOrg(org);
|
||||||
|
|
||||||
|
@ -134,14 +134,14 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
* If we're running in an admin context, it's cleaner to make temporary entities, plus eliminates the need for configuration
|
* If we're running in an admin context, it's cleaner to make temporary entities, plus eliminates the need for configuration
|
||||||
*/
|
*/
|
||||||
private void setupAdminMembers() {
|
private void setupAdminMembers() {
|
||||||
adminContext.getApi().getOrgClient().getMetadataClient().setMetadata(toAdminUri(orgURI),
|
adminContext.getApi().getOrgApi().getMetadataApi().setMetadata(toAdminUri(orgURI),
|
||||||
"KEY", MetadataValue.builder().value("VALUE").build());
|
"KEY", MetadataValue.builder().value("VALUE").build());
|
||||||
|
|
||||||
AdminCatalog newCatalog = AdminCatalog.builder()
|
AdminCatalog newCatalog = AdminCatalog.builder()
|
||||||
.name("Test Catalog "+getTestDateTimeStamp())
|
.name("Test Catalog "+getTestDateTimeStamp())
|
||||||
.description("created by testOrg()")
|
.description("created by testOrg()")
|
||||||
.build();
|
.build();
|
||||||
newCatalog = adminContext.getApi().getCatalogClient().createCatalog(toAdminUri(orgURI), newCatalog);
|
newCatalog = adminContext.getApi().getCatalogApi().createCatalog(toAdminUri(orgURI), newCatalog);
|
||||||
|
|
||||||
catalogRef = newCatalog.getHref();
|
catalogRef = newCatalog.getHref();
|
||||||
testCatalogId = newCatalog.getId().substring("urn:vcloud:catalog:".length());
|
testCatalogId = newCatalog.getId().substring("urn:vcloud:catalog:".length());
|
||||||
|
@ -153,7 +153,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
public void testGetOrgMetadata() {
|
public void testGetOrgMetadata() {
|
||||||
|
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
Metadata metadata = orgClient.getMetadataClient().getMetadata(orgURI);
|
Metadata metadata = orgApi.getMetadataApi().getMetadata(orgURI);
|
||||||
|
|
||||||
// NOTE The environment MUST have at one metadata entry for the first organisation configured
|
// NOTE The environment MUST have at one metadata entry for the first organisation configured
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /org/{id}/metadata/{key}", dependsOnMethods = { "testGetOrgMetadata" })
|
@Test(description = "GET /org/{id}/metadata/{key}", dependsOnMethods = { "testGetOrgMetadata" })
|
||||||
public void testGetOrgMetadataValue() {
|
public void testGetOrgMetadataValue() {
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
MetadataValue value = orgClient.getMetadataClient().getMetadataValue(orgURI, "KEY");
|
MetadataValue value = orgApi.getMetadataApi().getMetadataValue(orgURI, "KEY");
|
||||||
|
|
||||||
// NOTE The environment MUST have configured the metadata entry as '{ key="KEY", value="VALUE" )'
|
// NOTE The environment MUST have configured the metadata entry as '{ key="KEY", value="VALUE" )'
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /org/{id}/catalog/{catalogId}/controlAccess", dependsOnMethods = { "testGetOrg" })
|
@Test(description = "GET /org/{id}/catalog/{catalogId}/controlAccess", dependsOnMethods = { "testGetOrg" })
|
||||||
public void testGetControlAccess() {
|
public void testGetControlAccess() {
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
ControlAccessParams params = orgClient.getControlAccess(orgURI, testCatalogId);
|
ControlAccessParams params = orgApi.getControlAccess(orgURI, testCatalogId);
|
||||||
|
|
||||||
// Check params are well formed
|
// Check params are well formed
|
||||||
checkControlAccessParams(params);
|
checkControlAccessParams(params);
|
||||||
|
@ -188,10 +188,10 @@ public class OrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "POST /org/{id}/catalog/{catalogId}/action/controlAccess", dependsOnMethods = { "testGetControlAccess" })
|
@Test(description = "POST /org/{id}/catalog/{catalogId}/action/controlAccess", dependsOnMethods = { "testGetControlAccess" })
|
||||||
public void testModifyControlAccess() {
|
public void testModifyControlAccess() {
|
||||||
// Setup params
|
// Setup params
|
||||||
ControlAccessParams params = orgClient.getControlAccess(orgURI, testCatalogId);
|
ControlAccessParams params = orgApi.getControlAccess(orgURI, testCatalogId);
|
||||||
|
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
ControlAccessParams modified = orgClient.modifyControlAccess(orgURI, testCatalogId, params);
|
ControlAccessParams modified = orgApi.modifyControlAccess(orgURI, testCatalogId, params);
|
||||||
|
|
||||||
// Check params are well formed
|
// Check params are well formed
|
||||||
checkControlAccessParams(modified);
|
checkControlAccessParams(modified);
|
|
@ -30,17 +30,17 @@ import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.CatalogReferences;
|
import org.jclouds.vcloud.director.v1_5.domain.query.CatalogReferences;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultCatalogRecord;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultCatalogRecord;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the {@link QueryClient} by observing its side effects.
|
* Test the {@link QueryApi} by observing its side effects.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "QueryClientExpectTest")
|
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "QueryApiExpectTest")
|
||||||
public class QueryClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class QueryApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testQueryAllCatalogs() {
|
public void testQueryAllCatalogs() {
|
||||||
|
@ -57,7 +57,7 @@ public class QueryClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/query/allCatalogs.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/query/allCatalogs.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||||
|
|
||||||
QueryResultRecords expected = QueryResultRecords.builder()
|
QueryResultRecords expected = QueryResultRecords.builder()
|
||||||
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=records"))
|
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=records"))
|
||||||
|
@ -114,7 +114,7 @@ public class QueryClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getQueryClient().catalogsQueryAll(), expected);
|
assertEquals(api.getQueryApi().catalogsQueryAll(), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -130,7 +130,7 @@ public class QueryClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/query/allCatalogReferences.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/query/allCatalogReferences.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||||
|
|
||||||
CatalogReferences expected = CatalogReferences.builder()
|
CatalogReferences expected = CatalogReferences.builder()
|
||||||
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=references"))
|
.href(URI.create("https://vcloudbeta.bluelock.com/api/catalogs/query?page=1&pageSize=25&format=references"))
|
||||||
|
@ -175,7 +175,7 @@ public class QueryClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getQueryClient().catalogReferencesQueryAll(), expected);
|
assertEquals(api.getQueryApi().catalogReferencesQueryAll(), expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultVAppRecord;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultVAppRecord;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultVAppTemplateRecord;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultVAppTemplateRecord;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultVMRecord;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultVMRecord;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.predicates.ReferencePredicates;
|
import org.jclouds.vcloud.director.v1_5.predicates.ReferencePredicates;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
|
@ -57,20 +57,20 @@ import org.testng.annotations.Test;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests live behavior of {@link QueryClient}.
|
* Tests live behavior of {@link QueryApi}.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "QueryClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "QueryApiLiveTest")
|
||||||
public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class QueryApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience references to API clients.
|
* Convenience references to API apis.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private QueryClient queryClient;
|
private QueryApi queryApi;
|
||||||
private VAppTemplateClient vAppTemplateClient;
|
private VAppTemplateApi vAppTemplateApi;
|
||||||
private VAppClient vAppClient;
|
private VAppApi vAppApi;
|
||||||
|
|
||||||
private VApp vApp;
|
private VApp vApp;
|
||||||
|
|
||||||
|
@ -81,34 +81,34 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() {
|
public void setupRequiredApis() {
|
||||||
queryClient = context.getApi().getQueryClient();
|
queryApi = context.getApi().getQueryApi();
|
||||||
vAppTemplateClient = context.getApi().getVAppTemplateClient();
|
vAppTemplateApi = context.getApi().getVAppTemplateApi();
|
||||||
vAppClient = context.getApi().getVAppClient();
|
vAppApi = context.getApi().getVAppApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /entity/{id}")
|
@Test(description = "GET /entity/{id}")
|
||||||
public void testEntity() {
|
public void testEntity() {
|
||||||
// Get a VAppTemplate to look up as an entity
|
// Get a VAppTemplate to look up as an entity
|
||||||
VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
|
VAppTemplate vAppTemplate = vAppTemplateApi.getVAppTemplate(vAppTemplateURI);
|
||||||
|
|
||||||
// Method under test
|
// Method under test
|
||||||
Entity entity = queryClient.entity(vAppTemplate.getId());
|
Entity entity = queryApi.entity(vAppTemplate.getId());
|
||||||
|
|
||||||
// Check returned entity
|
// Check returned entity
|
||||||
checkEntityType(entity);
|
checkEntityType(entity);
|
||||||
|
|
||||||
// Retrieve and check template using entity link
|
// Retrieve and check template using entity link
|
||||||
Link link = Iterables.find(entity.getLinks(), ReferencePredicates.<Link>typeEquals(VCloudDirectorMediaType.VAPP_TEMPLATE));
|
Link link = Iterables.find(entity.getLinks(), ReferencePredicates.<Link>typeEquals(VCloudDirectorMediaType.VAPP_TEMPLATE));
|
||||||
VAppTemplate retrieved = vAppTemplateClient.getVAppTemplate(link.getHref());
|
VAppTemplate retrieved = vAppTemplateApi.getVAppTemplate(link.getHref());
|
||||||
assertEquals(retrieved, vAppTemplate, String.format(ENTITY_EQUAL, "VAppTemplate"));
|
assertEquals(retrieved, vAppTemplate, String.format(ENTITY_EQUAL, "VAppTemplate"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /query")
|
@Test(description = "GET /query")
|
||||||
public void testQuery() {
|
public void testQuery() {
|
||||||
VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
|
VAppTemplate vAppTemplate = vAppTemplateApi.getVAppTemplate(vAppTemplateURI);
|
||||||
QueryResultRecords queryResult = queryClient.query("vAppTemplate", String.format("name==%s", vAppTemplate.getName()));
|
QueryResultRecords queryResult = queryApi.query("vAppTemplate", String.format("name==%s", vAppTemplate.getName()));
|
||||||
Set<URI> hrefs = toHrefs(queryResult);
|
Set<URI> hrefs = toHrefs(queryResult);
|
||||||
|
|
||||||
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP_TEMPLATE, null), QueryResultVAppTemplateRecord.class);
|
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP_TEMPLATE, null), QueryResultVAppTemplateRecord.class);
|
||||||
|
@ -117,19 +117,19 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /catalogs/query")
|
@Test(description = "GET /catalogs/query")
|
||||||
public void testQueryAllCatalogs() {
|
public void testQueryAllCatalogs() {
|
||||||
QueryResultRecords catalogRecords = queryClient.catalogsQueryAll();
|
QueryResultRecords catalogRecords = queryApi.catalogsQueryAll();
|
||||||
assertFalse(catalogRecords.getRecords().isEmpty(), String.format(NOT_EMPTY_OBJECT_FMT, "CatalogRecord", "QueryResultRecords"));
|
assertFalse(catalogRecords.getRecords().isEmpty(), String.format(NOT_EMPTY_OBJECT_FMT, "CatalogRecord", "QueryResultRecords"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /catalogs/query?format=references", dependsOnMethods = { "testQueryAllCatalogs" })
|
@Test(description = "GET /catalogs/query?format=references", dependsOnMethods = { "testQueryAllCatalogs" })
|
||||||
public void testQueryAllCatalogReferences() {
|
public void testQueryAllCatalogReferences() {
|
||||||
CatalogReferences catalogReferences = queryClient.catalogReferencesQueryAll();
|
CatalogReferences catalogReferences = queryApi.catalogReferencesQueryAll();
|
||||||
assertFalse(catalogReferences.getReferences().isEmpty(), String.format(NOT_EMPTY_OBJECT_FMT, "CatalogReference", "CatalogReferences"));
|
assertFalse(catalogReferences.getReferences().isEmpty(), String.format(NOT_EMPTY_OBJECT_FMT, "CatalogReference", "CatalogReferences"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplates/query")
|
@Test(description = "GET /vAppTemplates/query")
|
||||||
public void testQueryAllVAppTemplates() {
|
public void testQueryAllVAppTemplates() {
|
||||||
QueryResultRecords queryResult = queryClient.vAppTemplatesQueryAll();
|
QueryResultRecords queryResult = queryApi.vAppTemplatesQueryAll();
|
||||||
Set<URI> hrefs = toHrefs(queryResult);
|
Set<URI> hrefs = toHrefs(queryResult);
|
||||||
|
|
||||||
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP_TEMPLATE, null), QueryResultVAppTemplateRecord.class);
|
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP_TEMPLATE, null), QueryResultVAppTemplateRecord.class);
|
||||||
|
@ -138,8 +138,8 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplates/query?filter")
|
@Test(description = "GET /vAppTemplates/query?filter")
|
||||||
public void testQueryVAppTemplatesWithFilter() {
|
public void testQueryVAppTemplatesWithFilter() {
|
||||||
VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
|
VAppTemplate vAppTemplate = vAppTemplateApi.getVAppTemplate(vAppTemplateURI);
|
||||||
QueryResultRecords queryResult = queryClient.vAppTemplatesQuery(String.format("name==%s", vAppTemplate.getName()));
|
QueryResultRecords queryResult = queryApi.vAppTemplatesQuery(String.format("name==%s", vAppTemplate.getName()));
|
||||||
Set<URI> hrefs = toHrefs(queryResult);
|
Set<URI> hrefs = toHrefs(queryResult);
|
||||||
|
|
||||||
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP_TEMPLATE, null), QueryResultVAppTemplateRecord.class);
|
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP_TEMPLATE, null), QueryResultVAppTemplateRecord.class);
|
||||||
|
@ -150,7 +150,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
public void testQueryAllVApps() {
|
public void testQueryAllVApps() {
|
||||||
vApp = instantiateVApp();
|
vApp = instantiateVApp();
|
||||||
|
|
||||||
QueryResultRecords queryResult = queryClient.vAppsQueryAll();
|
QueryResultRecords queryResult = queryApi.vAppsQueryAll();
|
||||||
Set<URI> hrefs = toHrefs(queryResult);
|
Set<URI> hrefs = toHrefs(queryResult);
|
||||||
|
|
||||||
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultVAppRecord.class);
|
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultVAppRecord.class);
|
||||||
|
@ -159,7 +159,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /vApps/query?filter", dependsOnMethods = { "testQueryAllVApps" } )
|
@Test(description = "GET /vApps/query?filter", dependsOnMethods = { "testQueryAllVApps" } )
|
||||||
public void testQueryVAppsWithFilter() {
|
public void testQueryVAppsWithFilter() {
|
||||||
QueryResultRecords queryResult = queryClient.vAppsQuery(String.format("name==%s", vApp.getName()));
|
QueryResultRecords queryResult = queryApi.vAppsQuery(String.format("name==%s", vApp.getName()));
|
||||||
Set<URI> hrefs = toHrefs(queryResult);
|
Set<URI> hrefs = toHrefs(queryResult);
|
||||||
|
|
||||||
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultVAppRecord.class);
|
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultVAppRecord.class);
|
||||||
|
@ -175,15 +175,15 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the vApp so that it has VMs
|
// Start the vApp so that it has VMs
|
||||||
Task task = vAppClient.powerOn(vApp.getHref());
|
Task task = vAppApi.powerOn(vApp.getHref());
|
||||||
assertTaskSucceedsLong(task);
|
assertTaskSucceedsLong(task);
|
||||||
|
|
||||||
vApp = vAppClient.getVApp(vApp.getHref()); // reload, so it has the VMs
|
vApp = vAppApi.getVApp(vApp.getHref()); // reload, so it has the VMs
|
||||||
List<Vm> vms = vApp.getChildren().getVms();
|
List<Vm> vms = vApp.getChildren().getVms();
|
||||||
Set<URI> vmHrefs = toHrefs(vms);
|
Set<URI> vmHrefs = toHrefs(vms);
|
||||||
|
|
||||||
// Method under test: do the query
|
// Method under test: do the query
|
||||||
QueryResultRecords queryResult = queryClient.vmsQueryAll();
|
QueryResultRecords queryResult = queryApi.vmsQueryAll();
|
||||||
Set<URI> hrefs = toHrefs(queryResult);
|
Set<URI> hrefs = toHrefs(queryResult);
|
||||||
|
|
||||||
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VM, null), QueryResultVMRecord.class);
|
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VM, null), QueryResultVMRecord.class);
|
||||||
|
@ -195,7 +195,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
List<Vm> vms = vApp.getChildren().getVms();
|
List<Vm> vms = vApp.getChildren().getVms();
|
||||||
Set<URI> vmHrefs = toHrefs(vms);
|
Set<URI> vmHrefs = toHrefs(vms);
|
||||||
|
|
||||||
QueryResultRecords queryResult = queryClient.vmsQuery(String.format("containerName==%s", vApp.getName()));
|
QueryResultRecords queryResult = queryApi.vmsQuery(String.format("containerName==%s", vApp.getName()));
|
||||||
Set<URI> hrefs = toHrefs(queryResult);
|
Set<URI> hrefs = toHrefs(queryResult);
|
||||||
|
|
||||||
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VM, null), QueryResultVMRecord.class);
|
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VM, null), QueryResultVMRecord.class);
|
||||||
|
@ -204,7 +204,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /mediaList/query")
|
@Test(description = "GET /mediaList/query")
|
||||||
public void testQueryAllMedia() {
|
public void testQueryAllMedia() {
|
||||||
QueryResultRecords queryResult = queryClient.mediaListQueryAll();
|
QueryResultRecords queryResult = queryApi.mediaListQueryAll();
|
||||||
|
|
||||||
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultMediaRecord.class);
|
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultMediaRecord.class);
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,7 @@ public class QueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /mediaList/query?filter")
|
@Test(description = "GET /mediaList/query?filter")
|
||||||
public void testQueryMediaWithFilter() {
|
public void testQueryMediaWithFilter() {
|
||||||
String mediaName = "abc";
|
String mediaName = "abc";
|
||||||
QueryResultRecords queryResult = queryClient.mediaListQuery(String.format("name==%s", mediaName));
|
QueryResultRecords queryResult = queryApi.mediaListQuery(String.format("name==%s", mediaName));
|
||||||
|
|
||||||
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultMediaRecord.class);
|
assertRecordTypes(queryResult, Arrays.asList(VCloudDirectorMediaType.VAPP, null), QueryResultMediaRecord.class);
|
||||||
}
|
}
|
|
@ -32,17 +32,17 @@ import org.jclouds.vcloud.director.v1_5.domain.Error;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the {@link TaskClient} by observing its side effects.
|
* Test the {@link TaskApi} by observing its side effects.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "TaskClientExpectTest")
|
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "TaskApiExpectTest")
|
||||||
public class TaskClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class TaskApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTaskListForValidOrg() {
|
public void testTaskListForValidOrg() {
|
||||||
|
@ -69,7 +69,7 @@ public class TaskClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/org/org.xml", VCloudDirectorMediaType.TASKS_LIST + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/org/org.xml", VCloudDirectorMediaType.TASKS_LIST + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||||
|
|
||||||
TasksList expected = TasksList.builder()
|
TasksList expected = TasksList.builder()
|
||||||
.name("Tasks Lists")
|
.name("Tasks Lists")
|
||||||
|
@ -79,7 +79,7 @@ public class TaskClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.task(taskTwo())
|
.task(taskTwo())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getTaskClient().getTaskList(URI.create("https://vcloudbeta.bluelock.com/api/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0")), expected);
|
assertEquals(api.getTaskApi().getTaskList(URI.create("https://vcloudbeta.bluelock.com/api/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0")), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -102,7 +102,7 @@ public class TaskClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/org/error400.xml", VCloudDirectorMediaType.ERROR + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/org/error400.xml", VCloudDirectorMediaType.ERROR + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||||
|
|
||||||
Error expected = Error.builder()
|
Error expected = Error.builder()
|
||||||
.message("validation error on field 'id': String value has invalid format or length")
|
.message("validation error on field 'id': String value has invalid format or length")
|
||||||
|
@ -111,7 +111,7 @@ public class TaskClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
client.getTaskClient().getTaskList(URI.create("https://vcloudbeta.bluelock.com/api/org/NOTAUUID"));
|
api.getTaskApi().getTaskList(URI.create("https://vcloudbeta.bluelock.com/api/org/NOTAUUID"));
|
||||||
fail("Should give HTTP 400 error");
|
fail("Should give HTTP 400 error");
|
||||||
} catch (VCloudDirectorException vde) {
|
} catch (VCloudDirectorException vde) {
|
||||||
assertEquals(vde.getError(), expected);
|
assertEquals(vde.getError(), expected);
|
||||||
|
@ -141,9 +141,9 @@ public class TaskClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/org/error403-fake.xml", VCloudDirectorMediaType.ERROR + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/org/error403-fake.xml", VCloudDirectorMediaType.ERROR + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse, orgRequest, orgResponse);
|
||||||
|
|
||||||
assertNull(client.getTaskClient().getTaskList(URI.create("https://vcloudbeta.bluelock.com/api/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")));
|
assertNull(api.getTaskApi().getTaskList(URI.create("https://vcloudbeta.bluelock.com/api/org/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -159,14 +159,14 @@ public class TaskClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.payload(payloadFromResourceWithContentType("/task/task.xml", VCloudDirectorMediaType.TASK + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/task/task.xml", VCloudDirectorMediaType.TASK + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse);
|
||||||
|
|
||||||
URI taskUri = URI.create(endpoint + "/task/5fcd2af3-d0ec-45ce-9451-8c585a2c766b");
|
URI taskUri = URI.create(endpoint + "/task/5fcd2af3-d0ec-45ce-9451-8c585a2c766b");
|
||||||
|
|
||||||
//TODO: incorrect relationship, as task should not have a nested task container!!
|
//TODO: incorrect relationship, as task should not have a nested task container!!
|
||||||
Task expected = taskOne();
|
Task expected = taskOne();
|
||||||
|
|
||||||
assertEquals(client.getTaskClient().getTask(taskUri), expected);
|
assertEquals(api.getTaskApi().getTask(taskUri), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -181,11 +181,11 @@ public class TaskClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.statusCode(200)
|
.statusCode(200)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse);
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse, taskRequest, taskResponse);
|
||||||
|
|
||||||
URI taskUri = URI.create(endpoint + "/task/5fcd2af3-d0ec-45ce-9451-8c585a2c766b");
|
URI taskUri = URI.create(endpoint + "/task/5fcd2af3-d0ec-45ce-9451-8c585a2c766b");
|
||||||
|
|
||||||
client.getTaskClient().cancelTask(taskUri);
|
api.getTaskApi().cancelTask(taskUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Task taskOne() {
|
public static Task taskOne() {
|
|
@ -30,7 +30,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
import org.jclouds.vcloud.director.v1_5.domain.TasksList;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.VApp;
|
import org.jclouds.vcloud.director.v1_5.domain.VApp;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgList;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgList;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -39,19 +39,19 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests live behavior of {@link TaskClient}.
|
* Tests live behavior of {@link TaskApi}.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "TaskClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "TaskApiLiveTest")
|
||||||
public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class TaskApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience references to API clients.
|
* Convenience references to API apis.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private OrgClient orgClient;
|
private OrgApi orgApi;
|
||||||
private TaskClient taskClient;
|
private TaskApi taskApi;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shared state between dependant tests.
|
* Shared state between dependant tests.
|
||||||
|
@ -67,9 +67,9 @@ public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() {
|
public void setupRequiredApis() {
|
||||||
orgClient = context.getApi().getOrgClient();
|
orgApi = context.getApi().getOrgApi();
|
||||||
taskClient = context.getApi().getTaskClient();
|
taskApi = context.getApi().getTaskApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass(alwaysRun = true)
|
@AfterClass(alwaysRun = true)
|
||||||
|
@ -79,13 +79,13 @@ public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /tasksList/{id}")
|
@Test(description = "GET /tasksList/{id}")
|
||||||
public void testGetTaskList() {
|
public void testGetTaskList() {
|
||||||
orgList = orgClient.getOrgList();
|
orgList = orgApi.getOrgList();
|
||||||
Reference orgRef = Iterables.getFirst(orgList.getOrgs(), null);
|
Reference orgRef = Iterables.getFirst(orgList.getOrgs(), null);
|
||||||
assertNotNull(orgRef);
|
assertNotNull(orgRef);
|
||||||
orgURI = orgRef.getHref();
|
orgURI = orgRef.getHref();
|
||||||
|
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
taskList = taskClient.getTaskList(orgURI);
|
taskList = taskApi.getTaskList(orgURI);
|
||||||
|
|
||||||
// NOTE The environment MUST have ...
|
// NOTE The environment MUST have ...
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
taskURI = taskRef.getHref();
|
taskURI = taskRef.getHref();
|
||||||
|
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
task = taskClient.getTask(taskURI);
|
task = taskApi.getTask(taskURI);
|
||||||
|
|
||||||
// Check required elements and attributes
|
// Check required elements and attributes
|
||||||
checkTask(task);
|
checkTask(task);
|
||||||
|
@ -122,7 +122,7 @@ public class TaskClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
assertTaskStatusEventually(task, Task.Status.RUNNING, ImmutableSet.of(Task.Status.ERROR, Task.Status.ABORTED));
|
assertTaskStatusEventually(task, Task.Status.RUNNING, ImmutableSet.of(Task.Status.ERROR, Task.Status.ABORTED));
|
||||||
|
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
taskClient.cancelTask(taskURI);
|
taskApi.cancelTask(taskURI);
|
||||||
assertTaskStatusEventually(task, Task.Status.CANCELED, ImmutableSet.of(Task.Status.ERROR, Task.Status.ABORTED, Task.Status.SUCCESS));
|
assertTaskStatusEventually(task, Task.Status.CANCELED, ImmutableSet.of(Task.Status.ERROR, Task.Status.ABORTED, Task.Status.SUCCESS));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,29 +18,29 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.vcloud.director.v1_5.features;
|
package org.jclouds.vcloud.director.v1_5.features;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests behavior of {@link NetworkClient}
|
* Tests behavior of {@link NetworkApi}
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "UploadClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "UploadApiLiveTest")
|
||||||
public class UploadClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class UploadApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
public static final String UPLOAD = "upload";
|
public static final String UPLOAD = "upload";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience reference to API client.
|
* Convenience reference to API api.
|
||||||
*/
|
*/
|
||||||
protected UploadClient uploadClient;
|
protected UploadApi uploadApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() {
|
public void setupRequiredApis() {
|
||||||
uploadClient = context.getApi().getUploadClient();
|
uploadApi = context.getApi().getUploadApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "PUT ???", enabled = false)
|
@Test(description = "PUT ???", enabled = false)
|
|
@ -48,19 +48,19 @@ import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConnectionSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.OperatingSystemSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.OperatingSystemSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.RuntimeInfoSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.RuntimeInfoSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.VirtualHardwareSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.VirtualHardwareSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import org.testng.internal.annotations.Sets;
|
import org.testng.internal.annotations.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows us to test the {@link VAppClient} via its side effects.
|
* Allows us to test the {@link VAppApi} via its side effects.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "VAppClientExpectTest")
|
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "VAppApiExpectTest")
|
||||||
public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class VAppApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
private String vAppId = "vapp-d0e2b6b9-4381-4ddc-9572-cdfae54059be";
|
private String vAppId = "vapp-d0e2b6b9-4381-4ddc-9572-cdfae54059be";
|
||||||
private URI vAppURI = URI.create(endpoint + vAppId);
|
private URI vAppURI = URI.create(endpoint + vAppId);
|
||||||
|
@ -71,7 +71,7 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
@Test(enabled = false)//TODO
|
@Test(enabled = false)//TODO
|
||||||
public void testGetVapp() {
|
public void testGetVapp() {
|
||||||
VCloudDirectorClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId)
|
.apiCommand("GET", vAppId)
|
||||||
.acceptMedia(VCloudDirectorMediaType.VAPP)
|
.acceptMedia(VCloudDirectorMediaType.VAPP)
|
||||||
|
@ -82,12 +82,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
VApp expected = getVApp();
|
VApp expected = getVApp();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().getVApp(vAppURI), expected);
|
assertEquals(api.getVAppApi().getVApp(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVApp() {
|
public void testModifyVApp() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId)
|
.apiCommand("PUT", vAppId)
|
||||||
.xmlFilePayload("/vApp/modifyVApp.xml", VCloudDirectorMediaType.VAPP)
|
.xmlFilePayload("/vApp/modifyVApp.xml", VCloudDirectorMediaType.VAPP)
|
||||||
|
@ -103,12 +103,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyVAppTask();
|
Task expected = modifyVAppTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().modifyVApp(vAppURI, modified), expected);
|
assertEquals(api.getVAppApi().modifyVApp(vAppURI, modified), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testDeleteVApp() {
|
public void testDeleteVApp() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("DELETE", vAppId)
|
.apiCommand("DELETE", vAppId)
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -119,12 +119,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = deleteVAppTask();
|
Task expected = deleteVAppTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().deleteVApp(vAppURI), expected);
|
assertEquals(api.getVAppApi().deleteVApp(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testControlAccess() {
|
public void testControlAccess() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/controlAccess")
|
.apiCommand("POST", vAppId + "/action/controlAccess")
|
||||||
.xmlFilePayload("/vApp/controlAccessParams.xml", VCloudDirectorMediaType.CONTROL_ACCESS)
|
.xmlFilePayload("/vApp/controlAccessParams.xml", VCloudDirectorMediaType.CONTROL_ACCESS)
|
||||||
|
@ -138,12 +138,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
ControlAccessParams expected = controlAccessParams();
|
ControlAccessParams expected = controlAccessParams();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().modifyControlAccess(vAppURI, params), expected);
|
assertEquals(api.getVAppApi().modifyControlAccess(vAppURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testDeploy() {
|
public void testDeploy() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/deploy")
|
.apiCommand("POST", vAppId + "/action/deploy")
|
||||||
.xmlFilePayload("/vApp/deployParams.xml", VCloudDirectorMediaType.DEPLOY_VAPP_PARAMS)
|
.xmlFilePayload("/vApp/deployParams.xml", VCloudDirectorMediaType.DEPLOY_VAPP_PARAMS)
|
||||||
|
@ -158,12 +158,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = deployTask();
|
Task expected = deployTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().deploy(vAppURI, params), expected);
|
assertEquals(api.getVAppApi().deploy(vAppURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testDiscardSuspendedState() {
|
public void testDiscardSuspendedState() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/discardSuspendedState")
|
.apiCommand("POST", vAppId + "/action/discardSuspendedState")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -174,12 +174,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = discardSuspendedStateTask();
|
Task expected = discardSuspendedStateTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().discardSuspendedState(vAppURI), expected);
|
assertEquals(api.getVAppApi().discardSuspendedState(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testEnterMaintenanceMode() {
|
public void testEnterMaintenanceMode() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/enterMaintenanceMode")
|
.apiCommand("POST", vAppId + "/action/enterMaintenanceMode")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -188,12 +188,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.httpResponseBuilder().statusCode(204).build());
|
.httpResponseBuilder().statusCode(204).build());
|
||||||
|
|
||||||
// TODO how to test?
|
// TODO how to test?
|
||||||
client.getVAppClient().enterMaintenanceMode(vAppURI);
|
api.getVAppApi().enterMaintenanceMode(vAppURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testExitMaintenanceMode() {
|
public void testExitMaintenanceMode() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/exitMaintenanceMode")
|
.apiCommand("POST", vAppId + "/action/exitMaintenanceMode")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -202,12 +202,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.httpResponseBuilder().statusCode(204).build());
|
.httpResponseBuilder().statusCode(204).build());
|
||||||
|
|
||||||
// TODO how to test?
|
// TODO how to test?
|
||||||
client.getVAppClient().exitMaintenanceMode(vAppURI);
|
api.getVAppApi().exitMaintenanceMode(vAppURI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testRecomposeVApp() {
|
public void testRecomposeVApp() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/recomposeVApp")
|
.apiCommand("POST", vAppId + "/action/recomposeVApp")
|
||||||
.xmlFilePayload("/vApp/recomposeVAppParams.xml", VCloudDirectorMediaType.RECOMPOSE_VAPP_PARAMS)
|
.xmlFilePayload("/vApp/recomposeVAppParams.xml", VCloudDirectorMediaType.RECOMPOSE_VAPP_PARAMS)
|
||||||
|
@ -222,12 +222,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = recomposeVAppTask();
|
Task expected = recomposeVAppTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().recompose(vAppURI, params), expected);
|
assertEquals(api.getVAppApi().recompose(vAppURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUndeploy() {
|
public void testUndeploy() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/action/undeploy")
|
.apiCommand("POST", vAppId + "/action/undeploy")
|
||||||
.xmlFilePayload("/vApp/undeployParams.xml", VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS)
|
.xmlFilePayload("/vApp/undeployParams.xml", VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS)
|
||||||
|
@ -242,12 +242,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = undeployTask();
|
Task expected = undeployTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().undeploy(vAppURI, params), expected);
|
assertEquals(api.getVAppApi().undeploy(vAppURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testPowerOff() {
|
public void testPowerOff() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/powerOff")
|
.apiCommand("POST", vAppId + "/power/action/powerOff")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -258,12 +258,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = powerOffTask();
|
Task expected = powerOffTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().powerOff(vAppURI), expected);
|
assertEquals(api.getVAppApi().powerOff(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testPowerOn() {
|
public void testPowerOn() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/powerOn")
|
.apiCommand("POST", vAppId + "/power/action/powerOn")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -274,12 +274,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = powerOnTask();
|
Task expected = powerOnTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().powerOn(vAppURI), expected);
|
assertEquals(api.getVAppApi().powerOn(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testReboot() {
|
public void testReboot() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/reboot")
|
.apiCommand("POST", vAppId + "/power/action/reboot")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -290,12 +290,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = rebootTask();
|
Task expected = rebootTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().reboot(vAppURI), expected);
|
assertEquals(api.getVAppApi().reboot(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testReset() {
|
public void testReset() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/reset")
|
.apiCommand("POST", vAppId + "/power/action/reset")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -306,12 +306,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = resetTask();
|
Task expected = resetTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().reset(vAppURI), expected);
|
assertEquals(api.getVAppApi().reset(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testShutdown() {
|
public void testShutdown() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/shutdown")
|
.apiCommand("POST", vAppId + "/power/action/shutdown")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -322,12 +322,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = shutdownTask();
|
Task expected = shutdownTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().shutdown(vAppURI), expected);
|
assertEquals(api.getVAppApi().shutdown(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testSuspend() {
|
public void testSuspend() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vAppId + "/power/action/suspend")
|
.apiCommand("POST", vAppId + "/power/action/suspend")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -338,12 +338,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = suspendTask();
|
Task expected = suspendTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().suspend(vAppURI), expected);
|
assertEquals(api.getVAppApi().suspend(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetControlAccesss() {
|
public void testGetControlAccesss() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/controlAccess")
|
.apiCommand("GET", vAppId + "/controlAccess")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -354,12 +354,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
ControlAccessParams expected = getControlAccessParams();
|
ControlAccessParams expected = getControlAccessParams();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().getControlAccess(vAppURI), expected);
|
assertEquals(api.getVAppApi().getControlAccess(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetLeaseSettingsSection() {
|
public void testGetLeaseSettingsSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/leaseSettingsSection")
|
.apiCommand("GET", vAppId + "/leaseSettingsSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -370,12 +370,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
LeaseSettingsSection expected = getLeaseSettingsSection();
|
LeaseSettingsSection expected = getLeaseSettingsSection();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().getLeaseSettingsSection(vAppURI), expected);
|
assertEquals(api.getVAppApi().getLeaseSettingsSection(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyLeaseSettingsSection() {
|
public void testModifyLeaseSettingsSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/leaseSettingsSection")
|
.apiCommand("PUT", vAppId + "/leaseSettingsSection")
|
||||||
.xmlFilePayload("/vApp/modifyLeaseSettingsSection.xml", VCloudDirectorMediaType.LEASE_SETTINGS_SECTION)
|
.xmlFilePayload("/vApp/modifyLeaseSettingsSection.xml", VCloudDirectorMediaType.LEASE_SETTINGS_SECTION)
|
||||||
|
@ -390,12 +390,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyLeaseSettingsSectionTask();
|
Task expected = modifyLeaseSettingsSectionTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().modifyLeaseSettingsSection(vAppURI, section), expected);
|
assertEquals(api.getVAppApi().modifyLeaseSettingsSection(vAppURI, section), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetNetworkConfigSection() {
|
public void testGetNetworkConfigSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/networkConfigSection")
|
.apiCommand("GET", vAppId + "/networkConfigSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -406,12 +406,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
NetworkConfigSection expected = getNetworkConfigSection();
|
NetworkConfigSection expected = getNetworkConfigSection();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().getNetworkConfigSection(vAppURI), expected);
|
assertEquals(api.getVAppApi().getNetworkConfigSection(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyNetworkConfigSection() {
|
public void testModifyNetworkConfigSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/networkConfigSection")
|
.apiCommand("PUT", vAppId + "/networkConfigSection")
|
||||||
.xmlFilePayload("/vApp/modifyNetworkConfigSection.xml", VCloudDirectorMediaType.NETWORK_CONFIG_SECTION)
|
.xmlFilePayload("/vApp/modifyNetworkConfigSection.xml", VCloudDirectorMediaType.NETWORK_CONFIG_SECTION)
|
||||||
|
@ -426,12 +426,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyNetworkConfigSectionTask();
|
Task expected = modifyNetworkConfigSectionTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().modifyNetworkConfigSection(vAppURI, section), expected);
|
assertEquals(api.getVAppApi().modifyNetworkConfigSection(vAppURI, section), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetNetworkSection() {
|
public void testGetNetworkSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/networkSection")
|
.apiCommand("GET", vAppId + "/networkSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -442,12 +442,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
NetworkSection expected = getNetworkSection();
|
NetworkSection expected = getNetworkSection();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().getNetworkSection(vAppURI), expected);
|
assertEquals(api.getVAppApi().getNetworkSection(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetOwner() {
|
public void testGetOwner() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/owner")
|
.apiCommand("GET", vAppId + "/owner")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -458,12 +458,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Owner expected = getOwner();
|
Owner expected = getOwner();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().getOwner(vAppURI), expected);
|
assertEquals(api.getVAppApi().getOwner(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyOwner() {
|
public void testModifyOwner() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/owner")
|
.apiCommand("PUT", vAppId + "/owner")
|
||||||
.xmlFilePayload("/vApp/modifyOwner.xml", VCloudDirectorMediaType.OWNER)
|
.xmlFilePayload("/vApp/modifyOwner.xml", VCloudDirectorMediaType.OWNER)
|
||||||
|
@ -475,12 +475,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
Owner owner = Owner.builder()
|
Owner owner = Owner.builder()
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
client.getVAppClient().modifyOwner(vAppURI, owner);
|
api.getVAppApi().modifyOwner(vAppURI, owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetProductSections() {
|
public void testGetProductSections() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/productSections")
|
.apiCommand("GET", vAppId + "/productSections")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -491,12 +491,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
ProductSectionList expected = getProductSections();
|
ProductSectionList expected = getProductSections();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().getProductSections(vAppURI), expected);
|
assertEquals(api.getVAppApi().getProductSections(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyProductSections() {
|
public void testModifyProductSections() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/productSections")
|
.apiCommand("PUT", vAppId + "/productSections")
|
||||||
.xmlFilePayload("/vApp/modifyProductSections.xml", VCloudDirectorMediaType.PRODUCT_SECTION_LIST)
|
.xmlFilePayload("/vApp/modifyProductSections.xml", VCloudDirectorMediaType.PRODUCT_SECTION_LIST)
|
||||||
|
@ -508,12 +508,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyProductSectionsTask();
|
Task expected = modifyProductSectionsTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().modifyProductSections(vAppURI, null), expected);
|
assertEquals(api.getVAppApi().modifyProductSections(vAppURI, null), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetStartupSection() {
|
public void testGetStartupSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vAppId + "/startupSection")
|
.apiCommand("GET", vAppId + "/startupSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -524,12 +524,12 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
StartupSection expected = getStartupSection();
|
StartupSection expected = getStartupSection();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().getStartupSection(vAppURI), expected);
|
assertEquals(api.getVAppApi().getStartupSection(vAppURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyStartupSection() {
|
public void testModifyStartupSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vAppId + "/startupSection")
|
.apiCommand("PUT", vAppId + "/startupSection")
|
||||||
.xmlFilePayload("/vApp/modifyStartupSection.xml", VCloudDirectorMediaType.STARTUP_SECTION)
|
.xmlFilePayload("/vApp/modifyStartupSection.xml", VCloudDirectorMediaType.STARTUP_SECTION)
|
||||||
|
@ -544,7 +544,7 @@ public class VAppClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyStartupSectionTask();
|
Task expected = modifyStartupSectionTask();
|
||||||
|
|
||||||
assertEquals(client.getVAppClient().modifyStartupSection(vAppURI, section), expected);
|
assertEquals(api.getVAppApi().modifyStartupSection(vAppURI, section), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static VApp getVApp() {
|
public static VApp getVApp() {
|
|
@ -60,7 +60,7 @@ import org.jclouds.dmtf.ovf.NetworkSection;
|
||||||
import org.jclouds.dmtf.ovf.ProductSection;
|
import org.jclouds.dmtf.ovf.ProductSection;
|
||||||
import org.jclouds.dmtf.ovf.StartupSection;
|
import org.jclouds.dmtf.ovf.StartupSection;
|
||||||
import org.jclouds.io.Payloads;
|
import org.jclouds.io.Payloads;
|
||||||
import org.jclouds.vcloud.director.v1_5.AbstractVAppClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.AbstractVAppApiLiveTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.AccessSetting;
|
import org.jclouds.vcloud.director.v1_5.domain.AccessSetting;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Checks;
|
import org.jclouds.vcloud.director.v1_5.domain.Checks;
|
||||||
|
@ -90,12 +90,12 @@ import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests behavior of the {@link VAppClient}.
|
* Tests behavior of the {@link VAppApi}.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VAppClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VAppApiLiveTest")
|
||||||
public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
public class VAppApiLiveTest extends AbstractVAppApiLiveTest {
|
||||||
|
|
||||||
private MetadataValue metadataValue;
|
private MetadataValue metadataValue;
|
||||||
private String key;
|
private String key;
|
||||||
|
@ -103,9 +103,9 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
private boolean mediaCreated = false;
|
private boolean mediaCreated = false;
|
||||||
private boolean testUserCreated = false;
|
private boolean testUserCreated = false;
|
||||||
|
|
||||||
@BeforeClass(alwaysRun = true, dependsOnMethods = { "setupRequiredClients" })
|
@BeforeClass(alwaysRun = true, dependsOnMethods = { "setupRequiredApis" })
|
||||||
protected void setupRequiredEntities() {
|
protected void setupRequiredEntities() {
|
||||||
Set<Link> links = vdcClient.getVdc(vdcURI).getLinks();
|
Set<Link> links = vdcApi.getVdc(vdcURI).getLinks();
|
||||||
|
|
||||||
if (mediaURI == null) {
|
if (mediaURI == null) {
|
||||||
Predicate<Link> addMediaLink = and(relEquals(Link.Rel.ADD), typeEquals(VCloudDirectorMediaType.MEDIA));
|
Predicate<Link> addMediaLink = and(relEquals(Link.Rel.ADD), typeEquals(VCloudDirectorMediaType.MEDIA));
|
||||||
|
@ -119,21 +119,21 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.name(name("media"))
|
.name(name("media"))
|
||||||
.size(iso.length)
|
.size(iso.length)
|
||||||
.imageType(Media.ImageType.ISO)
|
.imageType(Media.ImageType.ISO)
|
||||||
.description("Test media generated by VAppClientLiveTest")
|
.description("Test media generated by VAppApiLiveTest")
|
||||||
.build();
|
.build();
|
||||||
Media media = context.getApi().getMediaClient().createMedia(addMedia.getHref(), sourceMedia);
|
Media media = context.getApi().getMediaApi().createMedia(addMedia.getHref(), sourceMedia);
|
||||||
|
|
||||||
Link uploadLink = getFirst(getFirst(media.getFiles(), null).getLinks(), null);
|
Link uploadLink = getFirst(getFirst(media.getFiles(), null).getLinks(), null);
|
||||||
context.getApi().getUploadClient().upload(uploadLink.getHref(), Payloads.newByteArrayPayload(iso));
|
context.getApi().getUploadApi().upload(uploadLink.getHref(), Payloads.newByteArrayPayload(iso));
|
||||||
|
|
||||||
media = context.getApi().getMediaClient().getMedia(media.getHref());
|
media = context.getApi().getMediaApi().getMedia(media.getHref());
|
||||||
|
|
||||||
if (media.getTasks().size() == 1) {
|
if (media.getTasks().size() == 1) {
|
||||||
Task uploadTask = Iterables.getOnlyElement(media.getTasks());
|
Task uploadTask = Iterables.getOnlyElement(media.getTasks());
|
||||||
Checks.checkTask(uploadTask);
|
Checks.checkTask(uploadTask);
|
||||||
assertEquals(uploadTask.getStatus(), Task.Status.RUNNING);
|
assertEquals(uploadTask.getStatus(), Task.Status.RUNNING);
|
||||||
assertTrue(retryTaskSuccess.apply(uploadTask), String.format(TASK_COMPLETE_TIMELY, "uploadTask"));
|
assertTrue(retryTaskSuccess.apply(uploadTask), String.format(TASK_COMPLETE_TIMELY, "uploadTask"));
|
||||||
media = context.getApi().getMediaClient().getMedia(media.getHref());
|
media = context.getApi().getMediaApi().getMedia(media.getHref());
|
||||||
}
|
}
|
||||||
|
|
||||||
mediaURI = media.getHref();
|
mediaURI = media.getHref();
|
||||||
|
@ -143,7 +143,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
if (adminContext != null) {
|
if (adminContext != null) {
|
||||||
Link orgLink = find(links, and(relEquals("up"), typeEquals(VCloudDirectorMediaType.ORG)));
|
Link orgLink = find(links, and(relEquals("up"), typeEquals(VCloudDirectorMediaType.ORG)));
|
||||||
testUserURI = adminContext.getApi().getUserClient().createUser(toAdminUri(orgLink), randomTestUser("VAppAccessTest")).getHref();
|
testUserURI = adminContext.getApi().getUserApi().createUser(toAdminUri(orgLink), randomTestUser("VAppAccessTest")).getHref();
|
||||||
} else {
|
} else {
|
||||||
testUserURI = userURI;
|
testUserURI = userURI;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
public void cleanUp() {
|
public void cleanUp() {
|
||||||
if (adminContext != null && mediaCreated && mediaURI != null) {
|
if (adminContext != null && mediaCreated && mediaURI != null) {
|
||||||
try {
|
try {
|
||||||
Task delete = context.getApi().getMediaClient().deleteMedia(mediaURI);
|
Task delete = context.getApi().getMediaApi().deleteMedia(mediaURI);
|
||||||
taskDoneEventually(delete);
|
taskDoneEventually(delete);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting media");
|
logger.warn(e, "Error when deleting media");
|
||||||
|
@ -161,7 +161,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
}
|
}
|
||||||
if (adminContext != null && testUserCreated && testUserURI != null) {
|
if (adminContext != null && testUserCreated && testUserURI != null) {
|
||||||
try {
|
try {
|
||||||
adminContext.getApi().getUserClient().deleteUser(testUserURI);
|
adminContext.getApi().getUserApi().deleteUser(testUserURI);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting user");
|
logger.warn(e, "Error when deleting user");
|
||||||
}
|
}
|
||||||
|
@ -169,12 +169,12 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#getVApp(URI)
|
* @see VAppApi#getVApp(URI)
|
||||||
*/
|
*/
|
||||||
@Test(description = "GET /vApp/{id}")
|
@Test(description = "GET /vApp/{id}")
|
||||||
public void testGetVApp() {
|
public void testGetVApp() {
|
||||||
// The method under test
|
// The method under test
|
||||||
vApp = vAppClient.getVApp(vAppURI);
|
vApp = vAppApi.getVApp(vAppURI);
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkVApp(vApp);
|
checkVApp(vApp);
|
||||||
|
@ -192,7 +192,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#modifyVApp(URI, VApp)
|
* @see VAppApi#modifyVApp(URI, VApp)
|
||||||
*/
|
*/
|
||||||
@Test(description = "PUT /vApp/{id}", dependsOnMethods = { "testGetVApp" })
|
@Test(description = "PUT /vApp/{id}", dependsOnMethods = { "testGetVApp" })
|
||||||
public void testModifyVApp() {
|
public void testModifyVApp() {
|
||||||
|
@ -203,11 +203,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vAppNames.add(newVApp.getName());
|
vAppNames.add(newVApp.getName());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyVApp = vAppClient.modifyVApp(vApp.getHref(), newVApp);
|
Task modifyVApp = vAppApi.modifyVApp(vApp.getHref(), newVApp);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyVApp), String.format(TASK_COMPLETE_TIMELY, "modifyVApp"));
|
assertTrue(retryTaskSuccess.apply(modifyVApp), String.format(TASK_COMPLETE_TIMELY, "modifyVApp"));
|
||||||
|
|
||||||
// Get the updated VApp
|
// Get the updated VApp
|
||||||
vApp = vAppClient.getVApp(vApp.getHref());
|
vApp = vAppApi.getVApp(vApp.getHref());
|
||||||
|
|
||||||
// Check the required fields are set
|
// Check the required fields are set
|
||||||
assertEquals(vApp.getName(), newVApp.getName(), String.format(OBJ_FIELD_EQ, VAPP, "Name", newVApp.getName(), vApp.getName()));
|
assertEquals(vApp.getName(), newVApp.getName(), String.format(OBJ_FIELD_EQ, VAPP, "Name", newVApp.getName(), vApp.getName()));
|
||||||
|
@ -223,11 +223,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task deployVApp = vAppClient.deploy(vApp.getHref(), params);
|
Task deployVApp = vAppApi.deploy(vApp.getHref(), params);
|
||||||
assertTrue(retryTaskSuccessLong.apply(deployVApp), String.format(TASK_COMPLETE_TIMELY, "deployVApp"));
|
assertTrue(retryTaskSuccessLong.apply(deployVApp), String.format(TASK_COMPLETE_TIMELY, "deployVApp"));
|
||||||
|
|
||||||
// Get the updated VApp
|
// Get the updated VApp
|
||||||
vApp = vAppClient.getVApp(vApp.getHref());
|
vApp = vAppApi.getVApp(vApp.getHref());
|
||||||
|
|
||||||
// Check the required fields are set
|
// Check the required fields are set
|
||||||
assertTrue(vApp.isDeployed(), String.format(OBJ_FIELD_EQ, VAPP, "deployed", "TRUE", vApp.isDeployed().toString()));
|
assertTrue(vApp.isDeployed(), String.format(OBJ_FIELD_EQ, VAPP, "deployed", "TRUE", vApp.isDeployed().toString()));
|
||||||
|
@ -242,11 +242,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vApp = powerOffVApp(vApp.getHref());
|
vApp = powerOffVApp(vApp.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task powerOnVApp = vAppClient.powerOn(vApp.getHref());
|
Task powerOnVApp = vAppApi.powerOn(vApp.getHref());
|
||||||
assertTaskSucceedsLong(powerOnVApp);
|
assertTaskSucceedsLong(powerOnVApp);
|
||||||
|
|
||||||
// Get the updated VApp
|
// Get the updated VApp
|
||||||
vApp = vAppClient.getVApp(vApp.getHref());
|
vApp = vAppApi.getVApp(vApp.getHref());
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVAppStatus(vAppURI, Status.POWERED_ON);
|
assertVAppStatus(vAppURI, Status.POWERED_ON);
|
||||||
|
@ -258,11 +258,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vApp = powerOnVApp(vApp.getHref());
|
vApp = powerOnVApp(vApp.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task reboot = vAppClient.reboot(vApp.getHref());
|
Task reboot = vAppApi.reboot(vApp.getHref());
|
||||||
assertTaskSucceedsLong(reboot);
|
assertTaskSucceedsLong(reboot);
|
||||||
|
|
||||||
// Get the updated VApp
|
// Get the updated VApp
|
||||||
vApp = vAppClient.getVApp(vApp.getHref());
|
vApp = vAppApi.getVApp(vApp.getHref());
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVAppStatus(vAppURI, Status.POWERED_OFF);
|
assertVAppStatus(vAppURI, Status.POWERED_OFF);
|
||||||
|
@ -274,11 +274,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vApp = powerOnVApp(vApp.getHref());
|
vApp = powerOnVApp(vApp.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task shutdown = vAppClient.shutdown(vAppURI);
|
Task shutdown = vAppApi.shutdown(vAppURI);
|
||||||
assertTaskSucceedsLong(shutdown);
|
assertTaskSucceedsLong(shutdown);
|
||||||
|
|
||||||
// Get the updated VApp
|
// Get the updated VApp
|
||||||
vApp = vAppClient.getVApp(vAppURI);
|
vApp = vAppApi.getVApp(vAppURI);
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVAppStatus(vAppURI, Status.POWERED_OFF);
|
assertVAppStatus(vAppURI, Status.POWERED_OFF);
|
||||||
|
@ -293,11 +293,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vApp = powerOnVApp(vApp.getHref());
|
vApp = powerOnVApp(vApp.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task suspend = vAppClient.suspend(vAppURI);
|
Task suspend = vAppApi.suspend(vAppURI);
|
||||||
assertTaskSucceedsLong(suspend);
|
assertTaskSucceedsLong(suspend);
|
||||||
|
|
||||||
// Get the updated VApp
|
// Get the updated VApp
|
||||||
vApp = vAppClient.getVApp(vApp.getHref());
|
vApp = vAppApi.getVApp(vApp.getHref());
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVAppStatus(vAppURI, Status.SUSPENDED);
|
assertVAppStatus(vAppURI, Status.SUSPENDED);
|
||||||
|
@ -312,11 +312,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vApp = powerOnVApp(vApp.getHref());
|
vApp = powerOnVApp(vApp.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task reset = vAppClient.reset(vAppURI);
|
Task reset = vAppApi.reset(vAppURI);
|
||||||
assertTaskSucceedsLong(reset);
|
assertTaskSucceedsLong(reset);
|
||||||
|
|
||||||
// Get the updated VApp
|
// Get the updated VApp
|
||||||
vApp = vAppClient.getVApp(vAppURI);
|
vApp = vAppApi.getVApp(vAppURI);
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVAppStatus(vAppURI, Status.POWERED_ON);
|
assertVAppStatus(vAppURI, Status.POWERED_ON);
|
||||||
|
@ -330,11 +330,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
UndeployVAppParams params = UndeployVAppParams.builder().build();
|
UndeployVAppParams params = UndeployVAppParams.builder().build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task undeploy = vAppClient.undeploy(vApp.getHref(), params);
|
Task undeploy = vAppApi.undeploy(vApp.getHref(), params);
|
||||||
assertTrue(retryTaskSuccess.apply(undeploy), String.format(TASK_COMPLETE_TIMELY, "undeploy"));
|
assertTrue(retryTaskSuccess.apply(undeploy), String.format(TASK_COMPLETE_TIMELY, "undeploy"));
|
||||||
|
|
||||||
// Get the updated VApp
|
// Get the updated VApp
|
||||||
vApp = vAppClient.getVApp(vAppURI);
|
vApp = vAppApi.getVApp(vAppURI);
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertFalse(vApp.isDeployed(), String.format(OBJ_FIELD_EQ, VAPP, "deployed", "FALSE", vApp.isDeployed().toString()));
|
assertFalse(vApp.isDeployed(), String.format(OBJ_FIELD_EQ, VAPP, "deployed", "FALSE", vApp.isDeployed().toString()));
|
||||||
|
@ -347,11 +347,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vApp = powerOnVApp(vApp.getHref());
|
vApp = powerOnVApp(vApp.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task powerOffVApp = vAppClient.powerOff(vApp.getHref());
|
Task powerOffVApp = vAppApi.powerOff(vApp.getHref());
|
||||||
assertTrue(retryTaskSuccess.apply(powerOffVApp), String.format(TASK_COMPLETE_TIMELY, "powerOffVApp"));
|
assertTrue(retryTaskSuccess.apply(powerOffVApp), String.format(TASK_COMPLETE_TIMELY, "powerOffVApp"));
|
||||||
|
|
||||||
// Get the updated VApp
|
// Get the updated VApp
|
||||||
vApp = vAppClient.getVApp(vAppURI);
|
vApp = vAppApi.getVApp(vAppURI);
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVAppStatus(vAppURI, Status.POWERED_OFF);
|
assertVAppStatus(vAppURI, Status.POWERED_OFF);
|
||||||
|
@ -368,7 +368,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
ControlAccessParams modified = vAppClient.modifyControlAccess(vApp.getHref(), params);
|
ControlAccessParams modified = vAppApi.modifyControlAccess(vApp.getHref(), params);
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkControlAccessParams(modified);
|
checkControlAccessParams(modified);
|
||||||
|
@ -384,7 +384,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
ControlAccessParams modified = vAppClient.modifyControlAccess(vApp.getHref(), params);
|
ControlAccessParams modified = vAppApi.modifyControlAccess(vApp.getHref(), params);
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkControlAccessParams(modified);
|
checkControlAccessParams(modified);
|
||||||
|
@ -400,7 +400,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vApp = suspendVApp(vAppURI);
|
vApp = suspendVApp(vAppURI);
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task discardSuspendedState = vAppClient.discardSuspendedState(vApp.getHref());
|
Task discardSuspendedState = vAppApi.discardSuspendedState(vApp.getHref());
|
||||||
assertTrue(retryTaskSuccess.apply(discardSuspendedState), String.format(TASK_COMPLETE_TIMELY, "discardSuspendedState"));
|
assertTrue(retryTaskSuccess.apply(discardSuspendedState), String.format(TASK_COMPLETE_TIMELY, "discardSuspendedState"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,18 +413,18 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.notForceCustomization()
|
.notForceCustomization()
|
||||||
.notPowerOn()
|
.notPowerOn()
|
||||||
.build();
|
.build();
|
||||||
Task deployVApp = vAppClient.deploy(temp.getHref(), params);
|
Task deployVApp = vAppApi.deploy(temp.getHref(), params);
|
||||||
assertTaskSucceedsLong(deployVApp);
|
assertTaskSucceedsLong(deployVApp);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Method under test
|
// Method under test
|
||||||
vAppClient.enterMaintenanceMode(temp.getHref());
|
vAppApi.enterMaintenanceMode(temp.getHref());
|
||||||
|
|
||||||
temp = vAppClient.getVApp(temp.getHref());
|
temp = vAppApi.getVApp(temp.getHref());
|
||||||
assertTrue(temp.isInMaintenanceMode(), String.format(CONDITION_FMT, "InMaintenanceMode", "TRUE", temp.isInMaintenanceMode()));
|
assertTrue(temp.isInMaintenanceMode(), String.format(CONDITION_FMT, "InMaintenanceMode", "TRUE", temp.isInMaintenanceMode()));
|
||||||
|
|
||||||
// Exit maintenance mode
|
// Exit maintenance mode
|
||||||
vAppClient.exitMaintenanceMode(temp.getHref());
|
vAppApi.exitMaintenanceMode(temp.getHref());
|
||||||
} finally {
|
} finally {
|
||||||
cleanUpVApp(temp);
|
cleanUpVApp(temp);
|
||||||
}
|
}
|
||||||
|
@ -439,17 +439,17 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.notForceCustomization()
|
.notForceCustomization()
|
||||||
.notPowerOn()
|
.notPowerOn()
|
||||||
.build();
|
.build();
|
||||||
Task deployVApp = vAppClient.deploy(temp.getHref(), params);
|
Task deployVApp = vAppApi.deploy(temp.getHref(), params);
|
||||||
assertTaskSucceedsLong(deployVApp);
|
assertTaskSucceedsLong(deployVApp);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Enter maintenance mode
|
// Enter maintenance mode
|
||||||
vAppClient.enterMaintenanceMode(temp.getHref());
|
vAppApi.enterMaintenanceMode(temp.getHref());
|
||||||
|
|
||||||
// Method under test
|
// Method under test
|
||||||
vAppClient.exitMaintenanceMode(temp.getHref());
|
vAppApi.exitMaintenanceMode(temp.getHref());
|
||||||
|
|
||||||
temp = vAppClient.getVApp(temp.getHref());
|
temp = vAppApi.getVApp(temp.getHref());
|
||||||
assertFalse(temp.isInMaintenanceMode(), String.format(CONDITION_FMT, "InMaintenanceMode", "FALSE", temp.isInMaintenanceMode()));
|
assertFalse(temp.isInMaintenanceMode(), String.format(CONDITION_FMT, "InMaintenanceMode", "FALSE", temp.isInMaintenanceMode()));
|
||||||
} finally {
|
} finally {
|
||||||
cleanUpVApp(temp);
|
cleanUpVApp(temp);
|
||||||
|
@ -464,14 +464,14 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
RecomposeVAppParams params = RecomposeVAppParams.builder().build();
|
RecomposeVAppParams params = RecomposeVAppParams.builder().build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task recomposeVApp = vAppClient.recompose(vApp.getHref(), params);
|
Task recomposeVApp = vAppApi.recompose(vApp.getHref(), params);
|
||||||
assertTrue(retryTaskSuccess.apply(recomposeVApp), String.format(TASK_COMPLETE_TIMELY, "recomposeVApp"));
|
assertTrue(retryTaskSuccess.apply(recomposeVApp), String.format(TASK_COMPLETE_TIMELY, "recomposeVApp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /vApp/{id}/controlAccess", dependsOnMethods = { "testGetVApp" })
|
@Test(description = "GET /vApp/{id}/controlAccess", dependsOnMethods = { "testGetVApp" })
|
||||||
public void testGetControlAccess() {
|
public void testGetControlAccess() {
|
||||||
// The method under test
|
// The method under test
|
||||||
ControlAccessParams controlAccess = vAppClient.getControlAccess(vApp.getHref());
|
ControlAccessParams controlAccess = vAppApi.getControlAccess(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkControlAccessParams(controlAccess);
|
checkControlAccessParams(controlAccess);
|
||||||
|
@ -480,7 +480,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetVApp" })
|
@Test(description = "GET /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetVApp" })
|
||||||
public void testGetLeaseSettingsSection() {
|
public void testGetLeaseSettingsSection() {
|
||||||
// The method under test
|
// The method under test
|
||||||
LeaseSettingsSection section = vAppClient.getLeaseSettingsSection(vApp.getHref());
|
LeaseSettingsSection section = vAppApi.getLeaseSettingsSection(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkLeaseSettingsSection(section);
|
checkLeaseSettingsSection(section);
|
||||||
|
@ -489,18 +489,18 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "PUT /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetLeaseSettingsSection" })
|
@Test(description = "PUT /vApp/{id}/leaseSettingsSection", dependsOnMethods = { "testGetLeaseSettingsSection" })
|
||||||
public void testModifyLeaseSettingsSection() {
|
public void testModifyLeaseSettingsSection() {
|
||||||
// Copy existing section
|
// Copy existing section
|
||||||
LeaseSettingsSection oldSection = vAppClient.getLeaseSettingsSection(vApp.getHref());
|
LeaseSettingsSection oldSection = vAppApi.getLeaseSettingsSection(vApp.getHref());
|
||||||
Integer twoHours = (int) TimeUnit.SECONDS.convert(2L, TimeUnit.HOURS);
|
Integer twoHours = (int) TimeUnit.SECONDS.convert(2L, TimeUnit.HOURS);
|
||||||
LeaseSettingsSection newSection = oldSection.toBuilder()
|
LeaseSettingsSection newSection = oldSection.toBuilder()
|
||||||
.deploymentLeaseInSeconds(twoHours)
|
.deploymentLeaseInSeconds(twoHours)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyLeaseSettingsSection = vAppClient.modifyLeaseSettingsSection(vApp.getHref(), newSection);
|
Task modifyLeaseSettingsSection = vAppApi.modifyLeaseSettingsSection(vApp.getHref(), newSection);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyLeaseSettingsSection), String.format(TASK_COMPLETE_TIMELY, "modifyLeaseSettingsSection"));
|
assertTrue(retryTaskSuccess.apply(modifyLeaseSettingsSection), String.format(TASK_COMPLETE_TIMELY, "modifyLeaseSettingsSection"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
LeaseSettingsSection modified = vAppClient.getLeaseSettingsSection(vApp.getHref());
|
LeaseSettingsSection modified = vAppApi.getLeaseSettingsSection(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkLeaseSettingsSection(modified);
|
checkLeaseSettingsSection(modified);
|
||||||
|
@ -538,7 +538,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetVApp" })
|
@Test(description = "GET /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetVApp" })
|
||||||
public void testGetNetworkConfigSection() {
|
public void testGetNetworkConfigSection() {
|
||||||
// The method under test
|
// The method under test
|
||||||
NetworkConfigSection section = vAppClient.getNetworkConfigSection(vApp.getHref());
|
NetworkConfigSection section = vAppApi.getNetworkConfigSection(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkNetworkConfigSection(section);
|
checkNetworkConfigSection(section);
|
||||||
|
@ -547,16 +547,16 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "PUT /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetNetworkConfigSection" })
|
@Test(description = "PUT /vApp/{id}/networkConfigSection", dependsOnMethods = { "testGetNetworkConfigSection" })
|
||||||
public void testModifyNetworkConfigSection() {
|
public void testModifyNetworkConfigSection() {
|
||||||
// Copy existing section and update fields
|
// Copy existing section and update fields
|
||||||
NetworkConfigSection oldSection = vAppClient.getNetworkConfigSection(vApp.getHref());
|
NetworkConfigSection oldSection = vAppApi.getNetworkConfigSection(vApp.getHref());
|
||||||
NetworkConfigSection newSection = oldSection.toBuilder()
|
NetworkConfigSection newSection = oldSection.toBuilder()
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyNetworkConfigSection = vAppClient.modifyNetworkConfigSection(vApp.getHref(), newSection);
|
Task modifyNetworkConfigSection = vAppApi.modifyNetworkConfigSection(vApp.getHref(), newSection);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyNetworkConfigSection), String.format(TASK_COMPLETE_TIMELY, "modifyNetworkConfigSection"));
|
assertTrue(retryTaskSuccess.apply(modifyNetworkConfigSection), String.format(TASK_COMPLETE_TIMELY, "modifyNetworkConfigSection"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
NetworkConfigSection modified = vAppClient.getNetworkConfigSection(vApp.getHref());
|
NetworkConfigSection modified = vAppApi.getNetworkConfigSection(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkNetworkConfigSection(modified);
|
checkNetworkConfigSection(modified);
|
||||||
|
@ -571,7 +571,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/networkSection", dependsOnMethods = { "testGetVApp" })
|
@Test(description = "GET /vApp/{id}/networkSection", dependsOnMethods = { "testGetVApp" })
|
||||||
public void testGetNetworkSection() {
|
public void testGetNetworkSection() {
|
||||||
// The method under test
|
// The method under test
|
||||||
NetworkSection section = vAppClient.getNetworkSection(vApp.getHref());
|
NetworkSection section = vAppApi.getNetworkSection(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkNetworkSection(section);
|
checkNetworkSection(section);
|
||||||
|
@ -580,7 +580,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/owner", dependsOnMethods = { "testGetVApp" })
|
@Test(description = "GET /vApp/{id}/owner", dependsOnMethods = { "testGetVApp" })
|
||||||
public void testGetOwner() {
|
public void testGetOwner() {
|
||||||
// The method under test
|
// The method under test
|
||||||
Owner owner = vAppClient.getOwner(vApp.getHref());
|
Owner owner = vAppApi.getOwner(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkOwner(owner);
|
checkOwner(owner);
|
||||||
|
@ -591,10 +591,10 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
Owner newOwner = Owner.builder().user(Reference.builder().href(testUserURI).type(ADMIN_USER).build()).build();
|
Owner newOwner = Owner.builder().user(Reference.builder().href(testUserURI).type(ADMIN_USER).build()).build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
vAppClient.modifyOwner(vApp.getHref(), newOwner);
|
vAppApi.modifyOwner(vApp.getHref(), newOwner);
|
||||||
|
|
||||||
// Get the new VApp owner
|
// Get the new VApp owner
|
||||||
Owner modified = vAppClient.getOwner(vApp.getHref());
|
Owner modified = vAppApi.getOwner(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkOwner(modified);
|
checkOwner(modified);
|
||||||
|
@ -606,7 +606,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/productSections", dependsOnMethods = { "testGetVApp" })
|
@Test(description = "GET /vApp/{id}/productSections", dependsOnMethods = { "testGetVApp" })
|
||||||
public void testGetProductSections() {
|
public void testGetProductSections() {
|
||||||
// The method under test
|
// The method under test
|
||||||
ProductSectionList sectionList = vAppClient.getProductSections(vApp.getHref());
|
ProductSectionList sectionList = vAppApi.getProductSections(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkProductSectionList(sectionList);
|
checkProductSectionList(sectionList);
|
||||||
|
@ -615,7 +615,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "PUT /vApp/{id}/productSections", dependsOnMethods = { "testGetProductSections" })
|
@Test(description = "PUT /vApp/{id}/productSections", dependsOnMethods = { "testGetProductSections" })
|
||||||
public void testModifyProductSections() {
|
public void testModifyProductSections() {
|
||||||
// Copy existing section and update fields
|
// Copy existing section and update fields
|
||||||
ProductSectionList oldSections = vAppClient.getProductSections(vApp.getHref());
|
ProductSectionList oldSections = vAppApi.getProductSections(vApp.getHref());
|
||||||
ProductSectionList newSections = oldSections.toBuilder()
|
ProductSectionList newSections = oldSections.toBuilder()
|
||||||
.productSection(ProductSection.builder()
|
.productSection(ProductSection.builder()
|
||||||
.info("Information about the installed software") // Default ovf:Info text
|
.info("Information about the installed software") // Default ovf:Info text
|
||||||
|
@ -627,11 +627,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyProductSections = vAppClient.modifyProductSections(vApp.getHref(), newSections);
|
Task modifyProductSections = vAppApi.modifyProductSections(vApp.getHref(), newSections);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyProductSections), String.format(TASK_COMPLETE_TIMELY, "modifyProductSections"));
|
assertTrue(retryTaskSuccess.apply(modifyProductSections), String.format(TASK_COMPLETE_TIMELY, "modifyProductSections"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
ProductSectionList modified = vAppClient.getProductSections(vApp.getHref());
|
ProductSectionList modified = vAppApi.getProductSections(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkProductSectionList(modified);
|
checkProductSectionList(modified);
|
||||||
|
@ -646,7 +646,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/startupSection", dependsOnMethods = { "testGetVApp" })
|
@Test(description = "GET /vApp/{id}/startupSection", dependsOnMethods = { "testGetVApp" })
|
||||||
public void testGetStartupSection() {
|
public void testGetStartupSection() {
|
||||||
// The method under test
|
// The method under test
|
||||||
StartupSection section = vAppClient.getStartupSection(vApp.getHref());
|
StartupSection section = vAppApi.getStartupSection(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkStartupSection(section);
|
checkStartupSection(section);
|
||||||
|
@ -655,15 +655,15 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "PUT /vApp/{id}/startupSection", dependsOnMethods = { "testGetStartupSection" })
|
@Test(description = "PUT /vApp/{id}/startupSection", dependsOnMethods = { "testGetStartupSection" })
|
||||||
public void testModifyStartupSection() {
|
public void testModifyStartupSection() {
|
||||||
// Copy existing section and update fields
|
// Copy existing section and update fields
|
||||||
StartupSection oldSection = vAppClient.getStartupSection(vApp.getHref());
|
StartupSection oldSection = vAppApi.getStartupSection(vApp.getHref());
|
||||||
StartupSection newSection = oldSection.toBuilder().build();
|
StartupSection newSection = oldSection.toBuilder().build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyStartupSection = vAppClient.modifyStartupSection(vApp.getHref(), newSection);
|
Task modifyStartupSection = vAppApi.modifyStartupSection(vApp.getHref(), newSection);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyStartupSection), String.format(TASK_COMPLETE_TIMELY, "modifyStartupSection"));
|
assertTrue(retryTaskSuccess.apply(modifyStartupSection), String.format(TASK_COMPLETE_TIMELY, "modifyStartupSection"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
StartupSection modified = vAppClient.getStartupSection(vApp.getHref());
|
StartupSection modified = vAppApi.getStartupSection(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkStartupSection(modified);
|
checkStartupSection(modified);
|
||||||
|
@ -678,10 +678,10 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
key = name("key-");
|
key = name("key-");
|
||||||
String value = name("value-");
|
String value = name("value-");
|
||||||
metadataValue = MetadataValue.builder().value(value).build();
|
metadataValue = MetadataValue.builder().value(value).build();
|
||||||
vAppClient.getMetadataClient().setMetadata(vApp.getHref(), key, metadataValue);
|
vAppApi.getMetadataApi().setMetadata(vApp.getHref(), key, metadataValue);
|
||||||
|
|
||||||
// Retrieve the value, and assert it was set correctly
|
// Retrieve the value, and assert it was set correctly
|
||||||
MetadataValue newMetadataValue = vAppClient.getMetadataClient().getMetadataValue(vApp.getHref(), key);
|
MetadataValue newMetadataValue = vAppApi.getMetadataApi().getMetadataValue(vApp.getHref(), key);
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkMetadataValueFor(VAPP, newMetadataValue, value);
|
checkMetadataValueFor(VAPP, newMetadataValue, value);
|
||||||
|
@ -690,7 +690,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" })
|
@Test(description = "GET /vApp/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" })
|
||||||
public void testGetMetadata() {
|
public void testGetMetadata() {
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
Metadata metadata = vAppClient.getMetadataClient().getMetadata(vApp.getHref());
|
Metadata metadata = vAppApi.getMetadataApi().getMetadata(vApp.getHref());
|
||||||
|
|
||||||
checkMetadata(metadata);
|
checkMetadata(metadata);
|
||||||
|
|
||||||
|
@ -701,7 +701,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" })
|
@Test(description = "GET /vApp/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" })
|
||||||
public void testGetOrgMetadataValue() {
|
public void testGetOrgMetadataValue() {
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
MetadataValue value = vAppClient.getMetadataClient().getMetadataValue(vApp.getHref(), key);
|
MetadataValue value = vAppApi.getMetadataApi().getMetadataValue(vApp.getHref(), key);
|
||||||
|
|
||||||
String expected = metadataValue.getValue();
|
String expected = metadataValue.getValue();
|
||||||
|
|
||||||
|
@ -712,11 +712,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "DELETE /vApp/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" })
|
@Test(description = "DELETE /vApp/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" })
|
||||||
public void testDeleteMetadataEntry() {
|
public void testDeleteMetadataEntry() {
|
||||||
// Delete the entry
|
// Delete the entry
|
||||||
Task task = vAppClient.getMetadataClient().deleteMetadataEntry(vApp.getHref(), key);
|
Task task = vAppApi.getMetadataApi().deleteMetadataEntry(vApp.getHref(), key);
|
||||||
retryTaskSuccess.apply(task);
|
retryTaskSuccess.apply(task);
|
||||||
|
|
||||||
// Confirm the entry has been deleted
|
// Confirm the entry has been deleted
|
||||||
Metadata newMetadata = vAppClient.getMetadataClient().getMetadata(vApp.getHref());
|
Metadata newMetadata = vAppApi.getMetadataApi().getMetadata(vApp.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkMetadataKeyAbsentFor(VAPP, newMetadata, key);
|
checkMetadataKeyAbsentFor(VAPP, newMetadata, key);
|
||||||
|
@ -724,7 +724,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "POST /vApp/{id}/metadata", dependsOnMethods = { "testGetMetadata" })
|
@Test(description = "POST /vApp/{id}/metadata", dependsOnMethods = { "testGetMetadata" })
|
||||||
public void testMergeMetadata() {
|
public void testMergeMetadata() {
|
||||||
Metadata oldMetadata = vAppClient.getMetadataClient().getMetadata(vApp.getHref());
|
Metadata oldMetadata = vAppApi.getMetadataApi().getMetadata(vApp.getHref());
|
||||||
Map<String, String> oldMetadataMap = Checks.metadataToMap(oldMetadata);
|
Map<String, String> oldMetadataMap = Checks.metadataToMap(oldMetadata);
|
||||||
|
|
||||||
// Store a value, to be deleted
|
// Store a value, to be deleted
|
||||||
|
@ -733,11 +733,11 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
Metadata addedMetadata = Metadata.builder()
|
Metadata addedMetadata = Metadata.builder()
|
||||||
.entry(MetadataEntry.builder().key(key).value(value).build())
|
.entry(MetadataEntry.builder().key(key).value(value).build())
|
||||||
.build();
|
.build();
|
||||||
Task task = vAppClient.getMetadataClient().mergeMetadata(vApp.getHref(), addedMetadata);
|
Task task = vAppApi.getMetadataApi().mergeMetadata(vApp.getHref(), addedMetadata);
|
||||||
retryTaskSuccess.apply(task);
|
retryTaskSuccess.apply(task);
|
||||||
|
|
||||||
// Confirm the entry contains everything that was there, and everything that was being added
|
// Confirm the entry contains everything that was there, and everything that was being added
|
||||||
Metadata newMetadata = vAppClient.getMetadataClient().getMetadata(vApp.getHref());
|
Metadata newMetadata = vAppApi.getMetadataApi().getMetadata(vApp.getHref());
|
||||||
Map<String, String> expectedMetadataMap = ImmutableMap.<String, String>builder()
|
Map<String, String> expectedMetadataMap = ImmutableMap.<String, String>builder()
|
||||||
.putAll(oldMetadataMap)
|
.putAll(oldMetadataMap)
|
||||||
.put(key, value)
|
.put(key, value)
|
||||||
|
@ -748,7 +748,7 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VAppClient#deleteVApp(URI)
|
* @see VAppApi#deleteVApp(URI)
|
||||||
*/
|
*/
|
||||||
@Test(description = "DELETE /vApp/{id}")
|
@Test(description = "DELETE /vApp/{id}")
|
||||||
public void testDeleteVApp() {
|
public void testDeleteVApp() {
|
||||||
|
@ -756,10 +756,10 @@ public class VAppClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
VApp temp = instantiateVApp();
|
VApp temp = instantiateVApp();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task deleteVApp = vAppClient.deleteVApp(temp.getHref());
|
Task deleteVApp = vAppApi.deleteVApp(temp.getHref());
|
||||||
assertTrue(retryTaskSuccess.apply(deleteVApp), String.format(TASK_COMPLETE_TIMELY, "deleteVApp"));
|
assertTrue(retryTaskSuccess.apply(deleteVApp), String.format(TASK_COMPLETE_TIMELY, "deleteVApp"));
|
||||||
|
|
||||||
VApp deleted = vAppClient.getVApp(temp.getHref());
|
VApp deleted = vAppApi.getVApp(temp.getHref());
|
||||||
assertNull(deleted, "The VApp "+temp.getName()+" should have been deleted");
|
assertNull(deleted, "The VApp "+temp.getName()+" should have been deleted");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -67,20 +67,20 @@ import org.jclouds.vcloud.director.v1_5.domain.section.CustomizationSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.GuestCustomizationSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.GuestCustomizationSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.LeaseSettingsSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.LeaseSettingsSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the request/response behavior of {@link org.jclouds.vcloud.director.v1_5.features.VAppTemplateClient}
|
* Tests the request/response behavior of {@link org.jclouds.vcloud.director.v1_5.features.VAppTemplateApi}
|
||||||
*
|
*
|
||||||
* @author Adam Lowe
|
* @author Adam Lowe
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, testName = "VAppTemplateClientExpectTest")
|
@Test(groups = { "unit", "user" }, testName = "VAppTemplateApiExpectTest")
|
||||||
public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class VAppTemplateApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
public VAppTemplateClientExpectTest() {
|
public VAppTemplateApiExpectTest() {
|
||||||
TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
|
TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,24 +89,24 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId).acceptMedia(VAPP_TEMPLATE).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId).acceptMedia(VAPP_TEMPLATE).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/vAppTemplate.xml", VAPP_TEMPLATE).httpResponseBuilder().build(),
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/vAppTemplate.xml", VAPP_TEMPLATE).httpResponseBuilder().build(),
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId).xmlFilePayload("/vapptemplate/vAppTemplate.xml", VAPP_TEMPLATE).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId).xmlFilePayload("/vapptemplate/vAppTemplate.xml", VAPP_TEMPLATE).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build(),
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build(),
|
||||||
new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
VAppTemplate template = client.getVAppTemplate(uri);
|
VAppTemplate template = api.getVAppTemplate(uri);
|
||||||
|
|
||||||
assertEquals(template, exampleTemplate());
|
assertEquals(template, exampleTemplate());
|
||||||
|
|
||||||
Task task = client.modifyVAppTemplate(uri, exampleTemplate());
|
Task task = api.modifyVAppTemplate(uri, exampleTemplate());
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
|
|
||||||
task = client.deleteVappTemplate(uri);
|
task = api.deleteVappTemplate(uri);
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,11 +115,11 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId).acceptMedia(VAPP_TEMPLATE).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId).acceptMedia(VAPP_TEMPLATE).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.getVAppTemplate(uri);
|
api.getVAppTemplate(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = ResourceNotFoundException.class)
|
@Test(expectedExceptions = ResourceNotFoundException.class)
|
||||||
|
@ -127,11 +127,11 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId).xmlFilePayload("/vapptemplate/vAppTemplate.xml", VAPP_TEMPLATE).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId).xmlFilePayload("/vapptemplate/vAppTemplate.xml", VAPP_TEMPLATE).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.modifyVAppTemplate(uri, exampleTemplate());
|
api.modifyVAppTemplate(uri, exampleTemplate());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = VCloudDirectorException.class)
|
@Test(expectedExceptions = VCloudDirectorException.class)
|
||||||
|
@ -139,24 +139,24 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.deleteVappTemplate(uri);
|
api.deleteVappTemplate(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testConsolidateVAppTemplate() {
|
public void testConsolidateVAppTemplate() {
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/consolidate").acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/consolidate").acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
Task task = client.consolidateVm(uri);
|
Task task = api.consolidateVm(uri);
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,24 +165,24 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/consolidate").acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/consolidate").acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.consolidateVm(uri);
|
api.consolidateVm(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDisableDownloadVAppTemplate() {
|
public void testDisableDownloadVAppTemplate() {
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/disableDownload").httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/disableDownload").httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
client.disableDownload(uri);
|
api.disableDownload(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = VCloudDirectorException.class)
|
@Test(expectedExceptions = VCloudDirectorException.class)
|
||||||
|
@ -190,24 +190,24 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/disableDownload").httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/disableDownload").httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.disableDownload(uri);
|
api.disableDownload(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEnableDownloadVAppTemplate() {
|
public void testEnableDownloadVAppTemplate() {
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/enableDownload").acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/enableDownload").acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
Task task = client.enableDownload(uri);
|
Task task = api.enableDownload(uri);
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,28 +216,28 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/enableDownload").acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/enableDownload").acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.enableDownload(uri);
|
api.enableDownload(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRelocateVAppTemplate() {
|
public void testRelocateVAppTemplate() {
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/relocate").xmlFilePayload("/vapptemplate/relocateParams.xml", RELOCATE_TEMPLATE).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/relocate").xmlFilePayload("/vapptemplate/relocateParams.xml", RELOCATE_TEMPLATE).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
|
|
||||||
Reference datastore = Reference.builder().href(URI.create("https://vcloud.example.com/api/admin/extension/datastore/607")).build();
|
Reference datastore = Reference.builder().href(URI.create("https://vcloud.example.com/api/admin/extension/datastore/607")).build();
|
||||||
RelocateParams params = RelocateParams.builder().datastore(datastore).build();
|
RelocateParams params = RelocateParams.builder().datastore(datastore).build();
|
||||||
|
|
||||||
Task task = client.relocateVm(uri, params);
|
Task task = api.relocateVm(uri, params);
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,14 +246,14 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/relocate").xmlFilePayload("/vapptemplate/relocateParams.xml", RELOCATE_TEMPLATE).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/action/relocate").xmlFilePayload("/vapptemplate/relocateParams.xml", RELOCATE_TEMPLATE).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
Reference datastore = Reference.builder().href(URI.create("https://vcloud.example.com/api/admin/extension/datastore/607")).build();
|
Reference datastore = Reference.builder().href(URI.create("https://vcloud.example.com/api/admin/extension/datastore/607")).build();
|
||||||
RelocateParams params = RelocateParams.builder().datastore(datastore).build();
|
RelocateParams params = RelocateParams.builder().datastore(datastore).build();
|
||||||
|
|
||||||
client.relocateVm(uri, params);
|
api.relocateVm(uri, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -261,19 +261,19 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/customizationSection").acceptMedia(CUSTOMIZATION_SECTION).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/customizationSection").acceptMedia(CUSTOMIZATION_SECTION).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/customizationSection.xml", CUSTOMIZATION_SECTION).httpResponseBuilder().build(),
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/customizationSection.xml", CUSTOMIZATION_SECTION).httpResponseBuilder().build(),
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/customizationSection").xmlFilePayload("/vapptemplate/customizationSection.xml", CUSTOMIZATION_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/customizationSection").xmlFilePayload("/vapptemplate/customizationSection.xml", CUSTOMIZATION_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
CustomizationSection section = client.getCustomizationSection(uri);
|
CustomizationSection section = api.getCustomizationSection(uri);
|
||||||
|
|
||||||
assertEquals(section, exampleCustomizationSection());
|
assertEquals(section, exampleCustomizationSection());
|
||||||
|
|
||||||
Task task = client.modifyCustomizationSection(uri, exampleCustomizationSection());
|
Task task = api.modifyCustomizationSection(uri, exampleCustomizationSection());
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,11 +281,11 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/customizationSection").acceptMedia(CUSTOMIZATION_SECTION).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/customizationSection").acceptMedia(CUSTOMIZATION_SECTION).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNull(client.getCustomizationSection(uri));
|
assertNull(api.getCustomizationSection(uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = ResourceNotFoundException.class)
|
@Test(expectedExceptions = ResourceNotFoundException.class)
|
||||||
|
@ -293,30 +293,30 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/customizationSection").xmlFilePayload("/vapptemplate/customizationSection.xml", CUSTOMIZATION_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/customizationSection").xmlFilePayload("/vapptemplate/customizationSection.xml", CUSTOMIZATION_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.modifyCustomizationSection(uri, exampleCustomizationSection());
|
api.modifyCustomizationSection(uri, exampleCustomizationSection());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGuestCustomizationSection() {
|
public void testGuestCustomizationSection() {
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/guestCustomizationSection").acceptMedia(GUEST_CUSTOMIZATION_SECTION).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/guestCustomizationSection").acceptMedia(GUEST_CUSTOMIZATION_SECTION).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/guestCustomizationSection.xml", GUEST_CUSTOMIZATION_SECTION).httpResponseBuilder().build(),
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/guestCustomizationSection.xml", GUEST_CUSTOMIZATION_SECTION).httpResponseBuilder().build(),
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/guestCustomizationSection").xmlFilePayload("/vapptemplate/guestCustomizationSection.xml", GUEST_CUSTOMIZATION_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/guestCustomizationSection").xmlFilePayload("/vapptemplate/guestCustomizationSection.xml", GUEST_CUSTOMIZATION_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
GuestCustomizationSection section = client.getGuestCustomizationSection(uri);
|
GuestCustomizationSection section = api.getGuestCustomizationSection(uri);
|
||||||
|
|
||||||
assertEquals(section, exampleGuestCustomizationSection());
|
assertEquals(section, exampleGuestCustomizationSection());
|
||||||
|
|
||||||
Task task = client.modifyGuestCustomizationSection(uri, exampleGuestCustomizationSection());
|
Task task = api.modifyGuestCustomizationSection(uri, exampleGuestCustomizationSection());
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,11 +325,11 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/guestCustomizationSection").acceptMedia(GUEST_CUSTOMIZATION_SECTION).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/guestCustomizationSection").acceptMedia(GUEST_CUSTOMIZATION_SECTION).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.getGuestCustomizationSection(uri);
|
api.getGuestCustomizationSection(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = VCloudDirectorException.class)
|
@Test(expectedExceptions = VCloudDirectorException.class)
|
||||||
|
@ -337,30 +337,30 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/guestCustomizationSection").xmlFilePayload("/vapptemplate/guestCustomizationSection.xml", GUEST_CUSTOMIZATION_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/guestCustomizationSection").xmlFilePayload("/vapptemplate/guestCustomizationSection.xml", GUEST_CUSTOMIZATION_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.modifyGuestCustomizationSection(uri, exampleGuestCustomizationSection());
|
api.modifyGuestCustomizationSection(uri, exampleGuestCustomizationSection());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testLeaseSettingsSection() throws ParseException {
|
public void testLeaseSettingsSection() throws ParseException {
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/leaseSettingsSection").acceptMedia(LEASE_SETTINGS_SECTION).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/leaseSettingsSection").acceptMedia(LEASE_SETTINGS_SECTION).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/leaseSettingsSection.xml", LEASE_SETTINGS_SECTION).httpResponseBuilder().build(),
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/leaseSettingsSection.xml", LEASE_SETTINGS_SECTION).httpResponseBuilder().build(),
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/leaseSettingsSection").xmlFilePayload("/vapptemplate/leaseSettingsSection.xml", LEASE_SETTINGS_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/leaseSettingsSection").xmlFilePayload("/vapptemplate/leaseSettingsSection.xml", LEASE_SETTINGS_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
LeaseSettingsSection section = client.getLeaseSettingsSection(uri);
|
LeaseSettingsSection section = api.getLeaseSettingsSection(uri);
|
||||||
|
|
||||||
assertEquals(section, exampleLeaseSettingsSection());
|
assertEquals(section, exampleLeaseSettingsSection());
|
||||||
|
|
||||||
Task task = client.modifyLeaseSettingsSection(uri, exampleLeaseSettingsSection());
|
Task task = api.modifyLeaseSettingsSection(uri, exampleLeaseSettingsSection());
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,11 +368,11 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/leaseSettingsSection").acceptMedia(LEASE_SETTINGS_SECTION).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/leaseSettingsSection").acceptMedia(LEASE_SETTINGS_SECTION).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNull(client.getLeaseSettingsSection(uri));
|
assertNull(api.getLeaseSettingsSection(uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = ResourceNotFoundException.class)
|
@Test(expectedExceptions = ResourceNotFoundException.class)
|
||||||
|
@ -380,30 +380,30 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/leaseSettingsSection").xmlFilePayload("/vapptemplate/leaseSettingsSection.xml", LEASE_SETTINGS_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/leaseSettingsSection").xmlFilePayload("/vapptemplate/leaseSettingsSection.xml", LEASE_SETTINGS_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.modifyLeaseSettingsSection(uri, exampleLeaseSettingsSection());
|
api.modifyLeaseSettingsSection(uri, exampleLeaseSettingsSection());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testVappTemplateMetadata() {
|
public void testVappTemplateMetadata() {
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata").acceptMedia(ANY).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata").acceptMedia(ANY).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/metadata.xml", METADATA).httpResponseBuilder().build(),
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/metadata.xml", METADATA).httpResponseBuilder().build(),
|
||||||
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/metadata").xmlFilePayload("/vapptemplate/metadata.xml", METADATA).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/metadata").xmlFilePayload("/vapptemplate/metadata.xml", METADATA).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
Metadata metadata = client.getMetadataClient().getMetadata(uri);
|
Metadata metadata = api.getMetadataApi().getMetadata(uri);
|
||||||
|
|
||||||
assertEquals(metadata, exampleMetadata());
|
assertEquals(metadata, exampleMetadata());
|
||||||
|
|
||||||
Task task = client.getMetadataClient().mergeMetadata(uri, exampleMetadata());
|
Task task = api.getMetadataApi().mergeMetadata(uri, exampleMetadata());
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,11 +412,11 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata").acceptMedia(ANY).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata").acceptMedia(ANY).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.getMetadataClient().getMetadata(uri);
|
api.getMetadataApi().getMetadata(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = VCloudDirectorException.class)
|
@Test(expectedExceptions = VCloudDirectorException.class)
|
||||||
|
@ -424,35 +424,35 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/metadata").xmlFilePayload("/vapptemplate/metadata.xml", METADATA).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/metadata").xmlFilePayload("/vapptemplate/metadata.xml", METADATA).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.getMetadataClient().mergeMetadata(uri, exampleMetadata());
|
api.getMetadataApi().mergeMetadata(uri, exampleMetadata());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testVappTemplateMetadataValue() {
|
public void testVappTemplateMetadataValue() {
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata/12345").acceptMedia(METADATA_ENTRY).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata/12345").acceptMedia(METADATA_ENTRY).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/metadataValue.xml", METADATA_ENTRY).httpResponseBuilder().build(),
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/metadataValue.xml", METADATA_ENTRY).httpResponseBuilder().build(),
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/metadata/12345").xmlFilePayload("/vapptemplate/metadataValue.xml", METADATA_ENTRY).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/metadata/12345").xmlFilePayload("/vapptemplate/metadataValue.xml", METADATA_ENTRY).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build(),
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build(),
|
||||||
new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId + "/metadata/12345").acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId + "/metadata/12345").acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
MetadataValue metadata = client.getMetadataClient().getMetadataValue(uri, "12345");
|
MetadataValue metadata = api.getMetadataApi().getMetadataValue(uri, "12345");
|
||||||
|
|
||||||
assertEquals(metadata, exampleMetadataValue());
|
assertEquals(metadata, exampleMetadataValue());
|
||||||
|
|
||||||
Task task = client.getMetadataClient().setMetadata(uri, "12345", exampleMetadataValue());
|
Task task = api.getMetadataApi().setMetadata(uri, "12345", exampleMetadataValue());
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
|
|
||||||
task = client.getMetadataClient().deleteMetadataEntry(uri, "12345");
|
task = api.getMetadataApi().deleteMetadataEntry(uri, "12345");
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,11 +460,11 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata/12345").acceptMedia(METADATA_ENTRY).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata/12345").acceptMedia(METADATA_ENTRY).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNull(client.getMetadataClient().getMetadataValue(uri, "12345"));
|
assertNull(api.getMetadataApi().getMetadataValue(uri, "12345"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = VCloudDirectorException.class)
|
@Test(expectedExceptions = VCloudDirectorException.class)
|
||||||
|
@ -472,11 +472,11 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/metadata/12345").xmlFilePayload("/vapptemplate/metadataValue.xml", METADATA_ENTRY).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/metadata/12345").xmlFilePayload("/vapptemplate/metadataValue.xml", METADATA_ENTRY).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.getMetadataClient().setMetadata(uri, "12345", exampleMetadataValue());
|
api.getMetadataApi().setMetadata(uri, "12345", exampleMetadataValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = ResourceNotFoundException.class)
|
@Test(expectedExceptions = ResourceNotFoundException.class)
|
||||||
|
@ -484,31 +484,31 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId + "/metadata/12345").acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId + "/metadata/12345").acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.getMetadataClient().deleteMetadataEntry(uri, "12345");
|
api.getMetadataApi().deleteMetadataEntry(uri, "12345");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNetworkConfigSection() throws ParseException {
|
public void testNetworkConfigSection() throws ParseException {
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/networkConfigSection").acceptMedia(NETWORK_CONFIG_SECTION).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/networkConfigSection").acceptMedia(NETWORK_CONFIG_SECTION).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/networkConfigSection.xml", NETWORK_CONFIG_SECTION).httpResponseBuilder().build(),
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/networkConfigSection.xml", NETWORK_CONFIG_SECTION).httpResponseBuilder().build(),
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/networkConfigSection").xmlFilePayload("/vapptemplate/networkConfigSection.xml", NETWORK_CONFIG_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/networkConfigSection").xmlFilePayload("/vapptemplate/networkConfigSection.xml", NETWORK_CONFIG_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build()
|
||||||
).getVAppTemplateClient();
|
).getVAppTemplateApi();
|
||||||
|
|
||||||
assertNotNull(client);
|
assertNotNull(api);
|
||||||
|
|
||||||
NetworkConfigSection section = client.getNetworkConfigSection(uri);
|
NetworkConfigSection section = api.getNetworkConfigSection(uri);
|
||||||
|
|
||||||
assertEquals(section, exampleNetworkConfigSection());
|
assertEquals(section, exampleNetworkConfigSection());
|
||||||
|
|
||||||
Task task = client.modifyNetworkConfigSection(uri, exampleNetworkConfigSection());
|
Task task = api.modifyNetworkConfigSection(uri, exampleNetworkConfigSection());
|
||||||
assertNotNull(task);
|
assertNotNull(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,11 +517,11 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/networkConfigSection").acceptMedia(NETWORK_CONFIG_SECTION).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/networkConfigSection").acceptMedia(NETWORK_CONFIG_SECTION).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.getNetworkConfigSection(uri);
|
api.getNetworkConfigSection(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expectedExceptions = VCloudDirectorException.class)
|
@Test(expectedExceptions = VCloudDirectorException.class)
|
||||||
|
@ -529,11 +529,11 @@ public class VAppTemplateClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9";
|
||||||
URI uri = URI.create(endpoint + templateId);
|
URI uri = URI.create(endpoint + templateId);
|
||||||
|
|
||||||
VAppTemplateClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VAppTemplateApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/networkConfigSection").xmlFilePayload("/vapptemplate/networkConfigSection.xml", NETWORK_CONFIG_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/networkConfigSection").xmlFilePayload("/vapptemplate/networkConfigSection.xml", NETWORK_CONFIG_SECTION).acceptMedia(TASK).httpRequestBuilder().build(),
|
||||||
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateClient();
|
new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getVAppTemplateApi();
|
||||||
|
|
||||||
client.modifyNetworkConfigSection(uri, exampleNetworkConfigSection());
|
api.modifyNetworkConfigSection(uri, exampleNetworkConfigSection());
|
||||||
}
|
}
|
||||||
|
|
||||||
private VAppTemplate exampleTemplate() {
|
private VAppTemplate exampleTemplate() {
|
|
@ -46,7 +46,7 @@ import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.jclouds.dmtf.ovf.NetworkSection;
|
import org.jclouds.dmtf.ovf.NetworkSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.AbstractVAppClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.AbstractVAppApiLiveTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Checks;
|
import org.jclouds.vcloud.director.v1_5.domain.Checks;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link.Rel;
|
import org.jclouds.vcloud.director.v1_5.domain.Link.Rel;
|
||||||
|
@ -78,14 +78,14 @@ import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the request/response behavior of {@link VAppTemplateClient}
|
* Tests the request/response behavior of {@link VAppTemplateApi}
|
||||||
*
|
*
|
||||||
* NOTE The environment MUST have at least one template configured
|
* NOTE The environment MUST have at least one template configured
|
||||||
*
|
*
|
||||||
* @author Aled Sage
|
* @author Aled Sage
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VAppTemplateClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VAppTemplateApiLiveTest")
|
||||||
public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
public class VAppTemplateApiLiveTest extends AbstractVAppApiLiveTest {
|
||||||
|
|
||||||
private String key;
|
private String key;
|
||||||
private String val;
|
private String val;
|
||||||
|
@ -94,7 +94,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
protected void tidyUp() {
|
protected void tidyUp() {
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
try {
|
try {
|
||||||
Task delete = vAppTemplateClient.getMetadataClient().deleteMetadataEntry(vAppTemplateURI, key);
|
Task delete = vAppTemplateApi.getMetadataApi().deleteMetadataEntry(vAppTemplateURI, key);
|
||||||
taskDoneEventually(delete);
|
taskDoneEventually(delete);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error when deleting metadata entry '%s'", key);
|
logger.warn(e, "Error when deleting metadata entry '%s'", key);
|
||||||
|
@ -107,11 +107,11 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
CloneVAppTemplateParams cloneVAppTemplateParams = CloneVAppTemplateParams.builder()
|
CloneVAppTemplateParams cloneVAppTemplateParams = CloneVAppTemplateParams.builder()
|
||||||
.source(Reference.builder().href(vAppTemplateURI).build())
|
.source(Reference.builder().href(vAppTemplateURI).build())
|
||||||
.build();
|
.build();
|
||||||
VAppTemplate clonedVappTemplate = vdcClient.cloneVAppTemplate(vdcURI, cloneVAppTemplateParams);
|
VAppTemplate clonedVappTemplate = vdcApi.cloneVAppTemplate(vdcURI, cloneVAppTemplateParams);
|
||||||
|
|
||||||
if (waitForTask) {
|
if (waitForTask) {
|
||||||
Task cloneTask = Iterables.getFirst(clonedVappTemplate.getTasks(), null);
|
Task cloneTask = Iterables.getFirst(clonedVappTemplate.getTasks(), null);
|
||||||
assertNotNull(cloneTask, "vdcClient.cloneVAppTemplate returned VAppTemplate that did not contain any tasks");
|
assertNotNull(cloneTask, "vdcApi.cloneVAppTemplate returned VAppTemplate that did not contain any tasks");
|
||||||
assertTaskSucceeds(cloneTask);
|
assertTaskSucceeds(cloneTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplate/{id}")
|
@Test(description = "GET /vAppTemplate/{id}")
|
||||||
public void testGetVAppTemplate() {
|
public void testGetVAppTemplate() {
|
||||||
vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
|
vAppTemplate = vAppTemplateApi.getVAppTemplate(vAppTemplateURI);
|
||||||
|
|
||||||
checkVAppTemplate(vAppTemplate);
|
checkVAppTemplate(vAppTemplate);
|
||||||
assertEquals(vAppTemplate.getHref(), vAppTemplateURI);
|
assertEquals(vAppTemplate.getHref(), vAppTemplateURI);
|
||||||
|
@ -128,22 +128,22 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplate/{id}/owner")
|
@Test(description = "GET /vAppTemplate/{id}/owner")
|
||||||
public void testGetVAppTemplateOwner() {
|
public void testGetVAppTemplateOwner() {
|
||||||
Owner owner = vAppTemplateClient.getOwner(vAppTemplateURI);
|
Owner owner = vAppTemplateApi.getOwner(vAppTemplateURI);
|
||||||
|
|
||||||
checkOwner(owner);
|
checkOwner(owner);
|
||||||
assertEquals(owner.getUser(), vAppTemplateClient.getVAppTemplate(vAppTemplateURI).getOwner().getUser());
|
assertEquals(owner.getUser(), vAppTemplateApi.getVAppTemplate(vAppTemplateURI).getOwner().getUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplate/{id}/customizationSection")
|
@Test(description = "GET /vAppTemplate/{id}/customizationSection")
|
||||||
public void testGetCustomizationSection() {
|
public void testGetCustomizationSection() {
|
||||||
CustomizationSection customizationSection = vAppTemplateClient.getCustomizationSection(vAppTemplateURI);
|
CustomizationSection customizationSection = vAppTemplateApi.getCustomizationSection(vAppTemplateURI);
|
||||||
|
|
||||||
checkCustomizationSection(customizationSection);
|
checkCustomizationSection(customizationSection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplate/{id}/productSections")
|
@Test(description = "GET /vAppTemplate/{id}/productSections")
|
||||||
public void testGetProductSections() {
|
public void testGetProductSections() {
|
||||||
ProductSectionList productSectionList = vAppTemplateClient.getProductSections(vAppTemplateURI);
|
ProductSectionList productSectionList = vAppTemplateApi.getProductSections(vAppTemplateURI);
|
||||||
|
|
||||||
checkProductSectionList(productSectionList);
|
checkProductSectionList(productSectionList);
|
||||||
}
|
}
|
||||||
|
@ -152,13 +152,13 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
public void testEditProductSections() {
|
public void testEditProductSections() {
|
||||||
// TODO make a real modification
|
// TODO make a real modification
|
||||||
|
|
||||||
ProductSectionList origSections = vAppTemplateClient.getProductSections(vApp.getHref());
|
ProductSectionList origSections = vAppTemplateApi.getProductSections(vApp.getHref());
|
||||||
ProductSectionList newSections = origSections.toBuilder().build();
|
ProductSectionList newSections = origSections.toBuilder().build();
|
||||||
|
|
||||||
Task task = vAppTemplateClient.modifyProductSections(vApp.getHref(), newSections);
|
Task task = vAppTemplateApi.modifyProductSections(vApp.getHref(), newSections);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
ProductSectionList modified = vAppTemplateClient.getProductSections(vApp.getHref());
|
ProductSectionList modified = vAppTemplateApi.getProductSections(vApp.getHref());
|
||||||
checkProductSectionList(modified);
|
checkProductSectionList(modified);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,21 +167,21 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
getGuestCustomizationSection(new Function<URI, GuestCustomizationSection>() {
|
getGuestCustomizationSection(new Function<URI, GuestCustomizationSection>() {
|
||||||
@Override
|
@Override
|
||||||
public GuestCustomizationSection apply(URI uri) {
|
public GuestCustomizationSection apply(URI uri) {
|
||||||
return vAppTemplateClient.getGuestCustomizationSection(uri);
|
return vAppTemplateApi.getGuestCustomizationSection(uri);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplate/{id}/leaseSettingsSection")
|
@Test(description = "GET /vAppTemplate/{id}/leaseSettingsSection")
|
||||||
public void testGetLeaseSettingsSection() {
|
public void testGetLeaseSettingsSection() {
|
||||||
LeaseSettingsSection leaseSettingsSection = vAppTemplateClient.getLeaseSettingsSection(vAppTemplateURI);
|
LeaseSettingsSection leaseSettingsSection = vAppTemplateApi.getLeaseSettingsSection(vAppTemplateURI);
|
||||||
|
|
||||||
checkLeaseSettingsSection(leaseSettingsSection);
|
checkLeaseSettingsSection(leaseSettingsSection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplate/{id}/metadata", dependsOnMethods = { "testEditMetadataValue" })
|
@Test(description = "GET /vAppTemplate/{id}/metadata", dependsOnMethods = { "testEditMetadataValue" })
|
||||||
public void testGetVAppTemplateMetadata() {
|
public void testGetVAppTemplateMetadata() {
|
||||||
Metadata metadata = vAppTemplateClient.getMetadataClient().getMetadata(vAppTemplateURI);
|
Metadata metadata = vAppTemplateApi.getMetadataApi().getMetadata(vAppTemplateURI);
|
||||||
|
|
||||||
checkMetadata(metadata);
|
checkMetadata(metadata);
|
||||||
}
|
}
|
||||||
|
@ -189,10 +189,10 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
// implicitly tested by testEditVAppTemplateMetadataValue, which first creates the metadata entry; otherwise no entry may exist
|
// implicitly tested by testEditVAppTemplateMetadataValue, which first creates the metadata entry; otherwise no entry may exist
|
||||||
@Test(description = "GET /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetVAppTemplateMetadata" })
|
@Test(description = "GET /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetVAppTemplateMetadata" })
|
||||||
public void testGetMetadataValue() {
|
public void testGetMetadataValue() {
|
||||||
Metadata metadata = vAppTemplateClient.getMetadataClient().getMetadata(vAppTemplateURI);
|
Metadata metadata = vAppTemplateApi.getMetadataApi().getMetadata(vAppTemplateURI);
|
||||||
MetadataEntry entry = Iterables.get(metadata.getMetadataEntries(), 0);
|
MetadataEntry entry = Iterables.get(metadata.getMetadataEntries(), 0);
|
||||||
|
|
||||||
MetadataValue val = vAppTemplateClient.getMetadataClient().getMetadataValue(vAppTemplateURI, entry.getKey());
|
MetadataValue val = vAppTemplateApi.getMetadataApi().getMetadataValue(vAppTemplateURI, entry.getKey());
|
||||||
|
|
||||||
checkMetadataValue(val);
|
checkMetadataValue(val);
|
||||||
assertEquals(val.getValue(), entry.getValue());
|
assertEquals(val.getValue(), entry.getValue());
|
||||||
|
@ -200,7 +200,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplate/{id}/networkConfigSection")
|
@Test(description = "GET /vAppTemplate/{id}/networkConfigSection")
|
||||||
public void testGetVAppTemplateNetworkConfigSection() {
|
public void testGetVAppTemplateNetworkConfigSection() {
|
||||||
NetworkConfigSection networkConfigSection = vAppTemplateClient.getNetworkConfigSection(vAppTemplateURI);
|
NetworkConfigSection networkConfigSection = vAppTemplateApi.getNetworkConfigSection(vAppTemplateURI);
|
||||||
|
|
||||||
checkNetworkConfigSection(networkConfigSection);
|
checkNetworkConfigSection(networkConfigSection);
|
||||||
}
|
}
|
||||||
|
@ -210,21 +210,21 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
getNetworkConnectionSection(new Function<URI, NetworkConnectionSection>() {
|
getNetworkConnectionSection(new Function<URI, NetworkConnectionSection>() {
|
||||||
@Override
|
@Override
|
||||||
public NetworkConnectionSection apply(URI uri) {
|
public NetworkConnectionSection apply(URI uri) {
|
||||||
return vAppTemplateClient.getNetworkConnectionSection(uri);
|
return vAppTemplateApi.getNetworkConnectionSection(uri);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplate/{id}/networkSection")
|
@Test(description = "GET /vAppTemplate/{id}/networkSection")
|
||||||
public void testGetVAppTemplateNetworkSection() {
|
public void testGetVAppTemplateNetworkSection() {
|
||||||
NetworkSection networkSection = vAppTemplateClient.getNetworkSection(vAppTemplateURI);
|
NetworkSection networkSection = vAppTemplateApi.getNetworkSection(vAppTemplateURI);
|
||||||
|
|
||||||
checkOvfNetworkSection(networkSection);
|
checkOvfNetworkSection(networkSection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /vAppTemplate/{id}/ovf")
|
@Test(description = "GET /vAppTemplate/{id}/ovf")
|
||||||
public void testGetVAppTemplateOvf() {
|
public void testGetVAppTemplateOvf() {
|
||||||
Envelope envelope = vAppTemplateClient.getOvf(vAppTemplateURI);
|
Envelope envelope = vAppTemplateApi.getOvf(vAppTemplateURI);
|
||||||
|
|
||||||
checkOvfEnvelope(envelope);
|
checkOvfEnvelope(envelope);
|
||||||
}
|
}
|
||||||
|
@ -238,17 +238,17 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.description(description)
|
.description(description)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
final Task task = vAppTemplateClient.modifyVAppTemplate(vAppTemplateURI, template);
|
final Task task = vAppTemplateApi.modifyVAppTemplate(vAppTemplateURI, template);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
VAppTemplate newTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
|
VAppTemplate newTemplate = vAppTemplateApi.getVAppTemplate(vAppTemplateURI);
|
||||||
assertEquals(newTemplate.getName(), name);
|
assertEquals(newTemplate.getName(), name);
|
||||||
assertEquals(newTemplate.getDescription(), description);
|
assertEquals(newTemplate.getDescription(), description);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "POST /vAppTemplate/{id}/metadata", dependsOnMethods = { "testGetVAppTemplate" })
|
@Test(description = "POST /vAppTemplate/{id}/metadata", dependsOnMethods = { "testGetVAppTemplate" })
|
||||||
public void testEditMetadata() {
|
public void testEditMetadata() {
|
||||||
Metadata oldMetadata = vAppTemplateClient.getMetadataClient().getMetadata(vAppTemplateURI);
|
Metadata oldMetadata = vAppTemplateApi.getMetadataApi().getMetadata(vAppTemplateURI);
|
||||||
Map<String,String> oldMetadataMap = metadataToMap(oldMetadata);
|
Map<String,String> oldMetadataMap = metadataToMap(oldMetadata);
|
||||||
|
|
||||||
key = name("key-");
|
key = name("key-");
|
||||||
|
@ -256,10 +256,10 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
MetadataEntry metadataEntry = MetadataEntry.builder().entry(key, val).build();
|
MetadataEntry metadataEntry = MetadataEntry.builder().entry(key, val).build();
|
||||||
Metadata metadata = Metadata.builder().fromMetadata(oldMetadata).entry(metadataEntry).build();
|
Metadata metadata = Metadata.builder().fromMetadata(oldMetadata).entry(metadataEntry).build();
|
||||||
|
|
||||||
final Task task = vAppTemplateClient.getMetadataClient().mergeMetadata(vAppTemplateURI, metadata);
|
final Task task = vAppTemplateApi.getMetadataApi().mergeMetadata(vAppTemplateURI, metadata);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
Metadata newMetadata = vAppTemplateClient.getMetadataClient().getMetadata(vAppTemplateURI);
|
Metadata newMetadata = vAppTemplateApi.getMetadataApi().getMetadata(vAppTemplateURI);
|
||||||
Map<String,String> expectedMetadataMap = ImmutableMap.<String,String>builder()
|
Map<String,String> expectedMetadataMap = ImmutableMap.<String,String>builder()
|
||||||
.putAll(oldMetadataMap)
|
.putAll(oldMetadataMap)
|
||||||
.put(key, val)
|
.put(key, val)
|
||||||
|
@ -272,19 +272,19 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
val = "new"+val;
|
val = "new"+val;
|
||||||
MetadataValue metadataValue = MetadataValue.builder().value(val).build();
|
MetadataValue metadataValue = MetadataValue.builder().value(val).build();
|
||||||
|
|
||||||
final Task task = vAppTemplateClient.getMetadataClient().setMetadata(vAppTemplateURI, key, metadataValue);
|
final Task task = vAppTemplateApi.getMetadataApi().setMetadata(vAppTemplateURI, key, metadataValue);
|
||||||
retryTaskSuccess.apply(task);
|
retryTaskSuccess.apply(task);
|
||||||
|
|
||||||
MetadataValue newMetadataValue = vAppTemplateClient.getMetadataClient().getMetadataValue(vAppTemplateURI, key);
|
MetadataValue newMetadataValue = vAppTemplateApi.getMetadataApi().getMetadataValue(vAppTemplateURI, key);
|
||||||
assertEquals(newMetadataValue.getValue(), metadataValue.getValue());
|
assertEquals(newMetadataValue.getValue(), metadataValue.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "DELETE /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadataValue" })
|
@Test(description = "DELETE /vAppTemplate/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadataValue" })
|
||||||
public void testDeleteVAppTemplateMetadataValue() {
|
public void testDeleteVAppTemplateMetadataValue() {
|
||||||
final Task deletionTask = vAppTemplateClient.getMetadataClient().deleteMetadataEntry(vAppTemplateURI, key);
|
final Task deletionTask = vAppTemplateApi.getMetadataApi().deleteMetadataEntry(vAppTemplateURI, key);
|
||||||
assertTaskSucceeds(deletionTask);
|
assertTaskSucceeds(deletionTask);
|
||||||
|
|
||||||
Metadata newMetadata = vAppTemplateClient.getMetadataClient().getMetadata(vAppTemplateURI);
|
Metadata newMetadata = vAppTemplateApi.getMetadataApi().getMetadata(vAppTemplateURI);
|
||||||
checkMetadataKeyAbsentFor("vAppTemplate", newMetadata, key);
|
checkMetadataKeyAbsentFor("vAppTemplate", newMetadata, key);
|
||||||
key = null;
|
key = null;
|
||||||
}
|
}
|
||||||
|
@ -297,10 +297,10 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.computerName(computerName)
|
.computerName(computerName)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
final Task task = vAppTemplateClient.modifyGuestCustomizationSection(vm.getHref(), newSection);
|
final Task task = vAppTemplateApi.modifyGuestCustomizationSection(vm.getHref(), newSection);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
GuestCustomizationSection modified = vAppTemplateClient.getGuestCustomizationSection(vm.getHref());
|
GuestCustomizationSection modified = vAppTemplateApi.getGuestCustomizationSection(vm.getHref());
|
||||||
|
|
||||||
checkGuestCustomizationSection(modified);
|
checkGuestCustomizationSection(modified);
|
||||||
assertEquals(modified.getComputerName(), computerName);
|
assertEquals(modified.getComputerName(), computerName);
|
||||||
|
@ -308,7 +308,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "PUT /vAppTemplate/{id}/customizationSection")
|
@Test(description = "PUT /vAppTemplate/{id}/customizationSection")
|
||||||
public void testEditCustomizationSection() {
|
public void testEditCustomizationSection() {
|
||||||
boolean oldVal = vAppTemplateClient.getCustomizationSection(vAppTemplateURI).isCustomizeOnInstantiate();
|
boolean oldVal = vAppTemplateApi.getCustomizationSection(vAppTemplateURI).isCustomizeOnInstantiate();
|
||||||
boolean newVal = !oldVal;
|
boolean newVal = !oldVal;
|
||||||
|
|
||||||
CustomizationSection customizationSection = CustomizationSection.builder()
|
CustomizationSection customizationSection = CustomizationSection.builder()
|
||||||
|
@ -316,10 +316,10 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.customizeOnInstantiate(newVal)
|
.customizeOnInstantiate(newVal)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
final Task task = vAppTemplateClient.modifyCustomizationSection(vAppTemplateURI, customizationSection);
|
final Task task = vAppTemplateApi.modifyCustomizationSection(vAppTemplateURI, customizationSection);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
CustomizationSection newCustomizationSection = vAppTemplateClient.getCustomizationSection(vAppTemplateURI);
|
CustomizationSection newCustomizationSection = vAppTemplateApi.getCustomizationSection(vAppTemplateURI);
|
||||||
assertEquals(newCustomizationSection.isCustomizeOnInstantiate(), newVal);
|
assertEquals(newCustomizationSection.isCustomizeOnInstantiate(), newVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,10 +336,10 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.deploymentLeaseInSeconds(deploymentLeaseInSeconds)
|
.deploymentLeaseInSeconds(deploymentLeaseInSeconds)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
final Task task = vAppTemplateClient.modifyLeaseSettingsSection(vAppTemplateURI, leaseSettingSection);
|
final Task task = vAppTemplateApi.modifyLeaseSettingsSection(vAppTemplateURI, leaseSettingSection);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
LeaseSettingsSection newLeaseSettingsSection = vAppTemplateClient.getLeaseSettingsSection(vAppTemplateURI);
|
LeaseSettingsSection newLeaseSettingsSection = vAppTemplateApi.getLeaseSettingsSection(vAppTemplateURI);
|
||||||
assertEquals(newLeaseSettingsSection.getStorageLeaseInSeconds(), (Integer) storageLeaseInSeconds);
|
assertEquals(newLeaseSettingsSection.getStorageLeaseInSeconds(), (Integer) storageLeaseInSeconds);
|
||||||
assertEquals(newLeaseSettingsSection.getDeploymentLeaseInSeconds(), (Integer) deploymentLeaseInSeconds);
|
assertEquals(newLeaseSettingsSection.getDeploymentLeaseInSeconds(), (Integer) deploymentLeaseInSeconds);
|
||||||
}
|
}
|
||||||
|
@ -348,7 +348,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
public void testEditNetworkConfigSection() {
|
public void testEditNetworkConfigSection() {
|
||||||
// TODO What to modify?
|
// TODO What to modify?
|
||||||
|
|
||||||
NetworkConfigSection oldSection = vAppTemplateClient.getNetworkConfigSection(vApp.getHref());
|
NetworkConfigSection oldSection = vAppTemplateApi.getNetworkConfigSection(vApp.getHref());
|
||||||
NetworkConfigSection newSection = oldSection.toBuilder().build();
|
NetworkConfigSection newSection = oldSection.toBuilder().build();
|
||||||
|
|
||||||
// String networkName = ""+random.nextInt();
|
// String networkName = ""+random.nextInt();
|
||||||
|
@ -365,10 +365,10 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
// .networkConfigs(vappNetworkConfigurations)
|
// .networkConfigs(vappNetworkConfigurations)
|
||||||
// .build();
|
// .build();
|
||||||
|
|
||||||
final Task task = vAppTemplateClient.modifyNetworkConfigSection(vApp.getHref(), newSection);
|
final Task task = vAppTemplateApi.modifyNetworkConfigSection(vApp.getHref(), newSection);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
NetworkConfigSection modified = vAppTemplateClient.getNetworkConfigSection(vAppTemplateURI);
|
NetworkConfigSection modified = vAppTemplateApi.getNetworkConfigSection(vAppTemplateURI);
|
||||||
checkNetworkConfigSection(modified);
|
checkNetworkConfigSection(modified);
|
||||||
|
|
||||||
// assertEquals(modified§.getNetworkConfigs().size(), 1);
|
// assertEquals(modified§.getNetworkConfigs().size(), 1);
|
||||||
|
@ -384,7 +384,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
Reference network = Iterables.getLast(networks);
|
Reference network = Iterables.getLast(networks);
|
||||||
|
|
||||||
// Copy existing section and update fields
|
// Copy existing section and update fields
|
||||||
NetworkConnectionSection oldSection = vAppTemplateClient.getNetworkConnectionSection(vm.getHref());
|
NetworkConnectionSection oldSection = vAppTemplateApi.getNetworkConnectionSection(vm.getHref());
|
||||||
NetworkConnectionSection newSection = oldSection.toBuilder()
|
NetworkConnectionSection newSection = oldSection.toBuilder()
|
||||||
.networkConnection(NetworkConnection.builder()
|
.networkConnection(NetworkConnection.builder()
|
||||||
.ipAddressAllocationMode(IpAddressAllocationMode.DHCP.toString())
|
.ipAddressAllocationMode(IpAddressAllocationMode.DHCP.toString())
|
||||||
|
@ -392,10 +392,10 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Task task = vAppTemplateClient.modifyNetworkConnectionSection(vm.getHref(), newSection);
|
Task task = vAppTemplateApi.modifyNetworkConnectionSection(vm.getHref(), newSection);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
NetworkConnectionSection modified = vAppTemplateClient.getNetworkConnectionSection(vm.getHref());
|
NetworkConnectionSection modified = vAppTemplateApi.getNetworkConnectionSection(vm.getHref());
|
||||||
checkNetworkConnectionSection(modified);
|
checkNetworkConnectionSection(modified);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,26 +405,26 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
VAppTemplate clonedVappTemplate = cloneVAppTemplate(true);
|
VAppTemplate clonedVappTemplate = cloneVAppTemplate(true);
|
||||||
|
|
||||||
// Confirm that "get" works pre-delete
|
// Confirm that "get" works pre-delete
|
||||||
VAppTemplate vAppTemplatePreDelete = vAppTemplateClient.getVAppTemplate(clonedVappTemplate.getHref());
|
VAppTemplate vAppTemplatePreDelete = vAppTemplateApi.getVAppTemplate(clonedVappTemplate.getHref());
|
||||||
checkVAppTemplate(vAppTemplatePreDelete);
|
checkVAppTemplate(vAppTemplatePreDelete);
|
||||||
|
|
||||||
// Delete the template
|
// Delete the template
|
||||||
final Task task = vAppTemplateClient.deleteVappTemplate(clonedVappTemplate.getHref());
|
final Task task = vAppTemplateApi.deleteVappTemplate(clonedVappTemplate.getHref());
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
// Confirm that can't access post-delete, i.e. template has been deleted
|
// Confirm that can't access post-delete, i.e. template has been deleted
|
||||||
VAppTemplate deleted = vAppTemplateClient.getVAppTemplate(clonedVappTemplate.getHref());
|
VAppTemplate deleted = vAppTemplateApi.getVAppTemplate(clonedVappTemplate.getHref());
|
||||||
assertNull(deleted);
|
assertNull(deleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "POST /vAppTemplate/{id}/action/disableDownload")
|
@Test(description = "POST /vAppTemplate/{id}/action/disableDownload")
|
||||||
public void testDisableVAppTemplateDownload() throws Exception {
|
public void testDisableVAppTemplateDownload() throws Exception {
|
||||||
vAppTemplateClient.disableDownload(vAppTemplateURI);
|
vAppTemplateApi.disableDownload(vAppTemplateURI);
|
||||||
|
|
||||||
// TODO Check that it really is disabled. The only thing I can see for determining this
|
// TODO Check that it really is disabled. The only thing I can see for determining this
|
||||||
// is the undocumented "download" link in the VAppTemplate. But that is brittle and we
|
// is the undocumented "download" link in the VAppTemplate. But that is brittle and we
|
||||||
// don't know what timing guarantees there are for adding/removing the link.
|
// don't know what timing guarantees there are for adding/removing the link.
|
||||||
VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
|
VAppTemplate vAppTemplate = vAppTemplateApi.getVAppTemplate(vAppTemplateURI);
|
||||||
Set<Link> links = vAppTemplate.getLinks();
|
Set<Link> links = vAppTemplate.getLinks();
|
||||||
assertTrue(Iterables.all(Iterables.transform(links, rel), Predicates.not(Predicates.in(EnumSet.of(Link.Rel.DOWNLOAD_DEFAULT, Link.Rel.DOWNLOAD_ALTERNATE)))),
|
assertTrue(Iterables.all(Iterables.transform(links, rel), Predicates.not(Predicates.in(EnumSet.of(Link.Rel.DOWNLOAD_DEFAULT, Link.Rel.DOWNLOAD_ALTERNATE)))),
|
||||||
"Should not offer download link after disabling download: "+vAppTemplate);
|
"Should not offer download link after disabling download: "+vAppTemplate);
|
||||||
|
@ -433,14 +433,14 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "POST /vAppTemplate/{id}/action/enableDownload")
|
@Test(description = "POST /vAppTemplate/{id}/action/enableDownload")
|
||||||
public void testEnableVAppTemplateDownload() throws Exception {
|
public void testEnableVAppTemplateDownload() throws Exception {
|
||||||
// First disable so that enable really has some work to do...
|
// First disable so that enable really has some work to do...
|
||||||
vAppTemplateClient.disableDownload(vAppTemplateURI);
|
vAppTemplateApi.disableDownload(vAppTemplateURI);
|
||||||
final Task task = vAppTemplateClient.enableDownload(vAppTemplateURI);
|
final Task task = vAppTemplateApi.enableDownload(vAppTemplateURI);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
// TODO Check that it really is enabled. The only thing I can see for determining this
|
// TODO Check that it really is enabled. The only thing I can see for determining this
|
||||||
// is the undocumented "download" link in the VAppTemplate. But that is brittle and we
|
// is the undocumented "download" link in the VAppTemplate. But that is brittle and we
|
||||||
// don't know what timing guarantees there are for adding/removing the link.
|
// don't know what timing guarantees there are for adding/removing the link.
|
||||||
VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
|
VAppTemplate vAppTemplate = vAppTemplateApi.getVAppTemplate(vAppTemplateURI);
|
||||||
Set<Link> links = vAppTemplate.getLinks();
|
Set<Link> links = vAppTemplate.getLinks();
|
||||||
assertTrue(Iterables.any(Iterables.transform(links, rel), Predicates.in(EnumSet.of(Link.Rel.DOWNLOAD_DEFAULT, Link.Rel.DOWNLOAD_ALTERNATE))),
|
assertTrue(Iterables.any(Iterables.transform(links, rel), Predicates.in(EnumSet.of(Link.Rel.DOWNLOAD_DEFAULT, Link.Rel.DOWNLOAD_ALTERNATE))),
|
||||||
"Should offer download link after enabling download: "+vAppTemplate);
|
"Should offer download link after enabling download: "+vAppTemplate);
|
||||||
|
@ -455,7 +455,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "POST /vAppTemplate/{id}/action/consolidate")
|
@Test(description = "POST /vAppTemplate/{id}/action/consolidate")
|
||||||
public void testConsolidateVAppTemplate() throws Exception {
|
public void testConsolidateVAppTemplate() throws Exception {
|
||||||
final Task task = vAppTemplateClient.consolidateVm(vm.getHref());
|
final Task task = vAppTemplateApi.consolidateVm(vm.getHref());
|
||||||
assertTaskSucceedsLong(task);
|
assertTaskSucceedsLong(task);
|
||||||
|
|
||||||
// TODO Need assertion that command had effect
|
// TODO Need assertion that command had effect
|
||||||
|
@ -469,7 +469,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.datastore(dataStore)
|
.datastore(dataStore)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
final Task task = vAppTemplateClient.relocateVm(vAppTemplateURI, relocateParams);
|
final Task task = vAppTemplateApi.relocateVm(vAppTemplateURI, relocateParams);
|
||||||
assertTaskSucceedsLong(task);
|
assertTaskSucceedsLong(task);
|
||||||
|
|
||||||
// TODO Need assertion that command had effect
|
// TODO Need assertion that command had effect
|
||||||
|
@ -478,7 +478,7 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
// NOTE This will fail unless we can relocate a template to another datastore
|
// NOTE This will fail unless we can relocate a template to another datastore
|
||||||
@Test(description = "GET /vAppTemplate/{id}/shadowVms", dependsOnMethods = { "testRelocateVAppTemplate" })
|
@Test(description = "GET /vAppTemplate/{id}/shadowVms", dependsOnMethods = { "testRelocateVAppTemplate" })
|
||||||
public void testGetShadowVms() {
|
public void testGetShadowVms() {
|
||||||
References references = vAppTemplateClient.getShadowVms(vAppTemplateURI);
|
References references = vAppTemplateApi.getShadowVms(vAppTemplateURI);
|
||||||
|
|
||||||
Checks.checkReferences(references);
|
Checks.checkReferences(references);
|
||||||
}
|
}
|
||||||
|
@ -488,12 +488,12 @@ public class VAppTemplateClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "test completed task not included in vAppTemplate")
|
@Test(description = "test completed task not included in vAppTemplate")
|
||||||
public void testCompletedTaskNotIncludedInVAppTemplate() throws Exception {
|
public void testCompletedTaskNotIncludedInVAppTemplate() throws Exception {
|
||||||
// Kick off a task, and wait for it to complete
|
// Kick off a task, and wait for it to complete
|
||||||
vAppTemplateClient.disableDownload(vAppTemplateURI);
|
vAppTemplateApi.disableDownload(vAppTemplateURI);
|
||||||
final Task task = vAppTemplateClient.enableDownload(vAppTemplateURI);
|
final Task task = vAppTemplateApi.enableDownload(vAppTemplateURI);
|
||||||
assertTaskDoneEventually(task);
|
assertTaskDoneEventually(task);
|
||||||
|
|
||||||
// Ask the VAppTemplate for its tasks, and the status of the matching task if it exists
|
// Ask the VAppTemplate for its tasks, and the status of the matching task if it exists
|
||||||
VAppTemplate vAppTemplate = vAppTemplateClient.getVAppTemplate(vAppTemplateURI);
|
VAppTemplate vAppTemplate = vAppTemplateApi.getVAppTemplate(vAppTemplateURI);
|
||||||
List<Task> tasks = vAppTemplate.getTasks();
|
List<Task> tasks = vAppTemplate.getTasks();
|
||||||
for (Task contender : tasks) {
|
for (Task contender : tasks) {
|
||||||
if (task.getId().equals(contender.getId())) {
|
if (task.getId().equals(contender.getId())) {
|
|
@ -46,18 +46,18 @@ import org.jclouds.vcloud.director.v1_5.domain.params.CloneVAppTemplateParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.ComposeVAppParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.ComposeVAppParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.InstantiateVAppTemplateParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.InstantiateVAppTemplateParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.UploadVAppTemplateParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.UploadVAppTemplateParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows us to test a client via its side effects.
|
* Allows us to test a api via its side effects.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "VdcClientExpectTest")
|
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "VdcApiExpectTest")
|
||||||
public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class VdcApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
private URI vdcURI;
|
private URI vdcURI;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetVdc() {
|
public void testGetVdc() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f")
|
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -80,13 +80,13 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Vdc expected = getVdc();
|
Vdc expected = getVdc();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().getVdc(vdcURI), expected);
|
assertEquals(api.getVdcApi().getVdc(vdcURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testResponse400ForInvalidVdcId() {
|
public void testResponse400ForInvalidVdcId() {
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/vdc/NOTAUUID")
|
.apiCommand("GET", "/vdc/NOTAUUID")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -102,7 +102,7 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
client.getVdcClient().getVdc(URI.create(endpoint + "/vdc/NOTAUUID"));
|
api.getVdcApi().getVdc(URI.create(endpoint + "/vdc/NOTAUUID"));
|
||||||
fail("Should give HTTP 400 error");
|
fail("Should give HTTP 400 error");
|
||||||
} catch (VCloudDirectorException vde) {
|
} catch (VCloudDirectorException vde) {
|
||||||
assertEquals(vde.getError(), expected);
|
assertEquals(vde.getError(), expected);
|
||||||
|
@ -112,7 +112,7 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
@Test
|
@Test
|
||||||
public void testResponse403ForFakeVdcId() {
|
public void testResponse403ForFakeVdcId() {
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/vdc/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
.apiCommand("GET", "/vdc/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -121,12 +121,12 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.xmlFilePayload("/vdc/error403-fake.xml", VCloudDirectorMediaType.ERROR)
|
.xmlFilePayload("/vdc/error403-fake.xml", VCloudDirectorMediaType.ERROR)
|
||||||
.httpResponseBuilder().statusCode(403).build());
|
.httpResponseBuilder().statusCode(403).build());
|
||||||
|
|
||||||
assertNull(client.getVdcClient().getVdc(URI.create(endpoint + "/vdc/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")));
|
assertNull(api.getVdcApi().getVdc(URI.create(endpoint + "/vdc/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testCaptureVApp() {
|
public void testCaptureVApp() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
|
||||||
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
||||||
|
@ -143,12 +143,12 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().captureVApp(vdcURI, params), expected);
|
assertEquals(api.getVdcApi().captureVApp(vdcURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testResponse4xxForCaptureVAppNoParams() {
|
public void testResponse4xxForCaptureVAppNoParams() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/captureVApp")
|
||||||
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
.xmlFilePayload("/vdc/params/captureVApp.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
||||||
|
@ -165,7 +165,7 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
client.getVdcClient().captureVApp(vdcURI, null);
|
api.getVdcApi().captureVApp(vdcURI, null);
|
||||||
fail("Should give HTTP 400 error");
|
fail("Should give HTTP 400 error");
|
||||||
} catch (VCloudDirectorException vde) {
|
} catch (VCloudDirectorException vde) {
|
||||||
assertEquals(vde.getError(), expected);
|
assertEquals(vde.getError(), expected);
|
||||||
|
@ -174,7 +174,7 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testCloneVApp() {
|
public void testCloneVApp() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
|
||||||
.xmlFilePayload("/vdc/params/cloneVApp.xml", VCloudDirectorMediaType.CLONE_VAPP_PARAMS)
|
.xmlFilePayload("/vdc/params/cloneVApp.xml", VCloudDirectorMediaType.CLONE_VAPP_PARAMS)
|
||||||
|
@ -191,12 +191,12 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().cloneVApp(vdcURI, params), expected);
|
assertEquals(api.getVdcApi().cloneVApp(vdcURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testCloneVAppTemplate() {
|
public void testCloneVAppTemplate() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneVAppTemplate")
|
||||||
.xmlFilePayload("/vdc/params/cloneVAppTemplate.xml", VCloudDirectorMediaType.CLONE_VAPP_TEMPLATE_PARAMS)
|
.xmlFilePayload("/vdc/params/cloneVAppTemplate.xml", VCloudDirectorMediaType.CLONE_VAPP_TEMPLATE_PARAMS)
|
||||||
|
@ -213,12 +213,12 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().cloneVAppTemplate(vdcURI, params), expected);
|
assertEquals(api.getVdcApi().cloneVAppTemplate(vdcURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testComposeVApp() {
|
public void testComposeVApp() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/composeVApp")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/composeVApp")
|
||||||
.xmlFilePayload("/vdc/params/composeVApp.xml", VCloudDirectorMediaType.COMPOSE_VAPP_PARAMS)
|
.xmlFilePayload("/vdc/params/composeVApp.xml", VCloudDirectorMediaType.COMPOSE_VAPP_PARAMS)
|
||||||
|
@ -235,12 +235,12 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().composeVApp(vdcURI, params), expected);
|
assertEquals(api.getVdcApi().composeVApp(vdcURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testInstantiateVAppTemplate() {
|
public void testInstantiateVAppTemplate() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/instantiateVAppTemplate")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/instantiateVAppTemplate")
|
||||||
.xmlFilePayload("/vdc/params/instantiateVAppTemplate.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
.xmlFilePayload("/vdc/params/instantiateVAppTemplate.xml", VCloudDirectorMediaType.CAPTURE_VAPP_PARAMS)
|
||||||
|
@ -257,12 +257,12 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().instantiateVApp(vdcURI, params), expected);
|
assertEquals(api.getVdcApi().instantiateVApp(vdcURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUploadVAppTemplate() {
|
public void testUploadVAppTemplate() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/uploadVAppTemplate")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/uploadVAppTemplate")
|
||||||
.xmlFilePayload("/vdc/params/uploadVAppTemplate.xml", VCloudDirectorMediaType.UPLOAD_VAPP_TEMPLATE_PARAMS)
|
.xmlFilePayload("/vdc/params/uploadVAppTemplate.xml", VCloudDirectorMediaType.UPLOAD_VAPP_TEMPLATE_PARAMS)
|
||||||
|
@ -279,14 +279,14 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().uploadVAppTemplate(vdcURI, params), expected);
|
assertEquals(api.getVdcApi().uploadVAppTemplate(vdcURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateMedia() {
|
public void testCreateMedia() {
|
||||||
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/media")
|
||||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -303,16 +303,16 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.type("application/vnd.vmware.vcloud.media+xml")
|
.type("application/vnd.vmware.vcloud.media+xml")
|
||||||
.description("Test media generated by testCreateMedia()")
|
.description("Test media generated by testCreateMedia()")
|
||||||
.build();
|
.build();
|
||||||
Media expected = MediaClientExpectTest.createMedia();
|
Media expected = MediaApiExpectTest.createMedia();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().createMedia(vdcUri, source), expected);
|
assertEquals(api.getVdcApi().createMedia(vdcUri, source), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCloneMedia() {
|
public void testCloneMedia() {
|
||||||
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
|
.apiCommand("POST", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/action/cloneMedia")
|
||||||
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
.acceptMedia(VCloudDirectorMediaType.MEDIA)
|
||||||
|
@ -333,16 +333,16 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
.build())
|
.build())
|
||||||
.isSourceDelete(false)
|
.isSourceDelete(false)
|
||||||
.build();
|
.build();
|
||||||
Media expected = MediaClientExpectTest.cloneMedia();
|
Media expected = MediaApiExpectTest.cloneMedia();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().cloneMedia(vdcUri, params), expected);
|
assertEquals(api.getVdcApi().cloneMedia(vdcUri, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetMetadata() {
|
public void testGetMetadata() {
|
||||||
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
URI vdcUri = URI.create(endpoint + "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata")
|
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -353,14 +353,14 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Metadata expected = metadata();
|
Metadata expected = metadata();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().getMetadataClient().getMetadata(vdcUri), expected);
|
assertEquals(api.getVdcApi().getMetadataApi().getMetadata(vdcUri), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetMetadataValue() {
|
public void testGetMetadataValue() {
|
||||||
URI vdcUri = URI.create("https://vcloudbeta.bluelock.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
URI vdcUri = URI.create("https://vcloudbeta.bluelock.com/api/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f");
|
||||||
|
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata/key")
|
.apiCommand("GET", "/vdc/e9cd3387-ac57-4d27-a481-9bee75e0690f/metadata/key")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -371,7 +371,7 @@ public class VdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
MetadataValue expected = metadataValue();
|
MetadataValue expected = metadataValue();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().getMetadataClient().getMetadataValue(vdcUri, "key"), expected);
|
assertEquals(api.getVdcApi().getMetadataApi().getMetadataValue(vdcUri, "key"), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vdc getVdc() {
|
public static Vdc getVdc() {
|
|
@ -51,7 +51,7 @@ import org.jclouds.vcloud.director.v1_5.domain.params.InstantiateVAppTemplatePar
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.InstantiationParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.InstantiationParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.UploadVAppTemplateParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.UploadVAppTemplateParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConfigSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -62,21 +62,21 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests behavior of {@link VdcClient}
|
* Tests behavior of {@link VdcApi}
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VdcClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VdcApiLiveTest")
|
||||||
public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class VdcApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
public static final String VDC = "vdc";
|
public static final String VDC = "vdc";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience reference to API client.
|
* Convenience reference to API api.
|
||||||
*/
|
*/
|
||||||
protected VdcClient vdcClient;
|
protected VdcApi vdcApi;
|
||||||
protected VAppTemplateClient vappTemplateClient;
|
protected VAppTemplateApi vappTemplateApi;
|
||||||
protected VAppClient vappClient;
|
protected VAppApi vappApi;
|
||||||
|
|
||||||
private VApp instantiatedVApp;
|
private VApp instantiatedVApp;
|
||||||
private VApp clonedVApp;
|
private VApp clonedVApp;
|
||||||
|
@ -88,10 +88,10 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() {
|
public void setupRequiredApis() {
|
||||||
vdcClient = context.getApi().getVdcClient();
|
vdcApi = context.getApi().getVdcApi();
|
||||||
vappTemplateClient = context.getApi().getVAppTemplateClient();
|
vappTemplateApi = context.getApi().getVAppTemplateApi();
|
||||||
vappClient = context.getApi().getVAppClient();
|
vappApi = context.getApi().getVAppApi();
|
||||||
|
|
||||||
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
|
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
if (metadataSet) {
|
if (metadataSet) {
|
||||||
try {
|
try {
|
||||||
Task delete = adminContext.getApi().getVdcClient().getMetadataClient().deleteMetadataEntry(toAdminUri(vdcURI), "key");
|
Task delete = adminContext.getApi().getVdcApi().getMetadataApi().deleteMetadataEntry(toAdminUri(vdcURI), "key");
|
||||||
taskDoneEventually(delete);
|
taskDoneEventually(delete);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error deleting metadata entry");
|
logger.warn(e, "Error deleting metadata entry");
|
||||||
|
@ -129,7 +129,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /vdc/{id}")
|
@Test(description = "GET /vdc/{id}")
|
||||||
public void testGetVdc() {
|
public void testGetVdc() {
|
||||||
Vdc vdc = vdcClient.getVdc(vdcURI);
|
Vdc vdc = vdcApi.getVdc(vdcURI);
|
||||||
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
|
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
|
||||||
assertTrue(!vdc.getDescription().equals("DO NOT USE"), "vDC isn't to be used for testing");
|
assertTrue(!vdc.getDescription().equals("DO NOT USE"), "vDC isn't to be used for testing");
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
//.sections(sections) // TODO: ovf sections
|
//.sections(sections) // TODO: ovf sections
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
capturedVAppTemplate = vdcClient.captureVApp(vdcURI, captureVappParams);
|
capturedVAppTemplate = vdcApi.captureVApp(vdcURI, captureVappParams);
|
||||||
|
|
||||||
Task task = Iterables.getFirst(capturedVAppTemplate.getTasks(), null);
|
Task task = Iterables.getFirst(capturedVAppTemplate.getTasks(), null);
|
||||||
assertTaskSucceedsLong(task);
|
assertTaskSucceedsLong(task);
|
||||||
|
@ -178,10 +178,10 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
//.linkedClone(true)
|
//.linkedClone(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
clonedVApp = vdcClient.cloneVApp(vdcURI, cloneVappParams);
|
clonedVApp = vdcApi.cloneVApp(vdcURI, cloneVappParams);
|
||||||
|
|
||||||
Task task = Iterables.getFirst(clonedVApp.getTasks(), null);
|
Task task = Iterables.getFirst(clonedVApp.getTasks(), null);
|
||||||
assertNotNull(task, "vdcClient.cloneVApp returned VApp that did not contain any tasks");
|
assertNotNull(task, "vdcApi.cloneVApp returned VApp that did not contain any tasks");
|
||||||
assertTaskSucceedsLong(task);
|
assertTaskSucceedsLong(task);
|
||||||
|
|
||||||
Checks.checkVApp(clonedVApp);
|
Checks.checkVApp(clonedVApp);
|
||||||
|
@ -189,12 +189,12 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "POST /vdc/{id}/action/cloneVAppTemplate")
|
@Test(description = "POST /vdc/{id}/action/cloneVAppTemplate")
|
||||||
public void testCloneVAppTemplate() {
|
public void testCloneVAppTemplate() {
|
||||||
clonedVAppTemplate = vdcClient.cloneVAppTemplate(vdcURI, CloneVAppTemplateParams.builder()
|
clonedVAppTemplate = vdcApi.cloneVAppTemplate(vdcURI, CloneVAppTemplateParams.builder()
|
||||||
.source(vAppTemplateURI)
|
.source(vAppTemplateURI)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
Task task = Iterables.getFirst(clonedVAppTemplate.getTasks(), null);
|
Task task = Iterables.getFirst(clonedVAppTemplate.getTasks(), null);
|
||||||
assertNotNull(task, "vdcClient.cloneVAppTemplate returned VAppTemplate that did not contain any tasks");
|
assertNotNull(task, "vdcApi.cloneVAppTemplate returned VAppTemplate that did not contain any tasks");
|
||||||
assertTaskSucceedsLong(task);
|
assertTaskSucceedsLong(task);
|
||||||
|
|
||||||
Checks.checkVAppTemplate(clonedVAppTemplate);
|
Checks.checkVAppTemplate(clonedVAppTemplate);
|
||||||
|
@ -204,7 +204,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
public void testComposeVApp() {
|
public void testComposeVApp() {
|
||||||
String name = name("composed-");
|
String name = name("composed-");
|
||||||
|
|
||||||
composedVApp = vdcClient.composeVApp(vdcURI, ComposeVAppParams.builder()
|
composedVApp = vdcApi.composeVApp(vdcURI, ComposeVAppParams.builder()
|
||||||
.name(name)
|
.name(name)
|
||||||
// TODO: test optional params
|
// TODO: test optional params
|
||||||
//.sourcedItem(SourcedCompositionItemParam.builder()
|
//.sourcedItem(SourcedCompositionItemParam.builder()
|
||||||
|
@ -223,7 +223,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
Task task = Iterables.getFirst(composedVApp.getTasks(), null);
|
Task task = Iterables.getFirst(composedVApp.getTasks(), null);
|
||||||
assertNotNull(task, "vdcClient.composeVApp returned VApp that did not contain any tasks");
|
assertNotNull(task, "vdcApi.composeVApp returned VApp that did not contain any tasks");
|
||||||
assertTaskSucceedsLong(task);
|
assertTaskSucceedsLong(task);
|
||||||
|
|
||||||
Checks.checkVApp(composedVApp);
|
Checks.checkVApp(composedVApp);
|
||||||
|
@ -231,10 +231,10 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
String.format(OBJ_FIELD_EQ, "VApp", "name", name, composedVApp.getName()));
|
String.format(OBJ_FIELD_EQ, "VApp", "name", name, composedVApp.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Duplicates code in VAppClientLiveTest
|
// TODO Duplicates code in VAppApiLiveTest
|
||||||
@Test(description = "POST /vdc/{id}/action/instantiateVAppTemplate")
|
@Test(description = "POST /vdc/{id}/action/instantiateVAppTemplate")
|
||||||
public void testInstantiateVAppTemplate() {
|
public void testInstantiateVAppTemplate() {
|
||||||
Vdc vdc = vdcClient.getVdc(vdcURI);
|
Vdc vdc = vdcApi.getVdc(vdcURI);
|
||||||
|
|
||||||
Set<Reference> networks = vdc.getAvailableNetworks();
|
Set<Reference> networks = vdc.getAvailableNetworks();
|
||||||
Optional<Reference> parentNetwork = Iterables.tryFind(
|
Optional<Reference> parentNetwork = Iterables.tryFind(
|
||||||
|
@ -276,7 +276,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.source(vAppTemplateURI)
|
.source(vAppTemplateURI)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
instantiatedVApp = vdcClient.instantiateVApp(vdcURI, instantiate);
|
instantiatedVApp = vdcApi.instantiateVApp(vdcURI, instantiate);
|
||||||
Task instantiationTask = Iterables.getFirst(instantiatedVApp.getTasks(), null);
|
Task instantiationTask = Iterables.getFirst(instantiatedVApp.getTasks(), null);
|
||||||
assertTaskSucceedsLong(instantiationTask);
|
assertTaskSucceedsLong(instantiationTask);
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
//.manifestRequired(true)
|
//.manifestRequired(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
uploadedVAppTemplate = vdcClient.uploadVAppTemplate(vdcURI, uploadVAppTemplateParams);
|
uploadedVAppTemplate = vdcApi.uploadVAppTemplate(vdcURI, uploadVAppTemplateParams);
|
||||||
|
|
||||||
Checks.checkVAppTemplateWhenNotReady(uploadedVAppTemplate);
|
Checks.checkVAppTemplateWhenNotReady(uploadedVAppTemplate);
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupMetadata() {
|
private void setupMetadata() {
|
||||||
adminContext.getApi().getVdcClient().getMetadataClient().setMetadata(toAdminUri(vdcURI),
|
adminContext.getApi().getVdcApi().getMetadataApi().setMetadata(toAdminUri(vdcURI),
|
||||||
"key", MetadataValue.builder().value("value").build());
|
"key", MetadataValue.builder().value("value").build());
|
||||||
metadataSet = true;
|
metadataSet = true;
|
||||||
}
|
}
|
||||||
|
@ -327,7 +327,7 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
setupMetadata();
|
setupMetadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
Metadata metadata = vdcClient.getMetadataClient().getMetadata(vdcURI);
|
Metadata metadata = vdcApi.getMetadataApi().getMetadata(vdcURI);
|
||||||
|
|
||||||
// required for testing
|
// required for testing
|
||||||
assertFalse(Iterables.isEmpty(metadata.getMetadataEntries()),
|
assertFalse(Iterables.isEmpty(metadata.getMetadataEntries()),
|
||||||
|
@ -339,12 +339,12 @@ public class VdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /vdc/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" } )
|
@Test(description = "GET /vdc/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" } )
|
||||||
public void testGetMetadataValue() {
|
public void testGetMetadataValue() {
|
||||||
// First find a key
|
// First find a key
|
||||||
Metadata metadata = vdcClient.getMetadataClient().getMetadata(vdcURI);
|
Metadata metadata = vdcApi.getMetadataApi().getMetadata(vdcURI);
|
||||||
Map<String, String> metadataMap = Checks.metadataToMap(metadata);
|
Map<String, String> metadataMap = Checks.metadataToMap(metadata);
|
||||||
String key = Iterables.getFirst(metadataMap.keySet(), "MadeUpKey!");
|
String key = Iterables.getFirst(metadataMap.keySet(), "MadeUpKey!");
|
||||||
String value = metadataMap.get(key);
|
String value = metadataMap.get(key);
|
||||||
|
|
||||||
MetadataValue metadataValue = vdcClient.getMetadataClient().getMetadataValue(vdcURI, key);
|
MetadataValue metadataValue = vdcApi.getMetadataApi().getMetadataValue(vdcURI, key);
|
||||||
|
|
||||||
Checks.checkMetadataValueFor(VDC, metadataValue, value);
|
Checks.checkMetadataValueFor(VDC, metadataValue, value);
|
||||||
}
|
}
|
|
@ -49,8 +49,8 @@ import org.jclouds.vcloud.director.v1_5.domain.section.NetworkConnectionSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.OperatingSystemSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.OperatingSystemSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.RuntimeInfoSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.RuntimeInfoSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.section.VirtualHardwareSection;
|
import org.jclouds.vcloud.director.v1_5.domain.section.VirtualHardwareSection;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
|
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import org.testng.internal.annotations.Sets;
|
import org.testng.internal.annotations.Sets;
|
||||||
|
@ -59,12 +59,12 @@ import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Multimaps;
|
import com.google.common.collect.Multimaps;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows us to test the {@link VmClient} via its side effects.
|
* Allows us to test the {@link VmApi} via its side effects.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "VmClientExpectTest")
|
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "VmApiExpectTest")
|
||||||
public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class VmApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
private String vmId = "vm-d0e2b6b9-4381-4ddc-9572-cdfae54059be";
|
private String vmId = "vm-d0e2b6b9-4381-4ddc-9572-cdfae54059be";
|
||||||
private URI vmURI = URI.create(endpoint + vmId);
|
private URI vmURI = URI.create(endpoint + vmId);
|
||||||
|
@ -75,7 +75,7 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
@Test(enabled = false)//TODO
|
@Test(enabled = false)//TODO
|
||||||
public void testGetVm() {
|
public void testGetVm() {
|
||||||
VCloudDirectorClient client = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = orderedRequestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId)
|
.apiCommand("GET", vmId)
|
||||||
.acceptMedia(VCloudDirectorMediaType.VM)
|
.acceptMedia(VCloudDirectorMediaType.VM)
|
||||||
|
@ -86,12 +86,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Vm expected = getVm();
|
Vm expected = getVm();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getVm(vmURI), expected);
|
assertEquals(api.getVmApi().getVm(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVm() {
|
public void testModifyVm() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId)
|
.apiCommand("PUT", vmId)
|
||||||
.xmlFilePayload("/vm/modifyVm.xml", VCloudDirectorMediaType.VM)
|
.xmlFilePayload("/vm/modifyVm.xml", VCloudDirectorMediaType.VM)
|
||||||
|
@ -107,12 +107,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyVmTask();
|
Task expected = modifyVmTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyVm(vmURI, modified), expected);
|
assertEquals(api.getVmApi().modifyVm(vmURI, modified), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testDeleteVm() {
|
public void testDeleteVm() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("DELETE", vmId)
|
.apiCommand("DELETE", vmId)
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -123,12 +123,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = deleteVmTask();
|
Task expected = deleteVmTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().deleteVm(vmURI), expected);
|
assertEquals(api.getVmApi().deleteVm(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testConsolidateVm() {
|
public void testConsolidateVm() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/action/consolidate")
|
.apiCommand("POST", vmId + "/action/consolidate")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -139,12 +139,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = consolidateVmTask();
|
Task expected = consolidateVmTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().consolidateVm(vmURI), expected);
|
assertEquals(api.getVmApi().consolidateVm(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testDeploy() {
|
public void testDeploy() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/action/deploy")
|
.apiCommand("POST", vmId + "/action/deploy")
|
||||||
.xmlFilePayload("/vm/deployParams.xml", VCloudDirectorMediaType.DEPLOY_VAPP_PARAMS)
|
.xmlFilePayload("/vm/deployParams.xml", VCloudDirectorMediaType.DEPLOY_VAPP_PARAMS)
|
||||||
|
@ -159,12 +159,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = deployTask();
|
Task expected = deployTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().deploy(vmURI, params), expected);
|
assertEquals(api.getVmApi().deploy(vmURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testDiscardSuspendedState() {
|
public void testDiscardSuspendedState() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/action/discardSuspendedState")
|
.apiCommand("POST", vmId + "/action/discardSuspendedState")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -175,12 +175,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = discardSuspendedStateTask();
|
Task expected = discardSuspendedStateTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().discardSuspendedState(vmURI), expected);
|
assertEquals(api.getVmApi().discardSuspendedState(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testInstallVMwareTools() {
|
public void testInstallVMwareTools() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/action/installVMwareTools")
|
.apiCommand("POST", vmId + "/action/installVMwareTools")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -191,12 +191,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = installVMwareToolsTask();
|
Task expected = installVMwareToolsTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().installVMwareTools(vmURI), expected);
|
assertEquals(api.getVmApi().installVMwareTools(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testRelocate() {
|
public void testRelocate() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/action/relocate")
|
.apiCommand("POST", vmId + "/action/relocate")
|
||||||
.xmlFilePayload("/vApp/relocateParams.xml", VCloudDirectorMediaType.RELOCATE_VM_PARAMS)
|
.xmlFilePayload("/vApp/relocateParams.xml", VCloudDirectorMediaType.RELOCATE_VM_PARAMS)
|
||||||
|
@ -211,12 +211,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = relocateTask();
|
Task expected = relocateTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().relocateVm(vmURI, params), expected);
|
assertEquals(api.getVmApi().relocateVm(vmURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUndeploy() {
|
public void testUndeploy() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/action/undeploy")
|
.apiCommand("POST", vmId + "/action/undeploy")
|
||||||
.xmlFilePayload("/vApp/undeployParams.xml", VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS)
|
.xmlFilePayload("/vApp/undeployParams.xml", VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS)
|
||||||
|
@ -231,12 +231,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = undeployTask();
|
Task expected = undeployTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().undeploy(vmURI, params), expected);
|
assertEquals(api.getVmApi().undeploy(vmURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUpgradeHardwareVersion() {
|
public void testUpgradeHardwareVersion() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/action/upgradeHardwareVersion")
|
.apiCommand("POST", vmId + "/action/upgradeHardwareVersion")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -247,12 +247,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = upgradeHardwareVersionTask();
|
Task expected = upgradeHardwareVersionTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().upgradeHardwareVersion(vmURI), expected);
|
assertEquals(api.getVmApi().upgradeHardwareVersion(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testPowerOff() {
|
public void testPowerOff() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/power/action/powerOff")
|
.apiCommand("POST", vmId + "/power/action/powerOff")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -263,12 +263,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = powerOffTask();
|
Task expected = powerOffTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().powerOff(vmURI), expected);
|
assertEquals(api.getVmApi().powerOff(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testPowerOn() {
|
public void testPowerOn() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/power/action/powerOn")
|
.apiCommand("POST", vmId + "/power/action/powerOn")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -279,12 +279,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = powerOnTask();
|
Task expected = powerOnTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().powerOn(vmURI), expected);
|
assertEquals(api.getVmApi().powerOn(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testReboot() {
|
public void testReboot() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/power/action/reboot")
|
.apiCommand("POST", vmId + "/power/action/reboot")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -295,12 +295,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = rebootTask();
|
Task expected = rebootTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().reboot(vmURI), expected);
|
assertEquals(api.getVmApi().reboot(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testReset() {
|
public void testReset() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/power/action/reset")
|
.apiCommand("POST", vmId + "/power/action/reset")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -311,12 +311,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = resetTask();
|
Task expected = resetTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().reset(vmURI), expected);
|
assertEquals(api.getVmApi().reset(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testShutdown() {
|
public void testShutdown() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/power/action/shutdown")
|
.apiCommand("POST", vmId + "/power/action/shutdown")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -327,12 +327,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = shutdownTask();
|
Task expected = shutdownTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().shutdown(vmURI), expected);
|
assertEquals(api.getVmApi().shutdown(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testSuspend() {
|
public void testSuspend() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/power/action/suspend")
|
.apiCommand("POST", vmId + "/power/action/suspend")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -343,12 +343,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = suspendTask();
|
Task expected = suspendTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().suspend(vmURI), expected);
|
assertEquals(api.getVmApi().suspend(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetGuestCustomizationSection() {
|
public void testGetGuestCustomizationSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/guestCustomizationSection")
|
.apiCommand("GET", vmId + "/guestCustomizationSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -359,12 +359,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
GuestCustomizationSection expected = getGuestCustomizationSection();
|
GuestCustomizationSection expected = getGuestCustomizationSection();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getGuestCustomizationSection(vmURI), expected);
|
assertEquals(api.getVmApi().getGuestCustomizationSection(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyGuestCustomizationSection() {
|
public void testModifyGuestCustomizationSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/guestCustomizationSection")
|
.apiCommand("PUT", vmId + "/guestCustomizationSection")
|
||||||
.xmlFilePayload("/vApp/modifyGuestCustomizationSection.xml", VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION)
|
.xmlFilePayload("/vApp/modifyGuestCustomizationSection.xml", VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION)
|
||||||
|
@ -379,12 +379,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyGuestCustomizationSectionTask();
|
Task expected = modifyGuestCustomizationSectionTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyGuestCustomizationSection(vmURI, section), expected);
|
assertEquals(api.getVmApi().modifyGuestCustomizationSection(vmURI, section), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testEjectMedia() {
|
public void testEjectMedia() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/media/action/ejectMedia")
|
.apiCommand("PUT", vmId + "/media/action/ejectMedia")
|
||||||
.xmlFilePayload("/vApp/ejectMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
|
.xmlFilePayload("/vApp/ejectMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
|
||||||
|
@ -399,12 +399,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = ejectMediaTask();
|
Task expected = ejectMediaTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().ejectMedia(vmURI, params), expected);
|
assertEquals(api.getVmApi().ejectMedia(vmURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testInsertMedia() {
|
public void testInsertMedia() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/media/action/insertMedia")
|
.apiCommand("PUT", vmId + "/media/action/insertMedia")
|
||||||
.xmlFilePayload("/vApp/insertMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
|
.xmlFilePayload("/vApp/insertMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
|
||||||
|
@ -419,12 +419,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = insertMediaTask();
|
Task expected = insertMediaTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().insertMedia(vmURI, params), expected);
|
assertEquals(api.getVmApi().insertMedia(vmURI, params), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetNetworkConnectionSection() {
|
public void testGetNetworkConnectionSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/networkConnectionSection")
|
.apiCommand("GET", vmId + "/networkConnectionSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -435,12 +435,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
NetworkConnectionSection expected = getNetworkConnectionSection();
|
NetworkConnectionSection expected = getNetworkConnectionSection();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getNetworkConnectionSection(vmURI), expected);
|
assertEquals(api.getVmApi().getNetworkConnectionSection(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyNetworkConnectionSection() {
|
public void testModifyNetworkConnectionSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/networkConnectionSection")
|
.apiCommand("PUT", vmId + "/networkConnectionSection")
|
||||||
.xmlFilePayload("/vApp/modifyNetworkConnectionSection.xml", VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION)
|
.xmlFilePayload("/vApp/modifyNetworkConnectionSection.xml", VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION)
|
||||||
|
@ -455,12 +455,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyNetworkConnectionSectionTask();
|
Task expected = modifyNetworkConnectionSectionTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyNetworkConnectionSection(vmURI, section), expected);
|
assertEquals(api.getVmApi().modifyNetworkConnectionSection(vmURI, section), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetOperatingSystemSection() {
|
public void testGetOperatingSystemSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/operatingSystemSection")
|
.apiCommand("GET", vmId + "/operatingSystemSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -471,12 +471,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
OperatingSystemSection expected = getOperatingSystemSection();
|
OperatingSystemSection expected = getOperatingSystemSection();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getOperatingSystemSection(vmURI), expected);
|
assertEquals(api.getVmApi().getOperatingSystemSection(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyOperatingSystemSection() {
|
public void testModifyOperatingSystemSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/operatingSystemSection")
|
.apiCommand("PUT", vmId + "/operatingSystemSection")
|
||||||
.xmlFilePayload("/vApp/modifyOperatingSystemSection.xml", VCloudDirectorMediaType.OPERATING_SYSTEM_SECTION)
|
.xmlFilePayload("/vApp/modifyOperatingSystemSection.xml", VCloudDirectorMediaType.OPERATING_SYSTEM_SECTION)
|
||||||
|
@ -491,12 +491,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyOperatingSystemSectionTask();
|
Task expected = modifyOperatingSystemSectionTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyOperatingSystemSection(vmURI, section), expected);
|
assertEquals(api.getVmApi().modifyOperatingSystemSection(vmURI, section), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetProductSections() {
|
public void testGetProductSections() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/productSections")
|
.apiCommand("GET", vmId + "/productSections")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -507,12 +507,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
ProductSectionList expected = getProductSections();
|
ProductSectionList expected = getProductSections();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getProductSections(vmURI), expected);
|
assertEquals(api.getVmApi().getProductSections(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyProductSections() {
|
public void testModifyProductSections() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/productSections")
|
.apiCommand("PUT", vmId + "/productSections")
|
||||||
.xmlFilePayload("/vApp/modifyProductSections.xml", VCloudDirectorMediaType.PRODUCT_SECTION_LIST)
|
.xmlFilePayload("/vApp/modifyProductSections.xml", VCloudDirectorMediaType.PRODUCT_SECTION_LIST)
|
||||||
|
@ -524,12 +524,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyProductSectionsTask();
|
Task expected = modifyProductSectionsTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyProductSections(vmURI, null), expected);
|
assertEquals(api.getVmApi().modifyProductSections(vmURI, null), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetPendingQuestion() {
|
public void testGetPendingQuestion() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/question")
|
.apiCommand("GET", vmId + "/question")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -540,12 +540,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
VmPendingQuestion expected = getPendingQuestion();
|
VmPendingQuestion expected = getPendingQuestion();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getPendingQuestion(vmURI), expected);
|
assertEquals(api.getVmApi().getPendingQuestion(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testAnswerQuestion() {
|
public void testAnswerQuestion() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/question/action/answer")
|
.apiCommand("PUT", vmId + "/question/action/answer")
|
||||||
.xmlFilePayload("/vApp/answerQuestion.xml", VCloudDirectorMediaType.VM_PENDING_ANSWER)
|
.xmlFilePayload("/vApp/answerQuestion.xml", VCloudDirectorMediaType.VM_PENDING_ANSWER)
|
||||||
|
@ -557,12 +557,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
VmQuestionAnswer answer = null; // = VmQuestionAnswer.builder();
|
VmQuestionAnswer answer = null; // = VmQuestionAnswer.builder();
|
||||||
// .build;
|
// .build;
|
||||||
|
|
||||||
client.getVmClient().answerQuestion(vmURI, answer);
|
api.getVmApi().answerQuestion(vmURI, answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetRuntimeInfoSection() {
|
public void testGetRuntimeInfoSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/runtimeInfoSection")
|
.apiCommand("GET", vmId + "/runtimeInfoSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -573,12 +573,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
RuntimeInfoSection expected = getRuntimeInfoSection();
|
RuntimeInfoSection expected = getRuntimeInfoSection();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getRuntimeInfoSection(vmURI), expected);
|
assertEquals(api.getVmApi().getRuntimeInfoSection(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetScreenImage() {
|
public void testGetScreenImage() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/screen")
|
.apiCommand("GET", vmId + "/screen")
|
||||||
.acceptMedia(VCloudDirectorMediaType.ANY_IMAGE)
|
.acceptMedia(VCloudDirectorMediaType.ANY_IMAGE)
|
||||||
|
@ -591,12 +591,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
byte[] expected = getScreenImage();
|
byte[] expected = getScreenImage();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getScreenImage(vmURI), expected);
|
assertEquals(api.getVmApi().getScreenImage(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetScreenTicket() {
|
public void testGetScreenTicket() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", vmId + "/screen/action/acquireTicket")
|
.apiCommand("POST", vmId + "/screen/action/acquireTicket")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -607,12 +607,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
ScreenTicket expected = getScreenTicket();
|
ScreenTicket expected = getScreenTicket();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getScreenTicket(vmURI), expected);
|
assertEquals(api.getVmApi().getScreenTicket(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSection() {
|
public void testGetVirtualHardwareSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/virtualHardwareSection")
|
.apiCommand("GET", vmId + "/virtualHardwareSection")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -623,12 +623,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
VirtualHardwareSection expected = getVirtualHardwareSection();
|
VirtualHardwareSection expected = getVirtualHardwareSection();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getVirtualHardwareSection(vmURI), expected);
|
assertEquals(api.getVmApi().getVirtualHardwareSection(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSection() {
|
public void testModifyVirtualHardwareSection() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/virtualHardwareSection")
|
.apiCommand("PUT", vmId + "/virtualHardwareSection")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSection.xml", VCloudDirectorMediaType.VIRTUAL_HARDWARE_SECTION)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSection.xml", VCloudDirectorMediaType.VIRTUAL_HARDWARE_SECTION)
|
||||||
|
@ -643,12 +643,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyVirtualHardwareSectionTask();
|
Task expected = modifyVirtualHardwareSectionTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyVirtualHardwareSection(vmURI, section), expected);
|
assertEquals(api.getVmApi().modifyVirtualHardwareSection(vmURI, section), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionCpu() {
|
public void testGetVirtualHardwareSectionCpu() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/virtualHardwareSection/cpu")
|
.apiCommand("GET", vmId + "/virtualHardwareSection/cpu")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -659,12 +659,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
RasdItem expected = getVirtualHardwareSectionCpu();
|
RasdItem expected = getVirtualHardwareSectionCpu();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getVirtualHardwareSectionCpu(vmURI), expected);
|
assertEquals(api.getVmApi().getVirtualHardwareSectionCpu(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSectionCpu() {
|
public void testModifyVirtualHardwareSectionCpu() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("", vmId + "/virtualHardwareSection/cpu")
|
.apiCommand("", vmId + "/virtualHardwareSection/cpu")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionCpu.xml", VCloudDirectorMediaType.OVF_RASD_ITEM)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionCpu.xml", VCloudDirectorMediaType.OVF_RASD_ITEM)
|
||||||
|
@ -679,12 +679,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyVirtualHardwareSectionCpuTask();
|
Task expected = modifyVirtualHardwareSectionCpuTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyVirtualHardwareSectionCpu(vmURI, cpu), expected);
|
assertEquals(api.getVmApi().modifyVirtualHardwareSectionCpu(vmURI, cpu), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionDisks() {
|
public void testGetVirtualHardwareSectionDisks() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/virtualHardwareSection/disks")
|
.apiCommand("GET", vmId + "/virtualHardwareSection/disks")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -695,12 +695,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
RasdItemsList expected = getVirtualHardwareSectionDisks();
|
RasdItemsList expected = getVirtualHardwareSectionDisks();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getVirtualHardwareSectionDisks(vmURI), expected);
|
assertEquals(api.getVmApi().getVirtualHardwareSectionDisks(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSectionDisks() {
|
public void testModifyVirtualHardwareSectionDisks() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/virtualHardwareSection/disks")
|
.apiCommand("PUT", vmId + "/virtualHardwareSection/disks")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionDisks.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionDisks.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
||||||
|
@ -715,12 +715,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyVirtualHardwareSectionDisksTask();
|
Task expected = modifyVirtualHardwareSectionDisksTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyVirtualHardwareSectionDisks(vmURI, disks), expected);
|
assertEquals(api.getVmApi().modifyVirtualHardwareSectionDisks(vmURI, disks), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionMedia() {
|
public void testGetVirtualHardwareSectionMedia() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/virtualHardwareSection/media")
|
.apiCommand("GET", vmId + "/virtualHardwareSection/media")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -731,12 +731,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
RasdItemsList expected = getVirtualHardwareSectionMedia();
|
RasdItemsList expected = getVirtualHardwareSectionMedia();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getVirtualHardwareSectionMedia(vmURI), expected);
|
assertEquals(api.getVmApi().getVirtualHardwareSectionMedia(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionMemory() {
|
public void testGetVirtualHardwareSectionMemory() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/virtualHardwareSection/memory")
|
.apiCommand("GET", vmId + "/virtualHardwareSection/memory")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -747,12 +747,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
RasdItem expected = getVirtualHardwareSectionMemory();
|
RasdItem expected = getVirtualHardwareSectionMemory();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getVirtualHardwareSectionMemory(vmURI), expected);
|
assertEquals(api.getVmApi().getVirtualHardwareSectionMemory(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSectionMemory() {
|
public void testModifyVirtualHardwareSectionMemory() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/virtualHardwareSection/memory")
|
.apiCommand("PUT", vmId + "/virtualHardwareSection/memory")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionMemory.xml", VCloudDirectorMediaType.VAPP)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionMemory.xml", VCloudDirectorMediaType.VAPP)
|
||||||
|
@ -767,12 +767,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyVirtualHardwareSectionMemoryTask();
|
Task expected = modifyVirtualHardwareSectionMemoryTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyVirtualHardwareSectionMemory(vmURI, memory), expected);
|
assertEquals(api.getVmApi().modifyVirtualHardwareSectionMemory(vmURI, memory), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionNetworkCards() {
|
public void testGetVirtualHardwareSectionNetworkCards() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/virtualHardwareSection/networkCards")
|
.apiCommand("GET", vmId + "/virtualHardwareSection/networkCards")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -783,12 +783,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
RasdItemsList expected = getVirtualHardwareSectionNetworkCards();
|
RasdItemsList expected = getVirtualHardwareSectionNetworkCards();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getVirtualHardwareSectionNetworkCards(vmURI), expected);
|
assertEquals(api.getVmApi().getVirtualHardwareSectionNetworkCards(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSectionNetworkCards() {
|
public void testModifyVirtualHardwareSectionNetworkCards() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/virtualHardwareSection/networkCards")
|
.apiCommand("PUT", vmId + "/virtualHardwareSection/networkCards")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionNetworkCards.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionNetworkCards.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
||||||
|
@ -803,12 +803,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyVirtualHardwareSectionNetworkCardsTask();
|
Task expected = modifyVirtualHardwareSectionNetworkCardsTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyVirtualHardwareSectionNetworkCards(vmURI, networkCards), expected);
|
assertEquals(api.getVmApi().modifyVirtualHardwareSectionNetworkCards(vmURI, networkCards), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVirtualHardwareSectionSerialPorts() {
|
public void testGetVirtualHardwareSectionSerialPorts() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", vmId + "/virtualHardwareSection/serialPorts")
|
.apiCommand("GET", vmId + "/virtualHardwareSection/serialPorts")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -819,12 +819,12 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
RasdItemsList expected = getVirtualHardwareSectionSerialPorts();
|
RasdItemsList expected = getVirtualHardwareSectionSerialPorts();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().getVirtualHardwareSectionSerialPorts(vmURI), expected);
|
assertEquals(api.getVmApi().getVirtualHardwareSectionSerialPorts(vmURI), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testModifyVirtualHardwareSectionSerialPorts() {
|
public void testModifyVirtualHardwareSectionSerialPorts() {
|
||||||
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", vmId + "/virtualHardwareSection/serialPorts")
|
.apiCommand("PUT", vmId + "/virtualHardwareSection/serialPorts")
|
||||||
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionSerialPorts.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
.xmlFilePayload("/vApp/modifyVirtualHardwareSectionSerialPorts.xml", VCloudDirectorMediaType.OVF_RASD_ITEMS_LIST)
|
||||||
|
@ -839,7 +839,7 @@ public class VmClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
||||||
|
|
||||||
Task expected = modifyVirtualHardwareSectionSerialPortsTask();
|
Task expected = modifyVirtualHardwareSectionSerialPortsTask();
|
||||||
|
|
||||||
assertEquals(client.getVmClient().modifyVirtualHardwareSectionSerialPorts(vmURI, serialPorts), expected);
|
assertEquals(api.getVmApi().modifyVirtualHardwareSectionSerialPorts(vmURI, serialPorts), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vm getVm() {
|
public static Vm getVm() {
|
|
@ -64,7 +64,7 @@ import org.jclouds.dmtf.cim.ResourceAllocationSettingData;
|
||||||
import org.jclouds.dmtf.ovf.MsgType;
|
import org.jclouds.dmtf.ovf.MsgType;
|
||||||
import org.jclouds.dmtf.ovf.ProductSection;
|
import org.jclouds.dmtf.ovf.ProductSection;
|
||||||
import org.jclouds.io.Payloads;
|
import org.jclouds.io.Payloads;
|
||||||
import org.jclouds.vcloud.director.v1_5.AbstractVAppClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.AbstractVAppApiLiveTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Checks;
|
import org.jclouds.vcloud.director.v1_5.domain.Checks;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
|
@ -108,12 +108,12 @@ import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests behavior of the {@link VmClient}.
|
* Tests behavior of the {@link VmApi}.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VmClientLiveTest")
|
@Test(groups = { "live", "user" }, singleThreaded = true, testName = "VmApiLiveTest")
|
||||||
public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
public class VmApiLiveTest extends AbstractVAppApiLiveTest {
|
||||||
|
|
||||||
private MetadataValue metadataValue;
|
private MetadataValue metadataValue;
|
||||||
private String key;
|
private String key;
|
||||||
|
@ -121,9 +121,9 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
private boolean mediaCreated = false;
|
private boolean mediaCreated = false;
|
||||||
private boolean testUserCreated = false;
|
private boolean testUserCreated = false;
|
||||||
|
|
||||||
@BeforeClass(alwaysRun = true, dependsOnMethods = { "setupRequiredClients" })
|
@BeforeClass(alwaysRun = true, dependsOnMethods = { "setupRequiredApis" })
|
||||||
protected void setupRequiredEntities() {
|
protected void setupRequiredEntities() {
|
||||||
Set<Link> links = vdcClient.getVdc(vdcURI).getLinks();
|
Set<Link> links = vdcApi.getVdc(vdcURI).getLinks();
|
||||||
|
|
||||||
if (mediaURI == null) {
|
if (mediaURI == null) {
|
||||||
Predicate<Link> addMediaLink = and(relEquals(Link.Rel.ADD), typeEquals(VCloudDirectorMediaType.MEDIA));
|
Predicate<Link> addMediaLink = and(relEquals(Link.Rel.ADD), typeEquals(VCloudDirectorMediaType.MEDIA));
|
||||||
|
@ -137,21 +137,21 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.name(name("media"))
|
.name(name("media"))
|
||||||
.size(iso.length)
|
.size(iso.length)
|
||||||
.imageType(Media.ImageType.ISO)
|
.imageType(Media.ImageType.ISO)
|
||||||
.description("Test media generated by VmClientLiveTest")
|
.description("Test media generated by VmApiLiveTest")
|
||||||
.build();
|
.build();
|
||||||
Media media = context.getApi().getMediaClient().createMedia(addMedia.getHref(), sourceMedia);
|
Media media = context.getApi().getMediaApi().createMedia(addMedia.getHref(), sourceMedia);
|
||||||
|
|
||||||
Link uploadLink = getFirst(getFirst(media.getFiles(), null).getLinks(), null);
|
Link uploadLink = getFirst(getFirst(media.getFiles(), null).getLinks(), null);
|
||||||
context.getApi().getUploadClient().upload(uploadLink.getHref(), Payloads.newByteArrayPayload(iso));
|
context.getApi().getUploadApi().upload(uploadLink.getHref(), Payloads.newByteArrayPayload(iso));
|
||||||
|
|
||||||
media = context.getApi().getMediaClient().getMedia(media.getHref());
|
media = context.getApi().getMediaApi().getMedia(media.getHref());
|
||||||
|
|
||||||
if (media.getTasks().size() == 1) {
|
if (media.getTasks().size() == 1) {
|
||||||
Task uploadTask = Iterables.getOnlyElement(media.getTasks());
|
Task uploadTask = Iterables.getOnlyElement(media.getTasks());
|
||||||
Checks.checkTask(uploadTask);
|
Checks.checkTask(uploadTask);
|
||||||
assertEquals(uploadTask.getStatus(), Task.Status.RUNNING);
|
assertEquals(uploadTask.getStatus(), Task.Status.RUNNING);
|
||||||
assertTrue(retryTaskSuccess.apply(uploadTask), String.format(TASK_COMPLETE_TIMELY, "uploadTask"));
|
assertTrue(retryTaskSuccess.apply(uploadTask), String.format(TASK_COMPLETE_TIMELY, "uploadTask"));
|
||||||
media = context.getApi().getMediaClient().getMedia(media.getHref());
|
media = context.getApi().getMediaApi().getMedia(media.getHref());
|
||||||
}
|
}
|
||||||
|
|
||||||
mediaURI = media.getHref();
|
mediaURI = media.getHref();
|
||||||
|
@ -161,7 +161,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
if (adminContext != null) {
|
if (adminContext != null) {
|
||||||
Link orgLink = find(links, and(relEquals("up"), typeEquals(VCloudDirectorMediaType.ORG)));
|
Link orgLink = find(links, and(relEquals("up"), typeEquals(VCloudDirectorMediaType.ORG)));
|
||||||
testUserURI = adminContext.getApi().getUserClient().createUser(toAdminUri(orgLink), randomTestUser("VAppAccessTest")).getHref();
|
testUserURI = adminContext.getApi().getUserApi().createUser(toAdminUri(orgLink), randomTestUser("VAppAccessTest")).getHref();
|
||||||
} else {
|
} else {
|
||||||
testUserURI = userURI;
|
testUserURI = userURI;
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
public void cleanUp() {
|
public void cleanUp() {
|
||||||
if (adminContext != null && mediaCreated && mediaURI != null) {
|
if (adminContext != null && mediaCreated && mediaURI != null) {
|
||||||
try {
|
try {
|
||||||
Task delete = context.getApi().getMediaClient().deleteMedia(mediaURI);
|
Task delete = context.getApi().getMediaApi().deleteMedia(mediaURI);
|
||||||
taskDoneEventually(delete);
|
taskDoneEventually(delete);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn("Error when deleting media: %s", e.getMessage());
|
logger.warn("Error when deleting media: %s", e.getMessage());
|
||||||
|
@ -179,7 +179,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
}
|
}
|
||||||
if (adminContext != null && testUserCreated && testUserURI != null) {
|
if (adminContext != null && testUserCreated && testUserURI != null) {
|
||||||
try {
|
try {
|
||||||
adminContext.getApi().getUserClient().deleteUser(testUserURI);
|
adminContext.getApi().getUserApi().deleteUser(testUserURI);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn("Error when deleting user: %s", e.getMessage());
|
logger.warn("Error when deleting user: %s", e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -187,12 +187,12 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#getVm(URI)
|
* @see VmApi#getVm(URI)
|
||||||
*/
|
*/
|
||||||
@Test(description = "GET /vApp/{id}")
|
@Test(description = "GET /vApp/{id}")
|
||||||
public void testGetVm() {
|
public void testGetVm() {
|
||||||
// The method under test
|
// The method under test
|
||||||
vm = vmClient.getVm(vmURI);
|
vm = vmApi.getVm(vmURI);
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkVm(vm);
|
checkVm(vm);
|
||||||
|
@ -205,7 +205,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#modifyVm(URI, Vm)
|
* @see VmApi#modifyVm(URI, Vm)
|
||||||
*/
|
*/
|
||||||
@Test(description = "PUT /vApp/{id}", dependsOnMethods = { "testGetVm" })
|
@Test(description = "PUT /vApp/{id}", dependsOnMethods = { "testGetVm" })
|
||||||
public void testModifyVm() {
|
public void testModifyVm() {
|
||||||
|
@ -215,11 +215,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyVm = vmClient.modifyVm(vm.getHref(), newVm);
|
Task modifyVm = vmApi.modifyVm(vm.getHref(), newVm);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyVm), String.format(TASK_COMPLETE_TIMELY, "modifyVm"));
|
assertTrue(retryTaskSuccess.apply(modifyVm), String.format(TASK_COMPLETE_TIMELY, "modifyVm"));
|
||||||
|
|
||||||
// Get the updated Vm
|
// Get the updated Vm
|
||||||
vm = vmClient.getVm(vm.getHref());
|
vm = vmApi.getVm(vm.getHref());
|
||||||
|
|
||||||
// Check the required fields are set
|
// Check the required fields are set
|
||||||
assertEquals(vm.getName(), newVm.getName(), String.format(OBJ_FIELD_EQ, VM, "Name", newVm.getName(), vm.getName()));
|
assertEquals(vm.getName(), newVm.getName(), String.format(OBJ_FIELD_EQ, VM, "Name", newVm.getName(), vm.getName()));
|
||||||
|
@ -235,11 +235,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task deployVm = vmClient.deploy(vm.getHref(), params);
|
Task deployVm = vmApi.deploy(vm.getHref(), params);
|
||||||
assertTrue(retryTaskSuccessLong.apply(deployVm), String.format(TASK_COMPLETE_TIMELY, "deployVm"));
|
assertTrue(retryTaskSuccessLong.apply(deployVm), String.format(TASK_COMPLETE_TIMELY, "deployVm"));
|
||||||
|
|
||||||
// Get the updated Vm
|
// Get the updated Vm
|
||||||
vm = vmClient.getVm(vm.getHref());
|
vm = vmApi.getVm(vm.getHref());
|
||||||
|
|
||||||
// Check the required fields are set
|
// Check the required fields are set
|
||||||
assertTrue(vm.isDeployed(), String.format(OBJ_FIELD_EQ, VM, "deployed", "TRUE", vm.isDeployed().toString()));
|
assertTrue(vm.isDeployed(), String.format(OBJ_FIELD_EQ, VM, "deployed", "TRUE", vm.isDeployed().toString()));
|
||||||
|
@ -254,11 +254,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOffVm(vm.getHref());
|
vm = powerOffVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task powerOnVm = vmClient.powerOn(vm.getHref());
|
Task powerOnVm = vmApi.powerOn(vm.getHref());
|
||||||
assertTaskSucceedsLong(powerOnVm);
|
assertTaskSucceedsLong(powerOnVm);
|
||||||
|
|
||||||
// Get the updated Vm
|
// Get the updated Vm
|
||||||
vm = vmClient.getVm(vm.getHref());
|
vm = vmApi.getVm(vm.getHref());
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVmStatus(vm.getHref(), Status.POWERED_ON);
|
assertVmStatus(vm.getHref(), Status.POWERED_ON);
|
||||||
|
@ -270,11 +270,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOnVm(vm.getHref());
|
vm = powerOnVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task reboot = vmClient.reboot(vm.getHref());
|
Task reboot = vmApi.reboot(vm.getHref());
|
||||||
assertTaskSucceedsLong(reboot);
|
assertTaskSucceedsLong(reboot);
|
||||||
|
|
||||||
// Get the updated Vm
|
// Get the updated Vm
|
||||||
vm = vmClient.getVm(vm.getHref());
|
vm = vmApi.getVm(vm.getHref());
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVmStatus(vmURI, Status.POWERED_OFF);
|
assertVmStatus(vmURI, Status.POWERED_OFF);
|
||||||
|
@ -286,11 +286,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOnVm(vm.getHref());
|
vm = powerOnVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task shutdown = vmClient.shutdown(vmURI);
|
Task shutdown = vmApi.shutdown(vmURI);
|
||||||
assertTaskSucceedsLong(shutdown);
|
assertTaskSucceedsLong(shutdown);
|
||||||
|
|
||||||
// Get the updated Vm
|
// Get the updated Vm
|
||||||
vm = vmClient.getVm(vmURI);
|
vm = vmApi.getVm(vmURI);
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVmStatus(vmURI, Status.POWERED_OFF);
|
assertVmStatus(vmURI, Status.POWERED_OFF);
|
||||||
|
@ -305,11 +305,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOnVm(vm.getHref());
|
vm = powerOnVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task suspend = vmClient.suspend(vmURI);
|
Task suspend = vmApi.suspend(vmURI);
|
||||||
assertTaskSucceedsLong(suspend);
|
assertTaskSucceedsLong(suspend);
|
||||||
|
|
||||||
// Get the updated Vm
|
// Get the updated Vm
|
||||||
vm = vmClient.getVm(vm.getHref());
|
vm = vmApi.getVm(vm.getHref());
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVmStatus(vmURI, Status.SUSPENDED);
|
assertVmStatus(vmURI, Status.SUSPENDED);
|
||||||
|
@ -324,11 +324,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOnVm(vm.getHref());
|
vm = powerOnVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task reset = vmClient.reset(vmURI);
|
Task reset = vmApi.reset(vmURI);
|
||||||
assertTaskSucceedsLong(reset);
|
assertTaskSucceedsLong(reset);
|
||||||
|
|
||||||
// Get the updated Vm
|
// Get the updated Vm
|
||||||
vm = vmClient.getVm(vm.getHref());
|
vm = vmApi.getVm(vm.getHref());
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVmStatus(vmURI, Status.POWERED_ON);
|
assertVmStatus(vmURI, Status.POWERED_ON);
|
||||||
|
@ -342,11 +342,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
UndeployVAppParams params = UndeployVAppParams.builder().build();
|
UndeployVAppParams params = UndeployVAppParams.builder().build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task undeploy = vmClient.undeploy(vm.getHref(), params);
|
Task undeploy = vmApi.undeploy(vm.getHref(), params);
|
||||||
assertTrue(retryTaskSuccess.apply(undeploy), String.format(TASK_COMPLETE_TIMELY, "undeploy"));
|
assertTrue(retryTaskSuccess.apply(undeploy), String.format(TASK_COMPLETE_TIMELY, "undeploy"));
|
||||||
|
|
||||||
// Get the updated Vm
|
// Get the updated Vm
|
||||||
vm = vmClient.getVm(vm.getHref());
|
vm = vmApi.getVm(vm.getHref());
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertFalse(vm.isDeployed(), String.format(OBJ_FIELD_EQ, VM, "deployed", "FALSE", vm.isDeployed().toString()));
|
assertFalse(vm.isDeployed(), String.format(OBJ_FIELD_EQ, VM, "deployed", "FALSE", vm.isDeployed().toString()));
|
||||||
|
@ -359,11 +359,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOnVm(vm.getHref());
|
vm = powerOnVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task powerOffVm = vmClient.powerOff(vm.getHref());
|
Task powerOffVm = vmApi.powerOff(vm.getHref());
|
||||||
assertTrue(retryTaskSuccess.apply(powerOffVm), String.format(TASK_COMPLETE_TIMELY, "powerOffVm"));
|
assertTrue(retryTaskSuccess.apply(powerOffVm), String.format(TASK_COMPLETE_TIMELY, "powerOffVm"));
|
||||||
|
|
||||||
// Get the updated Vm
|
// Get the updated Vm
|
||||||
vm = vmClient.getVm(vmURI);
|
vm = vmApi.getVm(vmURI);
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
assertVmStatus(vmURI, Status.POWERED_OFF);
|
assertVmStatus(vmURI, Status.POWERED_OFF);
|
||||||
|
@ -375,7 +375,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOnVm(vm.getHref());
|
vm = powerOnVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task consolidateVm = vmClient.consolidateVm(vm.getHref());
|
Task consolidateVm = vmApi.consolidateVm(vm.getHref());
|
||||||
assertTrue(retryTaskSuccess.apply(consolidateVm), String.format(TASK_COMPLETE_TIMELY, "consolidateVm"));
|
assertTrue(retryTaskSuccess.apply(consolidateVm), String.format(TASK_COMPLETE_TIMELY, "consolidateVm"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = suspendVm(vm.getHref());
|
vm = suspendVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task discardSuspendedState = vmClient.discardSuspendedState(vm.getHref());
|
Task discardSuspendedState = vmApi.discardSuspendedState(vm.getHref());
|
||||||
assertTrue(retryTaskSuccess.apply(discardSuspendedState), String.format(TASK_COMPLETE_TIMELY, "discardSuspendedState"));
|
assertTrue(retryTaskSuccess.apply(discardSuspendedState), String.format(TASK_COMPLETE_TIMELY, "discardSuspendedState"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOnVm(vm.getHref());
|
vm = powerOnVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task installVMwareTools = vmClient.installVMwareTools(vm.getHref());
|
Task installVMwareTools = vmApi.installVMwareTools(vm.getHref());
|
||||||
assertTrue(retryTaskSuccess.apply(installVMwareTools), String.format(TASK_COMPLETE_TIMELY, "installVMwareTools"));
|
assertTrue(retryTaskSuccess.apply(installVMwareTools), String.format(TASK_COMPLETE_TIMELY, "installVMwareTools"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,12 +403,12 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "POST /vApp/{id}/action/relocate", dependsOnMethods = { "testGetVm" })
|
@Test(description = "POST /vApp/{id}/action/relocate", dependsOnMethods = { "testGetVm" })
|
||||||
public void testRelocate() {
|
public void testRelocate() {
|
||||||
// Relocate to the last of the available datastores
|
// Relocate to the last of the available datastores
|
||||||
QueryResultRecords records = context.getApi().getQueryClient().queryAll("datastore");
|
QueryResultRecords records = context.getApi().getQueryApi().queryAll("datastore");
|
||||||
QueryResultRecordType datastore = Iterables.getLast(records.getRecords());
|
QueryResultRecordType datastore = Iterables.getLast(records.getRecords());
|
||||||
RelocateParams params = RelocateParams.builder().datastore(Reference.builder().href(datastore.getHref()).build()).build();
|
RelocateParams params = RelocateParams.builder().datastore(Reference.builder().href(datastore.getHref()).build()).build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task relocate = vmClient.relocateVm(vm.getHref(), params);
|
Task relocate = vmApi.relocateVm(vm.getHref(), params);
|
||||||
assertTrue(retryTaskSuccess.apply(relocate), String.format(TASK_COMPLETE_TIMELY, "relocate"));
|
assertTrue(retryTaskSuccess.apply(relocate), String.format(TASK_COMPLETE_TIMELY, "relocate"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOffVm(vm.getHref());
|
vm = powerOffVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task upgradeHardwareVersion = vmClient.upgradeHardwareVersion(vm.getHref());
|
Task upgradeHardwareVersion = vmApi.upgradeHardwareVersion(vm.getHref());
|
||||||
assertTrue(retryTaskSuccess.apply(upgradeHardwareVersion), String.format(TASK_COMPLETE_TIMELY, "upgradeHardwareVersion"));
|
assertTrue(retryTaskSuccess.apply(upgradeHardwareVersion), String.format(TASK_COMPLETE_TIMELY, "upgradeHardwareVersion"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
getGuestCustomizationSection(new Function<URI, GuestCustomizationSection>() {
|
getGuestCustomizationSection(new Function<URI, GuestCustomizationSection>() {
|
||||||
@Override
|
@Override
|
||||||
public GuestCustomizationSection apply(URI uri) {
|
public GuestCustomizationSection apply(URI uri) {
|
||||||
return vmClient.getGuestCustomizationSection(uri);
|
return vmApi.getGuestCustomizationSection(uri);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "PUT /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetGuestCustomizationSection" })
|
@Test(description = "PUT /vApp/{id}/guestCustomizationSection", dependsOnMethods = { "testGetGuestCustomizationSection" })
|
||||||
public void testModifyGuestCustomizationSection() {
|
public void testModifyGuestCustomizationSection() {
|
||||||
// Copy existing section and update fields
|
// Copy existing section and update fields
|
||||||
GuestCustomizationSection oldSection = vmClient.getGuestCustomizationSection(vm.getHref());
|
GuestCustomizationSection oldSection = vmApi.getGuestCustomizationSection(vm.getHref());
|
||||||
GuestCustomizationSection newSection = oldSection.toBuilder()
|
GuestCustomizationSection newSection = oldSection.toBuilder()
|
||||||
.computerName(name("n"))
|
.computerName(name("n"))
|
||||||
.enabled(Boolean.FALSE)
|
.enabled(Boolean.FALSE)
|
||||||
|
@ -443,11 +443,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyGuestCustomizationSection = vmClient.modifyGuestCustomizationSection(vm.getHref(), newSection);
|
Task modifyGuestCustomizationSection = vmApi.modifyGuestCustomizationSection(vm.getHref(), newSection);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyGuestCustomizationSection), String.format(TASK_COMPLETE_TIMELY, "modifyGuestCustomizationSection"));
|
assertTrue(retryTaskSuccess.apply(modifyGuestCustomizationSection), String.format(TASK_COMPLETE_TIMELY, "modifyGuestCustomizationSection"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
GuestCustomizationSection modified = vmClient.getGuestCustomizationSection(vm.getHref());
|
GuestCustomizationSection modified = vmApi.getGuestCustomizationSection(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkGuestCustomizationSection(modified);
|
checkGuestCustomizationSection(modified);
|
||||||
|
@ -472,7 +472,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task insertMedia = vmClient.insertMedia(vm.getHref(), params);
|
Task insertMedia = vmApi.insertMedia(vm.getHref(), params);
|
||||||
assertTrue(retryTaskSuccess.apply(insertMedia), String.format(TASK_COMPLETE_TIMELY, "insertMedia"));
|
assertTrue(retryTaskSuccess.apply(insertMedia), String.format(TASK_COMPLETE_TIMELY, "insertMedia"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -484,7 +484,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task ejectMedia = vmClient.ejectMedia(vm.getHref(), params);
|
Task ejectMedia = vmApi.ejectMedia(vm.getHref(), params);
|
||||||
assertTrue(retryTaskSuccess.apply(ejectMedia), String.format(TASK_COMPLETE_TIMELY, "ejectMedia"));
|
assertTrue(retryTaskSuccess.apply(ejectMedia), String.format(TASK_COMPLETE_TIMELY, "ejectMedia"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
getNetworkConnectionSection(new Function<URI, NetworkConnectionSection>() {
|
getNetworkConnectionSection(new Function<URI, NetworkConnectionSection>() {
|
||||||
@Override
|
@Override
|
||||||
public NetworkConnectionSection apply(URI uri) {
|
public NetworkConnectionSection apply(URI uri) {
|
||||||
return vmClient.getNetworkConnectionSection(uri);
|
return vmApi.getNetworkConnectionSection(uri);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -506,7 +506,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
Reference network = Iterables.getLast(networks);
|
Reference network = Iterables.getLast(networks);
|
||||||
|
|
||||||
// Copy existing section and update fields
|
// Copy existing section and update fields
|
||||||
NetworkConnectionSection oldSection = vmClient.getNetworkConnectionSection(vm.getHref());
|
NetworkConnectionSection oldSection = vmApi.getNetworkConnectionSection(vm.getHref());
|
||||||
NetworkConnectionSection newSection = oldSection.toBuilder()
|
NetworkConnectionSection newSection = oldSection.toBuilder()
|
||||||
.networkConnection(NetworkConnection.builder()
|
.networkConnection(NetworkConnection.builder()
|
||||||
.ipAddressAllocationMode(IpAddressAllocationMode.DHCP.toString())
|
.ipAddressAllocationMode(IpAddressAllocationMode.DHCP.toString())
|
||||||
|
@ -515,11 +515,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyNetworkConnectionSection = vmClient.modifyNetworkConnectionSection(vm.getHref(), newSection);
|
Task modifyNetworkConnectionSection = vmApi.modifyNetworkConnectionSection(vm.getHref(), newSection);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyNetworkConnectionSection), String.format(TASK_COMPLETE_TIMELY, "modifyNetworkConnectionSection"));
|
assertTrue(retryTaskSuccess.apply(modifyNetworkConnectionSection), String.format(TASK_COMPLETE_TIMELY, "modifyNetworkConnectionSection"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
NetworkConnectionSection modified = vmClient.getNetworkConnectionSection(vm.getHref());
|
NetworkConnectionSection modified = vmApi.getNetworkConnectionSection(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkNetworkConnectionSection(modified);
|
checkNetworkConnectionSection(modified);
|
||||||
|
@ -534,7 +534,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/operatingSystemSection", dependsOnMethods = { "testGetVm" })
|
@Test(description = "GET /vApp/{id}/operatingSystemSection", dependsOnMethods = { "testGetVm" })
|
||||||
public void testGetOperatingSystemSection() {
|
public void testGetOperatingSystemSection() {
|
||||||
// The method under test
|
// The method under test
|
||||||
OperatingSystemSection section = vmClient.getOperatingSystemSection(vm.getHref());
|
OperatingSystemSection section = vmApi.getOperatingSystemSection(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkOperatingSystemSection(section);
|
checkOperatingSystemSection(section);
|
||||||
|
@ -550,11 +550,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyOperatingSystemSection = vmClient.modifyOperatingSystemSection(vm.getHref(), newSection);
|
Task modifyOperatingSystemSection = vmApi.modifyOperatingSystemSection(vm.getHref(), newSection);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyOperatingSystemSection), String.format(TASK_COMPLETE_TIMELY, "modifyOperatingSystemSection"));
|
assertTrue(retryTaskSuccess.apply(modifyOperatingSystemSection), String.format(TASK_COMPLETE_TIMELY, "modifyOperatingSystemSection"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
OperatingSystemSection modified = vmClient.getOperatingSystemSection(vm.getHref());
|
OperatingSystemSection modified = vmApi.getOperatingSystemSection(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkOperatingSystemSection(modified);
|
checkOperatingSystemSection(modified);
|
||||||
|
@ -566,7 +566,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/productSections", dependsOnMethods = { "testGetVm" })
|
@Test(description = "GET /vApp/{id}/productSections", dependsOnMethods = { "testGetVm" })
|
||||||
public void testGetProductSections() {
|
public void testGetProductSections() {
|
||||||
// The method under test
|
// The method under test
|
||||||
ProductSectionList sectionList = vmClient.getProductSections(vm.getHref());
|
ProductSectionList sectionList = vmApi.getProductSections(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkProductSectionList(sectionList);
|
checkProductSectionList(sectionList);
|
||||||
|
@ -575,7 +575,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "PUT /vApp/{id}/productSections", dependsOnMethods = { "testGetProductSections" })
|
@Test(description = "PUT /vApp/{id}/productSections", dependsOnMethods = { "testGetProductSections" })
|
||||||
public void testModifyProductSections() {
|
public void testModifyProductSections() {
|
||||||
// Copy existing section and update fields
|
// Copy existing section and update fields
|
||||||
ProductSectionList oldSections = vmClient.getProductSections(vm.getHref());
|
ProductSectionList oldSections = vmApi.getProductSections(vm.getHref());
|
||||||
ProductSectionList newSections = oldSections.toBuilder()
|
ProductSectionList newSections = oldSections.toBuilder()
|
||||||
.productSection(ProductSection.builder()
|
.productSection(ProductSection.builder()
|
||||||
.info("Information about the installed software") // Default ovf:Info text
|
.info("Information about the installed software") // Default ovf:Info text
|
||||||
|
@ -587,11 +587,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyProductSections = vmClient.modifyProductSections(vm.getHref(), newSections);
|
Task modifyProductSections = vmApi.modifyProductSections(vm.getHref(), newSections);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyProductSections), String.format(TASK_COMPLETE_TIMELY, "modifyProductSections"));
|
assertTrue(retryTaskSuccess.apply(modifyProductSections), String.format(TASK_COMPLETE_TIMELY, "modifyProductSections"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
ProductSectionList modified = vmClient.getProductSections(vm.getHref());
|
ProductSectionList modified = vmApi.getProductSections(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkProductSectionList(modified);
|
checkProductSectionList(modified);
|
||||||
|
@ -612,7 +612,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
// TODO how to test?
|
// TODO how to test?
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
VmPendingQuestion question = vmClient.getPendingQuestion(vm.getHref());
|
VmPendingQuestion question = vmApi.getPendingQuestion(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkVmPendingQuestion(question);
|
checkVmPendingQuestion(question);
|
||||||
|
@ -623,7 +623,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
// TODO check that the question has been answered (e.g. asking for getPendingQuestion does not
|
// TODO check that the question has been answered (e.g. asking for getPendingQuestion does not
|
||||||
// include our answered question).
|
// include our answered question).
|
||||||
|
|
||||||
VmPendingQuestion question = vmClient.getPendingQuestion(vm.getHref());
|
VmPendingQuestion question = vmApi.getPendingQuestion(vm.getHref());
|
||||||
List<VmQuestionAnswerChoice> answerChoices = question.getChoices();
|
List<VmQuestionAnswerChoice> answerChoices = question.getChoices();
|
||||||
VmQuestionAnswerChoice answerChoice = Iterables.getFirst(answerChoices, null);
|
VmQuestionAnswerChoice answerChoice = Iterables.getFirst(answerChoices, null);
|
||||||
assertNotNull(answerChoice, "Question "+question+" must have at least once answer-choice");
|
assertNotNull(answerChoice, "Question "+question+" must have at least once answer-choice");
|
||||||
|
@ -633,13 +633,13 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.questionId(question.getQuestionId())
|
.questionId(question.getQuestionId())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
vmClient.answerQuestion(vm.getHref(), answer);
|
vmApi.answerQuestion(vm.getHref(), answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /vApp/{id}/runtimeInfoSection", dependsOnMethods = { "testGetVm" })
|
@Test(description = "GET /vApp/{id}/runtimeInfoSection", dependsOnMethods = { "testGetVm" })
|
||||||
public void testGetRuntimeInfoSection() {
|
public void testGetRuntimeInfoSection() {
|
||||||
// The method under test
|
// The method under test
|
||||||
RuntimeInfoSection section = vmClient.getRuntimeInfoSection(vm.getHref());
|
RuntimeInfoSection section = vmApi.getRuntimeInfoSection(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkRuntimeInfoSection(section);
|
checkRuntimeInfoSection(section);
|
||||||
|
@ -652,7 +652,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOnVm(vm.getHref());
|
vm = powerOnVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
byte[] image = vmClient.getScreenImage(vm.getHref());
|
byte[] image = vmApi.getScreenImage(vm.getHref());
|
||||||
|
|
||||||
// Check returned bytes against PNG header magic number
|
// Check returned bytes against PNG header magic number
|
||||||
byte[] pngHeaderBytes = new byte[] { (byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A };
|
byte[] pngHeaderBytes = new byte[] { (byte) 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A };
|
||||||
|
@ -669,7 +669,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOnVm(vm.getHref());
|
vm = powerOnVm(vm.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
ScreenTicket ticket = vmClient.getScreenTicket(vm.getHref());
|
ScreenTicket ticket = vmApi.getScreenTicket(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkScreenTicket(ticket);
|
checkScreenTicket(ticket);
|
||||||
|
@ -678,7 +678,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/virtualHardwareSection", dependsOnMethods = { "testGetVm" })
|
@Test(description = "GET /vApp/{id}/virtualHardwareSection", dependsOnMethods = { "testGetVm" })
|
||||||
public void testGetVirtualHardwareSection() {
|
public void testGetVirtualHardwareSection() {
|
||||||
// Method under test
|
// Method under test
|
||||||
VirtualHardwareSection hardware = vmClient.getVirtualHardwareSection(vm.getHref());
|
VirtualHardwareSection hardware = vmApi.getVirtualHardwareSection(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkVirtualHardwareSection(hardware);
|
checkVirtualHardwareSection(hardware);
|
||||||
|
@ -690,7 +690,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
vm = powerOffVm(vm.getHref());
|
vm = powerOffVm(vm.getHref());
|
||||||
|
|
||||||
// Copy existing section and update fields
|
// Copy existing section and update fields
|
||||||
VirtualHardwareSection oldSection = vmClient.getVirtualHardwareSection(vm.getHref());
|
VirtualHardwareSection oldSection = vmApi.getVirtualHardwareSection(vm.getHref());
|
||||||
Set<? extends ResourceAllocationSettingData> oldItems = oldSection.getItems();
|
Set<? extends ResourceAllocationSettingData> oldItems = oldSection.getItems();
|
||||||
Set<ResourceAllocationSettingData> newItems = Sets.newLinkedHashSet(oldItems);
|
Set<ResourceAllocationSettingData> newItems = Sets.newLinkedHashSet(oldItems);
|
||||||
ResourceAllocationSettingData oldMemory = Iterables.find(oldItems, new Predicate<ResourceAllocationSettingData>() {
|
ResourceAllocationSettingData oldMemory = Iterables.find(oldItems, new Predicate<ResourceAllocationSettingData>() {
|
||||||
|
@ -710,11 +710,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task modifyVirtualHardwareSection = vmClient.modifyVirtualHardwareSection(vm.getHref(), newSection);
|
Task modifyVirtualHardwareSection = vmApi.modifyVirtualHardwareSection(vm.getHref(), newSection);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSection), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSection"));
|
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSection), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSection"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
VirtualHardwareSection modifiedSection = vmClient.getVirtualHardwareSection(vm.getHref());
|
VirtualHardwareSection modifiedSection = vmApi.getVirtualHardwareSection(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkVirtualHardwareSection(modifiedSection);
|
checkVirtualHardwareSection(modifiedSection);
|
||||||
|
@ -735,7 +735,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
@Test(description = "GET /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
||||||
public void testGetVirtualHardwareSectionCpu() {
|
public void testGetVirtualHardwareSectionCpu() {
|
||||||
// Method under test
|
// Method under test
|
||||||
RasdItem rasd = vmClient.getVirtualHardwareSectionCpu(vm.getHref());
|
RasdItem rasd = vmApi.getVirtualHardwareSectionCpu(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkResourceAllocationSettingData(rasd);
|
checkResourceAllocationSettingData(rasd);
|
||||||
|
@ -744,18 +744,18 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSectionCpu" })
|
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/cpu", dependsOnMethods = { "testGetVirtualHardwareSectionCpu" })
|
||||||
public void testModifyVirtualHardwareSectionCpu() {
|
public void testModifyVirtualHardwareSectionCpu() {
|
||||||
// Copy existing section and update fields
|
// Copy existing section and update fields
|
||||||
RasdItem oldItem = vmClient.getVirtualHardwareSectionCpu(vm.getHref());
|
RasdItem oldItem = vmApi.getVirtualHardwareSectionCpu(vm.getHref());
|
||||||
RasdItem newItem = oldItem.toBuilder()
|
RasdItem newItem = oldItem.toBuilder()
|
||||||
.elementName("2 virtual CPU(s)")
|
.elementName("2 virtual CPU(s)")
|
||||||
.virtualQuantity(new BigInteger("2"))
|
.virtualQuantity(new BigInteger("2"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Method under test
|
// Method under test
|
||||||
Task modifyVirtualHardwareSectionCpu = vmClient.modifyVirtualHardwareSectionCpu(vm.getHref(), newItem);
|
Task modifyVirtualHardwareSectionCpu = vmApi.modifyVirtualHardwareSectionCpu(vm.getHref(), newItem);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionCpu), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionCpu"));
|
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionCpu), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionCpu"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
RasdItem modified = vmClient.getVirtualHardwareSectionCpu(vm.getHref());
|
RasdItem modified = vmApi.getVirtualHardwareSectionCpu(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object
|
// Check the retrieved object
|
||||||
checkResourceAllocationSettingData(modified);
|
checkResourceAllocationSettingData(modified);
|
||||||
|
@ -769,7 +769,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
@Test(description = "GET /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
||||||
public void testGetVirtualHardwareSectionDisks() {
|
public void testGetVirtualHardwareSectionDisks() {
|
||||||
// Method under test
|
// Method under test
|
||||||
RasdItemsList rasdItems = vmClient.getVirtualHardwareSectionDisks(vm.getHref());
|
RasdItemsList rasdItems = vmApi.getVirtualHardwareSectionDisks(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkRasdItemsList(rasdItems);
|
checkRasdItemsList(rasdItems);
|
||||||
|
@ -778,15 +778,15 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSectionDisks" })
|
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/disks", dependsOnMethods = { "testGetVirtualHardwareSectionDisks" })
|
||||||
public void testModifyVirtualHardwareSectionDisks() {
|
public void testModifyVirtualHardwareSectionDisks() {
|
||||||
// Copy the existing items list and modify the name of an item
|
// Copy the existing items list and modify the name of an item
|
||||||
RasdItemsList oldSection = vmClient.getVirtualHardwareSectionDisks(vm.getHref());
|
RasdItemsList oldSection = vmApi.getVirtualHardwareSectionDisks(vm.getHref());
|
||||||
RasdItemsList newSection = oldSection.toBuilder().build();
|
RasdItemsList newSection = oldSection.toBuilder().build();
|
||||||
|
|
||||||
// Method under test
|
// Method under test
|
||||||
Task modifyVirtualHardwareSectionDisks = vmClient.modifyVirtualHardwareSectionDisks(vm.getHref(), newSection);
|
Task modifyVirtualHardwareSectionDisks = vmApi.modifyVirtualHardwareSectionDisks(vm.getHref(), newSection);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionDisks), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionDisks"));
|
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionDisks), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionDisks"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
RasdItemsList modified = vmClient.getVirtualHardwareSectionDisks(vm.getHref());
|
RasdItemsList modified = vmApi.getVirtualHardwareSectionDisks(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkRasdItemsList(modified);
|
checkRasdItemsList(modified);
|
||||||
|
@ -814,7 +814,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/virtualHardwareSection/media", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
@Test(description = "GET /vApp/{id}/virtualHardwareSection/media", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
||||||
public void testGetVirtualHardwareSectionMedia() {
|
public void testGetVirtualHardwareSectionMedia() {
|
||||||
// Method under test
|
// Method under test
|
||||||
RasdItemsList rasdItems = vmClient.getVirtualHardwareSectionMedia(vm.getHref());
|
RasdItemsList rasdItems = vmApi.getVirtualHardwareSectionMedia(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkRasdItemsList(rasdItems);
|
checkRasdItemsList(rasdItems);
|
||||||
|
@ -823,7 +823,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
@Test(description = "GET /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
||||||
public void testGetVirtualHardwareSectionMemory() {
|
public void testGetVirtualHardwareSectionMemory() {
|
||||||
// Method under test
|
// Method under test
|
||||||
RasdItem rasd = vmClient.getVirtualHardwareSectionCpu(vm.getHref());
|
RasdItem rasd = vmApi.getVirtualHardwareSectionCpu(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkResourceAllocationSettingData(rasd);
|
checkResourceAllocationSettingData(rasd);
|
||||||
|
@ -831,18 +831,18 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSectionMemory" })
|
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/memory", dependsOnMethods = { "testGetVirtualHardwareSectionMemory" })
|
||||||
public void testModifyVirtualHardwareSectionMemory() {
|
public void testModifyVirtualHardwareSectionMemory() {
|
||||||
RasdItem origItem = vmClient.getVirtualHardwareSectionMemory(vm.getHref());
|
RasdItem origItem = vmApi.getVirtualHardwareSectionMemory(vm.getHref());
|
||||||
RasdItem newItem = origItem.toBuilder()
|
RasdItem newItem = origItem.toBuilder()
|
||||||
.elementName("1024 MB of memory")
|
.elementName("1024 MB of memory")
|
||||||
.virtualQuantity(new BigInteger("1024"))
|
.virtualQuantity(new BigInteger("1024"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Method under test
|
// Method under test
|
||||||
Task modifyVirtualHardwareSectionMemory = vmClient.modifyVirtualHardwareSectionMemory(vm.getHref(), newItem);
|
Task modifyVirtualHardwareSectionMemory = vmApi.modifyVirtualHardwareSectionMemory(vm.getHref(), newItem);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionMemory), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionMemory"));
|
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionMemory), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionMemory"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
RasdItem modified = vmClient.getVirtualHardwareSectionMemory(vm.getHref());
|
RasdItem modified = vmApi.getVirtualHardwareSectionMemory(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object
|
// Check the retrieved object
|
||||||
checkResourceAllocationSettingData(modified);
|
checkResourceAllocationSettingData(modified);
|
||||||
|
@ -856,7 +856,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
@Test(description = "GET /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
||||||
public void testGetVirtualHardwareSectionNetworkCards() {
|
public void testGetVirtualHardwareSectionNetworkCards() {
|
||||||
// Method under test
|
// Method under test
|
||||||
RasdItemsList rasdItems = vmClient.getVirtualHardwareSectionNetworkCards(vm.getHref());
|
RasdItemsList rasdItems = vmApi.getVirtualHardwareSectionNetworkCards(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkRasdItemsList(rasdItems);
|
checkRasdItemsList(rasdItems);
|
||||||
|
@ -864,15 +864,15 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSectionNetworkCards" })
|
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/networkCards", dependsOnMethods = { "testGetVirtualHardwareSectionNetworkCards" })
|
||||||
public void testModifyVirtualHardwareSectionNetworkCards() {
|
public void testModifyVirtualHardwareSectionNetworkCards() {
|
||||||
RasdItemsList oldSection = vmClient.getVirtualHardwareSectionNetworkCards(vm.getHref());
|
RasdItemsList oldSection = vmApi.getVirtualHardwareSectionNetworkCards(vm.getHref());
|
||||||
RasdItemsList newSection = oldSection.toBuilder().build();
|
RasdItemsList newSection = oldSection.toBuilder().build();
|
||||||
|
|
||||||
// Method under test
|
// Method under test
|
||||||
Task modifyVirtualHardwareSectionNetworkCards = vmClient.modifyVirtualHardwareSectionNetworkCards(vm.getHref(), newSection);
|
Task modifyVirtualHardwareSectionNetworkCards = vmApi.modifyVirtualHardwareSectionNetworkCards(vm.getHref(), newSection);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionNetworkCards), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionNetworkCards"));
|
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionNetworkCards), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionNetworkCards"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
RasdItemsList modified = vmClient.getVirtualHardwareSectionNetworkCards(vm.getHref());
|
RasdItemsList modified = vmApi.getVirtualHardwareSectionNetworkCards(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkRasdItemsList(modified);
|
checkRasdItemsList(modified);
|
||||||
|
@ -885,7 +885,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
@Test(description = "GET /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSection" })
|
||||||
public void testGetVirtualHardwareSectionSerialPorts() {
|
public void testGetVirtualHardwareSectionSerialPorts() {
|
||||||
// Method under test
|
// Method under test
|
||||||
RasdItemsList rasdItems = vmClient.getVirtualHardwareSectionSerialPorts(vm.getHref());
|
RasdItemsList rasdItems = vmApi.getVirtualHardwareSectionSerialPorts(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkRasdItemsList(rasdItems);
|
checkRasdItemsList(rasdItems);
|
||||||
|
@ -893,15 +893,15 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSectionSerialPorts" })
|
@Test(description = "PUT /vApp/{id}/virtualHardwareSection/serialPorts", dependsOnMethods = { "testGetVirtualHardwareSectionSerialPorts" })
|
||||||
public void testModifyVirtualHardwareSectionSerialPorts() {
|
public void testModifyVirtualHardwareSectionSerialPorts() {
|
||||||
RasdItemsList oldSection = vmClient.getVirtualHardwareSectionSerialPorts(vm.getHref());
|
RasdItemsList oldSection = vmApi.getVirtualHardwareSectionSerialPorts(vm.getHref());
|
||||||
RasdItemsList newSection = oldSection.toBuilder().build();
|
RasdItemsList newSection = oldSection.toBuilder().build();
|
||||||
|
|
||||||
// Method under test
|
// Method under test
|
||||||
Task modifyVirtualHardwareSectionSerialPorts = vmClient.modifyVirtualHardwareSectionSerialPorts(vm.getHref(), newSection);
|
Task modifyVirtualHardwareSectionSerialPorts = vmApi.modifyVirtualHardwareSectionSerialPorts(vm.getHref(), newSection);
|
||||||
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionSerialPorts), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionSerialPorts"));
|
assertTrue(retryTaskSuccess.apply(modifyVirtualHardwareSectionSerialPorts), String.format(TASK_COMPLETE_TIMELY, "modifyVirtualHardwareSectionSerialPorts"));
|
||||||
|
|
||||||
// Retrieve the modified section
|
// Retrieve the modified section
|
||||||
RasdItemsList modified = vmClient.getVirtualHardwareSectionSerialPorts(vm.getHref());
|
RasdItemsList modified = vmApi.getVirtualHardwareSectionSerialPorts(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkRasdItemsList(modified);
|
checkRasdItemsList(modified);
|
||||||
|
@ -916,10 +916,10 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
key = name("key-");
|
key = name("key-");
|
||||||
String value = name("value-");
|
String value = name("value-");
|
||||||
metadataValue = MetadataValue.builder().value(value).build();
|
metadataValue = MetadataValue.builder().value(value).build();
|
||||||
vmClient.getMetadataClient().setMetadata(vm.getHref(), key, metadataValue);
|
vmApi.getMetadataApi().setMetadata(vm.getHref(), key, metadataValue);
|
||||||
|
|
||||||
// Retrieve the value, and assert it was set correctly
|
// Retrieve the value, and assert it was set correctly
|
||||||
MetadataValue newMetadataValue = vmClient.getMetadataClient().getMetadataValue(vm.getHref(), key);
|
MetadataValue newMetadataValue = vmApi.getMetadataApi().getMetadataValue(vm.getHref(), key);
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkMetadataValueFor(VM, newMetadataValue, value);
|
checkMetadataValueFor(VM, newMetadataValue, value);
|
||||||
|
@ -928,7 +928,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" })
|
@Test(description = "GET /vApp/{id}/metadata", dependsOnMethods = { "testSetMetadataValue" })
|
||||||
public void testGetMetadata() {
|
public void testGetMetadata() {
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
Metadata metadata = vmClient.getMetadataClient().getMetadata(vm.getHref());
|
Metadata metadata = vmApi.getMetadataApi().getMetadata(vm.getHref());
|
||||||
|
|
||||||
checkMetadata(metadata);
|
checkMetadata(metadata);
|
||||||
|
|
||||||
|
@ -939,7 +939,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "GET /vApp/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" })
|
@Test(description = "GET /vApp/{id}/metadata/{key}", dependsOnMethods = { "testGetMetadata" })
|
||||||
public void testGetOrgMetadataValue() {
|
public void testGetOrgMetadataValue() {
|
||||||
// Call the method being tested
|
// Call the method being tested
|
||||||
MetadataValue value = vmClient.getMetadataClient().getMetadataValue(vm.getHref(), key);
|
MetadataValue value = vmApi.getMetadataApi().getMetadataValue(vm.getHref(), key);
|
||||||
|
|
||||||
String expected = metadataValue.getValue();
|
String expected = metadataValue.getValue();
|
||||||
|
|
||||||
|
@ -950,11 +950,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
@Test(description = "DELETE /vApp/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" })
|
@Test(description = "DELETE /vApp/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadataValue" })
|
||||||
public void testDeleteMetadataEntry() {
|
public void testDeleteMetadataEntry() {
|
||||||
// Delete the entry
|
// Delete the entry
|
||||||
Task task = vmClient.getMetadataClient().deleteMetadataEntry(vm.getHref(), key);
|
Task task = vmApi.getMetadataApi().deleteMetadataEntry(vm.getHref(), key);
|
||||||
retryTaskSuccess.apply(task);
|
retryTaskSuccess.apply(task);
|
||||||
|
|
||||||
// Confirm the entry has been deleted
|
// Confirm the entry has been deleted
|
||||||
Metadata newMetadata = vmClient.getMetadataClient().getMetadata(vm.getHref());
|
Metadata newMetadata = vmApi.getMetadataApi().getMetadata(vm.getHref());
|
||||||
|
|
||||||
// Check the retrieved object is well formed
|
// Check the retrieved object is well formed
|
||||||
checkMetadataKeyAbsentFor(VM, newMetadata, key);
|
checkMetadataKeyAbsentFor(VM, newMetadata, key);
|
||||||
|
@ -962,7 +962,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "POST /vApp/{id}/metadata", dependsOnMethods = { "testGetMetadata" })
|
@Test(description = "POST /vApp/{id}/metadata", dependsOnMethods = { "testGetMetadata" })
|
||||||
public void testMergeMetadata() {
|
public void testMergeMetadata() {
|
||||||
Metadata oldMetadata = vmClient.getMetadataClient().getMetadata(vm.getHref());
|
Metadata oldMetadata = vmApi.getMetadataApi().getMetadata(vm.getHref());
|
||||||
Map<String, String> oldMetadataMap = Checks.metadataToMap(oldMetadata);
|
Map<String, String> oldMetadataMap = Checks.metadataToMap(oldMetadata);
|
||||||
|
|
||||||
// Store a value, to be deleted
|
// Store a value, to be deleted
|
||||||
|
@ -971,11 +971,11 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
Metadata addedMetadata = Metadata.builder()
|
Metadata addedMetadata = Metadata.builder()
|
||||||
.entry(MetadataEntry.builder().key(key).value(value).build())
|
.entry(MetadataEntry.builder().key(key).value(value).build())
|
||||||
.build();
|
.build();
|
||||||
Task task = vmClient.getMetadataClient().mergeMetadata(vm.getHref(), addedMetadata);
|
Task task = vmApi.getMetadataApi().mergeMetadata(vm.getHref(), addedMetadata);
|
||||||
retryTaskSuccess.apply(task);
|
retryTaskSuccess.apply(task);
|
||||||
|
|
||||||
// Confirm the entry contains everything that was there, and everything that was being added
|
// Confirm the entry contains everything that was there, and everything that was being added
|
||||||
Metadata newMetadata = vmClient.getMetadataClient().getMetadata(vm.getHref());
|
Metadata newMetadata = vmApi.getMetadataApi().getMetadata(vm.getHref());
|
||||||
Map<String, String> expectedMetadataMap = ImmutableMap.<String, String>builder()
|
Map<String, String> expectedMetadataMap = ImmutableMap.<String, String>builder()
|
||||||
.putAll(oldMetadataMap)
|
.putAll(oldMetadataMap)
|
||||||
.put(key, value)
|
.put(key, value)
|
||||||
|
@ -986,7 +986,7 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VmClient#deleteVm(URI)
|
* @see VmApi#deleteVm(URI)
|
||||||
*/
|
*/
|
||||||
@Test(description = "DELETE /vApp/{id}")
|
@Test(description = "DELETE /vApp/{id}")
|
||||||
public void testDeleteVm() {
|
public void testDeleteVm() {
|
||||||
|
@ -997,21 +997,21 @@ public class VmClientLiveTest extends AbstractVAppClientLiveTest {
|
||||||
.notForceCustomization()
|
.notForceCustomization()
|
||||||
.powerOn()
|
.powerOn()
|
||||||
.build();
|
.build();
|
||||||
Task deployVApp = vAppClient.deploy(delete.getHref(), params);
|
Task deployVApp = vAppApi.deploy(delete.getHref(), params);
|
||||||
assertTaskSucceedsLong(deployVApp);
|
assertTaskSucceedsLong(deployVApp);
|
||||||
|
|
||||||
// Get the updated VApp and the Vm
|
// Get the updated VApp and the Vm
|
||||||
delete = vAppClient.getVApp(delete.getHref());
|
delete = vAppApi.getVApp(delete.getHref());
|
||||||
Vm temp = Iterables.getOnlyElement(delete.getChildren().getVms());
|
Vm temp = Iterables.getOnlyElement(delete.getChildren().getVms());
|
||||||
|
|
||||||
// Power off the Vm
|
// Power off the Vm
|
||||||
temp = powerOffVm(temp.getHref());
|
temp = powerOffVm(temp.getHref());
|
||||||
|
|
||||||
// The method under test
|
// The method under test
|
||||||
Task deleteVm = vmClient.deleteVm(temp.getHref());
|
Task deleteVm = vmApi.deleteVm(temp.getHref());
|
||||||
assertTrue(retryTaskSuccess.apply(deleteVm), String.format(TASK_COMPLETE_TIMELY, "deleteVm"));
|
assertTrue(retryTaskSuccess.apply(deleteVm), String.format(TASK_COMPLETE_TIMELY, "deleteVm"));
|
||||||
|
|
||||||
Vm deleted = vmClient.getVm(temp.getHref());
|
Vm deleted = vmApi.getVm(temp.getHref());
|
||||||
assertNull(deleted, "The Vm "+temp.getName()+" should have been deleted");
|
assertNull(deleted, "The Vm "+temp.getName()+" should have been deleted");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -23,25 +23,25 @@ import static org.testng.Assert.assertEquals;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
|
import org.jclouds.vcloud.director.v1_5.domain.AdminCatalog;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.PublishCatalogParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.PublishCatalogParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the {@link AdminCatalogClient} by observing its side effects.
|
* Test the {@link AdminCatalogApi} by observing its side effects.
|
||||||
*
|
*
|
||||||
* @author grkvlt@apache.org
|
* @author grkvlt@apache.org
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "CatalogClientExpectTest")
|
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "CatalogApiExpectTest")
|
||||||
public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class AdminCatalogApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
private Reference catalogRef = Reference.builder()
|
private Reference catalogRef = Reference.builder()
|
||||||
.type("application/vnd.vmware.vcloud.catalog+xml")
|
.type("application/vnd.vmware.vcloud.catalog+xml")
|
||||||
|
@ -51,7 +51,7 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateCatalog() {
|
public void testCreateCatalog() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/catalogs")
|
.apiCommand("POST", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/catalogs")
|
||||||
.xmlFilePayload("/catalog/admin/createCatalogSource.xml", VCloudDirectorMediaType.ADMIN_CATALOG)
|
.xmlFilePayload("/catalog/admin/createCatalogSource.xml", VCloudDirectorMediaType.ADMIN_CATALOG)
|
||||||
|
@ -64,7 +64,7 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
AdminCatalog source = createCatalogSource();
|
AdminCatalog source = createCatalogSource();
|
||||||
AdminCatalog expected = createCatalog();
|
AdminCatalog expected = createCatalog();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().createCatalog(catalogRef.getHref(), source), expected);
|
assertEquals(api.getCatalogApi().createCatalog(catalogRef.getHref(), source), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME disabled due to intermittent JXB error: javax.xml.bind.UnmarshalException:
|
// FIXME disabled due to intermittent JXB error: javax.xml.bind.UnmarshalException:
|
||||||
|
@ -76,7 +76,7 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
// <{http://www.vmware.com/vcloud/v1.5}VAppReference>
|
// <{http://www.vmware.com/vcloud/v1.5}VAppReference>
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetCatalog() {
|
public void testGetCatalog() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4")
|
.apiCommand("GET", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -87,7 +87,7 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
|
|
||||||
AdminCatalog expected = catalog();
|
AdminCatalog expected = catalog();
|
||||||
|
|
||||||
AdminCatalog actual = client.getCatalogClient().getCatalog(catalogRef.getHref());
|
AdminCatalog actual = api.getCatalogApi().getCatalog(catalogRef.getHref());
|
||||||
assertEquals(actual.getHref(), expected.getHref());
|
assertEquals(actual.getHref(), expected.getHref());
|
||||||
assertEquals(actual.getLinks(), expected.getLinks());
|
assertEquals(actual.getLinks(), expected.getLinks());
|
||||||
assertEquals(actual.getTasks(), expected.getTasks());
|
assertEquals(actual.getTasks(), expected.getTasks());
|
||||||
|
@ -101,12 +101,12 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
|
|
||||||
assertEquals(actual.getOwner(), expected.getOwner());
|
assertEquals(actual.getOwner(), expected.getOwner());
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().getCatalog(catalogRef.getHref()), expected);
|
assertEquals(api.getCatalogApi().getCatalog(catalogRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testModifyCatalog() {
|
public void testModifyCatalog() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4")
|
.apiCommand("PUT", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4")
|
||||||
.xmlFilePayload("/catalog/admin/updateCatalogSource.xml", VCloudDirectorMediaType.ADMIN_CATALOG)
|
.xmlFilePayload("/catalog/admin/updateCatalogSource.xml", VCloudDirectorMediaType.ADMIN_CATALOG)
|
||||||
|
@ -118,12 +118,12 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
|
|
||||||
AdminCatalog expected = modifyCatalog();
|
AdminCatalog expected = modifyCatalog();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().updateCatalog(catalogRef.getHref(), expected), expected);
|
assertEquals(api.getCatalogApi().updateCatalog(catalogRef.getHref(), expected), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOwner() {
|
public void testGetOwner() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/owner")
|
.apiCommand("GET", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/owner")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -145,12 +145,12 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getCatalogClient().getOwner(catalogRef.getHref()), expected);
|
assertEquals(api.getCatalogApi().getOwner(catalogRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSetOwner() {
|
public void testSetOwner() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/owner")
|
.apiCommand("PUT", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/owner")
|
||||||
.xmlFilePayload("/catalog/admin/updateOwnerSource.xml", VCloudDirectorMediaType.OWNER)
|
.xmlFilePayload("/catalog/admin/updateOwnerSource.xml", VCloudDirectorMediaType.OWNER)
|
||||||
|
@ -168,12 +168,12 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
client.getCatalogClient().setOwner(catalogRef.getHref(), newOwner);
|
api.getCatalogApi().setOwner(catalogRef.getHref(), newOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPublishCatalog() {
|
public void testPublishCatalog() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/action/publish")
|
.apiCommand("POST", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4/action/publish")
|
||||||
.xmlFilePayload("/catalog/admin/publishCatalogParams.xml", VCloudDirectorMediaType.PUBLISH_CATALOG_PARAMS)
|
.xmlFilePayload("/catalog/admin/publishCatalogParams.xml", VCloudDirectorMediaType.PUBLISH_CATALOG_PARAMS)
|
||||||
|
@ -186,12 +186,12 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
.isPublished(true)
|
.isPublished(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
client.getCatalogClient().publishCatalog(catalogRef.getHref(), params);
|
api.getCatalogApi().publishCatalog(catalogRef.getHref(), params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDeleteCatalog() {
|
public void testDeleteCatalog() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("DELETE", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4")
|
.apiCommand("DELETE", "/admin/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -199,7 +199,7 @@ public class AdminCatalogClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
new VcloudHttpResponsePrimer()
|
new VcloudHttpResponsePrimer()
|
||||||
.httpResponseBuilder().statusCode(204).build());
|
.httpResponseBuilder().statusCode(204).build());
|
||||||
|
|
||||||
client.getCatalogClient().deleteCatalog(catalogRef.getHref());
|
api.getCatalogApi().deleteCatalog(catalogRef.getHref());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final AdminCatalog createCatalogSource() {
|
public static final AdminCatalog createCatalogSource() {
|
|
@ -36,7 +36,7 @@ import org.jclouds.vcloud.director.v1_5.domain.Owner;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.User;
|
import org.jclouds.vcloud.director.v1_5.domain.User;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.params.PublishCatalogParams;
|
import org.jclouds.vcloud.director.v1_5.domain.params.PublishCatalogParams;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
@ -44,20 +44,20 @@ import org.testng.annotations.Test;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests live behavior of {@link AdminCatalogClient}.
|
* Tests live behavior of {@link AdminCatalogApi}.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "CatalogClientLiveTest")
|
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "CatalogApiLiveTest")
|
||||||
public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class AdminCatalogApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
public static final String CATALOG = "admin catalog";
|
public static final String CATALOG = "admin catalog";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience references to API clients.
|
* Convenience references to API apis.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private AdminCatalogClient catalogClient;
|
private AdminCatalogApi catalogApi;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shared state between dependant tests.
|
* Shared state between dependant tests.
|
||||||
|
@ -69,16 +69,16 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
protected void setupRequiredClients() {
|
protected void setupRequiredApis() {
|
||||||
catalogClient = adminContext.getApi().getCatalogClient();
|
catalogApi = adminContext.getApi().getCatalogApi();
|
||||||
orgRef = Iterables.getFirst(context.getApi().getOrgClient().getOrgList().getOrgs(), null).toAdminReference(endpoint);
|
orgRef = Iterables.getFirst(context.getApi().getOrgApi().getOrgList().getOrgs(), null).toAdminReference(endpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass(alwaysRun = true)
|
@AfterClass(alwaysRun = true)
|
||||||
protected void tidyUp() {
|
protected void tidyUp() {
|
||||||
if (catalog != null) {
|
if (catalog != null) {
|
||||||
try {
|
try {
|
||||||
catalogClient.deleteCatalog(catalog.getHref());
|
catalogApi.deleteCatalog(catalog.getHref());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(e, "Error deleting admin catalog '%s'", catalog.getName());
|
logger.warn(e, "Error deleting admin catalog '%s'", catalog.getName());
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
.name(name("Test Catalog "))
|
.name(name("Test Catalog "))
|
||||||
.description("created by testCreateCatalog()")
|
.description("created by testCreateCatalog()")
|
||||||
.build();
|
.build();
|
||||||
catalog = catalogClient.createCatalog(orgRef.getHref(), newCatalog);
|
catalog = catalogApi.createCatalog(orgRef.getHref(), newCatalog);
|
||||||
|
|
||||||
Checks.checkAdminCatalog(catalog);
|
Checks.checkAdminCatalog(catalog);
|
||||||
|
|
||||||
|
@ -100,21 +100,21 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
|
|
||||||
@Test(description = "GET /admin/catalog/{id}", dependsOnMethods = { "testCreateCatalog" })
|
@Test(description = "GET /admin/catalog/{id}", dependsOnMethods = { "testCreateCatalog" })
|
||||||
public void testGetCatalog() {
|
public void testGetCatalog() {
|
||||||
catalog = catalogClient.getCatalog(catalog.getHref());
|
catalog = catalogApi.getCatalog(catalog.getHref());
|
||||||
|
|
||||||
Checks.checkAdminCatalog(catalog);
|
Checks.checkAdminCatalog(catalog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /admin/catalog/{id}/owner", dependsOnMethods = { "testGetCatalog" })
|
@Test(description = "GET /admin/catalog/{id}/owner", dependsOnMethods = { "testGetCatalog" })
|
||||||
public void testGetCatalogOwner() {
|
public void testGetCatalogOwner() {
|
||||||
owner = catalogClient.getOwner(catalog.getHref());
|
owner = catalogApi.getOwner(catalog.getHref());
|
||||||
Checks.checkOwner(owner);
|
Checks.checkOwner(owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "PUT /admin/catalog/{id}/owner", dependsOnMethods = { "testGetCatalog" })
|
@Test(description = "PUT /admin/catalog/{id}/owner", dependsOnMethods = { "testGetCatalog" })
|
||||||
public void updateCatalogOwner() {
|
public void updateCatalogOwner() {
|
||||||
User newOwnerUser = randomTestUser("testUpdateCatalogOwner");
|
User newOwnerUser = randomTestUser("testUpdateCatalogOwner");
|
||||||
newOwnerUser = adminContext.getApi().getUserClient().createUser(orgRef.getHref(), newOwnerUser);
|
newOwnerUser = adminContext.getApi().getUserApi().createUser(orgRef.getHref(), newOwnerUser);
|
||||||
assertNotNull(newOwnerUser, "failed to create temp user to test updateCatalogOwner");
|
assertNotNull(newOwnerUser, "failed to create temp user to test updateCatalogOwner");
|
||||||
|
|
||||||
Owner oldOwner = owner;
|
Owner oldOwner = owner;
|
||||||
|
@ -124,16 +124,16 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
catalogClient.setOwner(catalog.getHref(), newOwner);
|
catalogApi.setOwner(catalog.getHref(), newOwner);
|
||||||
owner = catalogClient.getOwner(catalog.getHref());
|
owner = catalogApi.getOwner(catalog.getHref());
|
||||||
Checks.checkOwner(owner);
|
Checks.checkOwner(owner);
|
||||||
assertTrue(equal(owner.toBuilder().links(Collections.<Link>emptySet()).build(),
|
assertTrue(equal(owner.toBuilder().links(Collections.<Link>emptySet()).build(),
|
||||||
newOwner.toBuilder().user(newOwner.getUser().toBuilder().id(null).build()).build()),
|
newOwner.toBuilder().user(newOwner.getUser().toBuilder().id(null).build()).build()),
|
||||||
String.format(OBJ_FIELD_UPDATABLE, CATALOG, "owner"));
|
String.format(OBJ_FIELD_UPDATABLE, CATALOG, "owner"));
|
||||||
} finally {
|
} finally {
|
||||||
catalogClient.setOwner(catalog.getHref(), oldOwner);
|
catalogApi.setOwner(catalog.getHref(), oldOwner);
|
||||||
owner = catalogClient.getOwner(catalog.getHref());
|
owner = catalogApi.getOwner(catalog.getHref());
|
||||||
adminContext.getApi().getUserClient().deleteUser(newOwnerUser.getHref());
|
adminContext.getApi().getUserApi().deleteUser(newOwnerUser.getHref());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
// .catalogItems(newCatalogItems)
|
// .catalogItems(newCatalogItems)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
catalog = catalogClient.updateCatalog(catalog.getHref(), catalog);
|
catalog = catalogApi.updateCatalog(catalog.getHref(), catalog);
|
||||||
|
|
||||||
assertTrue(equal(catalog.getName(), newName), String.format(OBJ_FIELD_UPDATABLE, CATALOG, "name"));
|
assertTrue(equal(catalog.getName(), newName), String.format(OBJ_FIELD_UPDATABLE, CATALOG, "name"));
|
||||||
assertTrue(equal(catalog.getDescription(), newDescription),
|
assertTrue(equal(catalog.getDescription(), newDescription),
|
||||||
|
@ -171,7 +171,7 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
// .catalogItems(oldCatalogItems)
|
// .catalogItems(oldCatalogItems)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
catalog = catalogClient.updateCatalog(catalog.getHref(), catalog);
|
catalog = catalogApi.updateCatalog(catalog.getHref(), catalog);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,8 +186,8 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
.isPublished(true)
|
.isPublished(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
catalogClient.publishCatalog(catalog.getHref(), params);
|
catalogApi.publishCatalog(catalog.getHref(), params);
|
||||||
catalog = catalogClient.getCatalog(catalog.getHref());
|
catalog = catalogApi.getCatalog(catalog.getHref());
|
||||||
|
|
||||||
assertTrue(catalog.isPublished(), String.format(OBJ_FIELD_EQ,
|
assertTrue(catalog.isPublished(), String.format(OBJ_FIELD_EQ,
|
||||||
CATALOG, "isPublished", true, catalog.isPublished()));
|
CATALOG, "isPublished", true, catalog.isPublished()));
|
||||||
|
@ -202,10 +202,10 @@ public class AdminCatalogClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
.name(name("Test Catalog "))
|
.name(name("Test Catalog "))
|
||||||
.description("created by testCreateCatalog()")
|
.description("created by testCreateCatalog()")
|
||||||
.build();
|
.build();
|
||||||
deleteCatalog = catalogClient.createCatalog(orgRef.getHref(), deleteCatalog);
|
deleteCatalog = catalogApi.createCatalog(orgRef.getHref(), deleteCatalog);
|
||||||
catalogClient.deleteCatalog(deleteCatalog.getHref());
|
catalogApi.deleteCatalog(deleteCatalog.getHref());
|
||||||
|
|
||||||
deleteCatalog = catalogClient.getCatalog(deleteCatalog.getHref());
|
deleteCatalog = catalogApi.getCatalog(deleteCatalog.getHref());
|
||||||
assertNull(deleteCatalog, String.format(OBJ_DEL, CATALOG, deleteCatalog != null ? deleteCatalog.toString() : ""));
|
assertNull(deleteCatalog, String.format(OBJ_DEL, CATALOG, deleteCatalog != null ? deleteCatalog.toString() : ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -23,24 +23,24 @@ import static org.testng.Assert.assertEquals;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.NetworkClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.features.NetworkApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the {@link AdminNetworkClient} by observing its side effects.
|
* Test the {@link AdminNetworkApi} by observing its side effects.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "AdminNetworkClientExpectTest")
|
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "AdminNetworkApiExpectTest")
|
||||||
public class AdminNetworkClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class AdminNetworkApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
Reference networkRef = Reference.builder()
|
Reference networkRef = Reference.builder()
|
||||||
.href(URI.create(endpoint+"/admin/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1"))
|
.href(URI.create(endpoint+"/admin/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1"))
|
||||||
|
@ -48,7 +48,7 @@ public class AdminNetworkClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetNetworkWithOrgNetwork() {
|
public void testGetNetworkWithOrgNetwork() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1")
|
.apiCommand("GET", "/admin/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -59,12 +59,12 @@ public class AdminNetworkClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
|
|
||||||
OrgNetwork expected = orgNetwork();
|
OrgNetwork expected = orgNetwork();
|
||||||
|
|
||||||
assertEquals(client.getNetworkClient().getNetwork(networkRef.getHref()), expected);
|
assertEquals(api.getNetworkApi().getNetwork(networkRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateNetwork() {
|
public void testUpdateNetwork() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/admin/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1")
|
.apiCommand("PUT", "/admin/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1")
|
||||||
.xmlFilePayload("/network/admin/updateNetworkSource.xml", VCloudDirectorMediaType.ORG_NETWORK)
|
.xmlFilePayload("/network/admin/updateNetworkSource.xml", VCloudDirectorMediaType.ORG_NETWORK)
|
||||||
|
@ -76,12 +76,12 @@ public class AdminNetworkClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
|
|
||||||
Task expected = updateNetworkTask();
|
Task expected = updateNetworkTask();
|
||||||
|
|
||||||
assertEquals(client.getNetworkClient().updateNetwork(networkRef.getHref(), updateNetwork()), expected);
|
assertEquals(api.getNetworkApi().updateNetwork(networkRef.getHref(), updateNetwork()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testResetNetwork() {
|
public void testResetNetwork() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("POST", "/admin/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1/action/reset")
|
.apiCommand("POST", "/admin/network/b466c0c5-8a5c-4335-b703-a2e2e6b5f3e1/action/reset")
|
||||||
.acceptMedia(VCloudDirectorMediaType.TASK)
|
.acceptMedia(VCloudDirectorMediaType.TASK)
|
||||||
|
@ -92,12 +92,12 @@ public class AdminNetworkClientExpectTest extends VCloudDirectorAdminClientExpec
|
||||||
|
|
||||||
Task expected = resetNetworkTask();
|
Task expected = resetNetworkTask();
|
||||||
|
|
||||||
assertEquals(client.getNetworkClient().resetNetwork(networkRef.getHref()), expected);
|
assertEquals(api.getNetworkApi().resetNetwork(networkRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final OrgNetwork orgNetwork() {
|
public final OrgNetwork orgNetwork() {
|
||||||
return NetworkClientExpectTest.orgNetwork().toBuilder()
|
return NetworkApiExpectTest.orgNetwork().toBuilder()
|
||||||
.href(toAdminUri(NetworkClientExpectTest.orgNetwork().getHref()))
|
.href(toAdminUri(NetworkApiExpectTest.orgNetwork().getHref()))
|
||||||
.links(ImmutableSet.of(
|
.links(ImmutableSet.of(
|
||||||
Link.builder()
|
Link.builder()
|
||||||
.rel("alternate")
|
.rel("alternate")
|
|
@ -41,24 +41,24 @@ import org.jclouds.vcloud.director.v1_5.domain.network.NetworkFeatures;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.network.RouterInfo;
|
import org.jclouds.vcloud.director.v1_5.domain.network.RouterInfo;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.network.SyslogServerSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.network.SyslogServerSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgNetwork;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests live behavior of {@link AdminNetworkClient}.
|
* Tests live behavior of {@link AdminNetworkApi}.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminNetworkLiveTest")
|
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminNetworkLiveTest")
|
||||||
public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class AdminNetworkApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
public static final String NETWORK = "AdminNetwork";
|
public static final String NETWORK = "AdminNetwork";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience references to API clients.
|
* Convenience references to API apis.
|
||||||
*/
|
*/
|
||||||
private AdminNetworkClient networkClient;
|
private AdminNetworkApi networkApi;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shared state between dependant tests.
|
* Shared state between dependant tests.
|
||||||
|
@ -68,8 +68,8 @@ public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
protected void setupRequiredClients() {
|
protected void setupRequiredApis() {
|
||||||
networkClient = adminContext.getApi().getNetworkClient();
|
networkApi = adminContext.getApi().getNetworkApi();
|
||||||
networkRef = Reference.builder().href(networkURI).build().toAdminReference(endpoint);
|
networkRef = Reference.builder().href(networkURI).build().toAdminReference(endpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
public void testGetNetwork() {
|
public void testGetNetwork() {
|
||||||
//TODO: test both org and external networks
|
//TODO: test both org and external networks
|
||||||
assertNotNull(networkRef, String.format(OBJ_REQ_LIVE, NETWORK));
|
assertNotNull(networkRef, String.format(OBJ_REQ_LIVE, NETWORK));
|
||||||
network = networkClient.getNetwork(networkRef.getHref());
|
network = networkApi.getNetwork(networkRef.getHref());
|
||||||
|
|
||||||
if(network instanceof ExternalNetwork) {
|
if(network instanceof ExternalNetwork) {
|
||||||
Checks.checkExternalNetwork(Network.<ExternalNetwork>toSubType(network));
|
Checks.checkExternalNetwork(Network.<ExternalNetwork>toSubType(network));
|
||||||
|
@ -103,10 +103,10 @@ public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
OrgNetwork updateNetwork = getMutatedOrgNetwork(oldNetwork);
|
OrgNetwork updateNetwork = getMutatedOrgNetwork(oldNetwork);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Task updateNetworkTask = networkClient.updateNetwork(network.getHref(), updateNetwork);
|
Task updateNetworkTask = networkApi.updateNetwork(network.getHref(), updateNetwork);
|
||||||
Checks.checkTask(updateNetworkTask);
|
Checks.checkTask(updateNetworkTask);
|
||||||
assertTrue(retryTaskSuccess.apply(updateNetworkTask), String.format(TASK_COMPLETE_TIMELY, "updateNetworkTask"));
|
assertTrue(retryTaskSuccess.apply(updateNetworkTask), String.format(TASK_COMPLETE_TIMELY, "updateNetworkTask"));
|
||||||
network = networkClient.getNetwork(network.getHref());
|
network = networkApi.getNetwork(network.getHref());
|
||||||
|
|
||||||
Checks.checkOrgNetwork(Network.<OrgNetwork>toSubType(network));
|
Checks.checkOrgNetwork(Network.<OrgNetwork>toSubType(network));
|
||||||
|
|
||||||
|
@ -140,20 +140,20 @@ public class AdminNetworkClientLiveTest extends BaseVCloudDirectorClientLiveTest
|
||||||
// updateNetwork.getAllowedExternalIpAddresses()),
|
// updateNetwork.getAllowedExternalIpAddresses()),
|
||||||
// String.format(OBJ_FIELD_UPDATABLE, NETWORK, "allowedExternalIpAddresses"));
|
// String.format(OBJ_FIELD_UPDATABLE, NETWORK, "allowedExternalIpAddresses"));
|
||||||
} finally {
|
} finally {
|
||||||
Task updateNetworkTask = networkClient.updateNetwork(network.getHref(), oldNetwork);
|
Task updateNetworkTask = networkApi.updateNetwork(network.getHref(), oldNetwork);
|
||||||
Checks.checkTask(updateNetworkTask);
|
Checks.checkTask(updateNetworkTask);
|
||||||
assertTrue(retryTaskSuccess.apply(updateNetworkTask), String.format(TASK_COMPLETE_TIMELY, "updateNetworkTask"));
|
assertTrue(retryTaskSuccess.apply(updateNetworkTask), String.format(TASK_COMPLETE_TIMELY, "updateNetworkTask"));
|
||||||
network = networkClient.getNetwork(network.getHref());
|
network = networkApi.getNetwork(network.getHref());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "POST /admin/network/{id}/action/reset")
|
@Test(description = "POST /admin/network/{id}/action/reset")
|
||||||
public void testResetNetwork() {
|
public void testResetNetwork() {
|
||||||
// TODO assert that network is deployed somehow
|
// TODO assert that network is deployed somehow
|
||||||
Task resetNetworkTask = networkClient.resetNetwork(networkRef.getHref());
|
Task resetNetworkTask = networkApi.resetNetwork(networkRef.getHref());
|
||||||
Checks.checkTask(resetNetworkTask);
|
Checks.checkTask(resetNetworkTask);
|
||||||
assertTrue(retryTaskSuccess.apply(resetNetworkTask), String.format(TASK_COMPLETE_TIMELY, "resetNetworkTask"));
|
assertTrue(retryTaskSuccess.apply(resetNetworkTask), String.format(TASK_COMPLETE_TIMELY, "resetNetworkTask"));
|
||||||
network = networkClient.getNetwork(network.getHref());
|
network = networkApi.getNetwork(network.getHref());
|
||||||
|
|
||||||
Checks.checkOrgNetwork(Network.<OrgNetwork>toSubType(network));
|
Checks.checkOrgNetwork(Network.<OrgNetwork>toSubType(network));
|
||||||
// TODO: other assertions about the reset? that network is deployed when task is complete, for example
|
// TODO: other assertions about the reset? that network is deployed when task is complete, for example
|
|
@ -23,7 +23,7 @@ import static org.testng.Assert.assertEquals;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.network.SmtpServerSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.network.SmtpServerSettings;
|
||||||
|
@ -35,16 +35,16 @@ import org.jclouds.vcloud.director.v1_5.domain.org.OrgLeaseSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgPasswordPolicySettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgPasswordPolicySettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgVAppTemplateLeaseSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgVAppTemplateLeaseSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the {@link AdminOrgClient} by observing its side effects.
|
* Test the {@link AdminOrgApi} by observing its side effects.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "AdminOrgClientExpectTest")
|
@Test(groups = { "unit", "user" }, singleThreaded = true, testName = "AdminOrgApiExpectTest")
|
||||||
public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class AdminOrgApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
private Reference orgRef = Reference.builder()
|
private Reference orgRef = Reference.builder()
|
||||||
.href(URI.create(endpoint + "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0"))
|
.href(URI.create(endpoint + "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0"))
|
||||||
|
@ -52,7 +52,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetOrg() {
|
public void testGetOrg() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0")
|
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -64,7 +64,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
AdminOrg expected = adminOrg();
|
AdminOrg expected = adminOrg();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getOrg(orgRef.getHref()), expected);
|
assertEquals(api.getOrgApi().getOrg(orgRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final AdminOrg adminOrg() {
|
public static final AdminOrg adminOrg() {
|
||||||
|
@ -186,7 +186,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetSettings() {
|
public void testGetSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/")
|
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -198,12 +198,12 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgSettings expected = settings();
|
OrgSettings expected = settings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getSettings(orgRef.getHref()), expected);
|
assertEquals(api.getOrgApi().getSettings(orgRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUpdateSettings() {
|
public void testUpdateSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/")
|
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/")
|
||||||
.xmlFilePayload("/org/admin/updateSettingsSource.xml",
|
.xmlFilePayload("/org/admin/updateSettingsSource.xml",
|
||||||
|
@ -217,12 +217,12 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgSettings expected = updateSettings();
|
OrgSettings expected = updateSettings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().updateSettings(orgRef.getHref(), expected), expected);
|
assertEquals(api.getOrgApi().updateSettings(orgRef.getHref(), expected), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetEmailSettings() {
|
public void testGetEmailSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/email")
|
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/email")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -234,12 +234,12 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgEmailSettings expected = emailSettings();
|
OrgEmailSettings expected = emailSettings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getEmailSettings(orgRef.getHref()), expected);
|
assertEquals(api.getOrgApi().getEmailSettings(orgRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateEmailSettings() {
|
public void testUpdateEmailSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/email")
|
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/email")
|
||||||
.xmlFilePayload("/org/admin/updateEmailSettingsSource.xml",
|
.xmlFilePayload("/org/admin/updateEmailSettingsSource.xml",
|
||||||
|
@ -253,12 +253,12 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgEmailSettings expected = updateEmailSettings();
|
OrgEmailSettings expected = updateEmailSettings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().updateEmailSettings(orgRef.getHref(), expected), expected);
|
assertEquals(api.getOrgApi().updateEmailSettings(orgRef.getHref(), expected), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetGeneralSettings() {
|
public void testGetGeneralSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/general")
|
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/general")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -270,7 +270,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgGeneralSettings expected = generalSettings();
|
OrgGeneralSettings expected = generalSettings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getGeneralSettings(orgRef.getHref()), expected);
|
assertEquals(api.getOrgApi().getGeneralSettings(orgRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final OrgGeneralSettings generalSettings() {
|
public static final OrgGeneralSettings generalSettings() {
|
||||||
|
@ -292,7 +292,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUpdateGeneralSettings() {
|
public void testUpdateGeneralSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/general")
|
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/general")
|
||||||
.xmlFilePayload("/org/admin/updateGeneralSettingsSource.xml",
|
.xmlFilePayload("/org/admin/updateGeneralSettingsSource.xml",
|
||||||
|
@ -306,7 +306,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgGeneralSettings expected = updateGeneralSettings();
|
OrgGeneralSettings expected = updateGeneralSettings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().updateGeneralSettings(orgRef.getHref(), expected), expected);
|
assertEquals(api.getOrgApi().updateGeneralSettings(orgRef.getHref(), expected), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final OrgGeneralSettings updateGeneralSettings() {
|
public static final OrgGeneralSettings updateGeneralSettings() {
|
||||||
|
@ -317,7 +317,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetLdapSettings() {
|
public void testGetLdapSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/ldap")
|
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/ldap")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -329,7 +329,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgLdapSettings expected = ldapSettings();
|
OrgLdapSettings expected = ldapSettings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getLdapSettings(orgRef.getHref()), expected);
|
assertEquals(api.getOrgApi().getLdapSettings(orgRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final OrgLdapSettings ldapSettings() {
|
public static final OrgLdapSettings ldapSettings() {
|
||||||
|
@ -342,7 +342,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetPasswordPolicy() {
|
public void testGetPasswordPolicy() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/passwordPolicy")
|
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/passwordPolicy")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -354,7 +354,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgPasswordPolicySettings expected = passwordPolicy();
|
OrgPasswordPolicySettings expected = passwordPolicy();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getPasswordPolicy(orgRef.getHref()), expected);
|
assertEquals(api.getOrgApi().getPasswordPolicy(orgRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final OrgPasswordPolicySettings passwordPolicy() {
|
public static final OrgPasswordPolicySettings passwordPolicy() {
|
||||||
|
@ -374,7 +374,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdatePasswordPolicy() {
|
public void testUpdatePasswordPolicy() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/passwordPolicy")
|
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/passwordPolicy")
|
||||||
.xmlFilePayload("/org/admin/updatePasswordPolicySource.xml",
|
.xmlFilePayload("/org/admin/updatePasswordPolicySource.xml",
|
||||||
|
@ -388,7 +388,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgPasswordPolicySettings expected = updateOrgPasswordPolicy();
|
OrgPasswordPolicySettings expected = updateOrgPasswordPolicy();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().updatePasswordPolicy(orgRef.getHref(), expected), expected);
|
assertEquals(api.getOrgApi().updatePasswordPolicy(orgRef.getHref(), expected), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final OrgPasswordPolicySettings updateOrgPasswordPolicy() {
|
public static final OrgPasswordPolicySettings updateOrgPasswordPolicy() {
|
||||||
|
@ -401,7 +401,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVAppLeaseSettings() {
|
public void testGetVAppLeaseSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/vAppLeaseSettings")
|
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/vAppLeaseSettings")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -413,7 +413,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgLeaseSettings expected = vAppLeaseSettings();
|
OrgLeaseSettings expected = vAppLeaseSettings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getVAppLeaseSettings(orgRef.getHref()), expected);
|
assertEquals(api.getOrgApi().getVAppLeaseSettings(orgRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final OrgLeaseSettings vAppLeaseSettings() {
|
public static final OrgLeaseSettings vAppLeaseSettings() {
|
||||||
|
@ -433,7 +433,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUpdateOrgVAppLeaseSettings() {
|
public void testUpdateOrgVAppLeaseSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/vAppLeaseSettings")
|
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/vAppLeaseSettings")
|
||||||
.xmlFilePayload("/org/admin/updateVAppLeaseSettingsSource.xml",
|
.xmlFilePayload("/org/admin/updateVAppLeaseSettingsSource.xml",
|
||||||
|
@ -447,7 +447,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgLeaseSettings expected = updateVAppLeaseSettings();
|
OrgLeaseSettings expected = updateVAppLeaseSettings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().updateVAppLeaseSettings(orgRef.getHref(), expected), expected);
|
assertEquals(api.getOrgApi().updateVAppLeaseSettings(orgRef.getHref(), expected), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final OrgLeaseSettings updateVAppLeaseSettings() {
|
public static final OrgLeaseSettings updateVAppLeaseSettings() {
|
||||||
|
@ -458,7 +458,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testGetVAppTemplateLeaseSettings() {
|
public void testGetVAppTemplateLeaseSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/vAppTemplateLeaseSettings")
|
.apiCommand("GET", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/vAppTemplateLeaseSettings")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -470,7 +470,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgVAppTemplateLeaseSettings expected = vAppTemplateLeaseSettings();
|
OrgVAppTemplateLeaseSettings expected = vAppTemplateLeaseSettings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().getVAppTemplateLeaseSettings(orgRef.getHref()), expected);
|
assertEquals(api.getOrgApi().getVAppTemplateLeaseSettings(orgRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final OrgVAppTemplateLeaseSettings vAppTemplateLeaseSettings() {
|
public static final OrgVAppTemplateLeaseSettings vAppTemplateLeaseSettings() {
|
||||||
|
@ -489,7 +489,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test(enabled = false)
|
@Test(enabled = false)
|
||||||
public void testUpdateOrgVAppTemplateLeaseSettings() {
|
public void testUpdateOrgVAppTemplateLeaseSettings() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/vAppTemplateLeaseSettings")
|
.apiCommand("PUT", "/admin/org/6f312e42-cd2b-488d-a2bb-97519cd57ed0/settings/vAppTemplateLeaseSettings")
|
||||||
.xmlFilePayload("/org/admin/updateVAppLeaseSettingsSource.xml",
|
.xmlFilePayload("/org/admin/updateVAppLeaseSettingsSource.xml",
|
||||||
|
@ -503,7 +503,7 @@ public class AdminOrgClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
OrgVAppTemplateLeaseSettings expected = updateVAppTemplateLeaseSettings();
|
OrgVAppTemplateLeaseSettings expected = updateVAppTemplateLeaseSettings();
|
||||||
|
|
||||||
assertEquals(client.getOrgClient().updateVAppTemplateLeaseSettings(orgRef.getHref(), expected), expected);
|
assertEquals(api.getOrgApi().updateVAppTemplateLeaseSettings(orgRef.getHref(), expected), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final OrgVAppTemplateLeaseSettings updateVAppTemplateLeaseSettings() {
|
public static final OrgVAppTemplateLeaseSettings updateVAppTemplateLeaseSettings() {
|
|
@ -35,27 +35,27 @@ import org.jclouds.vcloud.director.v1_5.domain.org.OrgLeaseSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgPasswordPolicySettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgPasswordPolicySettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.org.OrgVAppTemplateLeaseSettings;
|
import org.jclouds.vcloud.director.v1_5.domain.org.OrgVAppTemplateLeaseSettings;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests live behavior of {@link AdminGroupClient}.
|
* Tests live behavior of {@link AdminGroupApi}.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminOrgClientLiveTest")
|
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminOrgApiLiveTest")
|
||||||
public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class AdminOrgApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
public static final String ORG = "admin org";
|
public static final String ORG = "admin org";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience references to API clients.
|
* Convenience references to API apis.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private AdminOrgClient orgClient;
|
private AdminOrgApi orgApi;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shared state between dependant tests.
|
* Shared state between dependant tests.
|
||||||
|
@ -71,22 +71,22 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() {
|
public void setupRequiredApis() {
|
||||||
orgClient = adminContext.getApi().getOrgClient();
|
orgApi = adminContext.getApi().getOrgApi();
|
||||||
orgRef = Iterables.getFirst(orgClient.getOrgList().getOrgs(), null).toAdminReference(endpoint);
|
orgRef = Iterables.getFirst(orgApi.getOrgList().getOrgs(), null).toAdminReference(endpoint);
|
||||||
assertNotNull(orgRef, String.format(REF_REQ_LIVE, "admin org"));
|
assertNotNull(orgRef, String.format(REF_REQ_LIVE, "admin org"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /admin/org/{id}")
|
@Test(description = "GET /admin/org/{id}")
|
||||||
public void testGetAdminOrg() {
|
public void testGetAdminOrg() {
|
||||||
AdminOrg adminOrg = orgClient.getOrg(orgRef.getHref());
|
AdminOrg adminOrg = orgApi.getOrg(orgRef.getHref());
|
||||||
|
|
||||||
Checks.checkAdminOrg(adminOrg);
|
Checks.checkAdminOrg(adminOrg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /admin/org/{id}/settings/email")
|
@Test(description = "GET /admin/org/{id}/settings/email")
|
||||||
public void testGetEmailSettings() {
|
public void testGetEmailSettings() {
|
||||||
emailSettings = orgClient.getEmailSettings(orgRef.getHref());
|
emailSettings = orgApi.getEmailSettings(orgRef.getHref());
|
||||||
|
|
||||||
Checks.checkEmailSettings(emailSettings);
|
Checks.checkEmailSettings(emailSettings);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.smtpServerSettings(newSmtpServerSettings)
|
.smtpServerSettings(newSmtpServerSettings)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
emailSettings = orgClient.updateEmailSettings(
|
emailSettings = orgApi.updateEmailSettings(
|
||||||
orgRef.getHref(), newEmailSettings);
|
orgRef.getHref(), newEmailSettings);
|
||||||
|
|
||||||
assertTrue(equal(emailSettings.isDefaultSmtpServer(), !isDefaultSmtpServer),
|
assertTrue(equal(emailSettings.isDefaultSmtpServer(), !isDefaultSmtpServer),
|
||||||
|
@ -154,14 +154,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.smtpServerSettings(oldSmtpServerSettings)
|
.smtpServerSettings(oldSmtpServerSettings)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
emailSettings = orgClient.updateEmailSettings(
|
emailSettings = orgApi.updateEmailSettings(
|
||||||
orgRef.getHref(), emailSettings);
|
orgRef.getHref(), emailSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /admin/org/{id}/settings/general")
|
@Test(description = "GET /admin/org/{id}/settings/general")
|
||||||
public void testGetGeneralSettings() {
|
public void testGetGeneralSettings() {
|
||||||
generalSettings = orgClient.getGeneralSettings(orgRef.getHref());
|
generalSettings = orgApi.getGeneralSettings(orgRef.getHref());
|
||||||
|
|
||||||
Checks.checkGeneralSettings(generalSettings);
|
Checks.checkGeneralSettings(generalSettings);
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.delayAfterPowerOnSeconds(delayAfterPowerOnSeconds+1)
|
.delayAfterPowerOnSeconds(delayAfterPowerOnSeconds+1)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
generalSettings = orgClient.updateGeneralSettings(
|
generalSettings = orgApi.updateGeneralSettings(
|
||||||
orgRef.getHref(), newGeneralSettings);
|
orgRef.getHref(), newGeneralSettings);
|
||||||
|
|
||||||
// assertTrue(equal(generalSettings.canPublishCatalogs(), !canPublishCatalogs),
|
// assertTrue(equal(generalSettings.canPublishCatalogs(), !canPublishCatalogs),
|
||||||
|
@ -216,21 +216,21 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.delayAfterPowerOnSeconds(delayAfterPowerOnSeconds)
|
.delayAfterPowerOnSeconds(delayAfterPowerOnSeconds)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
generalSettings = orgClient.updateGeneralSettings(
|
generalSettings = orgApi.updateGeneralSettings(
|
||||||
orgRef.getHref(), generalSettings);
|
orgRef.getHref(), generalSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /admin/org/{id}/settings/ldap")
|
@Test(description = "GET /admin/org/{id}/settings/ldap")
|
||||||
public void testGetLdapSettings() {
|
public void testGetLdapSettings() {
|
||||||
ldapSettings = orgClient.getLdapSettings(orgRef.getHref());
|
ldapSettings = orgApi.getLdapSettings(orgRef.getHref());
|
||||||
|
|
||||||
Checks.checkLdapSettings(ldapSettings);
|
Checks.checkLdapSettings(ldapSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /admin/org/{id}/settings/passwordPolicy")
|
@Test(description = "GET /admin/org/{id}/settings/passwordPolicy")
|
||||||
public void testGetPasswordPolicy() {
|
public void testGetPasswordPolicy() {
|
||||||
passwordPolicy = orgClient.getPasswordPolicy(orgRef.getHref());
|
passwordPolicy = orgApi.getPasswordPolicy(orgRef.getHref());
|
||||||
|
|
||||||
Checks.checkPasswordPolicySettings(passwordPolicy);
|
Checks.checkPasswordPolicySettings(passwordPolicy);
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.accountLockoutIntervalMinutes(accountLockoutIntervalMinutes+1)
|
.accountLockoutIntervalMinutes(accountLockoutIntervalMinutes+1)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
passwordPolicy = orgClient.updatePasswordPolicy(
|
passwordPolicy = orgApi.updatePasswordPolicy(
|
||||||
orgRef.getHref(), newPasswordPolicy);
|
orgRef.getHref(), newPasswordPolicy);
|
||||||
|
|
||||||
assertTrue(equal(passwordPolicy.isAccountLockoutEnabled(), !accountLockoutEnabled),
|
assertTrue(equal(passwordPolicy.isAccountLockoutEnabled(), !accountLockoutEnabled),
|
||||||
|
@ -272,14 +272,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.accountLockoutIntervalMinutes(accountLockoutIntervalMinutes)
|
.accountLockoutIntervalMinutes(accountLockoutIntervalMinutes)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
passwordPolicy = orgClient.updatePasswordPolicy(
|
passwordPolicy = orgApi.updatePasswordPolicy(
|
||||||
orgRef.getHref(), passwordPolicy);
|
orgRef.getHref(), passwordPolicy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /admin/org/{id}/settings/vAppLeaseSettings")
|
@Test(description = "GET /admin/org/{id}/settings/vAppLeaseSettings")
|
||||||
public void testGetVAppLeaseSettings() {
|
public void testGetVAppLeaseSettings() {
|
||||||
vAppLeaseSettings = orgClient.getVAppLeaseSettings(orgRef.getHref());
|
vAppLeaseSettings = orgApi.getVAppLeaseSettings(orgRef.getHref());
|
||||||
|
|
||||||
Checks.checkVAppLeaseSettings(vAppLeaseSettings);
|
Checks.checkVAppLeaseSettings(vAppLeaseSettings);
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.deploymentLeaseSeconds(deploymentLeaseSeconds+1)
|
.deploymentLeaseSeconds(deploymentLeaseSeconds+1)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
vAppLeaseSettings = orgClient.updateVAppLeaseSettings(
|
vAppLeaseSettings = orgApi.updateVAppLeaseSettings(
|
||||||
orgRef.getHref(), newVAppLeaseSettings);
|
orgRef.getHref(), newVAppLeaseSettings);
|
||||||
|
|
||||||
assertTrue(equal(vAppLeaseSettings.deleteOnStorageLeaseExpiration(), !deleteOnStorageLeaseExpiration),
|
assertTrue(equal(vAppLeaseSettings.deleteOnStorageLeaseExpiration(), !deleteOnStorageLeaseExpiration),
|
||||||
|
@ -321,14 +321,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.deploymentLeaseSeconds(deploymentLeaseSeconds)
|
.deploymentLeaseSeconds(deploymentLeaseSeconds)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
vAppLeaseSettings = orgClient.updateVAppLeaseSettings(
|
vAppLeaseSettings = orgApi.updateVAppLeaseSettings(
|
||||||
orgRef.getHref(), vAppLeaseSettings);
|
orgRef.getHref(), vAppLeaseSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /admin/org/{id}/settings/vAppTemplateLeaseSettings")
|
@Test(description = "GET /admin/org/{id}/settings/vAppTemplateLeaseSettings")
|
||||||
public void testGetVAppTemplateLeaseSettings() {
|
public void testGetVAppTemplateLeaseSettings() {
|
||||||
vAppTemplateLeaseSettings = orgClient.getVAppTemplateLeaseSettings(orgRef.getHref());
|
vAppTemplateLeaseSettings = orgApi.getVAppTemplateLeaseSettings(orgRef.getHref());
|
||||||
|
|
||||||
Checks.checkVAppTemplateLeaseSettings(vAppTemplateLeaseSettings);
|
Checks.checkVAppTemplateLeaseSettings(vAppTemplateLeaseSettings);
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,7 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.storageLeaseSeconds(storageLeaseSeconds+1)
|
.storageLeaseSeconds(storageLeaseSeconds+1)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
vAppTemplateLeaseSettings = orgClient.updateVAppTemplateLeaseSettings(
|
vAppTemplateLeaseSettings = orgApi.updateVAppTemplateLeaseSettings(
|
||||||
orgRef.getHref(), newVAppTemplateLeaseSettings);
|
orgRef.getHref(), newVAppTemplateLeaseSettings);
|
||||||
|
|
||||||
assertTrue(equal(vAppTemplateLeaseSettings.deleteOnStorageLeaseExpiration(), !deleteOnStorageLeaseExpiration),
|
assertTrue(equal(vAppTemplateLeaseSettings.deleteOnStorageLeaseExpiration(), !deleteOnStorageLeaseExpiration),
|
||||||
|
@ -364,14 +364,14 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.storageLeaseSeconds(storageLeaseSeconds)
|
.storageLeaseSeconds(storageLeaseSeconds)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
vAppTemplateLeaseSettings = orgClient.updateVAppTemplateLeaseSettings(
|
vAppTemplateLeaseSettings = orgApi.updateVAppTemplateLeaseSettings(
|
||||||
orgRef.getHref(), vAppTemplateLeaseSettings);
|
orgRef.getHref(), vAppTemplateLeaseSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /admin/org/{id}/settings")
|
@Test(description = "GET /admin/org/{id}/settings")
|
||||||
public void testGetSettings() {
|
public void testGetSettings() {
|
||||||
settings = orgClient.getSettings(orgRef.getHref());
|
settings = orgApi.getSettings(orgRef.getHref());
|
||||||
|
|
||||||
Checks.checkOrgSettings(settings);
|
Checks.checkOrgSettings(settings);
|
||||||
}
|
}
|
||||||
|
@ -387,7 +387,7 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.emailSettings(emailSettings.toBuilder().fromEmailAddress(newFromEmailAddress).build())
|
.emailSettings(emailSettings.toBuilder().fromEmailAddress(newFromEmailAddress).build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
OrgSettings modified = orgClient.updateSettings(
|
OrgSettings modified = orgApi.updateSettings(
|
||||||
orgRef.getHref(), newSettings);
|
orgRef.getHref(), newSettings);
|
||||||
|
|
||||||
Checks.checkOrgSettings(settings);
|
Checks.checkOrgSettings(settings);
|
||||||
|
@ -403,7 +403,7 @@ public class AdminOrgClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.emailSettings(emailSettings)
|
.emailSettings(emailSettings)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
settings = orgClient.updateSettings(
|
settings = orgApi.updateSettings(
|
||||||
orgRef.getHref(), restorableSettings);
|
orgRef.getHref(), restorableSettings);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (exception != null) {
|
if (exception != null) {
|
|
@ -25,20 +25,20 @@ import java.net.URI;
|
||||||
import org.jclouds.http.HttpRequest;
|
import org.jclouds.http.HttpRequest;
|
||||||
import org.jclouds.http.HttpResponse;
|
import org.jclouds.http.HttpResponse;
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
import org.jclouds.vcloud.director.v1_5.domain.Link;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRoleRecord;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRoleRecord;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the {@link AdminQueryClient} by observing its side effects.
|
* Test the {@link AdminQueryApi} by observing its side effects.
|
||||||
*
|
*
|
||||||
* @author Aled Sage
|
* @author Aled Sage
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "AdminQueryClientExpectTest")
|
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "AdminQueryApiExpectTest")
|
||||||
public class AdminQueryClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class AdminQueryApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
// TODO Write expect tests for all other admin-query operations
|
// TODO Write expect tests for all other admin-query operations
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class AdminQueryClientExpectTest extends VCloudDirectorAdminClientExpectT
|
||||||
.payload(payloadFromResourceWithContentType("/query/admin/allGroups.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/query/admin/allGroups.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||||
|
|
||||||
QueryResultRecords expected = QueryResultRecords.builder()
|
QueryResultRecords expected = QueryResultRecords.builder()
|
||||||
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/groups/query?page=1&pageSize=25&format=records"))
|
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/groups/query?page=1&pageSize=25&format=records"))
|
||||||
|
@ -80,7 +80,7 @@ public class AdminQueryClientExpectTest extends VCloudDirectorAdminClientExpectT
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getQueryClient().groupsQueryAll(), expected);
|
assertEquals(api.getQueryApi().groupsQueryAll(), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// <?xml version="1.0" encoding="UTF-8"?>
|
// <?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
@ -105,7 +105,7 @@ public class AdminQueryClientExpectTest extends VCloudDirectorAdminClientExpectT
|
||||||
.payload(payloadFromResourceWithContentType("/query/admin/allRoles.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
.payload(payloadFromResourceWithContentType("/query/admin/allRoles.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
|
||||||
|
|
||||||
QueryResultRecords expected = QueryResultRecords.builder()
|
QueryResultRecords expected = QueryResultRecords.builder()
|
||||||
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/roles/query?page=1&pageSize=25&format=records"))
|
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/roles/query?page=1&pageSize=25&format=records"))
|
||||||
|
@ -131,7 +131,7 @@ public class AdminQueryClientExpectTest extends VCloudDirectorAdminClientExpectT
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
assertEquals(client.getQueryClient().rolesQueryAll(), expected);
|
assertEquals(api.getQueryApi().rolesQueryAll(), expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,34 +30,34 @@ import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRecords;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRightRecord;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRightRecord;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRoleRecord;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultRoleRecord;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultStrandedUserRecord;
|
import org.jclouds.vcloud.director.v1_5.domain.query.QueryResultStrandedUserRecord;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests live behavior of {@link AdminQueryClient}.
|
* Tests live behavior of {@link AdminQueryApi}.
|
||||||
*
|
*
|
||||||
* @author Aled Sage
|
* @author Aled Sage
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminQueryClientLiveTest")
|
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminQueryApiLiveTest")
|
||||||
public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class AdminQueryApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience references to API clients.
|
* Convenience references to API apis.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private AdminQueryClient queryClient;
|
private AdminQueryApi queryApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() {
|
public void setupRequiredApis() {
|
||||||
queryClient = adminContext.getApi().getQueryClient();
|
queryApi = adminContext.getApi().getQueryApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(description = "GET /admin/groups/query")
|
@Test(description = "GET /admin/groups/query")
|
||||||
public void testQueryAllGroups() {
|
public void testQueryAllGroups() {
|
||||||
// TODO Ensure there will be at least one record, for asserting result
|
// TODO Ensure there will be at least one record, for asserting result
|
||||||
QueryResultRecords resultRecords = queryClient.groupsQueryAll();
|
QueryResultRecords resultRecords = queryApi.groupsQueryAll();
|
||||||
|
|
||||||
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
||||||
Checks.checkQueryResultRecord(record);
|
Checks.checkQueryResultRecord(record);
|
||||||
|
@ -67,7 +67,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /admin/orgs/query")
|
@Test(description = "GET /admin/orgs/query")
|
||||||
public void testQueryAllOrgs() {
|
public void testQueryAllOrgs() {
|
||||||
// TODO Ensure there will be at least one record, for asserting result
|
// TODO Ensure there will be at least one record, for asserting result
|
||||||
QueryResultRecords resultRecords = queryClient.orgsQueryAll();
|
QueryResultRecords resultRecords = queryApi.orgsQueryAll();
|
||||||
|
|
||||||
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
||||||
Checks.checkQueryResultRecord(record);
|
Checks.checkQueryResultRecord(record);
|
||||||
|
@ -77,7 +77,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /admin/rights/query")
|
@Test(description = "GET /admin/rights/query")
|
||||||
public void testQueryAllRights() {
|
public void testQueryAllRights() {
|
||||||
// TODO Ensure there will be at least one record, for asserting result
|
// TODO Ensure there will be at least one record, for asserting result
|
||||||
QueryResultRecords resultRecords = queryClient.rightsQueryAll();
|
QueryResultRecords resultRecords = queryApi.rightsQueryAll();
|
||||||
|
|
||||||
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
||||||
Checks.checkQueryResultRecord(record);
|
Checks.checkQueryResultRecord(record);
|
||||||
|
@ -88,14 +88,14 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /admin/roles/query")
|
@Test(description = "GET /admin/roles/query")
|
||||||
public void testQueryAllRoles() {
|
public void testQueryAllRoles() {
|
||||||
// TODO Ensure there will be at least one record, for asserting result
|
// TODO Ensure there will be at least one record, for asserting result
|
||||||
QueryResultRecords resultRecords = queryClient.rolesQueryAll();
|
QueryResultRecords resultRecords = queryApi.rolesQueryAll();
|
||||||
|
|
||||||
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
||||||
Checks.checkQueryResultRecord(record);
|
Checks.checkQueryResultRecord(record);
|
||||||
assertEquals(record.getClass(), QueryResultRoleRecord.class, "incorrect record type admin query");
|
assertEquals(record.getClass(), QueryResultRoleRecord.class, "incorrect record type admin query");
|
||||||
}
|
}
|
||||||
|
|
||||||
RoleReferences roleRefs = queryClient.roleReferencesQueryAll();
|
RoleReferences roleRefs = queryApi.roleReferencesQueryAll();
|
||||||
|
|
||||||
for (Reference ref : roleRefs.getReferences()) {
|
for (Reference ref : roleRefs.getReferences()) {
|
||||||
Checks.checkReferenceType(ref);
|
Checks.checkReferenceType(ref);
|
||||||
|
@ -105,7 +105,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /admin/strandedUsers/query")
|
@Test(description = "GET /admin/strandedUsers/query")
|
||||||
public void testQueryAllStrandedUsers() {
|
public void testQueryAllStrandedUsers() {
|
||||||
// TODO Ensure there will be at least one record, for asserting result
|
// TODO Ensure there will be at least one record, for asserting result
|
||||||
QueryResultRecords resultRecords = queryClient.strandedUsersQueryAll();
|
QueryResultRecords resultRecords = queryApi.strandedUsersQueryAll();
|
||||||
|
|
||||||
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
||||||
Checks.checkQueryResultRecord(record);
|
Checks.checkQueryResultRecord(record);
|
||||||
|
@ -116,7 +116,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /admin/users/query")
|
@Test(description = "GET /admin/users/query")
|
||||||
public void testQueryAllUsers() {
|
public void testQueryAllUsers() {
|
||||||
// TODO Ensure there will be at least one record, for asserting result
|
// TODO Ensure there will be at least one record, for asserting result
|
||||||
QueryResultRecords resultRecords = queryClient.usersQueryAll();
|
QueryResultRecords resultRecords = queryApi.usersQueryAll();
|
||||||
|
|
||||||
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
||||||
Checks.checkQueryResultRecord(record);
|
Checks.checkQueryResultRecord(record);
|
||||||
|
@ -127,7 +127,7 @@ public class AdminQueryClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "GET /admin/vdcs/query")
|
@Test(description = "GET /admin/vdcs/query")
|
||||||
public void testQueryAllVdc() {
|
public void testQueryAllVdc() {
|
||||||
// TODO Ensure there will be at least one record, for asserting result
|
// TODO Ensure there will be at least one record, for asserting result
|
||||||
QueryResultRecords resultRecords = queryClient.vdcsQueryAll();
|
QueryResultRecords resultRecords = queryApi.vdcsQueryAll();
|
||||||
|
|
||||||
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
for (QueryResultRecordType record : resultRecords.getRecords()) {
|
||||||
Checks.checkQueryResultRecord(record);
|
Checks.checkQueryResultRecord(record);
|
|
@ -23,20 +23,20 @@ import static org.testng.Assert.assertEquals;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
|
||||||
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminClient;
|
import org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.AdminVdc;
|
import org.jclouds.vcloud.director.v1_5.domain.AdminVdc;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
import org.jclouds.vcloud.director.v1_5.domain.Reference;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VdcClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.features.VdcApiExpectTest;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminClientExpectTest;
|
import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the {@link AdminVdcClient} by observing its side effects.
|
* Test the {@link AdminVdcApi} by observing its side effects.
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "AdminVdcClientExpectTest")
|
@Test(groups = { "unit", "admin" }, singleThreaded = true, testName = "AdminVdcApiExpectTest")
|
||||||
public class AdminVdcClientExpectTest extends VCloudDirectorAdminClientExpectTest {
|
public class AdminVdcApiExpectTest extends VCloudDirectorAdminApiExpectTest {
|
||||||
|
|
||||||
private Reference vdcRef = Reference.builder()
|
private Reference vdcRef = Reference.builder()
|
||||||
.href(URI.create(endpoint + "???"))
|
.href(URI.create(endpoint + "???"))
|
||||||
|
@ -44,7 +44,7 @@ public class AdminVdcClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
@Test( enabled = false )
|
@Test( enabled = false )
|
||||||
public void testGetVdc() {
|
public void testGetVdc() {
|
||||||
VCloudDirectorAdminClient client = requestsSendResponses(loginRequest, sessionResponse,
|
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
|
||||||
new VcloudHttpRequestPrimer()
|
new VcloudHttpRequestPrimer()
|
||||||
.apiCommand("GET", "/admin/vdc/???")
|
.apiCommand("GET", "/admin/vdc/???")
|
||||||
.acceptAnyMedia()
|
.acceptAnyMedia()
|
||||||
|
@ -56,11 +56,11 @@ public class AdminVdcClientExpectTest extends VCloudDirectorAdminClientExpectTes
|
||||||
|
|
||||||
AdminVdc expected = adminVdc();
|
AdminVdc expected = adminVdc();
|
||||||
|
|
||||||
assertEquals(client.getVdcClient().getVdc(vdcRef.getHref()), expected);
|
assertEquals(api.getVdcApi().getVdc(vdcRef.getHref()), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final AdminVdc adminVdc() {
|
public static final AdminVdc adminVdc() {
|
||||||
return AdminVdc.builder().fromVdc(VdcClientExpectTest.getVdc())
|
return AdminVdc.builder().fromVdc(VdcApiExpectTest.getVdc())
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
|
@ -33,28 +33,28 @@ import org.jclouds.vcloud.director.v1_5.domain.Metadata;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry;
|
import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
|
import org.jclouds.vcloud.director.v1_5.domain.MetadataValue;
|
||||||
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
import org.jclouds.vcloud.director.v1_5.domain.Task;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.MetadataClient;
|
import org.jclouds.vcloud.director.v1_5.features.MetadataApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.features.VdcClient;
|
import org.jclouds.vcloud.director.v1_5.features.VdcApi;
|
||||||
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorClientLiveTest;
|
import org.jclouds.vcloud.director.v1_5.internal.BaseVCloudDirectorApiLiveTest;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests behavior of {@link VdcClient}
|
* Tests behavior of {@link VdcApi}
|
||||||
*
|
*
|
||||||
* @author danikov
|
* @author danikov
|
||||||
*/
|
*/
|
||||||
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminVdcClientLiveTest")
|
@Test(groups = { "live", "admin" }, singleThreaded = true, testName = "AdminVdcApiLiveTest")
|
||||||
public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
public class AdminVdcApiLiveTest extends BaseVCloudDirectorApiLiveTest {
|
||||||
|
|
||||||
public static final String VDC = "admin vdc";
|
public static final String VDC = "admin vdc";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience reference to API client.
|
* Convenience reference to API api.
|
||||||
*/
|
*/
|
||||||
protected AdminVdcClient vdcClient;
|
protected AdminVdcApi vdcApi;
|
||||||
protected MetadataClient.Writeable metadataClient;
|
protected MetadataApi.Writeable metadataApi;
|
||||||
|
|
||||||
protected URI adminVdcUri;
|
protected URI adminVdcUri;
|
||||||
|
|
||||||
|
@ -63,9 +63,9 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeClass(alwaysRun = true)
|
@BeforeClass(alwaysRun = true)
|
||||||
public void setupRequiredClients() {
|
public void setupRequiredApis() {
|
||||||
vdcClient = adminContext.getApi().getVdcClient();
|
vdcApi = adminContext.getApi().getVdcApi();
|
||||||
metadataClient = vdcClient.getMetadataClient();
|
metadataApi = vdcApi.getMetadataApi();
|
||||||
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
|
assertNotNull(vdcURI, String.format(REF_REQ_LIVE, VDC));
|
||||||
adminVdcUri = toAdminUri(vdcURI);
|
adminVdcUri = toAdminUri(vdcURI);
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
public void cleanUp() throws Exception {
|
public void cleanUp() throws Exception {
|
||||||
if (metadataKey != null) {
|
if (metadataKey != null) {
|
||||||
try {
|
try {
|
||||||
Task task = metadataClient.deleteMetadataEntry(adminVdcUri, metadataKey);
|
Task task = metadataApi.deleteMetadataEntry(adminVdcUri, metadataKey);
|
||||||
taskDoneEventually(task);
|
taskDoneEventually(task);
|
||||||
} catch (VCloudDirectorException e) {
|
} catch (VCloudDirectorException e) {
|
||||||
logger.warn(e, "Error deleting metadata-value (perhaps it doesn't exist?); continuing...");
|
logger.warn(e, "Error deleting metadata-value (perhaps it doesn't exist?); continuing...");
|
||||||
|
@ -84,7 +84,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /admin/vdc/{id}")
|
@Test(description = "GET /admin/vdc/{id}")
|
||||||
public void testGetVdc() {
|
public void testGetVdc() {
|
||||||
AdminVdc vdc = vdcClient.getVdc(adminVdcUri);
|
AdminVdc vdc = vdcApi.getVdc(adminVdcUri);
|
||||||
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
|
assertNotNull(vdc, String.format(OBJ_REQ_LIVE, VDC));
|
||||||
|
|
||||||
// parent type
|
// parent type
|
||||||
|
@ -94,7 +94,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
// TODO insufficient permissions to test
|
// TODO insufficient permissions to test
|
||||||
@Test(description = "PUT /admin/vdc/{id}", enabled=false)
|
@Test(description = "PUT /admin/vdc/{id}", enabled=false)
|
||||||
public void testEditVdc() throws Exception {
|
public void testEditVdc() throws Exception {
|
||||||
String origName = vdcClient.getVdc(adminVdcUri).getName();
|
String origName = vdcApi.getVdc(adminVdcUri).getName();
|
||||||
String newName = name("a");
|
String newName = name("a");
|
||||||
Exception exception = null;
|
Exception exception = null;
|
||||||
|
|
||||||
|
@ -103,10 +103,10 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Task task = vdcClient.editVdc(adminVdcUri, vdc);
|
Task task = vdcApi.editVdc(adminVdcUri, vdc);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
AdminVdc modified = vdcClient.getVdc(adminVdcUri);
|
AdminVdc modified = vdcApi.getVdc(adminVdcUri);
|
||||||
assertEquals(modified.getName(), newName);
|
assertEquals(modified.getName(), newName);
|
||||||
|
|
||||||
// parent type
|
// parent type
|
||||||
|
@ -116,7 +116,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
AdminVdc restorableVdc = AdminVdc.builder().name(origName).build();
|
AdminVdc restorableVdc = AdminVdc.builder().name(origName).build();
|
||||||
Task task = vdcClient.editVdc(adminVdcUri, restorableVdc);
|
Task task = vdcApi.editVdc(adminVdcUri, restorableVdc);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (exception != null) {
|
if (exception != null) {
|
||||||
|
@ -133,11 +133,11 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
@Test(description = "DELETE /admin/vdc/{id}", enabled=false)
|
@Test(description = "DELETE /admin/vdc/{id}", enabled=false)
|
||||||
public void testDeleteVdc() throws Exception {
|
public void testDeleteVdc() throws Exception {
|
||||||
// TODO Need to have a VDC that we're happy to delete!
|
// TODO Need to have a VDC that we're happy to delete!
|
||||||
Task task = vdcClient.deleteVdc(adminVdcUri);
|
Task task = vdcApi.deleteVdc(adminVdcUri);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
vdcClient.getVdc(adminVdcUri);
|
vdcApi.getVdc(adminVdcUri);
|
||||||
} catch (VCloudDirectorException e) {
|
} catch (VCloudDirectorException e) {
|
||||||
// success; unreachable because it has been deleted
|
// success; unreachable because it has been deleted
|
||||||
}
|
}
|
||||||
|
@ -150,12 +150,12 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
Exception exception = null;
|
Exception exception = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
vdcClient.disableVdc(adminVdcUri);
|
vdcApi.disableVdc(adminVdcUri);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
exception = e;
|
exception = e;
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
vdcClient.enableVdc(adminVdcUri);
|
vdcApi.enableVdc(adminVdcUri);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (exception != null) {
|
if (exception != null) {
|
||||||
logger.warn(e, "Error resetting adminVdc.name; rethrowing original test exception...");
|
logger.warn(e, "Error resetting adminVdc.name; rethrowing original test exception...");
|
||||||
|
@ -169,7 +169,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
|
|
||||||
@Test(description = "GET /admin/vdc/{id}/metadata")
|
@Test(description = "GET /admin/vdc/{id}/metadata")
|
||||||
public void testGetMetadata() throws Exception {
|
public void testGetMetadata() throws Exception {
|
||||||
Metadata metadata = metadataClient.getMetadata(adminVdcUri);
|
Metadata metadata = metadataApi.getMetadata(adminVdcUri);
|
||||||
|
|
||||||
Checks.checkMetadata(metadata);
|
Checks.checkMetadata(metadata);
|
||||||
}
|
}
|
||||||
|
@ -183,10 +183,10 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
.entry(MetadataEntry.builder().entry(metadataKey, metadataValue).build())
|
.entry(MetadataEntry.builder().entry(metadataKey, metadataValue).build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Task task = metadataClient.mergeMetadata(adminVdcUri, metadata);
|
Task task = metadataApi.mergeMetadata(adminVdcUri, metadata);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
MetadataValue modified = metadataClient.getMetadataValue(adminVdcUri, metadataKey);
|
MetadataValue modified = metadataApi.getMetadataValue(adminVdcUri, metadataKey);
|
||||||
Checks.checkMetadataValueFor("AdminVdc", modified, metadataValue);
|
Checks.checkMetadataValueFor("AdminVdc", modified, metadataValue);
|
||||||
Checks.checkMetadata(metadata);
|
Checks.checkMetadata(metadata);
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
// TODO insufficient permissions to test
|
// TODO insufficient permissions to test
|
||||||
@Test(description = "GET /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadata" }, enabled=false)
|
@Test(description = "GET /admin/vdc/{id}/metadata/{key}", dependsOnMethods = { "testSetMetadata" }, enabled=false)
|
||||||
public void testGetMetadataValue() throws Exception {
|
public void testGetMetadataValue() throws Exception {
|
||||||
MetadataValue retrievedMetadataValue = metadataClient.getMetadataValue(adminVdcUri, metadataKey);
|
MetadataValue retrievedMetadataValue = metadataApi.getMetadataValue(adminVdcUri, metadataKey);
|
||||||
|
|
||||||
Checks.checkMetadataValueFor("AdminVdc", retrievedMetadataValue, metadataValue);
|
Checks.checkMetadataValueFor("AdminVdc", retrievedMetadataValue, metadataValue);
|
||||||
}
|
}
|
||||||
|
@ -205,10 +205,10 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
metadataValue = name("value-");
|
metadataValue = name("value-");
|
||||||
MetadataValue newV = MetadataValue.builder().value(metadataValue).build();
|
MetadataValue newV = MetadataValue.builder().value(metadataValue).build();
|
||||||
|
|
||||||
Task task = metadataClient.setMetadata(adminVdcUri, metadataKey, newV);
|
Task task = metadataApi.setMetadata(adminVdcUri, metadataKey, newV);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
MetadataValue retrievedMetadataValue = metadataClient.getMetadataValue(adminVdcUri, metadataKey);
|
MetadataValue retrievedMetadataValue = metadataApi.getMetadataValue(adminVdcUri, metadataKey);
|
||||||
Checks.checkMetadataValueFor("AdminVdc", retrievedMetadataValue, metadataValue);
|
Checks.checkMetadataValueFor("AdminVdc", retrievedMetadataValue, metadataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,11 +217,11 @@ public class AdminVdcClientLiveTest extends BaseVCloudDirectorClientLiveTest {
|
||||||
public void testDeleteMetadataValue() throws Exception {
|
public void testDeleteMetadataValue() throws Exception {
|
||||||
// TODO Remove dependency on other tests; make cleanUp delete a list of metadata entries?
|
// TODO Remove dependency on other tests; make cleanUp delete a list of metadata entries?
|
||||||
|
|
||||||
Task task = metadataClient.deleteMetadataEntry(adminVdcUri, metadataKey);
|
Task task = metadataApi.deleteMetadataEntry(adminVdcUri, metadataKey);
|
||||||
assertTaskSucceeds(task);
|
assertTaskSucceeds(task);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
metadataClient.getMetadataValue(adminVdcUri, metadataKey);
|
metadataApi.getMetadataValue(adminVdcUri, metadataKey);
|
||||||
fail("Retrieval of metadata value "+metadataKey+" should have fail after deletion");
|
fail("Retrieval of metadata value "+metadataKey+" should have fail after deletion");
|
||||||
} catch (VCloudDirectorException e) {
|
} catch (VCloudDirectorException e) {
|
||||||
// success; should not be accessible
|
// success; should not be accessible
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue