Search in sources :

Example 6 with ServiceStateCollectionUpdateRequest

use of com.vmware.xenon.common.ServiceStateCollectionUpdateRequest in project photon-model by vmware.

the class AWSNetworkUtils method removeNetworkLinkAndDocument.

/**
 * Remove a compute state's networkLink and delete the link's corresponding document
 *
 * @param service
 *            Service to issue the patch to.
 * @param computeState
 *            The compute state to be updated.
 * @param networkLink
 *            The network link need to be removed.
 * @param enumerationOperations
 *            The operation list to store the operations.
 * @return
 */
public static void removeNetworkLinkAndDocument(StatelessService service, ComputeState computeState, String networkLink, List<Operation> enumerationOperations) {
    // create a PATCH to remove one ComputeState's networkLink
    Map<String, Collection<Object>> collectionsMap = new HashMap<>();
    Collection<Object> networkLinksToBeRemoved = new ArrayList<>(Arrays.asList(networkLink));
    collectionsMap.put(ComputeState.FIELD_NAME_NETWORK_INTERFACE_LINKS, networkLinksToBeRemoved);
    ServiceStateCollectionUpdateRequest collectionRemovalBody = ServiceStateCollectionUpdateRequest.create(null, collectionsMap);
    Operation removeNetworkLinkOperation = Operation.createPatch(UriUtils.buildUri(service.getHost(), computeState.documentSelfLink)).setBody(collectionRemovalBody).setReferer(service.getUri());
    enumerationOperations.add(removeNetworkLinkOperation);
    // create a DELETE to remove that networkLink's corresponding document
    Operation removeNetworkLinkDocumentOperation = Operation.createDelete(UriUtils.buildUri(service.getHost(), networkLink)).setReferer(service.getUri());
    enumerationOperations.add(removeNetworkLinkDocumentOperation);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Collection(java.util.Collection) ServiceStateCollectionUpdateRequest(com.vmware.xenon.common.ServiceStateCollectionUpdateRequest) Operation(com.vmware.xenon.common.Operation)

Example 7 with ServiceStateCollectionUpdateRequest

use of com.vmware.xenon.common.ServiceStateCollectionUpdateRequest in project photon-model by vmware.

the class AWSComputeStateCreationAdapterService method populateUpdateOperations.

private void populateUpdateOperations(AWSComputeStateCreationContext context, AWSComputeStateCreationStage next) {
    if (context.request.instancesToBeUpdated == null || context.request.instancesToBeUpdated.size() == 0) {
        logFine(() -> "No local compute states to be updated");
        context.creationStage = next;
        handleComputeStateCreateOrUpdate(context);
    } else {
        logFine(() -> String.format("Need to update %d local compute states", context.request.instancesToBeUpdated.size()));
        for (String instanceId : context.request.instancesToBeUpdated.keySet()) {
            Instance instance = context.request.instancesToBeUpdated.get(instanceId);
            ComputeState existingComputeState = context.request.computeStatesToBeUpdated.get(instanceId);
            if (StringUtils.isEmpty(existingComputeState.endpointLink)) {
                existingComputeState.endpointLink = context.request.endpointLink;
            }
            Set<String> endpointLinks = new HashSet<>();
            if (existingComputeState.endpointLinks != null) {
                endpointLinks.addAll(existingComputeState.endpointLinks);
            }
            endpointLinks.add(context.request.endpointLink);
            // Calculate NICs delta - collection of NIC States to add, to update and to delete
            Map<String, List<Integer>> deviceIndexesDelta = new HashMap<>();
            Map<String, Map<String, Collection<Object>>> linksToNICSToAddOrRemove = new HashMap<>();
            // The stopped or stopping instance does not have full network settings.
            if (!AWSEnumerationUtils.instanceIsInStoppedState(instance)) {
                // Get existing NetworkInterfaceStates for this ComputeState
                List<NetworkInterfaceState> existingNicStates = context.request.nicStatesToBeUpdated.get(instanceId);
                deviceIndexesDelta = calculateNICsDeviceIndexesDelta(instance, existingNicStates);
                linksToNICSToAddOrRemove = addUpdateOrRemoveNICStates(context, instance, deviceIndexesDelta, existingComputeState.endpointLink, endpointLinks);
            }
            // Create dedicated PATCH operation for updating NIC Links {{
            if (linksToNICSToAddOrRemove.get(ADD_NIC_STATES) != null || linksToNICSToAddOrRemove.get(REMOVE_NIC_STATES) != null) {
                ServiceStateCollectionUpdateRequest updateComputeStateRequest = ServiceStateCollectionUpdateRequest.create(linksToNICSToAddOrRemove.get(ADD_NIC_STATES), linksToNICSToAddOrRemove.get(REMOVE_NIC_STATES));
                Operation patchComputeStateNICLinks = Operation.createPatch(UriUtils.buildUri(this.getHost(), existingComputeState.documentSelfLink)).setBody(updateComputeStateRequest).setReferer(this.getUri());
                context.enumerationOperations.add(patchComputeStateNICLinks);
            }
            // Update ComputeState
            String zoneId = instance.getPlacement().getAvailabilityZone();
            ZoneData zoneData = context.request.zones.get(zoneId);
            ComputeState computeStateToBeUpdated = mapInstanceToComputeState(this.getHost(), instance, context.request.parentComputeLink, zoneData.computeLink, existingComputeState.resourcePoolLink != null ? existingComputeState.resourcePoolLink : context.request.resourcePoolLink, existingComputeState.endpointLink, endpointLinks, existingComputeState.descriptionLink, context.request.parentCDStatsAdapterReferences, context.internalTagLinksMap.get(ec2_instance.toString()), zoneData.regionId, zoneId, context.request.tenantLinks, null, false, null);
            computeStateToBeUpdated.documentSelfLink = existingComputeState.documentSelfLink;
            Operation patchComputeState = createPatchOperation(this, computeStateToBeUpdated, existingComputeState.documentSelfLink);
            context.enumerationOperations.add(patchComputeState);
            // Reconcile remote diskLinks with current diskLinks of existing computeState and
            // update them with collection update request if needed.
            List<String> remoteDiskLinks = context.diskLinksByInstances.get(instance);
            List<String> currentDiskLinks = existingComputeState.diskLinks;
            Collection<Object> linksToAdd = new ArrayList<>();
            Collection<Object> linksToRemove = new ArrayList<>();
            if (remoteDiskLinks == null && currentDiskLinks != null) {
                linksToRemove.addAll(currentDiskLinks);
            } else if (remoteDiskLinks != null && currentDiskLinks == null) {
                linksToAdd.addAll(remoteDiskLinks);
            } else if (remoteDiskLinks != null && currentDiskLinks != null) {
                currentDiskLinks.stream().forEach(link -> {
                    if (!remoteDiskLinks.contains(link)) {
                        linksToRemove.add(link);
                    }
                });
                remoteDiskLinks.removeAll(currentDiskLinks);
                linksToAdd.addAll(remoteDiskLinks);
            }
            // If existing computeState does not have an internal tag then we need to add it
            // to tagLinks with collection update request patch.
            String ec2ComputeInternalTagLink = context.internalTagLinksMap.get(ec2_instance.toString()).iterator().next();
            // and send a combined collection update request for both of these.
            if (existingComputeState.tagLinks == null || (existingComputeState.tagLinks != null && !existingComputeState.tagLinks.contains(ec2ComputeInternalTagLink)) || !linksToAdd.isEmpty() || !linksToRemove.isEmpty()) {
                Map<String, Collection<Object>> itemsToAdd = new HashMap<>();
                Map<String, Collection<Object>> itemsToRemove = new HashMap<>();
                itemsToAdd.put(ComputeState.FIELD_NAME_DISK_LINKS, linksToAdd);
                itemsToRemove.put(ComputeState.FIELD_NAME_DISK_LINKS, linksToRemove);
                itemsToAdd.put(ComputeState.FIELD_NAME_TAG_LINKS, Collections.singletonList(ec2ComputeInternalTagLink));
                ServiceStateCollectionUpdateRequest updateTagLinksAndDiskLinks = ServiceStateCollectionUpdateRequest.create(itemsToAdd, itemsToRemove);
                context.enumerationOperations.add(Operation.createPatch(this.getHost(), existingComputeState.documentSelfLink).setBody(updateTagLinksAndDiskLinks).setReferer(this.getUri()));
            }
        }
        context.creationStage = next;
        handleComputeStateCreateOrUpdate(context);
    }
}
Also used : AWSEnumerationUtils.mapInstanceToComputeState(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSEnumerationUtils.mapInstanceToComputeState) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) Instance(com.amazonaws.services.ec2.model.Instance) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) NetworkInterfaceState(com.vmware.photon.controller.model.resources.NetworkInterfaceService.NetworkInterfaceState) ArrayList(java.util.ArrayList) ServiceStateCollectionUpdateRequest(com.vmware.xenon.common.ServiceStateCollectionUpdateRequest) AdapterUtils.createDeleteOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createDeleteOperation) AdapterUtils.createPatchOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createPatchOperation) AdapterUtils.createPostOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createPostOperation) Operation(com.vmware.xenon.common.Operation) ZoneData(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSEnumerationUtils.ZoneData) Collection(java.util.Collection) List(java.util.List) ArrayList(java.util.ArrayList) AWSEnumerationUtils.getRepresentativeListOfCDsFromInstanceList(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSEnumerationUtils.getRepresentativeListOfCDsFromInstanceList) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) HashSet(java.util.HashSet)

