summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorØyvind Grønnesby <oyving@verizonmedia.com>2020-05-14 13:53:46 +0200
committerGitHub <noreply@github.com>2020-05-14 13:53:46 +0200
commit00425b2db4fa59f5abdf7b87d2b041397e138bf1 (patch)
tree908eb50e1bc141b7ea0240c16283bfe087c42b80 /controller-api
parent83c42b7ce7e973f010e22f8f01a1aa508a964150 (diff)
parentae8ef6082f4e76c8c3c863925e33852a30636b93 (diff)
Merge pull request #13228 from vespa-engine/ogronnesby/remove-tenant-cost
Remove the TenantCost interface and the tenant cost API
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java3
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MockTenantCost.java36
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/TenantCost.java53
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/PathGroup.java2
4 files changed, 0 insertions, 94 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
index ca939023245..f87c764b3fd 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java
@@ -18,7 +18,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.organization.Mailer;
import com.yahoo.vespa.hosted.controller.api.integration.organization.OwnershipIssues;
import com.yahoo.vespa.hosted.controller.api.integration.resource.CostReportConsumer;
import com.yahoo.vespa.hosted.controller.api.integration.resource.MeteringClient;
-import com.yahoo.vespa.hosted.controller.api.integration.resource.TenantCost;
import com.yahoo.vespa.hosted.controller.api.integration.routing.GlobalRoutingService;
import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry;
@@ -70,8 +69,6 @@ public interface ServiceRegistry {
RunDataStore runDataStore();
- TenantCost tenantCost();
-
ZoneRegistry zoneRegistry();
ResourceTagger resourceTagger();
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MockTenantCost.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MockTenantCost.java
deleted file mode 100644
index fa3d28fe50c..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/MockTenantCost.java
+++ /dev/null
@@ -1,36 +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.api.integration.resource;
-
-import com.yahoo.config.provision.TenantName;
-
-import java.time.YearMonth;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author olaa
- */
-public class MockTenantCost implements TenantCost {
-
- private Set<YearMonth> monthsOfMetering = Collections.emptySet();
- private List<CostInfo> costInfoList = Collections.emptyList();
-
- @Override
- public Set<YearMonth> monthsWithMetering(TenantName tenantName) {
- return monthsOfMetering;
- }
-
- @Override
- public List<CostInfo> getTenantCostOfPeriod(TenantName tenantName, long startTimestamp, long endTimestamp) {
- return costInfoList;
- }
-
- public void setMonthsWithMetering(Set<YearMonth> monthsOfMetering) {
- this.monthsOfMetering = monthsOfMetering;
- }
-
- public void setCostInfoList(List<CostInfo> costInfoList) {
- this.costInfoList = costInfoList;
- }
-}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/TenantCost.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/TenantCost.java
deleted file mode 100644
index a2a91454366..00000000000
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/TenantCost.java
+++ /dev/null
@@ -1,53 +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.api.integration.resource;
-
-import com.yahoo.config.provision.TenantName;
-
-import java.time.LocalDate;
-import java.time.YearMonth;
-import java.time.temporal.ChronoUnit;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author olaa
- */
-public interface TenantCost {
-
- Set<YearMonth> monthsWithMetering(TenantName tenantName);
-
- List<CostInfo> getTenantCostOfPeriod(TenantName tenantName, long startTimestamp, long endTimestamp);
-
- default List<CostInfo> getTenantCostOfMonth(TenantName tenantName, YearMonth month) {
- return getTenantCostOfPeriod(tenantName, getMonthStartTimeStamp(month), getMonthEndTimeStamp(month));
- }
-
- static TenantCost empty() {
- return new TenantCost() {
- @Override
- public Set<YearMonth> monthsWithMetering(TenantName tenantName) {
- return Collections.emptySet();
- }
-
- @Override
- public List<CostInfo> getTenantCostOfPeriod(TenantName tenantName, long startTime, long endTime) {
- return Collections.emptyList();
- }
- };
- }
-
- private long getMonthStartTimeStamp(YearMonth month) {
- LocalDate startOfMonth = LocalDate.of(month.getYear(), month.getMonth(), 1);
- return startOfMonth.atStartOfDay(java.time.ZoneId.of("UTC"))
- .toInstant()
- .toEpochMilli();
- }
- private long getMonthEndTimeStamp(YearMonth month) {
- LocalDate startOfMonth = LocalDate.of(month.getYear(), month.getMonth(), 1);
- return startOfMonth.plus(1, ChronoUnit.MONTHS)
- .atStartOfDay(java.time.ZoneId.of("UTC"))
- .toInstant()
- .toEpochMilli();
- }
-}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/PathGroup.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/PathGroup.java
index c3614911ee3..0316803558b 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/PathGroup.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/role/PathGroup.java
@@ -56,8 +56,6 @@ enum PathGroup {
tenantInfo(Matcher.tenant,
PathPrefix.api,
"/application/v4/tenant/{tenant}/application/",
- "/application/v4/tenant/{tenant}/cost",
- "/application/v4/tenant/{tenant}/cost/{date}",
"/routing/v1/status/tenant/{tenant}/{*}"),
tenantKeys(Matcher.tenant,