public async Task GetAllSystemImagesAllLocations() { using (ComputeApiClient apiClient = new ComputeApiClient("AU")) { await apiClient.LoginAsync( accountCredentials: GetIntegrationTestCredentials() ); foreach (DatacenterWithMaintenanceStatusType datacenter in await apiClient.GetDataCentersWithMaintenanceStatuses()) { TestContext.WriteLine("DataCenter '{0}' ({1}):", datacenter.location, datacenter.displayName); foreach (var image in await apiClient.GetImages(null,null,datacenter.location,null,null)) { TestContext.WriteLine( "\tImage '{0}' (Id = '{1}') - '{2}' ({3})", image.name, image.id, image.operatingSystem[0].type, image.operatingSystem[0].displayName ); } } } }
public async Task GetAvailableDatacenters() { ICredentials credentials = GetIntegrationTestCredentials(); using (ComputeApiClient computeApiClient = new ComputeApiClient("au")) { IAccount account = await computeApiClient .LoginAsync(credentials); Assert.IsNotNull(account); Guid organizationId = account.OrganizationId; Assert.AreNotEqual(Guid.Empty, organizationId); IEnumerable<DatacenterWithMaintenanceStatusType> dataCenters = await computeApiClient .GetDataCentersWithMaintenanceStatuses(); Assert.AreNotEqual(0, dataCenters.Count()); foreach (DatacenterWithMaintenanceStatusType dataCenter in dataCenters) TestContext.WriteLine("{0}:{1} ({2})", dataCenter.location, dataCenter.displayName, dataCenter.country); } }