diff options
Diffstat (limited to 'controller-api')
3 files changed, 40 insertions, 0 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 bf16913d05a..1da8e5bf761 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 @@ -7,6 +7,7 @@ import com.yahoo.vespa.hosted.controller.api.identifiers.ControllerVersion; import com.yahoo.vespa.hosted.controller.api.integration.archive.ArchiveService; import com.yahoo.vespa.hosted.controller.api.integration.artifact.ArtifactRegistry; import com.yahoo.vespa.hosted.controller.api.integration.athenz.AccessControlService; +import com.yahoo.vespa.hosted.controller.api.integration.aws.EnclaveAccessService; import com.yahoo.vespa.hosted.controller.api.integration.aws.ResourceTagger; import com.yahoo.vespa.hosted.controller.api.integration.aws.RoleService; import com.yahoo.vespa.hosted.controller.api.integration.billing.BillingController; @@ -86,6 +87,8 @@ public interface ServiceRegistry { ResourceTagger resourceTagger(); + EnclaveAccessService amiService(); + RoleService roleService(); SystemMonitor systemMonitor(); diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/EnclaveAccessService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/EnclaveAccessService.java new file mode 100644 index 00000000000..44d7712c243 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/EnclaveAccessService.java @@ -0,0 +1,15 @@ +package com.yahoo.vespa.hosted.controller.api.integration.aws; + +import com.yahoo.config.provision.CloudAccount; + +import java.util.Set; + +/** + * @author jonmv + */ +public interface EnclaveAccessService { + + /** Makes the current AMIs available to the given accounts. */ + void allowAccessFor(Set<CloudAccount> accounts); + +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockEnclaveAccessService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockEnclaveAccessService.java new file mode 100644 index 00000000000..95c69c6a8fa --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockEnclaveAccessService.java @@ -0,0 +1,22 @@ +package com.yahoo.vespa.hosted.controller.api.integration.aws; + +import com.yahoo.config.provision.CloudAccount; + +import java.util.Set; +import java.util.TreeSet; + +/** + * @author jonmv + */ +public class MockEnclaveAccessService implements EnclaveAccessService { + + private volatile Set<CloudAccount> currentAccounts; + + public Set<CloudAccount> currentAccounts() { return currentAccounts; } + + @Override + public void allowAccessFor(Set<CloudAccount> accounts) { + currentAccounts = new TreeSet<>(accounts); + } + +} |