Example 8 with ServiceStateCollectionUpdateRequest

use of com.vmware.xenon.common.ServiceStateCollectionUpdateRequest in project photon-model by vmware.

the class AWSComputeStateCreationAdapterService method updateNICState.

/**
 * For each NetworkInterfaceState, obtain the corresponding AWS NIC, and generate POST operation
 * to update its private address
 */
private NetworkInterfaceState updateNICState(AWSComputeStateCreationContext context, Instance instance, NetworkInterfaceState existingNicState) {
    InstanceNetworkInterface awsNic = instance.getNetworkInterfaces().stream().filter(currentAwsNic -> currentAwsNic.getAttachment().getDeviceIndex() == existingNicState.deviceIndex).findFirst().orElse(null);
    // create a new NetworkInterfaceState for updating the address
    NetworkInterfaceState updateNicState = new NetworkInterfaceState();
    if (StringUtils.isEmpty(updateNicState.endpointLink)) {
        updateNicState.endpointLink = context.request.endpointLink;
    }
    // endpoint link.
    if (existingNicState.endpointLinks == null) {
        updateNicState.endpointLinks = new HashSet<>();
    } else {
        updateNicState.endpointLinks = existingNicState.endpointLinks;
    }
    updateNicState.endpointLinks.add(context.request.endpointLink);
    updateNicState.address = awsNic.getPrivateIpAddress();
    if (context.request.enumeratedSecurityGroups != null) {
        for (GroupIdentifier awsSG : awsNic.getGroups()) {
            // we should have updated the list of SG Ids before this step and should have
            // ensured that all the SGs exist locally
            String securityGroupLink = context.request.enumeratedSecurityGroups.securityGroupStates.get(awsSG.getGroupId());
            if (securityGroupLink == null || securityGroupLink.isEmpty()) {
                continue;
            }
            if (updateNicState.securityGroupLinks == null) {
                updateNicState.securityGroupLinks = new ArrayList<>();
            }
            updateNicState.securityGroupLinks.add(securityGroupLink);
        }
    }
    // create update operation and add it for batch execution on the next stage
    Operation updateNicOperation = createPatchOperation(this, updateNicState, existingNicState.documentSelfLink);
    context.enumerationOperations.add(updateNicOperation);
    // If existing network state does not have an internal tag then create dedicated
    // patch to update the internal tag link.
    String networkInterfaceInternalTagLink = context.internalTagLinksMap.get(ec2_net_interface.toString()).iterator().next();
    if (existingNicState.tagLinks == null || (existingNicState.tagLinks != null && !existingNicState.tagLinks.contains(networkInterfaceInternalTagLink))) {
        Map<String, Collection<Object>> collectionsToAddMap = Collections.singletonMap(NetworkInterfaceState.FIELD_NAME_TAG_LINKS, Collections.singletonList(networkInterfaceInternalTagLink));
        Map<String, Collection<Object>> collectionsToRemoveMap = Collections.singletonMap(NetworkInterfaceState.FIELD_NAME_TAG_LINKS, Collections.emptyList());
        ServiceStateCollectionUpdateRequest updateTagLinksRequest = ServiceStateCollectionUpdateRequest.create(collectionsToAddMap, collectionsToRemoveMap);
        context.enumerationOperations.add(Operation.createPatch(this.getHost(), existingNicState.documentSelfLink).setReferer(this.getUri()).setBody(updateTagLinksRequest));
    }
    return updateNicState;
}
Also used : NetworkInterfaceState(com.vmware.photon.controller.model.resources.NetworkInterfaceService.NetworkInterfaceState) Collection(java.util.Collection) ServiceStateCollectionUpdateRequest(com.vmware.xenon.common.ServiceStateCollectionUpdateRequest) AdapterUtils.createDeleteOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createDeleteOperation) AdapterUtils.createPatchOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createPatchOperation) AdapterUtils.createPostOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createPostOperation) Operation(com.vmware.xenon.common.Operation) InstanceNetworkInterface(com.amazonaws.services.ec2.model.InstanceNetworkInterface) GroupIdentifier(com.amazonaws.services.ec2.model.GroupIdentifier)

