Search in sources :

Example 16 with ComputeState

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

the class AzureLifecycleOperationService method updateComputeState.

private void updateComputeState(AzureLifecycleOperationContext ctx) {
    ComputeState state = new ComputeState();
    state.powerState = getPowerState(ctx.request);
    if (SUSPEND.equals(state.powerState)) {
        // clear IP address in case of power-off
        state.address = "";
    }
    Operation.createPatch(ctx.request.resourceReference).setBody(state).setCompletion((o, e) -> ctx.finish(e)).sendWith(this);
}
Also used : PowerState(com.vmware.photon.controller.model.resources.ComputeService.PowerState) Service(com.vmware.xenon.common.Service) ResourceOperationUtils.handleAdapterResourceOperationRegistration(com.vmware.photon.controller.model.adapters.registry.operations.ResourceOperationUtils.handleAdapterResourceOperationRegistration) ServiceDocument(com.vmware.xenon.common.ServiceDocument) AzureUriPaths(com.vmware.photon.controller.model.adapters.azure.AzureUriPaths) PhotonModelUtils(com.vmware.photon.controller.model.resources.util.PhotonModelUtils) ResourceOperationRequest(com.vmware.photon.controller.model.adapters.registry.operations.ResourceOperationRequest) AzureAsyncCallback(com.vmware.photon.controller.model.adapters.azure.AzureAsyncCallback) TargetCriteria(com.vmware.photon.controller.model.adapters.registry.operations.ResourceOperationUtils.TargetCriteria) Utils(com.vmware.xenon.common.Utils) SUSPEND(com.vmware.photon.controller.model.resources.ComputeService.PowerState.SUSPEND) AzureBaseAdapterContext(com.vmware.photon.controller.model.adapters.azure.utils.AzureBaseAdapterContext) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) EndpointType(com.vmware.photon.controller.model.constants.PhotonModelConstants.EndpointType) OperationStatusResponseInner(com.microsoft.azure.management.compute.implementation.OperationStatusResponseInner) ExecutorService(java.util.concurrent.ExecutorService) AdapterUtils(com.vmware.photon.controller.model.adapters.util.AdapterUtils) ResourceOperationSpec(com.vmware.photon.controller.model.adapters.registry.operations.ResourceOperationSpecService.ResourceOperationSpec) StatelessService(com.vmware.xenon.common.StatelessService) Operation(com.vmware.xenon.common.Operation) BaseAdapterStage(com.vmware.photon.controller.model.adapters.util.BaseAdapterContext.BaseAdapterStage) AzureUtils(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils) ResourceOperation(com.vmware.photon.controller.model.adapters.registry.operations.ResourceOperation) FactoryService(com.vmware.xenon.common.FactoryService) ResourceType(com.vmware.photon.controller.model.adapters.registry.operations.ResourceOperationSpecService.ResourceType) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState)

Example 17 with ComputeState

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

the class AzureSubscriptionEndpointCreationService method createSubscriptionEndpoint.

