Search in sources :

Example 81 with ComputeState

use of com.vmware.photon.controller.model.resources.ComputeService.ComputeState in project photon-model by vmware.

the class AzureBaseTest method createComputeHostWithDescription.

/**
 * Create Azure compute host per {@link #resourcePool} and {@link #endpointState}.
 */
protected ComputeStateWithDescription createComputeHostWithDescription() throws Throwable {
    ComputeState computeHost = AzureTestUtil.createDefaultComputeHost(getHost(), this.resourcePool.documentSelfLink, this.endpointState);
    this.endpointState.computeHostLink = computeHost.documentSelfLink;
    this.endpointState.computeLink = computeHost.documentSelfLink;
    ComputeDescription computeDescription = getServiceSynchronously(computeHost.descriptionLink, ComputeDescription.class);
    computeDescription.computeHostLink = computeHost.documentSelfLink;
    return ComputeStateWithDescription.create(computeDescription, computeHost);
}
Also used : ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) ComputeDescription(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription)

Example 82 with ComputeState

use of com.vmware.photon.controller.model.resources.ComputeService.ComputeState in project photon-model by vmware.

the class AzureSubscriptionEndpointsEnumerationServiceTest method testAddSecondAzureSubscription.

private void testAddSecondAzureSubscription() throws Throwable {
    // Request for creating computes for 1 Azure Subscriptions
    AzureSubscription subscription = getAzureSubscription(SUBSCRIPTION_ID_2, ACCOUNT_ID_2);
    createAzureEndpointsForSubscriptions(Collections.singletonList(subscription));
    // Query the Endpoints to assert
    ServiceDocumentQueryResult result = this.host.getExpandedFactoryState(UriUtils.buildUri(this.host, EndpointService.FACTORY_LINK));
    Assert.assertEquals(3, result.documents.size());
    // Assert the created Endpoint and other resources
    result.documents.remove(this.endpointLink);
    // Remove the endpoints created earlier
    this.createdEndpointLinks.forEach(endpoint -> result.documents.remove(endpoint));
    EndpointState endpointStateCreated = Utils.fromJson(result.documents.values().iterator().next(), EndpointState.class);
    assertCreatedEndpoint(endpointStateCreated, SUBSCRIPTION_ID_2);
    this.createdEndpointLinks.add(endpointStateCreated.documentSelfLink);
    // Assert the root compute under the endpoint
    ComputeState computeStateCreated = getServiceSynchronously(endpointStateCreated.computeLink, ComputeState.class);
    assertCreatedComputeState(computeStateCreated, SUBSCRIPTION_ID_2, ACCOUNT_ID_2);
    // Assert the partial AuthCredentialsState
    AuthCredentialsServiceState authCreated = getServiceSynchronously(endpointStateCreated.authCredentialsLink, AuthCredentialsServiceState.class);
    assertAuthCredentialState(authCreated, SUBSCRIPTION_ID_2);
}
Also used : EndpointState(com.vmware.photon.controller.model.resources.EndpointService.EndpointState) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) AuthCredentialsServiceState(com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState) ServiceDocumentQueryResult(com.vmware.xenon.common.ServiceDocumentQueryResult) AzureSubscription(com.vmware.photon.controller.model.adapters.azure.model.cost.AzureSubscription)

Example 83 with ComputeState

use of com.vmware.photon.controller.model.resources.ComputeService.ComputeState in project photon-model by vmware.

the class GCPEnumerationAdapterService method deleteHelper.

/**
 * This helper function deletes all compute states in one deletion page
 * every iteration. For each compute state, its associated disks will
 * also be deleted. After deletion, it will check if there is a next
 * deletion page. If there is, it will delete that page recursively.
 * If there are nothing to delete, it will jump to the finished stage
 * of the whole enumeration.
 * @param ctx The enumeration context.
 * @param results The results of deletion query.
 */