Example 9 with ServiceStateCollectionUpdateRequest

use of com.vmware.xenon.common.ServiceStateCollectionUpdateRequest in project photon-model by vmware.

the class AWSS3StorageEnumerationAdapterService method createDiskStates.

/**
 * Creates the disk states that represent the buckets received from AWS during
 * enumeration. Fields currently being enumerated for S3 are all immutable on AWS side, hence we only create
 * disks and don't patch to them in subsequent except for changes in tagLinks.
 */
private void createDiskStates(S3StorageEnumerationContext aws, S3StorageEnumerationSubStage next) {
    // For all the disks to be created, we filter them based on whether we were able to find the correct
    // region for the disk using getBucketTaggingConfiguration() call and then map them and create operations.
    // Filtering is done to avoid creating disk states with null region (since we don't PATCH region field
    // after creating the disk, we need to ensure that disk state is initially created with the correct region).
    // kick off the operation using a JOIN
    List<DiskState> diskStatesToBeCreated = new ArrayList<>();
    aws.bucketsToBeCreated.stream().filter(bucket -> aws.regionsByBucketName.containsKey(bucket.getName())).forEach(bucket -> {
        diskStatesToBeCreated.add(mapBucketToDiskState(bucket, aws));
    });
    diskStatesToBeCreated.forEach(diskState -> aws.enumerationOperations.add(createPostOperation(this, diskState, DiskService.FACTORY_LINK)));
    this.logFine(() -> String.format("Creating %d S3 disks", aws.bucketsToBeCreated.size()));
    // For those disk states which do not have the tagLink, add the tagLink by PATCHing those states.
    if (aws.internalTypeTagSelfLink != null) {
        aws.diskStatesToBeUpdatedByBucketName.entrySet().stream().filter(diskMap -> diskMap.getValue().tagLinks == null || !diskMap.getValue().tagLinks.contains(aws.internalTypeTagSelfLink)).forEach(diskMap -> {
            Map<String, Collection<Object>> collectionsToAddMap = Collections.singletonMap(DiskState.FIELD_NAME_TAG_LINKS, Collections.singletonList(aws.internalTypeTagSelfLink));
            Map<String, Collection<Object>> collectionsToRemoveMap = Collections.singletonMap(DiskState.FIELD_NAME_TAG_LINKS, Collections.emptyList());
            ServiceStateCollectionUpdateRequest updateTagLinksRequest = ServiceStateCollectionUpdateRequest.create(collectionsToAddMap, collectionsToRemoveMap);
            aws.enumerationOperations.add(Operation.createPatch(this.getHost(), diskMap.getValue().documentSelfLink).setReferer(aws.service.getUri()).setBody(updateTagLinksRequest));
        });
    }
    // update endpointLinks
    aws.diskStatesToBeUpdatedByBucketName.entrySet().stream().filter(diskMap -> diskMap.getValue().endpointLinks == null || !diskMap.getValue().endpointLinks.contains(aws.request.original.endpointLink)).forEach(diskMap -> {
        Map<String, Collection<Object>> collectionsToAddMap = Collections.singletonMap(DiskState.FIELD_NAME_ENDPOINT_LINKS, Collections.singletonList(aws.request.original.endpointLink));
        Map<String, Collection<Object>> collectionsToRemoveMap = Collections.singletonMap(DiskState.FIELD_NAME_ENDPOINT_LINKS, Collections.emptyList());
        ServiceStateCollectionUpdateRequest updateEndpointLinksRequest = ServiceStateCollectionUpdateRequest.create(collectionsToAddMap, collectionsToRemoveMap);
        aws.enumerationOperations.add(Operation.createPatch(this.getHost(), diskMap.getValue().documentSelfLink).setReferer(aws.service.getUri()).setBody(updateEndpointLinksRequest));
    });
    OperationJoin.JoinedCompletionHandler joinCompletion = (ox, exc) -> {
        if (exc != null) {
            this.logSevere(() -> String.format("Error creating/updating disk %s", Utils.toString(exc)));
            aws.subStage = S3StorageEnumerationSubStage.DELETE_DISKS;
            handleReceivedEnumerationData(aws);
            return;
        }
        ox.entrySet().stream().forEach(operationEntry -> {
            aws.diskStatesEnumerated.add(operationEntry.getValue().getBody(DiskState.class));
        });
        this.logFine(() -> "Successfully created and updated all the disk states.");
        aws.subStage = next;
        handleReceivedEnumerationData(aws);
    };
    if (aws.enumerationOperations.isEmpty()) {
        aws.subStage = next;
        handleReceivedEnumerationData(aws);
        return;
    }
    OperationJoin joinOp = OperationJoin.create(aws.enumerationOperations);
    joinOp.setCompletion(joinCompletion);
    joinOp.sendWith(this.getHost());
}
Also used : BUCKET_OWNER_NAME(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.BUCKET_OWNER_NAME) BucketTaggingConfiguration(com.amazonaws.services.s3.model.BucketTaggingConfiguration) AWSResourceType(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.AWSResourceType) QueryTask(com.vmware.xenon.services.common.QueryTask) Utils(com.vmware.xenon.common.Utils) STORAGE_TYPE_S3(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.STORAGE_TYPE_S3) Map(java.util.Map) AWSClientManager(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSClientManager) StatelessService(com.vmware.xenon.common.StatelessService) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) AmazonS3Client(com.amazonaws.services.s3.AmazonS3Client) AdapterUtils.getDeletionState(com.vmware.photon.controller.model.adapters.util.AdapterUtils.getDeletionState) List(java.util.List) TagService(com.vmware.photon.controller.model.resources.TagService) DeferredResult(com.vmware.xenon.common.DeferredResult) TAG_KEY_TYPE(com.vmware.photon.controller.model.constants.PhotonModelConstants.TAG_KEY_TYPE) QueryOption(com.vmware.xenon.services.common.QueryTask.QuerySpecification.QueryOption) DiskService(com.vmware.photon.controller.model.resources.DiskService) OperationContext(com.vmware.xenon.common.OperationContext) HashMap(java.util.HashMap) PhotonModelUtils(com.vmware.photon.controller.model.resources.util.PhotonModelUtils) TagsUtil(com.vmware.photon.controller.model.adapters.util.TagsUtil) ArrayList(java.util.ArrayList) Regions(com.amazonaws.regions.Regions) HashSet(java.util.HashSet) AWSConstants(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants) TagState(com.vmware.photon.controller.model.resources.TagService.TagState) ServiceStateCollectionUpdateRequest(com.vmware.xenon.common.ServiceStateCollectionUpdateRequest) AuthCredentialsService(com.vmware.xenon.services.common.AuthCredentialsService) Query(com.vmware.xenon.services.common.QueryTask.Query) AdapterUtils.createPostOperation(com.vmware.photon.controller.model.adapters.util.AdapterUtils.createPostOperation) BiConsumer(java.util.function.BiConsumer) EnumerationAction(com.vmware.photon.controller.model.adapterapi.EnumerationAction) AwsClientType(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.AwsClientType) ExecutorService(java.util.concurrent.ExecutorService) AWSConstants.getQueryResultLimit(com.vmware.photon.controller.model.adapters.awsadapter.AWSConstants.getQueryResultLimit) AdapterUtils(com.vmware.photon.controller.model.adapters.util.AdapterUtils) AmazonS3Exception(com.amazonaws.services.s3.model.AmazonS3Exception) ResourceState(com.vmware.photon.controller.model.resources.ResourceState) Operation(com.vmware.xenon.common.Operation) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) Bucket(com.amazonaws.services.s3.model.Bucket) TimeUnit(java.util.concurrent.TimeUnit) ComputeStateWithDescription(com.vmware.photon.controller.model.resources.ComputeService.ComputeStateWithDescription) ComputeEnumerateAdapterRequest(com.vmware.photon.controller.model.adapters.util.ComputeEnumerateAdapterRequest) AWSClientManagerFactory(com.vmware.photon.controller.model.adapters.awsadapter.util.AWSClientManagerFactory) Collections(java.util.Collections) AWSUriPaths(com.vmware.photon.controller.model.adapters.awsadapter.AWSUriPaths) OperationJoin(com.vmware.xenon.common.OperationJoin) PhotonModelUriUtils.createInventoryUri(com.vmware.photon.controller.model.util.PhotonModelUriUtils.createInventoryUri) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) OperationJoin(com.vmware.xenon.common.OperationJoin) ArrayList(java.util.ArrayList) Collection(java.util.Collection) ServiceStateCollectionUpdateRequest(com.vmware.xenon.common.ServiceStateCollectionUpdateRequest)