private void createSubscriptionEndpoint(EndpointState azureEaEndpoint, AzureSubscriptionEndpointCreationRequest request, Operation parentOp) {
    Operation authOp = Operation.createPost(UriUtils.extendUri(getInventoryServiceUri(), AuthCredentialsService.FACTORY_LINK));
    Operation cdOp = Operation.createPost(UriUtils.extendUri(getInventoryServiceUri(), ComputeDescriptionService.FACTORY_LINK));
    Operation csOp = Operation.createPost(UriUtils.extendUri(getInventoryServiceUri(), ComputeService.FACTORY_LINK));
    Operation endPointOp = Operation.createPost(UriUtils.extendUri(getInventoryServiceUri(), EndpointService.FACTORY_LINK));
    AuthCredentialsServiceState authCredentialsState = createAuthCredentialsState(azureEaEndpoint, request);
    EndpointState endpointState = createEndpointState(azureEaEndpoint, request);
    ComputeDescription computeDescState = AzureUtils.constructAzureSubscriptionComputeDescription(endpointState.documentSelfLink, azureEaEndpoint.tenantLinks, request.subscriptionId, null, null, endpointState.computeLink);
    authOp.setBody(authCredentialsState);
    OperationSequence sequence = OperationSequence.create(authOp).setCompletion((ops, exs) -> {
        if (exs != null) {
            handleFailure(exs, parentOp);
            return;
        }
        Operation o = ops.get(authOp.getId());
        AuthCredentialsServiceState authState = o.getBody(AuthCredentialsServiceState.class);
        computeDescState.authCredentialsLink = authState.documentSelfLink;
        endpointState.authCredentialsLink = authState.documentSelfLink;
        cdOp.setBody(computeDescState);
    }).next(cdOp).setCompletion((ops, exs) -> {
        if (exs != null) {
            handleFailure(exs, parentOp);
            return;
        }
        Operation o = ops.get(cdOp.getId());
        ComputeDescription cd = o.getBody(ComputeDescription.class);
        ComputeState cs = AzureUtils.constructAzureSubscriptionComputeState(endpointState.documentSelfLink, cd.documentSelfLink, azureEaEndpoint.tenantLinks, request.subscriptionId, azureEaEndpoint.resourcePoolLink, getCustomPropertiesMap(endpointState, request), null, endpointState.computeLink);
        csOp.setBody(cs);
        endpointState.computeDescriptionLink = cd.documentSelfLink;
    }).next(csOp).setCompletion((ops, exs) -> {
        if (exs != null) {
            handleFailure(exs, parentOp);
            return;
        }
        Operation o = ops.get(csOp.getId());
        ComputeState cs = o.getBody(ComputeState.class);
        endpointState.computeLink = cs.documentSelfLink;
        endPointOp.setBody(endpointState);
    }).next(endPointOp).setCompletion((ops, exs) -> {
        if (exs != null) {
            handleFailure(exs, parentOp);
            return;
        }
        Operation o = ops.get(endPointOp.getId());
        EndpointState es = o.getBody(EndpointState.class);
        parentOp.setBody(es);
        parentOp.complete();
    });
    sequence.sendWith(this);
}
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) ComputeDescription(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription) OperationSequence(com.vmware.xenon.common.OperationSequence) Operation(com.vmware.xenon.common.Operation)

Example 18 with ComputeState

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

the class AzureSubscriptionsEnumerationService method createResources.