private void deleteHelper(EnumerationContext ctx, ServiceDocumentQueryResult results) {
    if (results.documentCount == 0) {
        checkLinkAndFinishDeleting(ctx, results.nextPageLink);
        return;
    }
    List<Operation> operations = new ArrayList<>();
    results.documents.values().forEach(json -> {
        ComputeState computeState = Utils.fromJson(json, ComputeState.class);
        Long vmId = Long.parseLong(computeState.id);
        if (!ctx.vmIds.contains(vmId)) {
            operations.add(Operation.createDelete(this, computeState.documentSelfLink));
            logFine(() -> String.format("Deleting compute state %s", computeState.documentSelfLink));
            if (computeState.diskLinks != null && !computeState.diskLinks.isEmpty()) {
                computeState.diskLinks.forEach(diskLink -> {
                    operations.add(Operation.createDelete(this, diskLink));
                    logFine(() -> String.format("Deleting disk state %s", diskLink));
                });
            }
        }
    });
    if (operations.isEmpty()) {
        checkLinkAndFinishDeleting(ctx, results.nextPageLink);
        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())));
        }
        checkLinkAndFinishDeleting(ctx, results.nextPageLink);
    }).sendWith(this);
}
Also used : GCPUriPaths(com.vmware.photon.controller.model.adapters.gcp.GCPUriPaths) AuthCredentialsServiceState(com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState) ComputeEnumerateResourceRequest(com.vmware.photon.controller.model.adapterapi.ComputeEnumerateResourceRequest) GCPUtils.privateKeyFromPkcs8(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils.privateKeyFromPkcs8) QueryTask(com.vmware.xenon.services.common.QueryTask) OSType(com.vmware.photon.controller.model.ComputeProperties.OSType) GCPInstance(com.vmware.photon.controller.model.adapters.gcp.podo.vm.GCPInstance) ResourceGroupState(com.vmware.photon.controller.model.resources.ResourceGroupService.ResourceGroupState) DiskType(com.vmware.photon.controller.model.resources.DiskService.DiskType) ComputeType(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ComputeType) ENVIRONMENT_NAME_GCP(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ENVIRONMENT_NAME_GCP) Utils(com.vmware.xenon.common.Utils) GeneralSecurityException(java.security.GeneralSecurityException) GCPInstancesList(com.vmware.photon.controller.model.adapters.gcp.podo.vm.GCPInstancesList) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) ServiceDocumentQueryResult(com.vmware.xenon.common.ServiceDocumentQueryResult) URI(java.net.URI) DEFAULT_DISK_SOURCE_IMAGE(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.DEFAULT_DISK_SOURCE_IMAGE) GCPUtils.assignPowerState(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils.assignPowerState) GCPUtils.extractActualInstanceType(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils.extractActualInstanceType) ComputeDescription(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription) DISK_AUTO_DELETE(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.DISK_AUTO_DELETE) StatelessService(com.vmware.xenon.common.StatelessService) DEFAULT_DISK_SERVICE_REFERENCE(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.DEFAULT_DISK_SERVICE_REFERENCE) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) GCPDisk(com.vmware.photon.controller.model.adapters.gcp.podo.vm.GCPDisk) TaskManager(com.vmware.photon.controller.model.adapters.util.TaskManager) Set(java.util.Set) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) LIST_VM_TEMPLATE_URI(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.LIST_VM_TEMPLATE_URI) UUID(java.util.UUID) ServiceHost(com.vmware.xenon.common.ServiceHost) List(java.util.List) AUTH_HEADER_BEARER_PREFIX(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.AUTH_HEADER_BEARER_PREFIX) PrivateKey(java.security.PrivateKey) UriUtils(com.vmware.xenon.common.UriUtils) ComputeService(com.vmware.photon.controller.model.resources.ComputeService) QueryOption(com.vmware.xenon.services.common.QueryTask.QuerySpecification.QueryOption) NumericRange(com.vmware.xenon.services.common.QueryTask.NumericRange) DiskService(com.vmware.photon.controller.model.resources.DiskService) PhotonModelUriUtils(com.vmware.photon.controller.model.util.PhotonModelUriUtils) HashMap(java.util.HashMap) ComputeDescriptionService(com.vmware.photon.controller.model.resources.ComputeDescriptionService) GCPUtils(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils) MAX_RESULTS(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.MAX_RESULTS) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) PAGE_TOKEN(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.PAGE_TOKEN) UriPaths(com.vmware.photon.controller.model.UriPaths) EnumerationStages(com.vmware.photon.controller.model.adapters.util.enums.EnumerationStages) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) EnumerationAction(com.vmware.photon.controller.model.adapterapi.EnumerationAction) LinkedList(java.util.LinkedList) GCPAccessTokenResponse(com.vmware.photon.controller.model.adapters.gcp.podo.authorization.GCPAccessTokenResponse) AdapterUtils(com.vmware.photon.controller.model.adapters.util.AdapterUtils) GCPUtils.extractRegionFromZone(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils.extractRegionFromZone) EncryptionUtils(com.vmware.photon.controller.model.security.util.EncryptionUtils) Operation(com.vmware.xenon.common.Operation) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) IOException(java.io.IOException) ComputeScopes(com.google.api.services.compute.ComputeScopes) Consumer(java.util.function.Consumer) CUSTOM_OS_TYPE(com.vmware.photon.controller.model.ComputeProperties.CUSTOM_OS_TYPE) DEFAULT_DISK_CAPACITY(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.DEFAULT_DISK_CAPACITY) ComputeStateWithDescription(com.vmware.photon.controller.model.resources.ComputeService.ComputeStateWithDescription) GCPUtils.assignIPAddress(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils.assignIPAddress) Collections(java.util.Collections) OperationJoin(com.vmware.xenon.common.OperationJoin) PhotonModelUriUtils.createInventoryUri(com.vmware.photon.controller.model.util.PhotonModelUriUtils.createInventoryUri) JSONWebToken(com.vmware.photon.controller.model.adapters.gcp.utils.JSONWebToken) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) ArrayList(java.util.ArrayList) Operation(com.vmware.xenon.common.Operation)

