summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorMorten Tokle <morten.tokle@gmail.com>2018-03-14 12:24:14 +0100
committerGitHub <noreply@github.com>2018-03-14 12:24:14 +0100
commit5adc38666f5e9e55622bbb3c23bfea559d299b05 (patch)
treee5960292ad3f8a4192af6c348c1bcdac8eabe06c /controller-server
parent8a725c72aac0cfdce7e7c0ad4b03992648d49527 (diff)
parent9fa40b469a9061478853538d24904db2e7aab100 (diff)
Merge pull request #5326 from vespa-engine/mortent/controller-managed-zones-listed
Include only controller managed zones in uris and zones
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/zone/v2/ZoneApiHandler.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/zone/v2/ZoneApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/zone/v2/ZoneApiHandler.java
index 7900413b485..63de0ac8f69 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/zone/v2/ZoneApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/zone/v2/ZoneApiHandler.java
@@ -7,6 +7,7 @@ import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.LoggingRequestHandler;
import com.yahoo.slime.Cursor;
import com.yahoo.slime.Slime;
+import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneList;
import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneRegistry;
import com.yahoo.vespa.hosted.controller.proxy.ConfigServerRestExecutor;
import com.yahoo.vespa.hosted.controller.proxy.ProxyException;
@@ -89,13 +90,14 @@ public class ZoneApiHandler extends LoggingRequestHandler {
Slime slime = new Slime();
Cursor root = slime.setObject();
Cursor uris = root.setArray("uris");
- zoneRegistry.zones().controllerManaged().ids().forEach(zoneId -> uris.addString(request.getUri()
+ ZoneList zoneList = zoneRegistry.zones().controllerManaged();
+ zoneList.ids().forEach(zoneId -> uris.addString(request.getUri()
.resolve("/zone/v2/")
.resolve(zoneId.environment().value() + "/")
.resolve(zoneId.region().value())
.toString()));
Cursor zones = root.setArray("zones");
- zoneRegistry.zones().all().ids().forEach(zoneId -> {
+ zoneList.ids().forEach(zoneId -> {
Cursor object = zones.addObject();
object.setString("environment", zoneId.environment().value());
object.setString("region", zoneId.region().value());