private void createResources(AzureSubscriptionsEnumerationContext enumerationContext, AzureCostComputeEnumerationStages nextStage) {
    // Go through new subscriptions and create corresponding ComputeState
    // and ComputeDescription for them
    Collection<ComputeState> computesToCreate = new ArrayList<>();
    // Create ComputeDescription
    Collection<Operation> createComputeDescOps = enumerationContext.idToSubscription.values().stream().map(subscription -> Operation.createPost(UriUtils.extendUri(getInventoryServiceUri(), ComputeDescriptionService.FACTORY_LINK)).setBody(AzureUtils.constructAzureSubscriptionComputeDescription(enumerationContext.parent.endpointLink, enumerationContext.parent.tenantLinks, subscription.entityId, null, null, enumerationContext.parent.documentSelfLink)).setCompletion((o, e) -> {
        if (e != null) {
            logSevere(() -> String.format("Compute description creation " + " failed for azure subscription %s", subscription.entityId));
            return;
        }
        ComputeDescription cd = o.getBody(ComputeDescription.class);
        String csName = AzureUtils.constructSubscriptionName(subscription);
        computesToCreate.add(AzureUtils.constructAzureSubscriptionComputeState(enumerationContext.parent.endpointLink, cd.documentSelfLink, enumerationContext.parent.tenantLinks, csName, enumerationContext.parent.resourcePoolLink, getPropertiesMap(enumerationContext, subscription, true), null, enumerationContext.parent.documentSelfLink));
    })).collect(Collectors.toList());
    joinOperationAndSendRequest(createComputeDescOps, enumerationContext, (subsEnumCtx) -> {
        // Now create the ComputeState
        Collection<Operation> createComputeOps = computesToCreate.stream().map(computeState -> Operation.createPost(UriUtils.extendUri(getInventoryServiceUri(), ComputeService.FACTORY_LINK)).setBody(computeState).setCompletion((o, e) -> {
            if (e != null) {
                logSevere(() -> String.format("Compute state creation failed for azure" + " subscription %s", computeState.name));
            }
        })).collect(Collectors.toList());
        joinOperationAndSendRequest(createComputeOps, subsEnumCtx, (enumCtx) -> {
            enumCtx.stage = nextStage;
            handleAzureSubscriptionsEnumerationRequest(enumCtx);
        });
    });
}
Also used : QueryByPages(com.vmware.photon.controller.model.query.QueryUtils.QueryByPages) ServiceTypeCluster(com.vmware.photon.controller.model.util.ClusterUtil.ServiceTypeCluster) QueryTask(com.vmware.xenon.services.common.QueryTask) HashMap(java.util.HashMap) AzureUriPaths(com.vmware.photon.controller.model.adapters.azure.AzureUriPaths) ComputeDescriptionService(com.vmware.photon.controller.model.resources.ComputeDescriptionService) BaseAdapterContext(com.vmware.photon.controller.model.adapters.util.BaseAdapterContext) StringUtils(org.apache.commons.lang3.StringUtils) ArrayList(java.util.ArrayList) ResourceRequest(com.vmware.photon.controller.model.adapterapi.ResourceRequest) ComputeType(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ComputeType) EndpointAllocationTaskService(com.vmware.photon.controller.model.tasks.EndpointAllocationTaskService) Utils(com.vmware.xenon.common.Utils) EndpointConfigRequest(com.vmware.photon.controller.model.adapterapi.EndpointConfigRequest) Query(com.vmware.xenon.services.common.QueryTask.Query) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) Map(java.util.Map) EndpointType(com.vmware.photon.controller.model.constants.PhotonModelConstants.EndpointType) AzureSubscription(com.vmware.photon.controller.model.adapters.azure.model.cost.AzureSubscription) URI(java.net.URI) EndpointState(com.vmware.photon.controller.model.resources.EndpointService.EndpointState) AzureConstants(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants) ComputeDescription(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription) StatelessService(com.vmware.xenon.common.StatelessService) Collection(java.util.Collection) Operation(com.vmware.xenon.common.Operation) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) BaseAdapterStage(com.vmware.photon.controller.model.adapters.util.BaseAdapterContext.BaseAdapterStage) Collectors(java.util.stream.Collectors) Consumer(java.util.function.Consumer) AzureUtils(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils) ClusterUtil(com.vmware.photon.controller.model.util.ClusterUtil) UriUtils(com.vmware.xenon.common.UriUtils) PhotonModelConstants(com.vmware.photon.controller.model.constants.PhotonModelConstants) ComputeService(com.vmware.photon.controller.model.resources.ComputeService) OperationJoin(com.vmware.xenon.common.OperationJoin) PhotonModelUriUtils.createInventoryUri(com.vmware.photon.controller.model.util.PhotonModelUriUtils.createInventoryUri) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) ComputeDescription(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription) ArrayList(java.util.ArrayList) Operation(com.vmware.xenon.common.Operation)

Example 19 with ComputeState

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

the class AzureSubscriptionsEnumerationService method fetchExistingResources.

