Search in sources :

Example 6 with DiskState

use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.

the class AzureComputeEnumerationAdapterService method queryForDiskStates.

/**
 * Get all disk states related to given VMs
 */
private void queryForDiskStates(EnumerationContext ctx, ComputeEnumerationSubStages next) {
    if (ctx.virtualMachines.size() == 0) {
        logFine(() -> "No virtual machines found to be associated with local disks");
        if (ctx.regions.isEmpty()) {
            ctx.subStage = ComputeEnumerationSubStages.DISASSOCIATE_COMPUTE_STATES;
            handleSubStage(ctx);
            return;
        } else {
            ctx.subStage = ComputeEnumerationSubStages.UPDATE_COMPUTE_STATES;
            handleSubStage(ctx);
            return;
        }
    }
    ctx.diskStates.clear();
    List<String> diskIdList = new ArrayList<>();
    for (String instanceId : ctx.virtualMachines.keySet()) {
        VirtualMachineInner virtualMachine = ctx.virtualMachines.get(instanceId);
        String diskId = getVhdUri(virtualMachine);
        if (diskId == null) {
            continue;
        }
        diskIdList.add(diskId);
        List<String> dataDiskIDList = getDataDisksID(virtualMachine, AzureUtils.isDiskManaged(virtualMachine));
        if (null != dataDiskIDList && dataDiskIDList.size() > 0) {
            diskIdList.addAll(dataDiskIDList);
        }
    }
    Query.Builder qBuilder = Query.Builder.create().addKindFieldClause(DiskState.class).addInClause(DiskState.FIELD_NAME_ID, diskIdList, Occurance.SHOULD_OCCUR);
    QueryByPages<DiskState> queryDiskStates = new QueryByPages<>(getHost(), qBuilder.build(), DiskState.class, ctx.parentCompute.tenantLinks, // endpointLink
    null, ctx.parentCompute.documentSelfLink).setMaxPageSize(QueryUtils.MAX_RESULT_LIMIT).setClusterType(ServiceTypeCluster.INVENTORY_SERVICE);
    queryDiskStates.collectDocuments(Collectors.toList()).whenComplete((diskStates, e) -> {
        if (e != null) {
            handleError(ctx, e);
            return;
        }
        if (diskStates == null) {
            return;
        }
        diskStates.forEach(diskState -> ctx.diskStates.put(diskState.id, diskState));
        ctx.subStage = next;
        handleSubStage(ctx);
    });
}
Also used : QueryByPages(com.vmware.photon.controller.model.query.QueryUtils.QueryByPages) Query(com.vmware.xenon.services.common.QueryTask.Query) VirtualMachineInner(com.microsoft.azure.management.compute.implementation.VirtualMachineInner) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) ArrayList(java.util.ArrayList) Builder(com.vmware.xenon.services.common.QueryTask.Query.Builder)

Example 7 with DiskState

use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.

the class AzureComputeEnumerationAdapterService method updateOSDiskProperties.

private void updateOSDiskProperties(EnumerationContext ctx, VirtualMachineInner virtualMachine, String diskUri, Collection<Operation> opCollection) {
    DiskState diskToUpdate = ctx.diskStates.get(diskUri);
    Operation diskToUpdateOp = null;
    if (diskToUpdate == null) {
        diskToUpdate = createOSDiskState(virtualMachine, ctx);
        updateDiskCustomProperties(virtualMachine, ctx, diskToUpdate);
        diskToUpdateOp = Operation.createPost(createInventoryUri(getHost(), DiskService.FACTORY_LINK)).setBody(diskToUpdate);
    } else {
        updateDiskCustomProperties(virtualMachine, ctx, diskToUpdate);
        diskToUpdateOp = Operation.createPatch(createInventoryUri(getHost(), diskToUpdate.documentSelfLink)).setBody(diskToUpdate);
    }
    opCollection.add(diskToUpdateOp);
    ctx.diskStates.put(diskToUpdate.id, diskToUpdate);
}
Also used : DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) Operation(com.vmware.xenon.common.Operation)

