Search in sources :

Example 21 with TagState

use of com.vmware.photon.controller.model.resources.TagService.TagState in project photon-model by vmware.

the class TestAzureLongRunningEnumeration method getInternalTypeTagsList.

private List<TagState> getInternalTypeTagsList() {
    Query query = Query.Builder.create().addKindFieldClause(TagState.class).addFieldClause(TagState.FIELD_NAME_KEY, PhotonModelConstants.TAG_KEY_TYPE).build();
    Map<String, Query.Occurance> origin = new HashMap<>();
    origin.put(DISCOVERED.toString(), Query.Occurance.SHOULD_OCCUR);
    origin.put(SYSTEM.toString(), Query.Occurance.SHOULD_OCCUR);
    origin.put(USER_DEFINED.toString(), Query.Occurance.MUST_NOT_OCCUR);
    Query internalQuery = createOriginTagQuery(Boolean.FALSE, origin);
    query.addBooleanClause(internalQuery);
    QueryStrategy<TagState> queryLocalTags = new QueryTop<>(getHost(), query, TagState.class, null).setMaxResultsLimit(Integer.MAX_VALUE);
    List<TagState> tagStates = waitToComplete(queryLocalTags.collectDocuments(Collectors.toList()));
    return tagStates;
}
Also used : Query(com.vmware.xenon.services.common.QueryTask.Query) PhotonModelUtils.createOriginTagQuery(com.vmware.photon.controller.model.resources.util.PhotonModelUtils.createOriginTagQuery) LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap) AzureTestUtil.randomString(com.vmware.photon.controller.model.adapters.azure.instance.AzureTestUtil.randomString) TagState(com.vmware.photon.controller.model.resources.TagService.TagState) TagsUtil.newTagState(com.vmware.photon.controller.model.adapters.util.TagsUtil.newTagState)

Example 22 with TagState

use of com.vmware.photon.controller.model.resources.TagService.TagState in project photon-model by vmware.

the class AzureDiskEnumerationServiceTest method testManagedDiskEnumeration.