Example 84 with ComputeState

use of com.vmware.photon.controller.model.resources.ComputeService.ComputeState in project photon-model by vmware.

the class GCPEnumerationAdapterService method queryForComputeStates.

/**
 * Query all compute states for the cluster filtered by the received set of instance Ids.
 * @param ctx The Enumeration Context.
 * @param vms The Map of VM IDs and VMs.
 */
private void queryForComputeStates(EnumerationContext ctx, Map<Long, GCPInstance> vms) {
    logFine(() -> "Enumerating Local Compute States");
    QueryTask.Query.Builder instanceIdFilterParentQuery = QueryTask.Query.Builder.create(QueryTask.Query.Occurance.MUST_OCCUR);
    for (Long instanceId : vms.keySet()) {
        QueryTask.Query instanceIdFilter = QueryTask.Query.Builder.create(QueryTask.Query.Occurance.SHOULD_OCCUR).addFieldClause(ComputeState.FIELD_NAME_ID, instanceId.toString()).build();
        instanceIdFilterParentQuery.addClause(instanceIdFilter);
    }
    QueryTask.Query query = QueryTask.Query.Builder.create().addKindFieldClause(ComputeState.class).addFieldClause(ComputeState.FIELD_NAME_RESOURCE_POOL_LINK, ctx.enumRequest.resourcePoolLink).addFieldClause(ComputeState.FIELD_NAME_PARENT_LINK, ctx.enumRequest.resourceLink()).build().addBooleanClause(instanceIdFilterParentQuery.build());
    QueryTask q = QueryTask.Builder.createDirectTask().addOption(QueryTask.QuerySpecification.QueryOption.EXPAND_CONTENT).addOption(QueryTask.QuerySpecification.QueryOption.INDEXED_METADATA).setQuery(query).build();
    q.tenantLinks = ctx.computeHostDesc.tenantLinks;
    QueryUtils.startInventoryQueryTask(this, q).whenComplete((queryTask, e) -> {
        if (e != null) {
            handleError(ctx, e);
            return;
        }
        logFine(() -> String.format("Found %d matching compute states for GCP Instances", queryTask.results.documentCount));
        // Otherwise, we can jump directly to create stage.
        if (queryTask.results.documentCount > 0) {
            for (Object s : queryTask.results.documents.values()) {
                ComputeState computeState = Utils.fromJson(s, ComputeState.class);
                ctx.computeStates.add(computeState);
            }
            ctx.subStage = EnumerationSubStages.UPDATE_COMPUTESTATE_COMPUTEDESCRIPTION_DISK;
        } else {
            ctx.subStage = EnumerationSubStages.CREATE_LOCAL_VMS;
        }
        handleSubStage(ctx);
    });
}
Also used : ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) QueryTask(com.vmware.xenon.services.common.QueryTask)