Example 8 with DiskState

use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.

the class AzureComputeEnumerationAdapterService method disassociateOrRetireHelper.

/**
 * Helper method to paginate through resources to be deleted.
 */
private void disassociateOrRetireHelper(EnumerationContext ctx, ComputeEnumerationSubStages next) {
    if (ctx.deletionNextPageLink == null) {
        logFine(() -> String.format("Finished %s of compute states for Azure", ctx.request.preserveMissing ? "retiring" : "deletion"));
        ctx.subStage = next;
        handleSubStage(ctx);
        return;
    }
    CompletionHandler completionHandler = (o, e) -> {
        if (e != null) {
            handleError(ctx, e);
            return;
        }
        QueryTask queryTask = o.getBody(QueryTask.class);
        ctx.deletionNextPageLink = queryTask.results.nextPageLink;
        List<Operation> operations = new ArrayList<>();
        for (Object s : queryTask.results.documents.values()) {
            ComputeState computeState = Utils.fromJson(s, ComputeState.class);
            String vmId = computeState.id;
            // present in Azure but have older timestamp in local repository.
            if (ctx.vmIds.contains(vmId) || ctx.regionIds.contains(vmId)) {
                continue;
            }
            if (ctx.request.preserveMissing) {
                logFine(() -> String.format("Retiring compute state %s", computeState.documentSelfLink));
                ComputeState cs = new ComputeState();
                cs.powerState = PowerState.OFF;
                cs.lifecycleState = LifecycleState.RETIRED;
                operations.add(Operation.createPatch(this, computeState.documentSelfLink).setBody(cs));
            } else {
                // Deleting the localResourceState is done by disassociating the endpointLink from the
                // localResourceState. If the localResourceState isn't associated with any other
                // endpointLink, we issue a delete then
                Operation dOp = PhotonModelUtils.createRemoveEndpointLinksOperation(this, ctx.request.endpointLink, computeState);
                if (dOp != null) {
                    dOp.sendWith(getHost());
                    logFine(() -> String.format("Deleting compute state %s", computeState.documentSelfLink));
                }
                if (computeState.diskLinks != null && !computeState.diskLinks.isEmpty()) {
                    computeState.diskLinks.forEach(dl -> {
                        sendRequest(Operation.createGet(this, dl).setCompletion((op, ex) -> {
                            if (ex != null) {
                                logWarning(() -> String.format("Error retrieving " + "diskState: %s", ex.getMessage()));
                            } else {
                                DiskState diskState = op.getBody(DiskState.class);
                                Operation diskOp = PhotonModelUtils.createRemoveEndpointLinksOperation(this, ctx.request.endpointLink, diskState);
                                if (diskOp != null) {
                                    diskOp.sendWith(getHost());
                                    logFine(() -> String.format("Deleting disk state %s of machine %s", dl, computeState.documentSelfLink));
                                }
                            }
                        }));
                    });
                }
                if (computeState.networkInterfaceLinks != null && !computeState.networkInterfaceLinks.isEmpty()) {
                    computeState.networkInterfaceLinks.forEach(nil -> {
                        sendRequest(Operation.createGet(this, nil).setCompletion((op, ex) -> {
                            if (ex != null) {
                                logWarning(() -> String.format("Error retrieving NetworkInterface state: %s", ex.getMessage()));
                            } else {
                                NetworkInterfaceState networkInterfaceState = op.getBody(NetworkInterfaceState.class);
                                Operation nicOp = PhotonModelUtils.createRemoveEndpointLinksOperation(this, ctx.request.endpointLink, networkInterfaceState);
                                if (nicOp != null) {
                                    nicOp.sendWith(getHost());
                                    logFine(() -> String.format("Deleting NetworkInterface state %s of machine %s", nil, computeState.documentSelfLink));
                                }
                            }
                        }));
                    });
                }
            }
        }
        if (operations.size() == 0) {
            logFine(() -> String.format("No compute/disk states to %s", ctx.request.preserveMissing ? "retire" : "delete"));
            disassociateOrRetireHelper(ctx, next);
            return;
        }
        OperationJoin.create(operations).setCompletion((ops, exs) -> {
            if (exs != null) {
                // We don't want to fail the whole data collection if some of the
                // operation fails.
                exs.values().forEach(ex -> logWarning(() -> String.format("Error: %s", ex.getMessage())));
            }
            disassociateOrRetireHelper(ctx, next);
        }).sendWith(this);
    };
    logFine(() -> String.format("Querying page [%s] for resources to be %s", ctx.deletionNextPageLink, ctx.request.preserveMissing ? "retire" : "delete"));
    sendRequest(Operation.createGet(createInventoryUri(this.getHost(), ctx.deletionNextPageLink)).setCompletion(completionHandler));
}
Also used : PowerState(com.vmware.photon.controller.model.resources.ComputeService.PowerState) Arrays(java.util.Arrays) ComputeEnumerateResourceRequest(com.vmware.photon.controller.model.adapterapi.ComputeEnumerateResourceRequest) ServiceTypeCluster(com.vmware.photon.controller.model.util.ClusterUtil.ServiceTypeCluster) LifecycleState(com.vmware.photon.controller.model.resources.ComputeService.LifecycleState) DISK_CONTROLLER_NUMBER(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.DISK_CONTROLLER_NUMBER) Action1(rx.functions.Action1) StringUtils(org.apache.commons.lang3.StringUtils) Azure(com.microsoft.azure.management.Azure) Utils(com.vmware.xenon.common.Utils) Pair(org.apache.commons.lang3.tuple.Pair) SubnetState(com.vmware.photon.controller.model.resources.SubnetService.SubnetState) Map(java.util.Map) StorageDescription(com.vmware.photon.controller.model.resources.StorageDescriptionService.StorageDescription) OSDisk(com.microsoft.azure.management.compute.OSDisk) ResourceEnumerationTaskService(com.vmware.photon.controller.model.tasks.ResourceEnumerationTaskService) NetworkInterfaceState(com.vmware.photon.controller.model.resources.NetworkInterfaceService.NetworkInterfaceState) StatelessService(com.vmware.xenon.common.StatelessService) Set(java.util.Set) NetworkInterfaceService(com.vmware.photon.controller.model.resources.NetworkInterfaceService) StorageAccountTypes(com.microsoft.azure.management.compute.StorageAccountTypes) TagService(com.vmware.photon.controller.model.resources.TagService) CompletionHandler(com.vmware.xenon.common.Operation.CompletionHandler) SOURCE_TASK_LINK(com.vmware.photon.controller.model.constants.PhotonModelConstants.SOURCE_TASK_LINK) InstanceViewStatus(com.microsoft.azure.management.compute.InstanceViewStatus) DeferredResult(com.vmware.xenon.common.DeferredResult) UriUtils(com.vmware.xenon.common.UriUtils) ComputeService(com.vmware.photon.controller.model.resources.ComputeService) NumericRange(com.vmware.xenon.services.common.QueryTask.NumericRange) AZURE_DATA_DISK_CACHING(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AZURE_DATA_DISK_CACHING) ImageReferenceInner(com.microsoft.azure.management.compute.implementation.ImageReferenceInner) VirtualMachinesInner(com.microsoft.azure.management.compute.implementation.VirtualMachinesInner) ComputeDescriptionService(com.vmware.photon.controller.model.resources.ComputeDescriptionService) PhotonModelUtils(com.vmware.photon.controller.model.resources.util.PhotonModelUtils) RegionInfo(com.vmware.photon.controller.model.adapterapi.RegionEnumerationResponse.RegionInfo) TagsUtil(com.vmware.photon.controller.model.adapters.util.TagsUtil) ArrayList(java.util.ArrayList) TagState(com.vmware.photon.controller.model.resources.TagService.TagState) ServiceStateCollectionUpdateRequest(com.vmware.xenon.common.ServiceStateCollectionUpdateRequest) Query(com.vmware.xenon.services.common.QueryTask.Query) EnumerationStages(com.vmware.photon.controller.model.adapters.util.enums.EnumerationStages) OperatingSystemTypes(com.microsoft.azure.management.compute.OperatingSystemTypes) BiConsumer(java.util.function.BiConsumer) AZURE_DIAGNOSTIC_STORAGE_ACCOUNT_LINK(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AZURE_DIAGNOSTIC_STORAGE_ACCOUNT_LINK) AZURE_STORAGE_ACCOUNT_URI(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AZURE_STORAGE_ACCOUNT_URI) VirtualMachineInner(com.microsoft.azure.management.compute.implementation.VirtualMachineInner) AdapterUtils(com.vmware.photon.controller.model.adapters.util.AdapterUtils) DataDisk(com.microsoft.azure.management.compute.DataDisk) ResourceState(com.vmware.photon.controller.model.resources.ResourceState) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) ENVIRONMENT_NAME_AZURE(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ENVIRONMENT_NAME_AZURE) QueryTop(com.vmware.photon.controller.model.query.QueryUtils.QueryTop) CUSTOM_OS_TYPE(com.vmware.photon.controller.model.ComputeProperties.CUSTOM_OS_TYPE) ComputeStateWithDescription(com.vmware.photon.controller.model.resources.ComputeService.ComputeStateWithDescription) PhotonModelConstants(com.vmware.photon.controller.model.constants.PhotonModelConstants) ComputeEnumerateAdapterRequest(com.vmware.photon.controller.model.adapters.util.ComputeEnumerateAdapterRequest) RegionEnumerationResponse(com.vmware.photon.controller.model.adapterapi.RegionEnumerationResponse) QuerySpecification(com.vmware.xenon.services.common.QueryTask.QuerySpecification) PhotonModelUriUtils.createInventoryUri(com.vmware.photon.controller.model.util.PhotonModelUriUtils.createInventoryUri) AuthCredentialsServiceState(com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState) QueryTask(com.vmware.xenon.services.common.QueryTask) AZURE_RESOURCE_GROUP_NAME(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AZURE_RESOURCE_GROUP_NAME) OSType(com.vmware.photon.controller.model.ComputeProperties.OSType) AzureUriPaths(com.vmware.photon.controller.model.adapters.azure.AzureUriPaths) AZURE_MANAGED_DISK_TYPE(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AZURE_MANAGED_DISK_TYPE) ComputeType(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ComputeType) AzureSdkClients(com.vmware.photon.controller.model.adapters.azure.utils.AzureSdkClients) AzureUtils.injectOperationContext(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils.injectOperationContext) CUSTOM_PROP_ENDPOINT_LINK(com.vmware.photon.controller.model.constants.PhotonModelConstants.CUSTOM_PROP_ENDPOINT_LINK) URI(java.net.URI) TagsUtil.newTagState(com.vmware.photon.controller.model.adapters.util.TagsUtil.newTagState) EndpointState(com.vmware.photon.controller.model.resources.EndpointService.EndpointState) AzureConstants(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants) AzureConstants.getQueryResultLimit(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.getQueryResultLimit) ComputeDescription(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) Occurance(com.vmware.xenon.services.common.QueryTask.Query.Occurance) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) List(java.util.List) AzureUtils(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils) AzureUtils.getResourceGroupName(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils.getResourceGroupName) TAG_KEY_TYPE(com.vmware.photon.controller.model.constants.PhotonModelConstants.TAG_KEY_TYPE) Entry(java.util.Map.Entry) NetworkInterfacesInner(com.microsoft.azure.management.network.implementation.NetworkInterfacesInner) QueryOption(com.vmware.xenon.services.common.QueryTask.QuerySpecification.QueryOption) InstanceViewTypes(com.microsoft.azure.management.compute.InstanceViewTypes) TagsUtil.setTagLinksToResourceState(com.vmware.photon.controller.model.adapters.util.TagsUtil.setTagLinksToResourceState) Builder(com.vmware.xenon.services.common.QueryTask.Query.Builder) DiskService(com.vmware.photon.controller.model.resources.DiskService) AzureUtils.isDiskManaged(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils.isDiskManaged) Default(com.vmware.photon.controller.model.adapters.azure.utils.AzureDeferredResultServiceCallback.Default) QueryByPages(com.vmware.photon.controller.model.query.QueryUtils.QueryByPages) AZURE_OSDISK_CACHING(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AZURE_OSDISK_CACHING) PublicIPAddress(com.microsoft.azure.management.network.PublicIPAddress) HashMap(java.util.HashMap) HashSet(java.util.HashSet) AuthCredentialsService(com.vmware.xenon.services.common.AuthCredentialsService) TagsUtil.updateLocalTagStates(com.vmware.photon.controller.model.adapters.util.TagsUtil.updateLocalTagStates) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) EnumerationAction(com.vmware.photon.controller.model.adapterapi.EnumerationAction) AzureResourceType(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AzureResourceType) ExecutorService(java.util.concurrent.ExecutorService) Iterator(java.util.Iterator) NetworkInterfaceIPConfigurationInner(com.microsoft.azure.management.network.implementation.NetworkInterfaceIPConfigurationInner) Operation(com.vmware.xenon.common.Operation) Page(com.microsoft.azure.Page) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) NetworkInterfaceReferenceInner(com.microsoft.azure.management.compute.implementation.NetworkInterfaceReferenceInner) AzureDeferredResultServiceCallback(com.vmware.photon.controller.model.adapters.azure.utils.AzureDeferredResultServiceCallback) NetworkInterfaceInner(com.microsoft.azure.management.network.implementation.NetworkInterfaceInner) Collections(java.util.Collections) OperationJoin(com.vmware.xenon.common.OperationJoin) RESOURCE_GROUP_NAME(com.vmware.photon.controller.model.ComputeProperties.RESOURCE_GROUP_NAME) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) QueryTask(com.vmware.xenon.services.common.QueryTask) NetworkInterfaceState(com.vmware.photon.controller.model.resources.NetworkInterfaceService.NetworkInterfaceState) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) CompletionHandler(com.vmware.xenon.common.Operation.CompletionHandler) ArrayList(java.util.ArrayList) List(java.util.List) Operation(com.vmware.xenon.common.Operation)