@Test
public void testManagedDiskEnumeration() throws Throwable {
    // Exit if it is mock
    if (this.isMock) {
        return;
    }
    // create a disk in Azure
    Disk disk = createDisk("disk");
    assertNotNull(disk);
    ComputeEnumerateResourceRequest resourceRequest = kickOffEnumeration();
    ComputeEnumerateAdapterRequest request = new ComputeEnumerateAdapterRequest(resourceRequest, this.authState, this.computeHost);
    // Run disk enumeration
    patchServiceSynchronously(AzureDiskEnumerationAdapterService.SELF_LINK, request);
    // Fetch disks from local store to verify if diskState is created after enumeration
    Map<String, DiskState> diskStateMap = ProvisioningUtils.getResourceStates(getHost(), DiskService.FACTORY_LINK, DiskState.class);
    assertTrue("Newly created disk state is not found.", diskStateMap.keySet().stream().anyMatch(s -> s.equalsIgnoreCase(disk.id())));
    // verify internal tag links
    DiskState createdDisk = diskStateMap.entrySet().stream().filter(en -> en.getKey().equalsIgnoreCase(disk.id())).findFirst().get().getValue();
    assertNotNull(createdDisk.tagLinks);
    TagState typeTag = TagsUtil.newTagState(PhotonModelConstants.TAG_KEY_TYPE, AzureConstants.AzureResourceType.azure_managed_disk.toString(), false, this.computeHost.tenantLinks);
    assertTrue("internal tag not found", createdDisk.tagLinks.stream().anyMatch(s -> s.equalsIgnoreCase(typeTag.documentSelfLink)));
    // verify regionId
    assertNotNull("regionId not found", createdDisk.regionId);
    // Delete disk from Azure
    getAzureSdkClients().getComputeManager().disks().deleteById(disk.id());
    // Run enumeration to sync local disk states with disks in Azure
    patchServiceSynchronously(AzureDiskEnumerationAdapterService.SELF_LINK, request);
    // Need to wait for completion of patch operation on disk states
    TimeUnit.SECONDS.sleep(5);
    // After sync, query local disk states to verify endpoint links of disk state are disassociated
    diskStateMap = ProvisioningUtils.getResourceStates(getHost(), DiskService.FACTORY_LINK, DiskState.class);
    diskStateMap.values().forEach(diskState -> {
        if (diskState.id.equalsIgnoreCase(disk.id())) {
            assertTrue("Endpoint link must be null", diskState.endpointLink.isEmpty());
            assertTrue("Endpoint links in DiskState must be empty", diskState.endpointLinks.isEmpty());
        }
    });
}
Also used : VirtualMachine(com.microsoft.azure.management.compute.VirtualMachine) ComputeEnumerateResourceRequest(com.vmware.photon.controller.model.adapterapi.ComputeEnumerateResourceRequest) Region(com.microsoft.azure.management.resources.fluentcore.arm.Region) AzureBaseTest(com.vmware.photon.controller.model.adapters.azure.base.AzureBaseTest) TagsUtil(com.vmware.photon.controller.model.adapters.util.TagsUtil) Level(java.util.logging.Level) TagState(com.vmware.photon.controller.model.resources.TagService.TagState) Map(java.util.Map) After(org.junit.After) EnumerationAction(com.vmware.photon.controller.model.adapterapi.EnumerationAction) ProvisioningUtils(com.vmware.photon.controller.model.tasks.ProvisioningUtils) AzureTestUtil(com.vmware.photon.controller.model.adapters.azure.instance.AzureTestUtil) AzureConstants(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants) DataDisk(com.microsoft.azure.management.compute.DataDisk) Assert.assertNotNull(org.junit.Assert.assertNotNull) Assert.assertTrue(org.junit.Assert.assertTrue) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) Test(org.junit.Test) TimeUnit(java.util.concurrent.TimeUnit) Disk(com.microsoft.azure.management.compute.Disk) UriUtils(com.vmware.xenon.common.UriUtils) PhotonModelConstants(com.vmware.photon.controller.model.constants.PhotonModelConstants) ComputeEnumerateAdapterRequest(com.vmware.photon.controller.model.adapters.util.ComputeEnumerateAdapterRequest) KnownLinuxVirtualMachineImage(com.microsoft.azure.management.compute.KnownLinuxVirtualMachineImage) DiskService(com.vmware.photon.controller.model.resources.DiskService) SdkContext(com.microsoft.azure.management.resources.fluentcore.utils.SdkContext) ComputeEnumerateResourceRequest(com.vmware.photon.controller.model.adapterapi.ComputeEnumerateResourceRequest) ComputeEnumerateAdapterRequest(com.vmware.photon.controller.model.adapters.util.ComputeEnumerateAdapterRequest) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) DataDisk(com.microsoft.azure.management.compute.DataDisk) Disk(com.microsoft.azure.management.compute.Disk) TagState(com.vmware.photon.controller.model.resources.TagService.TagState) AzureBaseTest(com.vmware.photon.controller.model.adapters.azure.base.AzureBaseTest) Test(org.junit.Test)

Example 23 with TagState

use of com.vmware.photon.controller.model.resources.TagService.TagState in project photon-model by vmware.

the class VsphereEnumerationHelper method updateLocalTags.

static void updateLocalTags(VSphereIncrementalEnumerationService service, EnumerationProgress enumerationProgress, AbstractOverlay obj, ResourceState patchResponse) {
    List<TagState> tags;
    try {
        tags = retrieveAttachedTags(service, enumerationProgress.getEndpoint(), obj.getId(), enumerationProgress.getTenantLinks());
    } catch (IOException | RpcException e) {
        service.logWarning("Error updating local tags for %s", patchResponse.documentSelfLink);
        return;
    }
    Map<String, String> remoteTagMap = new HashMap<>();
    for (TagState ts : tags) {
        remoteTagMap.put(ts.key, ts.value);
    }
    TagsUtil.updateLocalTagStates(service, patchResponse, remoteTagMap, null);
}
Also used : HashMap(java.util.HashMap) RpcException(com.vmware.photon.controller.model.adapters.vsphere.vapi.RpcException) IOException(java.io.IOException) TagState(com.vmware.photon.controller.model.resources.TagService.TagState)

