diff options
author | Harald Musum <musum@yahooinc.com> | 2023-10-04 12:40:00 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2023-10-04 12:40:00 +0200 |
commit | 531debdd265128a2c658a994ed2d6ff55afdf253 (patch) | |
tree | 8822c2bafe899ae464e578fbf9a39bb1ce3d78af /controller-api | |
parent | c96c5dd1b6c50d89c5df73a0e36b1c9f7b003e7c (diff) |
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 | 9 |
1 files changed, 7 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..ae6c15852b4 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 @@ -28,13 +28,15 @@ public class CloudTenant extends Tenant { private final ArchiveAccess archiveAccess; private final Optional<Instant> invalidateUserSessionsBefore; private final Optional<BillingReference> billingReference; + private final Optional<String> 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, + Optional<String> planId) { super(name, createdAt, lastLoginInfo, Optional.empty(), tenantRoleLastMaintained, cloudAccounts); this.creator = creator; this.developerKeys = developerKeys; @@ -43,6 +45,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 +55,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(), Optional.empty()); } /** The user that created the tenant */ @@ -92,6 +95,8 @@ public class CloudTenant extends Tenant { return billingReference; } + public Optional<String> planId() { return planId; } + @Override public Type type() { return Type.cloud; |