From f2233af9ddffc4b7c1c6f25af5558e6c8b9542c8 Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Wed, 4 Oct 2023 14:08:44 +0200 Subject: Revert "Revert "Add support for persisting plan in ZooKeeper for a tenant"" --- .../com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'controller-api') diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java index 173d3e1950e..44a46195989 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java @@ -4,6 +4,7 @@ package com.yahoo.vespa.hosted.controller.tenant; import com.google.common.collect.BiMap; import com.google.common.collect.ImmutableBiMap; import com.yahoo.config.provision.TenantName; +import com.yahoo.vespa.hosted.controller.api.integration.billing.PlanId; import com.yahoo.vespa.hosted.controller.api.integration.secrets.TenantSecretStore; import com.yahoo.vespa.hosted.controller.api.role.SimplePrincipal; @@ -28,13 +29,15 @@ public class CloudTenant extends Tenant { private final ArchiveAccess archiveAccess; private final Optional invalidateUserSessionsBefore; private final Optional billingReference; + private final PlanId planId; /** Public for the serialization layer — do not use! */ public CloudTenant(TenantName name, Instant createdAt, LastLoginInfo lastLoginInfo, Optional creator, BiMap developerKeys, TenantInfo info, List tenantSecretStores, ArchiveAccess archiveAccess, Optional invalidateUserSessionsBefore, Instant tenantRoleLastMaintained, - List cloudAccounts, Optional billingReference) { + List cloudAccounts, Optional billingReference, + PlanId planId) { super(name, createdAt, lastLoginInfo, Optional.empty(), tenantRoleLastMaintained, cloudAccounts); this.creator = creator; this.developerKeys = developerKeys; @@ -43,6 +46,7 @@ public class CloudTenant extends Tenant { this.archiveAccess = Objects.requireNonNull(archiveAccess); this.invalidateUserSessionsBefore = invalidateUserSessionsBefore; this.billingReference = Objects.requireNonNull(billingReference); + this.planId = Objects.requireNonNull(planId); } /** Creates a tenant with the given name, provided it passes validation. */ @@ -52,7 +56,7 @@ public class CloudTenant extends Tenant { LastLoginInfo.EMPTY, Optional.ofNullable(creator).map(SimplePrincipal::of), ImmutableBiMap.of(), TenantInfo.empty(), List.of(), new ArchiveAccess(), Optional.empty(), - Instant.EPOCH, List.of(), Optional.empty()); + Instant.EPOCH, List.of(), Optional.empty(), PlanId.from("none")); } /** The user that created the tenant */ @@ -92,6 +96,8 @@ public class CloudTenant extends Tenant { return billingReference; } + public PlanId planId() { return planId; } + @Override public Type type() { return Type.cloud; -- cgit v1.2.3