Example 24 with TagState

use of com.vmware.photon.controller.model.resources.TagService.TagState in project photon-model by vmware.

the class TestAWSEnumerationTask method testTagEnumeration.

@Test
public void testTagEnumeration() throws Throwable {
    if (this.isMock) {
        return;
    }
    setUpTestVolume(this.host, this.client, this.awsTestContext, this.isMock);
    this.snapshotId = (String) this.awsTestContext.get(TestAWSSetupUtils.SNAPSHOT_KEY);
    this.ebsBlockDevice = new EbsBlockDevice().withSnapshotId(this.snapshotId);
    this.blockDeviceMapping = new BlockDeviceMapping().withDeviceName(BLOCK_DEVICE_NAME).withEbs(this.ebsBlockDevice);
    this.diskId = (String) this.awsTestContext.get(TestAWSSetupUtils.DISK_KEY);
    this.host.log("Running test: " + this.currentTestName.getMethodName());
    // VM tags
    Tag tag1 = new Tag(VM_TAG_KEY_1, VM_TAG_VALUE_1);
    Tag tag2 = new Tag(VM_TAG_KEY_2, VM_TAG_VALUE_2);
    Tag tag3 = new Tag(VM_TAG_KEY_3, VM_TAG_VALUE_3);
    List<Tag> vmTags = Arrays.asList(tag1, tag2, tag3);
    // SG tag
    List<Tag> sgTags = new ArrayList<>();
    sgTags.add(new Tag(INITIAL_SG_TAG, INITIAL_SG_TAG));
    // Network tag
    List<Tag> networkTags = new ArrayList<>();
    networkTags.add(new Tag(INITIAL_VPC_TAG, INITIAL_VPC_TAG));
    // Subnet tag
    List<Tag> subnetTags = new ArrayList<>();
    subnetTags.add(new Tag(INITIAL_SUBNET_TAG, INITIAL_SUBNET_TAG));
    // Disk tag
    List<Tag> diskTags = new ArrayList<>();
    diskTags.add(new Tag(INITIAL_DISK_TAG, INITIAL_DISK_TAG));
    try {
        String linuxVMId1 = provisionAWSEBSVMWithEC2Client(this.host, this.client, EC2_LINUX_AMI, this.subnetId, this.securityGroupId, this.blockDeviceMapping);
        this.instancesToCleanUp.add(linuxVMId1);
        waitForProvisioningToComplete(this.instancesToCleanUp, this.host, this.client, ZERO);
        // Tag the first VM with a name and add some additional tags
        tagResourcesWithName(this.client, VM_NAME, linuxVMId1);
        List<Tag> linuxVMId1Tags = Arrays.asList(tag1, tag2);
        // tag vm, default SG, VPC, Subnet and Disk
        tagResources(this.client, linuxVMId1Tags, linuxVMId1);
        tagResources(this.client, sgTags, this.securityGroupId);
        tagResources(this.client, networkTags, this.vpcId);
        tagResources(this.client, subnetTags, this.subnetId);
        tagResources(this.client, diskTags, this.diskId);
        enumerateResources(this.host, this.computeHost, this.endpointState, this.isMock, TEST_CASE_INITIAL);
        String linuxVMId2 = provisionAWSEBSVMWithEC2Client(this.host, this.client, EC2_LINUX_AMI, this.subnetId, this.securityGroupId, this.blockDeviceMapping);
        this.instancesToCleanUp.add(linuxVMId2);
        waitForProvisioningToComplete(this.instancesToCleanUp, this.host, this.client, ZERO);
        // Name the second VM and add some tags
        tagResourcesWithName(this.client, VM_UPDATED_NAME, linuxVMId2);
        List<Tag> linuxVMId2Tags = Arrays.asList(tag2, tag3);
        tagResources(this.client, linuxVMId2Tags, linuxVMId2);
        // Un-tag the resources
        unTagResources(this.client, sgTags, this.securityGroupId);
        unTagResources(this.client, networkTags, this.vpcId);
        unTagResources(this.client, subnetTags, this.subnetId);
        unTagResources(this.client, diskTags, this.diskId);
        // re-init tag arrays
        sgTags = new ArrayList<>();
        networkTags = new ArrayList<>();
        subnetTags = new ArrayList<>();
        diskTags = new ArrayList<>();
        // new key-value set remotely should result in a new tag state created locally
        // and a new tag link added to the SecurityGroupState, NetworkState, SubnetState and
        // DiskState
        sgTags.add(new Tag(SECONDARY_SG_TAG, SECONDARY_SG_TAG));
        networkTags.add(new Tag(SECONDARY_VPC_TAG, SECONDARY_VPC_TAG));
        subnetTags.add(new Tag(SECONDARY_SUBNET_TAG, SECONDARY_SUBNET_TAG));
        diskTags.add(new Tag(SECONDARY_DISK_TAG, SECONDARY_DISK_TAG));
        // tag again default SG, VPC, Subnet and Disk
        tagResources(this.client, diskTags, this.diskId);
        tagResources(this.client, sgTags, this.securityGroupId);
        tagResources(this.client, networkTags, this.vpcId);
        tagResources(this.client, subnetTags, this.subnetId);
        enumerateResources(this.host, this.computeHost, this.endpointState, this.isMock, TEST_CASE_INITIAL);
        validateComputeName(linuxVMId1, VM_NAME);
        validateComputeName(linuxVMId2, VM_UPDATED_NAME);
        // Validate tag states number
        int allTagsNumber = vmTags.size() + sgTags.size() + networkTags.size() + subnetTags.size() + diskTags.size();
        queryDocumentsAndAssertExpectedCount(this.host, allTagsNumber, TagService.FACTORY_LINK, false);
        ServiceDocumentQueryResult serviceDocumentQueryResult = queryAllFactoryResources(this.host, TagService.FACTORY_LINK);
        Map<String, TagState> tagsMap = new HashMap<>();
        for (Entry<String, Object> entry : serviceDocumentQueryResult.documents.entrySet()) {
            tagsMap.put(entry.getKey(), Utils.fromJson(entry.getValue(), TagState.class));
        }
        // validate security group tags
        Map<String, SecurityGroupState> allSecurityGroupStatesMap = ProvisioningUtils.<SecurityGroupState>getResourceStates(this.host, SecurityGroupService.FACTORY_LINK, SecurityGroupState.class);
        SecurityGroupState defaultSgState = allSecurityGroupStatesMap.get(this.securityGroupId);
        // ensure one link is deleted and one new is added to the sg state. One additional
        // link is an internal tag.
        assertNotNull(defaultSgState.tagLinks);
        assertEquals("Wrong number of security-group tag links found.", 1 + internalTagsCount1, defaultSgState.tagLinks.size());
        // validate vpc tags
        Map<String, NetworkState> allNetworkStatesMap = ProvisioningUtils.<NetworkState>getResourceStates(this.host, NetworkService.FACTORY_LINK, NetworkState.class);
        NetworkState defaultNetworkState = allNetworkStatesMap.get(this.vpcId);
        // ensure one link is deleted and one new is added to the network state. One additional
        // link is an internal tag.
        assertEquals("Wrong number of network tag links found.", 1 + internalTagsCount1, defaultNetworkState.tagLinks.size());
        // validate subnet tags
        Map<String, SubnetState> allSubnetStatesMap = ProvisioningUtils.<SubnetState>getResourceStates(this.host, SubnetService.FACTORY_LINK, SubnetState.class);
        SubnetState defaultSubnetState = allSubnetStatesMap.get(this.subnetId);
        // ensure one link is deleted and one new is added to the subnet state. One additional
        // link is an internal tag.
        assertEquals("Wrong number of subnet tag links found.", 1 + internalTagsCount1, defaultSubnetState.tagLinks.size());
        // validate disk tags
        Map<String, DiskState> allDiskStatesMap = ProvisioningUtils.<DiskState>getResourceStates(this.host, DiskService.FACTORY_LINK, DiskState.class);
        DiskState defaultDiskState = allDiskStatesMap.get(this.diskId);
        // ensure one link is deleted and one new is added to the disk state
        assertEquals("Wrong number of disk tag links found.", 1 + internalTagsCount1, defaultDiskState.tagLinks.size());
        // ensure EBS disk has an internal type tag set
        assertTrue(defaultDiskState.tagLinks.contains(TagsUtil.newTagState(TAG_KEY_TYPE, AWSResourceType.ebs_block.toString(), false, this.endpointState.tenantLinks).documentSelfLink));
        // validate vm tags
        Map<Tag, String> vmTagLinks = new HashMap<>();
        for (Tag tag : vmTags) {
            for (TagState tagState : tagsMap.values()) {
                if (tagState.key.equals(tag.getKey())) {
                    vmTagLinks.put(tag, tagState.documentSelfLink);
                }
            }
        }
        ComputeState linuxVMId1ComputeState = getComputeByAWSId(this.host, linuxVMId1);
        // compute has 2 remote tags + 1 local tag
        assertEquals(linuxVMId1Tags.size() + internalTagsCount1, linuxVMId1ComputeState.tagLinks.size());
        for (Tag tag : linuxVMId1Tags) {
            assertTrue(linuxVMId1ComputeState.tagLinks.contains(vmTagLinks.get(tag)));
        }
        ComputeState linuxVMId2ComputeState = getComputeByAWSId(this.host, linuxVMId2);
        assertEquals(linuxVMId2Tags.size() + internalTagsCount1, linuxVMId2ComputeState.tagLinks.size());
        for (Tag tag : linuxVMId2Tags) {
            assertTrue(linuxVMId2ComputeState.tagLinks.contains(vmTagLinks.get(tag)));
        }
    } catch (Throwable t) {
        this.host.log("Exception occurred during test execution: %s", t.getMessage());
        if (t instanceof AssertionError) {
            fail("Assert exception occurred during test execution: " + t.getMessage());
        }
    } finally {
        // un-tag default SG
        unTagResources(this.client, sgTags, this.securityGroupId);
        // un-tag default VPC
        unTagResources(this.client, networkTags, this.vpcId);
        // un-tag default Subnet
        unTagResources(this.client, subnetTags, this.subnetId);
        // un-tag default Disk
        unTagResources(this.client, diskTags, this.diskId);
        tearDownTestDisk(this.client, this.host, this.awsTestContext, this.isMock);
    }
}
Also used : ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) HashMap(java.util.HashMap) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) ArrayList(java.util.ArrayList) BlockDeviceMapping(com.amazonaws.services.ec2.model.BlockDeviceMapping) NetworkState(com.vmware.photon.controller.model.resources.NetworkService.NetworkState) TagState(com.vmware.photon.controller.model.resources.TagService.TagState) TagsUtil.newTagState(com.vmware.photon.controller.model.adapters.util.TagsUtil.newTagState) SecurityGroupState(com.vmware.photon.controller.model.resources.SecurityGroupService.SecurityGroupState) SubnetState(com.vmware.photon.controller.model.resources.SubnetService.SubnetState) TestAWSSetupUtils.deleteVMsOnThisEndpoint(com.vmware.photon.controller.model.adapters.awsadapter.TestAWSSetupUtils.deleteVMsOnThisEndpoint) ServiceDocumentQueryResult(com.vmware.xenon.common.ServiceDocumentQueryResult) EbsBlockDevice(com.amazonaws.services.ec2.model.EbsBlockDevice) Tag(com.amazonaws.services.ec2.model.Tag) Test(org.junit.Test)