Example 9 with DiskState

use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.

the class AzureComputeEnumerationAdapterService method createOSDiskState.

private DiskState createOSDiskState(VirtualMachineInner vm, EnumerationContext ctx) {
    DiskState diskState = new DiskState();
    diskState.id = getVhdUri(vm);
    if (diskState.tagLinks == null) {
        diskState.tagLinks = new HashSet<>();
    }
    if (vm.storageProfile() != null && vm.storageProfile().osDisk() != null && vm.storageProfile().osDisk().diskSizeGB() != null) {
        OSDisk osDisk = vm.storageProfile().osDisk();
        if (osDisk.managedDisk() != null && osDisk.managedDisk().id() != null) {
            // tag as managed disk
            diskState.tagLinks.add(ctx.managedDiskInternalTagLink);
        } else {
            // otherwise tag as vhd, as that is the default type
            diskState.tagLinks.add(ctx.vhdInternalTagLink);
        }
        if (osDisk.diskSizeGB() != null) {
            diskState.capacityMBytes = osDisk.diskSizeGB() * 1024;
        }
        diskState.name = osDisk.name();
    }
    diskState.regionId = vm.location();
    diskState.computeHostLink = ctx.parentCompute.documentSelfLink;
    diskState.resourcePoolLink = ctx.request.resourcePoolLink;
    diskState.tenantLinks = ctx.parentCompute.tenantLinks;
    diskState.status = DiskService.DiskStatus.ATTACHED;
    String id = UUID.randomUUID().toString();
    diskState.documentSelfLink = UriUtils.buildUriPath(DiskService.FACTORY_LINK, id);
    diskState.regionId = vm.location();
    diskState.endpointLink = ctx.request.endpointLink;
    AdapterUtils.addToEndpointLinks(diskState, ctx.request.endpointLink);
    return diskState;
}
Also used : OSDisk(com.microsoft.azure.management.compute.OSDisk) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState)