private void fetchExistingResources(AzureSubscriptionsEnumerationContext enumerationContext, AzureCostComputeEnumerationStages nextStage) {
    Query azureComputesQuery = createQueryForAzureSubscriptionComputes(enumerationContext);
    QueryByPages<ComputeState> querySubscriptionsComputes = new QueryByPages<>(getHost(), azureComputesQuery, ComputeState.class, enumerationContext.parent.tenantLinks);
    querySubscriptionsComputes.setClusterType(ServiceTypeCluster.INVENTORY_SERVICE);
    // Use max page size cause we collect ComputeStates
    querySubscriptionsComputes.setMaxPageSize(QueryUtils.MAX_RESULT_LIMIT);
    querySubscriptionsComputes.queryDocuments(computeState -> {
        if (computeState.customProperties != null && computeState.customProperties.containsKey(AzureConstants.AZURE_SUBSCRIPTION_ID_KEY)) {
            String subscriptionUuid = computeState.customProperties.get(AzureConstants.AZURE_SUBSCRIPTION_ID_KEY);
            enumerationContext.idToSubscription.remove(subscriptionUuid);
        }
    }).whenComplete((aVoid, t) -> {
        if (t != null) {
            getFailureConsumer(enumerationContext).accept(t);
            return;
        }
        enumerationContext.stage = nextStage;
        handleAzureSubscriptionsEnumerationRequest(enumerationContext);
    });
}
Also used : QueryByPages(com.vmware.photon.controller.model.query.QueryUtils.QueryByPages) ServiceTypeCluster(com.vmware.photon.controller.model.util.ClusterUtil.ServiceTypeCluster) QueryTask(com.vmware.xenon.services.common.QueryTask) HashMap(java.util.HashMap) AzureUriPaths(com.vmware.photon.controller.model.adapters.azure.AzureUriPaths) ComputeDescriptionService(com.vmware.photon.controller.model.resources.ComputeDescriptionService) BaseAdapterContext(com.vmware.photon.controller.model.adapters.util.BaseAdapterContext) StringUtils(org.apache.commons.lang3.StringUtils) ArrayList(java.util.ArrayList) ResourceRequest(com.vmware.photon.controller.model.adapterapi.ResourceRequest) ComputeType(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ComputeType) EndpointAllocationTaskService(com.vmware.photon.controller.model.tasks.EndpointAllocationTaskService) Utils(com.vmware.xenon.common.Utils) EndpointConfigRequest(com.vmware.photon.controller.model.adapterapi.EndpointConfigRequest) Query(com.vmware.xenon.services.common.QueryTask.Query) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) Map(java.util.Map) EndpointType(com.vmware.photon.controller.model.constants.PhotonModelConstants.EndpointType) AzureSubscription(com.vmware.photon.controller.model.adapters.azure.model.cost.AzureSubscription) URI(java.net.URI) EndpointState(com.vmware.photon.controller.model.resources.EndpointService.EndpointState) AzureConstants(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants) ComputeDescription(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription) StatelessService(com.vmware.xenon.common.StatelessService) Collection(java.util.Collection) Operation(com.vmware.xenon.common.Operation) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) BaseAdapterStage(com.vmware.photon.controller.model.adapters.util.BaseAdapterContext.BaseAdapterStage) Collectors(java.util.stream.Collectors) Consumer(java.util.function.Consumer) AzureUtils(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils) ClusterUtil(com.vmware.photon.controller.model.util.ClusterUtil) UriUtils(com.vmware.xenon.common.UriUtils) PhotonModelConstants(com.vmware.photon.controller.model.constants.PhotonModelConstants) ComputeService(com.vmware.photon.controller.model.resources.ComputeService) OperationJoin(com.vmware.xenon.common.OperationJoin) PhotonModelUriUtils.createInventoryUri(com.vmware.photon.controller.model.util.PhotonModelUriUtils.createInventoryUri) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) QueryByPages(com.vmware.photon.controller.model.query.QueryUtils.QueryByPages) Query(com.vmware.xenon.services.common.QueryTask.Query)

Example 20 with ComputeState

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

the class AzureCostStatsService method createAzureSubscriptionStats.