Example 85 with ComputeState

use of com.vmware.photon.controller.model.resources.ComputeService.ComputeState in project photon-model by vmware.

the class GCPEnumerationAdapterService method createHelper.

/**
 * This helper function creates a compute state according to the corresponding
 * instance on the cloud. It will also creates an auth credential and a compute
 * description with it. Moreover, if there is a root disk of the instance on
 * cloud, it will creates a root disk locally. Otherwise, it will create a
 * default root disk with the compute state. All the creation operations will
 * run in parallel. After all remote instances get created, it will jump to
 * list vm stage if there is a next page of list vms. Otherwise it will jump
 * to the delete stage.
 * @param ctx The Enumeration Context.
 * @param virtualMachine The virtual machine to be created.
 * @param size The number of remaining virtual machines to be created.
 */
private void createHelper(EnumerationContext ctx, GCPInstance virtualMachine, AtomicInteger size) {
    List<Operation> operations = new ArrayList<>();
    // TODO VSYM-1106: refactor the creation logic here.
    // Create compute description.
    // Map GCP instance data to compute description.
    ComputeDescription computeDescription = new ComputeDescription();
    computeDescription.id = UUID.randomUUID().toString();
    computeDescription.name = virtualMachine.name;
    computeDescription.zoneId = virtualMachine.zone;
    // TODO VSYM-1139: dynamically acquire all gcp zones, regions and mappings.
    computeDescription.regionId = extractRegionFromZone(virtualMachine.zone);
    computeDescription.instanceType = extractActualInstanceType(virtualMachine.machineType);
    computeDescription.authCredentialsLink = ctx.parentAuth.documentSelfLink;
    computeDescription.documentSelfLink = computeDescription.id;
    computeDescription.environmentName = ENVIRONMENT_NAME_GCP;
    computeDescription.instanceAdapterReference = UriUtils.buildUri(ServiceHost.LOCAL_HOST, this.getHost().getPort(), GCPUriPaths.GCP_INSTANCE_ADAPTER, null);
    computeDescription.statsAdapterReference = UriUtils.buildUri(ServiceHost.LOCAL_HOST, this.getHost().getPort(), GCPUriPaths.GCP_STATS_ADAPTER, null);
    computeDescription.tenantLinks = ctx.computeHostDesc.tenantLinks;
    Operation compDescOp = Operation.createPost(getHost(), ComputeDescriptionService.FACTORY_LINK).setBody(computeDescription);
    operations.add(compDescOp);
    // Create root disk.
    DiskService.DiskState rootDisk = new DiskService.DiskState();
    rootDisk.id = UUID.randomUUID().toString();
    rootDisk.documentSelfLink = rootDisk.id;
    rootDisk.customProperties = new HashMap<>();
    boolean foundRoot = false;
    if (virtualMachine.disks != null && !virtualMachine.disks.isEmpty()) {
        for (GCPDisk gcpDisk : virtualMachine.disks) {
            if (gcpDisk.boot) {
                foundRoot = true;
                rootDisk.name = gcpDisk.deviceName;
                rootDisk.customProperties.put(DISK_AUTO_DELETE, gcpDisk.autoDelete.toString());
                break;
            }
        }
    }
    if (!foundRoot) {
        rootDisk.name = rootDisk.id;
    }
    // These are required fields in disk service.
    // They cannot be accessed during vm enumeration.
    rootDisk.type = DiskType.HDD;
    rootDisk.capacityMBytes = DEFAULT_DISK_CAPACITY;
    rootDisk.sourceImageReference = URI.create(DEFAULT_DISK_SOURCE_IMAGE);
    rootDisk.customizationServiceReference = URI.create(DEFAULT_DISK_SERVICE_REFERENCE);
    // No matter we find root disk or not, the root disk should be booted first.
    rootDisk.bootOrder = 1;
    rootDisk.tenantLinks = ctx.computeHostDesc.tenantLinks;
    Operation diskOp = Operation.createPost(getHost(), DiskService.FACTORY_LINK).setBody(rootDisk);
    operations.add(diskOp);
    List<String> vmDisks = new ArrayList<>();
    vmDisks.add(UriUtils.buildUriPath(DiskService.FACTORY_LINK, rootDisk.documentSelfLink));
    // Create compute state
    ComputeState resource = new ComputeState();
    resource.id = virtualMachine.id.toString();
    resource.type = ComputeType.VM_GUEST;
    resource.environmentName = ComputeDescription.ENVIRONMENT_NAME_GCP;
    resource.name = virtualMachine.name;
    resource.parentLink = ctx.enumRequest.resourceLink();
    resource.descriptionLink = UriUtils.buildUriPath(ComputeDescriptionService.FACTORY_LINK, computeDescription.documentSelfLink);
    resource.resourcePoolLink = ctx.enumRequest.resourcePoolLink;
    resource.diskLinks = vmDisks;
    resource.customProperties = new HashMap<>();
    String osType = getNormalizedOSType(virtualMachine);
    if (osType != null) {
        resource.customProperties.put(CUSTOM_OS_TYPE, osType);
    }
    resource.tenantLinks = ctx.computeHostDesc.tenantLinks;
    assignIPAddress(resource, virtualMachine);
    assignPowerState(resource, virtualMachine.status);
    Operation resourceOp = Operation.createPost(getHost(), ComputeService.FACTORY_LINK).setBody(resource);
    operations.add(resourceOp);
    OperationJoin.create(operations).setCompletion((ops, exs) -> {
        if (exs != null) {
            exs.values().forEach(ex -> logWarning(() -> String.format("Error: %s", ex.getMessage())));
        }
        if (size.decrementAndGet() == 0) {
            ctx.virtualMachines.clear();
            if (ctx.enumNextPageLink != null) {
                ctx.subStage = EnumerationSubStages.LIST_REMOTE_VMS;
            } else {
                logFine(() -> "Finished creating compute states");
                ctx.subStage = EnumerationSubStages.DELETE_LOCAL_VMS;
            }
            handleSubStage(ctx);
        }
    }).sendWith(this);
}
Also used : GCPUriPaths(com.vmware.photon.controller.model.adapters.gcp.GCPUriPaths) AuthCredentialsServiceState(com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState) ComputeEnumerateResourceRequest(com.vmware.photon.controller.model.adapterapi.ComputeEnumerateResourceRequest) GCPUtils.privateKeyFromPkcs8(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils.privateKeyFromPkcs8) QueryTask(com.vmware.xenon.services.common.QueryTask) OSType(com.vmware.photon.controller.model.ComputeProperties.OSType) GCPInstance(com.vmware.photon.controller.model.adapters.gcp.podo.vm.GCPInstance) ResourceGroupState(com.vmware.photon.controller.model.resources.ResourceGroupService.ResourceGroupState) DiskType(com.vmware.photon.controller.model.resources.DiskService.DiskType) ComputeType(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ComputeType) ENVIRONMENT_NAME_GCP(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ENVIRONMENT_NAME_GCP) Utils(com.vmware.xenon.common.Utils) GeneralSecurityException(java.security.GeneralSecurityException) GCPInstancesList(com.vmware.photon.controller.model.adapters.gcp.podo.vm.GCPInstancesList) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) ServiceDocumentQueryResult(com.vmware.xenon.common.ServiceDocumentQueryResult) URI(java.net.URI) DEFAULT_DISK_SOURCE_IMAGE(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.DEFAULT_DISK_SOURCE_IMAGE) GCPUtils.assignPowerState(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils.assignPowerState) GCPUtils.extractActualInstanceType(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils.extractActualInstanceType) ComputeDescription(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription) DISK_AUTO_DELETE(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.DISK_AUTO_DELETE) StatelessService(com.vmware.xenon.common.StatelessService) DEFAULT_DISK_SERVICE_REFERENCE(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.DEFAULT_DISK_SERVICE_REFERENCE) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) GCPDisk(com.vmware.photon.controller.model.adapters.gcp.podo.vm.GCPDisk) TaskManager(com.vmware.photon.controller.model.adapters.util.TaskManager) Set(java.util.Set) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) LIST_VM_TEMPLATE_URI(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.LIST_VM_TEMPLATE_URI) UUID(java.util.UUID) ServiceHost(com.vmware.xenon.common.ServiceHost) List(java.util.List) AUTH_HEADER_BEARER_PREFIX(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.AUTH_HEADER_BEARER_PREFIX) PrivateKey(java.security.PrivateKey) UriUtils(com.vmware.xenon.common.UriUtils) ComputeService(com.vmware.photon.controller.model.resources.ComputeService) QueryOption(com.vmware.xenon.services.common.QueryTask.QuerySpecification.QueryOption) NumericRange(com.vmware.xenon.services.common.QueryTask.NumericRange) DiskService(com.vmware.photon.controller.model.resources.DiskService) PhotonModelUriUtils(com.vmware.photon.controller.model.util.PhotonModelUriUtils) HashMap(java.util.HashMap) ComputeDescriptionService(com.vmware.photon.controller.model.resources.ComputeDescriptionService) GCPUtils(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils) MAX_RESULTS(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.MAX_RESULTS) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) PAGE_TOKEN(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.PAGE_TOKEN) UriPaths(com.vmware.photon.controller.model.UriPaths) EnumerationStages(com.vmware.photon.controller.model.adapters.util.enums.EnumerationStages) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) EnumerationAction(com.vmware.photon.controller.model.adapterapi.EnumerationAction) LinkedList(java.util.LinkedList) GCPAccessTokenResponse(com.vmware.photon.controller.model.adapters.gcp.podo.authorization.GCPAccessTokenResponse) AdapterUtils(com.vmware.photon.controller.model.adapters.util.AdapterUtils) GCPUtils.extractRegionFromZone(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils.extractRegionFromZone) EncryptionUtils(com.vmware.photon.controller.model.security.util.EncryptionUtils) Operation(com.vmware.xenon.common.Operation) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) IOException(java.io.IOException) ComputeScopes(com.google.api.services.compute.ComputeScopes) Consumer(java.util.function.Consumer) CUSTOM_OS_TYPE(com.vmware.photon.controller.model.ComputeProperties.CUSTOM_OS_TYPE) DEFAULT_DISK_CAPACITY(com.vmware.photon.controller.model.adapters.gcp.constants.GCPConstants.DEFAULT_DISK_CAPACITY) ComputeStateWithDescription(com.vmware.photon.controller.model.resources.ComputeService.ComputeStateWithDescription) GCPUtils.assignIPAddress(com.vmware.photon.controller.model.adapters.gcp.utils.GCPUtils.assignIPAddress) Collections(java.util.Collections) OperationJoin(com.vmware.xenon.common.OperationJoin) PhotonModelUriUtils.createInventoryUri(com.vmware.photon.controller.model.util.PhotonModelUriUtils.createInventoryUri) JSONWebToken(com.vmware.photon.controller.model.adapters.gcp.utils.JSONWebToken) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) ComputeDescription(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) GCPDisk(com.vmware.photon.controller.model.adapters.gcp.podo.vm.GCPDisk) ArrayList(java.util.ArrayList) Operation(com.vmware.xenon.common.Operation) DiskService(com.vmware.photon.controller.model.resources.DiskService) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState)

Aggregations

ComputeState (com.vmware.photon.controller.model.resources.ComputeService.ComputeState)214 Operation (com.vmware.xenon.common.Operation)93 ArrayList (java.util.ArrayList)63 QueryTask (com.vmware.xenon.services.common.QueryTask)58 ComputeDescription (com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription)57 HashMap (java.util.HashMap)54 List (java.util.List)51 Map (java.util.Map)50 Utils (com.vmware.xenon.common.Utils)45 Test (org.junit.Test)45 UriUtils (com.vmware.xenon.common.UriUtils)44 URI (java.net.URI)42 Collectors (java.util.stream.Collectors)42 ComputeService (com.vmware.photon.controller.model.resources.ComputeService)40 DiskState (com.vmware.photon.controller.model.resources.DiskService.DiskState)40 EndpointState (com.vmware.photon.controller.model.resources.EndpointService.EndpointState)40 StatelessService (com.vmware.xenon.common.StatelessService)40 Query (com.vmware.xenon.services.common.QueryTask.Query)40 AuthCredentialsServiceState (com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState)38 ComputeType (com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ComputeType)36