Example 10 with ServiceStateCollectionUpdateRequest

use of com.vmware.xenon.common.ServiceStateCollectionUpdateRequest in project photon-model by vmware.

the class VSphereAdapterInstanceService method updateComputeStateDiskLinks.

/**
 * Remove diskLink from ComputeState by sending a ServiceStateCollectionUpdateRequest.
 */
public void updateComputeStateDiskLinks(ProvisionContext ctx, ComputeState computeState) {
    Map<String, Collection<Object>> collectionsToRemove = Collections.singletonMap(ComputeService.ComputeState.FIELD_NAME_DISK_LINKS, new ArrayList<>(computeState.diskLinks));
    ServiceStateCollectionUpdateRequest updateDiskLinksRequest = ServiceStateCollectionUpdateRequest.create(null, collectionsToRemove);
    Operation.createPatch(PhotonModelUriUtils.createInventoryUri(this.getHost(), computeState.documentSelfLink)).setBody(updateDiskLinksRequest).setReferer(this.getUri()).setCompletion((op, t) -> {
        if (t != null) {
            log(Level.INFO, "Not able to update the compute state with the detached " + "disks %s", t.getMessage());
        }
        ctx.mgr.finishTask();
    }).sendWith(this.getHost());
}
Also used : PowerState(com.vmware.photon.controller.model.resources.ComputeService.PowerState) IpAssignment(com.vmware.photon.controller.model.resources.NetworkInterfaceDescriptionService.IpAssignment) VirtualEthernetCardOpaqueNetworkBackingInfo(com.vmware.vim25.VirtualEthernetCardOpaqueNetworkBackingInfo) QueryTask(com.vmware.xenon.services.common.QueryTask) LifecycleState(com.vmware.photon.controller.model.resources.ComputeService.LifecycleState) DiskType(com.vmware.photon.controller.model.resources.DiskService.DiskType) SubnetState(com.vmware.photon.controller.model.resources.SubnetService.SubnetState) Map(java.util.Map) COMPUTE_HOST_LINK_PROP_NAME(com.vmware.photon.controller.model.ComputeProperties.COMPUTE_HOST_LINK_PROP_NAME) Connection(com.vmware.photon.controller.model.adapters.vsphere.util.connection.Connection) URI(java.net.URI) VirtualDevice(com.vmware.vim25.VirtualDevice) TaskInfo(com.vmware.vim25.TaskInfo) NsxProperties(com.vmware.photon.controller.model.adapters.vsphere.network.NsxProperties) CustomizationSpec(com.vmware.vim25.CustomizationSpec) DiskStateExpanded(com.vmware.photon.controller.model.resources.DiskService.DiskStateExpanded) NetworkInterfaceState(com.vmware.photon.controller.model.resources.NetworkInterfaceService.NetworkInterfaceState) StatelessService(com.vmware.xenon.common.StatelessService) Collection(java.util.Collection) TaskManager(com.vmware.photon.controller.model.adapters.util.TaskManager) Collectors(java.util.stream.Collectors) ClientUtils.handleVirtualDiskUpdate(com.vmware.photon.controller.model.adapters.vsphere.ClientUtils.handleVirtualDiskUpdate) List(java.util.List) InvalidPropertyFaultMsg(com.vmware.vim25.InvalidPropertyFaultMsg) DeferredResult(com.vmware.xenon.common.DeferredResult) ComputeService(com.vmware.photon.controller.model.resources.ComputeService) ClientUtils.handleVirtualDeviceUpdate(com.vmware.photon.controller.model.adapters.vsphere.ClientUtils.handleVirtualDeviceUpdate) VC_UUID(com.vmware.photon.controller.model.adapters.vsphere.CustomProperties.VC_UUID) VirtualFloppy(com.vmware.vim25.VirtualFloppy) VimPath(com.vmware.photon.controller.model.adapters.vsphere.util.VimPath) ComputeProperties(com.vmware.photon.controller.model.ComputeProperties) PhotonModelUriUtils(com.vmware.photon.controller.model.util.PhotonModelUriUtils) VirtualEthernetCardDistributedVirtualPortBackingInfo(com.vmware.vim25.VirtualEthernetCardDistributedVirtualPortBackingInfo) HashMap(java.util.HashMap) GetMoRef(com.vmware.photon.controller.model.adapters.vsphere.util.connection.GetMoRef) RuntimeFaultFaultMsg(com.vmware.vim25.RuntimeFaultFaultMsg) StringUtil(io.netty.util.internal.StringUtil) DvsProperties(com.vmware.photon.controller.model.adapters.vsphere.network.DvsProperties) VirtualEthernetCardNetworkBackingInfo(com.vmware.vim25.VirtualEthernetCardNetworkBackingInfo) ArrayList(java.util.ArrayList) Level(java.util.logging.Level) ComputeInstanceRequest(com.vmware.photon.controller.model.adapterapi.ComputeInstanceRequest) VirtualCdrom(com.vmware.vim25.VirtualCdrom) ServiceStateCollectionUpdateRequest(com.vmware.xenon.common.ServiceStateCollectionUpdateRequest) ClientUtils.findMatchingDiskState(com.vmware.photon.controller.model.adapters.vsphere.ClientUtils.findMatchingDiskState) CollectionUtils(org.apache.commons.collections.CollectionUtils) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) ResourceState(com.vmware.photon.controller.model.resources.ResourceState) DATACENTER_SELF_LINK(com.vmware.photon.controller.model.adapters.vsphere.CustomProperties.DATACENTER_SELF_LINK) Operation(com.vmware.xenon.common.Operation) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) VirtualDeviceBackingInfo(com.vmware.vim25.VirtualDeviceBackingInfo) ManagedObjectReference(com.vmware.vim25.ManagedObjectReference) TaskStage(com.vmware.xenon.common.TaskState.TaskStage) NetworkInterfaceStateWithDetails(com.vmware.photon.controller.model.adapters.vsphere.ProvisionContext.NetworkInterfaceStateWithDetails) TimeUnit(java.util.concurrent.TimeUnit) VirtualDisk(com.vmware.vim25.VirtualDisk) ClusterUtil(com.vmware.photon.controller.model.util.ClusterUtil) VirtualEthernetCard(com.vmware.vim25.VirtualEthernetCard) Collections(java.util.Collections) TaskInfoState(com.vmware.vim25.TaskInfoState) OperationJoin(com.vmware.xenon.common.OperationJoin) Collection(java.util.Collection) ServiceStateCollectionUpdateRequest(com.vmware.xenon.common.ServiceStateCollectionUpdateRequest)

