diff options
author | Harald Musum <musum@yahooinc.com> | 2023-10-04 14:08:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 14:08:44 +0200 |
commit | f2233af9ddffc4b7c1c6f25af5558e6c8b9542c8 (patch) | |
tree | 44b66bf7fcb33dfb183dc138c4c788ccb69c909b /controller-api | |
parent | ad72fccfcd7aed3ae88cbbfadc0edf7b00286921 (diff) |
Revert "Revert "Add support for persisting plan in ZooKeeper for a tenant""
Diffstat (limited to 'controller-api')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/CloudTenant.java | 10 |
1 files changed, 8 insertions, 2 deletions
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<Instant> invalidateUserSessionsBefore; private final Optional<BillingReference> billingReference; + private final PlanId planId; /** Public for the serialization layer — do not use! */ public CloudTenant(TenantName name, Instant createdAt, LastLoginInfo lastLoginInfo, Optional<SimplePrincipal> creator, BiMap<PublicKey, SimplePrincipal> developerKeys, TenantInfo info, List<TenantSecretStore> tenantSecretStores, ArchiveAccess archiveAccess, Optional<Instant> invalidateUserSessionsBefore, Instant tenantRoleLastMaintained, - List<CloudAccountInfo> cloudAccounts, Optional<BillingReference> billingReference) { + List<CloudAccountInfo> cloudAccounts, Optional<BillingReference> 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; |