diff options
author | Øyvind Grønnesby <oyving@verizonmedia.com> | 2020-05-27 15:59:39 +0200 |
---|---|---|
committer | Øyvind Grønnesby <oyving@verizonmedia.com> | 2020-05-27 15:59:39 +0200 |
commit | 80f55c0d27164738033fd8ce0260d35b75240c9a (patch) | |
tree | 1a869b708b7dee608ddf0770af52254a874bcf8e /controller-server | |
parent | 3867149fbf005f5b8b86f01783aa7aa2bbdd76e9 (diff) |
Remove the old Billing interface
Diffstat (limited to 'controller-server')
4 files changed, 0 insertions, 52 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/BillingMaintainer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/BillingMaintainer.java deleted file mode 100644 index 7427fac93d2..00000000000 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/BillingMaintainer.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.hosted.controller.maintenance; - -import com.yahoo.config.provision.SystemName; -import com.yahoo.vespa.hosted.controller.Controller; -import com.yahoo.vespa.hosted.controller.api.integration.organization.Billing; -import com.yahoo.vespa.hosted.controller.tenant.CloudTenant; - -import java.time.Duration; -import java.util.EnumSet; - -/** - * @author olaa - */ -public class BillingMaintainer extends ControllerMaintainer { - - private final Billing billing; - - public BillingMaintainer(Controller controller, Duration interval) { - super(controller, interval, BillingMaintainer.class.getSimpleName(), EnumSet.of(SystemName.cd)); - this.billing = controller.serviceRegistry().billingService(); - } - - @Override - public void maintain() { - controller().tenants().asList() - .stream() - .filter(tenant -> tenant instanceof CloudTenant) - .map(tenant -> (CloudTenant) tenant) - .forEach(cloudTenant -> controller().applications().asList(cloudTenant.name()) - .forEach(application -> { - billing.handleBilling(application.id().defaultInstance(), cloudTenant.billingInfo().customerId()); - }) - ); - } - -} - - diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ControllerMaintenance.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ControllerMaintenance.java index d20be628078..193c3833202 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ControllerMaintenance.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ControllerMaintenance.java @@ -40,7 +40,6 @@ public class ControllerMaintenance extends AbstractComponent { private final CostReportMaintainer costReportMaintainer; private final ResourceMeterMaintainer resourceMeterMaintainer; private final NameServiceDispatcher nameServiceDispatcher; - private final BillingMaintainer billingMaintainer; private final CloudEventReporter cloudEventReporter; private final RotationStatusUpdater rotationStatusUpdater; private final ResourceTagMaintainer resourceTagMaintainer; @@ -69,7 +68,6 @@ public class ControllerMaintenance extends AbstractComponent { nameServiceDispatcher = new NameServiceDispatcher(controller, Duration.ofSeconds(10)); costReportMaintainer = new CostReportMaintainer(controller, Duration.ofHours(2), controller.serviceRegistry().costReportConsumer()); resourceMeterMaintainer = new ResourceMeterMaintainer(controller, Duration.ofMinutes(1), metric, controller.serviceRegistry().meteringService()); - billingMaintainer = new BillingMaintainer(controller, Duration.ofDays(3)); cloudEventReporter = new CloudEventReporter(controller, Duration.ofDays(1)); rotationStatusUpdater = new RotationStatusUpdater(controller, maintenanceInterval); resourceTagMaintainer = new ResourceTagMaintainer(controller, Duration.ofMinutes(30), controller.serviceRegistry().resourceTagger()); @@ -96,7 +94,6 @@ public class ControllerMaintenance extends AbstractComponent { costReportMaintainer.close(); resourceMeterMaintainer.close(); nameServiceDispatcher.close(); - billingMaintainer.close(); cloudEventReporter.close(); rotationStatusUpdater.close(); resourceTagMaintainer.close(); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java index 667e9687aa1..318ad3ddf66 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ServiceRegistryMock.java @@ -16,7 +16,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.certificates.EndpointCe import com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServer; import com.yahoo.vespa.hosted.controller.api.integration.dns.MemoryNameService; import com.yahoo.vespa.hosted.controller.api.integration.entity.MemoryEntityService; -import com.yahoo.vespa.hosted.controller.api.integration.organization.MockBilling; import com.yahoo.vespa.hosted.controller.api.integration.organization.MockContactRetriever; import com.yahoo.vespa.hosted.controller.api.integration.organization.MockIssueHandler; import com.yahoo.vespa.hosted.controller.api.integration.resource.CostReportConsumerMock; @@ -50,7 +49,6 @@ public class ServiceRegistryMock extends AbstractComponent implements ServiceReg private final LoggingDeploymentIssues loggingDeploymentIssues = new LoggingDeploymentIssues(); private final MemoryEntityService memoryEntityService = new MemoryEntityService(); private final CostReportConsumerMock costReportConsumerMock = new CostReportConsumerMock(); - private final MockBilling mockBilling = new MockBilling(); private final MockAwsEventFetcher mockAwsEventFetcher = new MockAwsEventFetcher(); private final ArtifactRepositoryMock artifactRepositoryMock = new ArtifactRepositoryMock(); private final MockTesterCloud mockTesterCloud; @@ -135,11 +133,6 @@ public class ServiceRegistryMock extends AbstractComponent implements ServiceReg } @Override - public MockBilling billingService() { - return mockBilling; - } - - @Override public MockAwsEventFetcher eventFetcherService() { return mockAwsEventFetcher; } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/controller/responses/maintenance.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/controller/responses/maintenance.json index fbdf8caaed7..ecb5c319f44 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/controller/responses/maintenance.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/controller/responses/maintenance.json @@ -4,9 +4,6 @@ "name": "ApplicationOwnershipConfirmer" }, { - "name": "BillingMaintainer" - }, - { "name": "CloudEventReporter" }, { |