Search in sources :

Example 6 with RegionEnumerationResponse

use of com.vmware.photon.controller.model.adapterapi.RegionEnumerationResponse in project photon-model by vmware.

the class TestAWSEnumerationTask method testGetAvailableRegions.

@Test
public void testGetAvailableRegions() {
    URI uri = UriUtils.buildUri(ServiceHost.LOCAL_HOST, host.getPort(), UriPaths.AdapterTypePath.REGION_ENUMERATION_ADAPTER.adapterLink(PhotonModelConstants.EndpointType.aws.toString().toLowerCase()), null);
    Operation post = Operation.createPost(uri);
    post.setBody(new AuthCredentialsServiceState());
    Operation operation = host.getTestRequestSender().sendAndWait(post);
    RegionEnumerationResponse result = operation.getBody(RegionEnumerationResponse.class);
    assertEquals(Regions.values().length, result.regions.size());
}
Also used : AuthCredentialsServiceState(com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState) RegionEnumerationResponse(com.vmware.photon.controller.model.adapterapi.RegionEnumerationResponse) Operation(com.vmware.xenon.common.Operation) URI(java.net.URI) Test(org.junit.Test)

Aggregations

RegionEnumerationResponse (com.vmware.photon.controller.model.adapterapi.RegionEnumerationResponse)6 Operation (com.vmware.xenon.common.Operation)5 EndpointState (com.vmware.photon.controller.model.resources.EndpointService.EndpointState)3 RegionInfo (com.vmware.photon.controller.model.adapterapi.RegionEnumerationResponse.RegionInfo)2 AuthCredentialsServiceState (com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState)2 URI (java.net.URI)2 Test (org.junit.Test)2 Regions (com.amazonaws.regions.Regions)1 ComputeProperties (com.vmware.photon.controller.model.ComputeProperties)1 CUSTOM_PROP_STORAGE_SHARED (com.vmware.photon.controller.model.ComputeProperties.CUSTOM_PROP_STORAGE_SHARED)1 RESOURCE_TYPE_KEY (com.vmware.photon.controller.model.ComputeProperties.RESOURCE_TYPE_KEY)1 UriPaths (com.vmware.photon.controller.model.UriPaths)1 AWSUriPaths (com.vmware.photon.controller.model.adapters.awsadapter.AWSUriPaths)1 EndpointAdapterUtils (com.vmware.photon.controller.model.adapters.util.EndpointAdapterUtils)1 VimNames (com.vmware.photon.controller.model.adapters.vsphere.util.VimNames)1 BasicConnection (com.vmware.photon.controller.model.adapters.vsphere.util.connection.BasicConnection)1 DatacenterLister (com.vmware.photon.controller.model.adapters.vsphere.util.finders.DatacenterLister)1 PhotonModelConstants (com.vmware.photon.controller.model.constants.PhotonModelConstants)1 BaseModelTest (com.vmware.photon.controller.model.helpers.BaseModelTest)1 ResourceMetricsService (com.vmware.photon.controller.model.monitoring.ResourceMetricsService)1