diff options
author | Morten Tokle <mortent@oath.com> | 2018-03-14 10:29:37 +0100 |
---|---|---|
committer | Morten Tokle <mortent@oath.com> | 2018-03-14 10:29:37 +0100 |
commit | 9fa40b469a9061478853538d24904db2e7aab100 (patch) | |
tree | d184efc539c2c98cdf38850dd123d763ff513e65 | |
parent | 4ba6e931fddd00436abf1de33eeaf38dc7aed8b5 (diff) |
Include only controller managed zones in uris and zones
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/zone/v2/ZoneApiHandler.java | 6 |
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()); |