Example 25 with TagState

use of com.vmware.photon.controller.model.resources.TagService.TagState in project photon-model by vmware.

the class AzureNetworkEnumerationAdapterService method createSubnetInternalTagStates.

/**
 * Create internal tag resources for subnets.
 */
private void createSubnetInternalTagStates(NetworkEnumContext context, NetworkEnumStages next) {
    TagState internalTypeTag = newTagState(PhotonModelConstants.TAG_KEY_TYPE, SUBNET_TAG_TYPE_VALUE, false, context.parentCompute.tenantLinks);
    // operation to create tag "type" for subnets.
    Operation.createPost(this, TagService.FACTORY_LINK).setBody(internalTypeTag).setCompletion((o, e) -> {
        if (e != null) {
            logSevere("Error creating internal type tag for subnets %s", e.getMessage());
        } else {
            context.subnetInternalTagsMap.put(PhotonModelConstants.TAG_KEY_TYPE, SUBNET_TAG_TYPE_VALUE);
            context.subnetInternalTagLinksSet.add(internalTypeTag.documentSelfLink);
        }
        handleSubStage(context, next);
    }).sendWith(this);
}
Also used : QUERY_PARAM_API_VERSION(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.QUERY_PARAM_API_VERSION) ComputeEnumerateResourceRequest(com.vmware.photon.controller.model.adapterapi.ComputeEnumerateResourceRequest) ServiceTypeCluster(com.vmware.photon.controller.model.util.ClusterUtil.ServiceTypeCluster) AzureUriPaths(com.vmware.photon.controller.model.adapters.azure.AzureUriPaths) SubnetStateWithParentVNetId(com.vmware.photon.controller.model.adapters.azure.enumeration.AzureNetworkEnumerationAdapterService.NetworkEnumContext.SubnetStateWithParentVNetId) LifecycleState(com.vmware.photon.controller.model.support.LifecycleState) StringUtils(org.apache.commons.lang3.StringUtils) ResourceGroupState(com.vmware.photon.controller.model.resources.ResourceGroupService.ResourceGroupState) MatchType(com.vmware.xenon.services.common.QueryTask.QueryTerm.MatchType) Utils(com.vmware.xenon.common.Utils) SubnetState(com.vmware.photon.controller.model.resources.SubnetService.SubnetState) Map(java.util.Map) URI(java.net.URI) TagsUtil.newTagState(com.vmware.photon.controller.model.adapters.util.TagsUtil.newTagState) VirtualNetworkListResult(com.vmware.photon.controller.model.adapters.azure.model.network.VirtualNetworkListResult) AzureConstants(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants) SubnetService(com.vmware.photon.controller.model.resources.SubnetService) StatelessService(com.vmware.xenon.common.StatelessService) DEFAULT_INSTANCE_ADAPTER_REFERENCE(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.DEFAULT_INSTANCE_ADAPTER_REFERENCE) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) Occurance(com.vmware.xenon.services.common.QueryTask.Query.Occurance) AdapterUtils.getDeletionState(com.vmware.photon.controller.model.adapters.util.AdapterUtils.getDeletionState) Collectors(java.util.stream.Collectors) NETWORK_REST_API_VERSION(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.NETWORK_REST_API_VERSION) List(java.util.List) AzureUtils(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils) Stream(java.util.stream.Stream) TagService(com.vmware.photon.controller.model.resources.TagService) CompletionHandler(com.vmware.xenon.common.Operation.CompletionHandler) AddressSpace(com.vmware.photon.controller.model.adapters.azure.model.network.AddressSpace) DeferredResult(com.vmware.xenon.common.DeferredResult) UriUtils(com.vmware.xenon.common.UriUtils) Entry(java.util.Map.Entry) TagsUtil.setTagLinksToResourceState(com.vmware.photon.controller.model.adapters.util.TagsUtil.setTagLinksToResourceState) AzureUtils.getAzureConfig(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils.getAzureConfig) NumericRange(com.vmware.xenon.services.common.QueryTask.NumericRange) Builder(com.vmware.xenon.services.common.QueryTask.Query.Builder) LIST_VIRTUAL_NETWORKS_URI(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.LIST_VIRTUAL_NETWORKS_URI) ComputeProperties(com.vmware.photon.controller.model.ComputeProperties) ResourceGroupStateType(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.ResourceGroupStateType) QueryByPages(com.vmware.photon.controller.model.query.QueryUtils.QueryByPages) HashMap(java.util.HashMap) PhotonModelUtils(com.vmware.photon.controller.model.resources.util.PhotonModelUtils) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) TagState(com.vmware.photon.controller.model.resources.TagService.TagState) AuthCredentialsService(com.vmware.xenon.services.common.AuthCredentialsService) Query(com.vmware.xenon.services.common.QueryTask.Query) AUTH_HEADER_BEARER_PREFIX(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AUTH_HEADER_BEARER_PREFIX) EnumerationStages(com.vmware.photon.controller.model.adapters.util.enums.EnumerationStages) TagsUtil.updateLocalTagStates(com.vmware.photon.controller.model.adapters.util.TagsUtil.updateLocalTagStates) VirtualNetwork(com.vmware.photon.controller.model.adapters.azure.model.network.VirtualNetwork) BiConsumer(java.util.function.BiConsumer) EnumerationAction(com.vmware.photon.controller.model.adapterapi.EnumerationAction) AzureResourceType(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AzureResourceType) AdapterUtils(com.vmware.photon.controller.model.adapters.util.AdapterUtils) ResourceState(com.vmware.photon.controller.model.resources.ResourceState) Subnet(com.vmware.photon.controller.model.adapters.azure.model.network.Subnet) AdapterUriUtil(com.vmware.photon.controller.model.adapters.util.AdapterUriUtil) Operation(com.vmware.xenon.common.Operation) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) NetworkService(com.vmware.photon.controller.model.resources.NetworkService) 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) ApplicationTokenCredentials(com.microsoft.azure.credentials.ApplicationTokenCredentials) NetworkState(com.vmware.photon.controller.model.resources.NetworkService.NetworkState) Collections(java.util.Collections) OperationJoin(com.vmware.xenon.common.OperationJoin) TagsUtil.newTagState(com.vmware.photon.controller.model.adapters.util.TagsUtil.newTagState) TagState(com.vmware.photon.controller.model.resources.TagService.TagState)

Aggregations

TagState (com.vmware.photon.controller.model.resources.TagService.TagState)31 ArrayList (java.util.ArrayList)18 HashMap (java.util.HashMap)18 Operation (com.vmware.xenon.common.Operation)15 Query (com.vmware.xenon.services.common.QueryTask.Query)15 HashSet (java.util.HashSet)14 Map (java.util.Map)14 TagsUtil.newTagState (com.vmware.photon.controller.model.adapters.util.TagsUtil.newTagState)13 Utils (com.vmware.xenon.common.Utils)13 TagService (com.vmware.photon.controller.model.resources.TagService)12 QueryTask (com.vmware.xenon.services.common.QueryTask)12 List (java.util.List)12 Set (java.util.Set)12 StatelessService (com.vmware.xenon.common.StatelessService)11 Collectors (java.util.stream.Collectors)11 DiskState (com.vmware.photon.controller.model.resources.DiskService.DiskState)10 UriUtils (com.vmware.xenon.common.UriUtils)10 PhotonModelConstants (com.vmware.photon.controller.model.constants.PhotonModelConstants)8 QueryUtils (com.vmware.photon.controller.model.query.QueryUtils)8 ResourceState (com.vmware.photon.controller.model.resources.ResourceState)8