Example 10 with DiskState

use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.

the class AzureComputeDiskDay2Service method updateDiskState.

/**
 * Update status and LUN of DiskState
 */
private DeferredResult<Operation> updateDiskState(AzureComputeDiskDay2Context context) {
    DiskState diskState = context.diskState;
    if (context.request.operation.equals(ResourceOperation.ATTACH_DISK.operation)) {
        diskState.status = DiskService.DiskStatus.ATTACHED;
    } else if (context.request.operation.equals(ResourceOperation.DETACH_DISK.operation)) {
        diskState.status = DiskService.DiskStatus.AVAILABLE;
        diskState.customProperties.remove(DISK_CONTROLLER_NUMBER);
    }
    if (!context.request.isMockRequest) {
        DataDisk dataDisk = context.provisionedVm.inner().storageProfile().dataDisks().stream().filter(dd -> diskState.name.equalsIgnoreCase(dd.name())).findFirst().orElse(null);
        if (dataDisk != null) {
            if (diskState.customProperties == null) {
                diskState.customProperties = new HashMap<>();
            }
            diskState.customProperties.put(DISK_CONTROLLER_NUMBER, String.valueOf(dataDisk.lun()));
        }
    }
    Operation diskPatchOp = null;
    if (context.request.operation.equals(ResourceOperation.ATTACH_DISK.operation)) {
        diskPatchOp = Operation.createPatch(createInventoryUri(this.getHost(), diskState.documentSelfLink)).setBody(diskState).setReferer(this.getUri());
    } else if (context.request.operation.equals(ResourceOperation.DETACH_DISK.operation)) {
        diskPatchOp = Operation.createPut(createInventoryUri(this.getHost(), diskState.documentSelfLink)).setBody(diskState).setReferer(this.getUri());
    }
    return this.sendWithDeferredResult(diskPatchOp);
}
Also used : DataDisk(com.microsoft.azure.management.compute.DataDisk) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) Operation(com.vmware.xenon.common.Operation) ResourceOperation(com.vmware.photon.controller.model.adapters.registry.operations.ResourceOperation)

