diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2018-01-02 12:43:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-02 12:43:40 +0100 |
commit | e77379005bccd3d5009b1484038183a05856b4cd (patch) | |
tree | 35545093828437f6d7704b4b6c3646a39ff50a00 /controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/zone/v2/ZoneApiHandler.java | |
parent | b73a4d2c8b5e7ae83743b10b8f21836811e5dff4 (diff) | |
parent | 95ae8c562a8826f03bd2faad82b0ffb754133342 (diff) |
Merge pull request #4453 from vespa-engine/jvenstad/zone-cleanup-4
Jvenstad/zone cleanup 4
Diffstat (limited to 'controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/zone/v2/ZoneApiHandler.java')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/zone/v2/ZoneApiHandler.java | 17 |
1 files changed, 7 insertions, 10 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 772dd1f6cb1..68dc2325687 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 @@ -1,9 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.restapi.zone.v2; -import com.yahoo.config.provision.Environment; -import com.yahoo.config.provision.RegionName; -import com.yahoo.config.provision.ZoneId; +import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId; import com.yahoo.container.jdisc.HttpRequest; import com.yahoo.container.jdisc.HttpResponse; import com.yahoo.container.jdisc.LoggingRequestHandler; @@ -20,7 +18,6 @@ import com.yahoo.vespa.hosted.controller.restapi.SlimeJsonResponse; import com.yahoo.yolean.Exceptions; import java.io.IOException; -import java.util.Optional; import java.util.concurrent.Executor; import java.util.logging.Level; @@ -94,16 +91,16 @@ public class ZoneApiHandler extends LoggingRequestHandler { Slime slime = new Slime(); Cursor root = slime.setObject(); Cursor uris = root.setArray("uris"); - zoneRegistry.zones().forEach(zone -> uris.addString(request.getUri() + zoneRegistry.zones().all().ids().forEach(zoneId -> uris.addString(request.getUri() .resolve("/zone/v2/") - .resolve(zone.environment().value() + "/") - .resolve(zone.region().value()) + .resolve(zoneId.environment().value() + "/") + .resolve(zoneId.region().value()) .toString())); Cursor zones = root.setArray("zones"); - zoneRegistry.zones().forEach(zone -> { + zoneRegistry.zones().all().ids().forEach(zoneId -> { Cursor object = zones.addObject(); - object.setString("environment", zone.environment().value()); - object.setString("region", zone.region().value()); + object.setString("environment", zoneId.environment().value()); + object.setString("region", zoneId.region().value()); }); return new SlimeJsonResponse(slime); } |