use of com.vmware.photon.controller.model.tasks.TaskOption in project photon-model by vmware.
the class TestAWSSetupUtils method performResourceStatsCollection.
/**
* Performs stats collection for given resourcePoolLink
*/
public static StatsCollectionTaskState performResourceStatsCollection(VerificationHost host, EnumSet<TaskOption> options, String resourcePoolLink) throws Throwable {
StatsCollectionTaskState statsCollectionTaskState = new StatsCollectionTaskState();
statsCollectionTaskState.resourcePoolLink = resourcePoolLink;
statsCollectionTaskState.options = EnumSet.noneOf(TaskOption.class);
if (options != null) {
statsCollectionTaskState.options = options;
}
URI uri = UriUtils.buildUri(host, StatsCollectionTaskService.FACTORY_LINK);
StatsCollectionTaskState statsTask = TestUtils.doPost(host, statsCollectionTaskState, StatsCollectionTaskState.class, uri);
return statsTask;
}
use of com.vmware.photon.controller.model.tasks.TaskOption in project photon-model by vmware.
the class AzureTestUtil method performResourceStatsCollection.
/**
* Performs stats collection for given resourcePoolLink.
*/
public static StatsCollectionTaskState performResourceStatsCollection(VerificationHost host, EnumSet<TaskOption> options, String resourcePoolLink) throws Throwable {
StatsCollectionTaskState statsCollectionTaskState = new StatsCollectionTaskState();
statsCollectionTaskState.resourcePoolLink = resourcePoolLink;
statsCollectionTaskState.options = EnumSet.noneOf(TaskOption.class);
if (options != null) {
statsCollectionTaskState.options = options;
}
URI uri = UriUtils.buildUri(host, StatsCollectionTaskService.FACTORY_LINK);
StatsCollectionTaskState statsTask = TestUtils.doPost(host, statsCollectionTaskState, StatsCollectionTaskState.class, uri);
return statsTask;
}
use of com.vmware.photon.controller.model.tasks.TaskOption in project photon-model by vmware.
the class TestAWSSetupUtils method performResourceEnumeration.
/**
* Method to perform compute resource enumeration on the AWS endpoint.
*
* @param resourcePoolLink
* The link to the AWS resource pool.
* @param computeDescriptionLink
* The link to the compute description for the AWS host.
* @param parentComputeLink
* The compute state associated with the AWS host.
* @return
* @throws Throwable
*/
public static ResourceEnumerationTaskState performResourceEnumeration(VerificationHost host, ComputeState computeHost, EndpointState endpointState, URI peerURI, EnumSet<TaskOption> options) throws Throwable {
// Kick of a Resource Enumeration task to enumerate the instances on the AWS endpoint
ResourceEnumerationTaskState enumerationTaskState = new ResourceEnumerationTaskState();
enumerationTaskState.parentComputeLink = computeHost.documentSelfLink;
enumerationTaskState.enumerationAction = EnumerationAction.START;
enumerationTaskState.adapterManagementReference = UriUtils.buildUri(AWSEnumerationAdapterService.SELF_LINK);
enumerationTaskState.resourcePoolLink = computeHost.resourcePoolLink;
if (options != null) {
enumerationTaskState.options = options;
} else {
enumerationTaskState.options = EnumSet.noneOf(TaskOption.class);
}
enumerationTaskState.tenantLinks = endpointState.tenantLinks;
enumerationTaskState.endpointLink = endpointState.documentSelfLink;
URI uri = createServiceURI(host, peerURI, ResourceEnumerationTaskService.FACTORY_LINK);
return TestUtils.doPost(host, enumerationTaskState, ResourceEnumerationTaskState.class, uri);
}
Aggregations