diff options
author | Morten Tokle <mortent@verizonmedia.com> | 2020-12-16 12:48:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-16 12:48:38 +0100 |
commit | 495d571406d984662ca679406ef946f328711958 (patch) | |
tree | ec3582093a435683b8359180a9718a4d6f4f57bc | |
parent | 4e9cdffe7862149902e3bdbe5f5fce9a93e70bf2 (diff) | |
parent | 947e936d0a398c0a41d9494a5d412efe9ead52f2 (diff) |
Merge pull request #15834 from vespa-engine/mpolden/allow-controller-zone
Allow controller zone
2 files changed, 9 insertions, 0 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java index 824a374642a..117ac9bbf4b 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java @@ -2206,6 +2206,10 @@ public class ApplicationApiHandler extends LoggingRequestHandler { private ZoneId requireZone(String environment, String region) { ZoneId zone = ZoneId.from(environment, region); + // TODO(mpolden): Find a way to not hardcode this. Some APIs allow this "virtual" zone, e.g. /logs + if (zone.environment() == Environment.prod && zone.region().value().equals("controller")) { + return zone; + } if (!controller.zoneRegistry().hasZone(zone)) { throw new IllegalArgumentException("Zone " + zone + " does not exist in this system"); } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java index 27d7b6f3d7a..3d1375601ad 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java @@ -494,6 +494,11 @@ public class ApplicationApiTest extends ControllerContainerTest { .userIdentity(USER_ID), "INFO - All good"); + // GET controller logs + tester.assertResponse(request("/application/v4/tenant/tenant2/application/application1/environment/prod/region/controller/instance/default/logs?from=1233&to=3214", GET) + .userIdentity(USER_ID), + "INFO - All good"); + // Get content - root tester.assertResponse(request("/application/v4/tenant/tenant2/application/application1/instance/default/environment/dev/region/us-east-1/content/", GET).userIdentity(USER_ID), "{\"path\":\"/\"}"); |