use of com.vmware.photon.controller.model.adapters.azure.ea.enumeration.AzureSubscriptionsEnumerationService.AzureSubscriptionsEnumerationRequest in project photon-model by vmware.
the class AzureSubscriptionsEnumerationServiceTest method createAzureCostComputesForSubscriptions.
private void createAzureCostComputesForSubscriptions(Collection<AzureSubscription> subscriptions) {
AzureSubscriptionsEnumerationRequest request = getAzureCostComputeEnumRequestForSubscriptions(subscriptions);
TestRequestSender sender = new TestRequestSender(this.host);
Operation op = Operation.createPatch(this.host, AzureSubscriptionsEnumerationService.SELF_LINK).setBody(request);
sender.sendAndWait(op);
}
use of com.vmware.photon.controller.model.adapters.azure.ea.enumeration.AzureSubscriptionsEnumerationService.AzureSubscriptionsEnumerationRequest in project photon-model by vmware.
the class AzureSubscriptionsEnumerationServiceTest method getAzureCostComputeEnumRequestForSubscriptions.
private AzureSubscriptionsEnumerationRequest getAzureCostComputeEnumRequestForSubscriptions(Collection<AzureSubscription> azureSubscriptions) {
AzureSubscriptionsEnumerationRequest request = new AzureSubscriptionsEnumerationRequest();
request.resourceReference = UriUtils.buildUri(this.host, this.computeLink);
request.azureSubscriptions = azureSubscriptions;
return request;
}
use of com.vmware.photon.controller.model.adapters.azure.ea.enumeration.AzureSubscriptionsEnumerationService.AzureSubscriptionsEnumerationRequest in project photon-model by vmware.
the class AzureCostStatsService method createMissingComputeStates.
/**
* The user adds the EA account as the end-point. By parsing the bill, we understand there are
* one or more subscriptions, resources whose compute states need to be created in order
* to store cost information for those entities.
*/
private void createMissingComputeStates(Context context, Stages next, List<AzureSubscription> newSubscriptions) {
logInfo(() -> String.format("Creating compute states for the following subscriptions: %s for " + "endpoint %s ", newSubscriptions.toString(), context.computeHostDesc.endpointLink));
AzureSubscriptionsEnumerationRequest request = new AzureSubscriptionsEnumerationRequest();
request.resourceReference = UriUtils.extendUri(getInventoryServiceUri(), context.computeHostDesc.documentSelfLink);
request.azureSubscriptions = newSubscriptions;
Operation.createPatch(getHost(), AzureSubscriptionsEnumerationService.SELF_LINK).setBody(request).setCompletion((operation, exception) -> {
logInfo(() -> String.format("Finished creating compute states for " + "subscriptions under endpoint %s.", context.computeHostDesc.documentSelfLink));
context.stage = next;
handleRequest(context);
}).sendWith(this);
}
Aggregations