Aggregations

ServiceStateCollectionUpdateRequest (com.vmware.xenon.common.ServiceStateCollectionUpdateRequest)13 Collection (java.util.Collection)13 Operation (com.vmware.xenon.common.Operation)10 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)5 QueryUtils (com.vmware.photon.controller.model.query.QueryUtils)4 ComputeState (com.vmware.photon.controller.model.resources.ComputeService.ComputeState)4 NetworkInterfaceState (com.vmware.photon.controller.model.resources.NetworkInterfaceService.NetworkInterfaceState)4 ResourceState (com.vmware.photon.controller.model.resources.ResourceState)4 OperationJoin (com.vmware.xenon.common.OperationJoin)4 QueryTask (com.vmware.xenon.services.common.QueryTask)4 List (java.util.List)4 Map (java.util.Map)4 AdapterUtils.createPostOperation (com.vmware.photon.controller.model.adapters.util.AdapterUtils.createPostOperation)3 Utils (com.vmware.xenon.common.Utils)3 Collections (java.util.Collections)3 HashSet (java.util.HashSet)3 ComputeProperties (com.vmware.photon.controller.model.ComputeProperties)2 ResourceOperation (com.vmware.photon.controller.model.adapters.registry.operations.ResourceOperation)2 AdapterUtils (com.vmware.photon.controller.model.adapters.util.AdapterUtils)2