Aggregations

DiskState (com.vmware.photon.controller.model.resources.DiskService.DiskState)77 ArrayList (java.util.ArrayList)24 Operation (com.vmware.xenon.common.Operation)23 DiskService (com.vmware.photon.controller.model.resources.DiskService)18 ComputeState (com.vmware.photon.controller.model.resources.ComputeService.ComputeState)16 List (java.util.List)15 EnumerationAction (com.vmware.photon.controller.model.adapterapi.EnumerationAction)13 UriUtils (com.vmware.xenon.common.UriUtils)13 Utils (com.vmware.xenon.common.Utils)13 HashMap (java.util.HashMap)13 TimeUnit (java.util.concurrent.TimeUnit)13 QueryTask (com.vmware.xenon.services.common.QueryTask)12 Query (com.vmware.xenon.services.common.QueryTask.Query)12 HashSet (java.util.HashSet)12 Test (org.junit.Test)11 AzureConstants (com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants)10 PhotonModelUriUtils.createInventoryUri (com.vmware.photon.controller.model.util.PhotonModelUriUtils.createInventoryUri)10 ServiceDocumentQueryResult (com.vmware.xenon.common.ServiceDocumentQueryResult)10 AuthCredentialsService (com.vmware.xenon.services.common.AuthCredentialsService)10 Map (java.util.Map)10