From 274c068c456bdf89421941740b10ee092f130e75 Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Fri, 20 Apr 2018 09:12:58 +0200 Subject: Rename interface --- .../api/integration/configserver/ConfigServer.java | 72 ++++++++++++++++++++++ .../configserver/ConfigServerClient.java | 70 --------------------- 2 files changed, 72 insertions(+), 70 deletions(-) create mode 100644 controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java delete mode 100644 controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerClient.java (limited to 'controller-api') diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java new file mode 100644 index 00000000000..44c6d899360 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java @@ -0,0 +1,72 @@ +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.configserver; + +import com.fasterxml.jackson.databind.JsonNode; +import com.yahoo.component.Version; +import com.yahoo.vespa.hosted.controller.api.application.v4.model.DeployOptions; +import com.yahoo.vespa.hosted.controller.api.application.v4.model.EndpointStatus; +import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId; +import com.yahoo.vespa.hosted.controller.api.identifiers.Hostname; +import com.yahoo.vespa.serviceview.bindings.ApplicationView; + +import java.io.IOException; +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +/** + * The API controllers use when communicating with config servers. + * + * @author Oyvind Grønnesby + */ +public interface ConfigServer { + + interface PreparedApplication { + void activate(); + List messages(); + PrepareResponse prepareResponse(); + } + + // TODO: Deprecated, remove when implementations have been removed + default PreparedApplication prepare(DeploymentId applicationInstance, DeployOptions deployOptions, Set rotationCnames, Set rotationNames, byte[] content) { + return deploy(applicationInstance, deployOptions, rotationCnames, rotationNames, content); + } + + PreparedApplication deploy(DeploymentId applicationInstance, DeployOptions deployOptions, Set rotationCnames, Set rotationNames, byte[] content); + + void restart(DeploymentId applicationInstance, Optional hostname) throws NoInstanceException; + + void deactivate(DeploymentId applicationInstance) throws NoInstanceException; + + JsonNode waitForConfigConverge(DeploymentId applicationInstance, long timeoutInSeconds); + + ApplicationView getApplicationView(String tenantName, String applicationName, String instanceName, String environment, String region); + + Map getServiceApiResponse(String tenantName, String applicationName, String instanceName, String environment, String region, String serviceName, String restPath); + + /** Returns the version this particular config server is running */ + Version version(URI configServerUri); + + /** + * Set new status on en endpoint in one zone. + * + * @param deployment The application/zone pair + * @param endpoint The endpoint to modify + * @param status The new status with metadata + * @throws IOException If trouble contacting the server + */ + void setGlobalRotationStatus(DeploymentId deployment, String endpoint, EndpointStatus status) throws IOException; + + /** + * Get the endpoint status for an app in one zone + * + * @param deployment The application/zone pair + * @param endpoint The endpoint to modify + * @return The endpoint status with metadata + * @throws IOException If trouble contacting the server + */ + EndpointStatus getGlobalRotationStatus(DeploymentId deployment, String endpoint) throws IOException; + +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerClient.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerClient.java deleted file mode 100644 index 089cba4fe43..00000000000 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerClient.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.hosted.controller.api.integration.configserver; - -import com.fasterxml.jackson.databind.JsonNode; -import com.yahoo.component.Version; -import com.yahoo.vespa.hosted.controller.api.application.v4.model.DeployOptions; -import com.yahoo.vespa.hosted.controller.api.application.v4.model.EndpointStatus; -import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId; -import com.yahoo.vespa.hosted.controller.api.identifiers.Hostname; -import com.yahoo.vespa.serviceview.bindings.ApplicationView; - -import java.io.IOException; -import java.net.URI; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; - -/** - * @author Oyvind Grønnesby - */ -public interface ConfigServerClient { - - interface PreparedApplication { - void activate(); - List messages(); - PrepareResponse prepareResponse(); - } - - // TODO: Deprecated, remove when implementations have been removed - default PreparedApplication prepare(DeploymentId applicationInstance, DeployOptions deployOptions, Set rotationCnames, Set rotationNames, byte[] content) { - return deploy(applicationInstance, deployOptions, rotationCnames, rotationNames, content); - } - - PreparedApplication deploy(DeploymentId applicationInstance, DeployOptions deployOptions, Set rotationCnames, Set rotationNames, byte[] content); - - void restart(DeploymentId applicationInstance, Optional hostname) throws NoInstanceException; - - void deactivate(DeploymentId applicationInstance) throws NoInstanceException; - - JsonNode waitForConfigConverge(DeploymentId applicationInstance, long timeoutInSeconds); - - ApplicationView getApplicationView(String tenantName, String applicationName, String instanceName, String environment, String region); - - Map getServiceApiResponse(String tenantName, String applicationName, String instanceName, String environment, String region, String serviceName, String restPath); - - /** Returns the version this particular config server is running */ - Version version(URI configServerUri); - - /** - * Set new status on en endpoint in one zone. - * - * @param deployment The application/zone pair - * @param endpoint The endpoint to modify - * @param status The new status with metadata - * @throws IOException If trouble contacting the server - */ - void setGlobalRotationStatus(DeploymentId deployment, String endpoint, EndpointStatus status) throws IOException; - - /** - * Get the endpoint status for an app in one zone - * - * @param deployment The application/zone pair - * @param endpoint The endpoint to modify - * @return The endpoint status with metadata - * @throws IOException If trouble contacting the server - */ - EndpointStatus getGlobalRotationStatus(DeploymentId deployment, String endpoint) throws IOException; - -} -- cgit v1.2.3