// Create Azure account stats
private void createAzureSubscriptionStats(Context context, AzureSubscription subscription) {
    // convert the subscription daily costs to cumulative
    AtomicDouble cumulativeValue = new AtomicDouble(0.0);
    subscription.cost = subscription.cost.entrySet().stream().sorted(Comparator.comparing(Entry::getKey)).collect(Collectors.toMap(Entry::getKey, e -> cumulativeValue.addAndGet(e.getValue())));
    Consumer<List<ComputeState>> subscriptionStatsProcessor = (subscriptionComputeStates) -> subscriptionComputeStates.forEach(subscriptionComputeState -> {
        String statName = AzureStatsNormalizer.getNormalizedStatKeyValue(AzureCostConstants.COST);
        String costUnit = AzureStatsNormalizer.getNormalizedUnitValue(AzureCostConstants.DEFAULT_CURRENCY_VALUE);
        ComputeStats subscriptionStats = new ComputeStats();
        subscriptionStats.computeLink = subscriptionComputeState.documentSelfLink;
        subscriptionStats.statValues = new ConcurrentSkipListMap<>();
        List<ServiceStat> costStats = new ArrayList<>();
        for (Entry<Long, Double> cost : subscription.cost.entrySet()) {
            ServiceStat azureAccountStat = AzureCostHelper.createServiceStat(statName, cost.getValue(), costUnit, cost.getKey());
            costStats.add(azureAccountStat);
        }
        subscriptionStats.statValues.put(statName, costStats);
        context.statsResponse.statsList.add(subscriptionStats);
    });
    processSubscriptionStats(context, subscription, subscriptionStatsProcessor);
}
Also used : AzureCostConstants(com.vmware.photon.controller.model.adapters.azure.constants.AzureCostConstants) AzureStatsNormalizer(com.vmware.photon.controller.model.adapters.azure.utils.AzureStatsNormalizer) AuthCredentialsServiceState(com.vmware.xenon.services.common.AuthCredentialsService.AuthCredentialsServiceState) Arrays(java.util.Arrays) DateTimeZone(org.joda.time.DateTimeZone) ServiceTypeCluster(com.vmware.photon.controller.model.util.ClusterUtil.ServiceTypeCluster) QueryTask(com.vmware.xenon.services.common.QueryTask) ServiceDocument(com.vmware.xenon.common.ServiceDocument) AzureUriPaths(com.vmware.photon.controller.model.adapters.azure.AzureUriPaths) StringUtils(org.apache.commons.lang3.StringUtils) ComputeType(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ComputeType) EndpointAllocationTaskService(com.vmware.photon.controller.model.tasks.EndpointAllocationTaskService) SingleResourceStatsCollectionTaskState(com.vmware.photon.controller.model.tasks.monitoring.SingleResourceStatsCollectionTaskService.SingleResourceStatsCollectionTaskState) Utils(com.vmware.xenon.common.Utils) BufferedSink(okio.BufferedSink) Map(java.util.Map) AzureService(com.vmware.photon.controller.model.adapters.azure.model.cost.AzureService) URI(java.net.URI) AzureSubscriptionsEnumerationRequest(com.vmware.photon.controller.model.adapters.azure.ea.enumeration.AzureSubscriptionsEnumerationService.AzureSubscriptionsEnumerationRequest) Builder(com.vmware.xenon.services.common.QueryTask.Builder) Path(java.nio.file.Path) EndpointState(com.vmware.photon.controller.model.resources.EndpointService.EndpointState) Interceptor(okhttp3.Interceptor) ComputeStatsResponse(com.vmware.photon.controller.model.adapterapi.ComputeStatsResponse) AzureDetailedBillHandler(com.vmware.photon.controller.model.adapters.azure.ea.utils.AzureDetailedBillHandler) Request(okhttp3.Request) ComputeStatsRequest(com.vmware.photon.controller.model.adapterapi.ComputeStatsRequest) StatelessService(com.vmware.xenon.common.StatelessService) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) OldEaSummarizedBillElement(com.vmware.photon.controller.model.adapters.azure.model.cost.OldEaSummarizedBillElement) TaskManager(com.vmware.photon.controller.model.adapters.util.TaskManager) Set(java.util.Set) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) AzureSubscriptionsEnumerationService(com.vmware.photon.controller.model.adapters.azure.ea.enumeration.AzureSubscriptionsEnumerationService) AzureCostHelper(com.vmware.photon.controller.model.adapters.azure.ea.utils.AzureCostHelper) List(java.util.List) Stream(java.util.stream.Stream) UriUtils(com.vmware.xenon.common.UriUtils) Entry(java.util.Map.Entry) QueryOption(com.vmware.xenon.services.common.QueryTask.QuerySpecification.QueryOption) INTERNAL_REQUEST_TIMEOUT_SECONDS(com.vmware.photon.controller.model.adapters.azure.constants.AzureCostConstants.INTERNAL_REQUEST_TIMEOUT_SECONDS) ResourceMetrics(com.vmware.photon.controller.model.monitoring.ResourceMetricsService.ResourceMetrics) SingleResourceTaskCollectionStage(com.vmware.photon.controller.model.tasks.monitoring.SingleResourceStatsCollectionTaskService.SingleResourceTaskCollectionStage) Okio(okio.Okio) QueryByPages(com.vmware.photon.controller.model.query.QueryUtils.QueryByPages) OperationContext(com.vmware.xenon.common.OperationContext) AtomicDouble(com.google.common.util.concurrent.AtomicDouble) HashMap(java.util.HashMap) Function(java.util.function.Function) AzureResource(com.vmware.photon.controller.model.adapters.azure.model.cost.AzureResource) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) EndpointConfigRequest(com.vmware.photon.controller.model.adapterapi.EndpointConfigRequest) Query(com.vmware.xenon.services.common.QueryTask.Query) CollectionUtils(org.apache.commons.collections.CollectionUtils) EaBillLinkElement(com.vmware.photon.controller.model.adapters.azure.model.cost.EaBillLinkElement) ComputeState(com.vmware.photon.controller.model.resources.ComputeService.ComputeState) AUTO_DISCOVERED_ENTITY(com.vmware.photon.controller.model.constants.PhotonModelConstants.AUTO_DISCOVERED_ENTITY) EaBillLinks(com.vmware.photon.controller.model.adapters.azure.model.cost.EaBillLinks) BiConsumer(java.util.function.BiConsumer) Response(okhttp3.Response) EndpointType(com.vmware.photon.controller.model.constants.PhotonModelConstants.EndpointType) Call(okhttp3.Call) Callback(okhttp3.Callback) AzureSubscription(com.vmware.photon.controller.model.adapters.azure.model.cost.AzureSubscription) ComputeStats(com.vmware.photon.controller.model.adapterapi.ComputeStatsResponse.ComputeStats) ExecutorService(java.util.concurrent.ExecutorService) OldApi(com.vmware.photon.controller.model.adapters.azure.model.cost.OldApi) AdapterUtils(com.vmware.photon.controller.model.adapters.util.AdapterUtils) ServiceErrorResponse(com.vmware.xenon.common.ServiceErrorResponse) Files(java.nio.file.Files) Operation(com.vmware.xenon.common.Operation) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) TypeName(com.vmware.xenon.common.ServiceDocumentDescription.TypeName) ServiceStat(com.vmware.xenon.common.ServiceStats.ServiceStat) File(java.io.File) QueryTop(com.vmware.photon.controller.model.query.QueryUtils.QueryTop) BillParsingStatus(com.vmware.photon.controller.model.adapters.azure.model.cost.BillParsingStatus) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) LocalDate(org.joda.time.LocalDate) ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) OkHttpClient(okhttp3.OkHttpClient) Paths(java.nio.file.Paths) ClusterUtil(com.vmware.photon.controller.model.util.ClusterUtil) ComputeStateWithDescription(com.vmware.photon.controller.model.resources.ComputeService.ComputeStateWithDescription) PhotonModelConstants(com.vmware.photon.controller.model.constants.PhotonModelConstants) ServiceDocumentDescription(com.vmware.xenon.common.ServiceDocumentDescription) Comparator(java.util.Comparator) QuerySpecification(com.vmware.xenon.services.common.QueryTask.QuerySpecification) OperationJoin(com.vmware.xenon.common.OperationJoin) AtomicDouble(com.google.common.util.concurrent.AtomicDouble) ArrayList(java.util.ArrayList) AtomicDouble(com.google.common.util.concurrent.AtomicDouble) ServiceStat(com.vmware.xenon.common.ServiceStats.ServiceStat) Entry(java.util.Map.Entry) ComputeStats(com.vmware.photon.controller.model.adapterapi.ComputeStatsResponse.ComputeStats) List(java.util.List) ArrayList(java.util.ArrayList)

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