aboutsummaryrefslogtreecommitdiffstats
path: root/orchestrator-restapi
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2018-03-01 12:51:24 +0100
committerMartin Polden <mpolden@mpolden.no>2018-03-01 15:22:33 +0100
commitab6db5440693e787b633a8c982ef4454956203b5 (patch)
tree5e98e308fc9e370904776b8e793c35292277f997 /orchestrator-restapi
parent38b565a428f2272b5184b5ee69a95d9654e7ae54 (diff)
New path for suspend all API
This is required to allow authorization of these requests.
Diffstat (limited to 'orchestrator-restapi')
-rw-r--r--orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/HostApi.java2
-rw-r--r--orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/HostSuspensionApi.java15
2 files changed, 15 insertions, 2 deletions
diff --git a/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/HostApi.java b/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/HostApi.java
index ad0f3e094eb..1c4d138acef 100644
--- a/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/HostApi.java
+++ b/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/HostApi.java
@@ -14,9 +14,7 @@ import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.UriInfo;
/**
* Definition of Orchestrator's REST API for hosts.
diff --git a/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/HostSuspensionApi.java b/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/HostSuspensionApi.java
index a5ca15d2d15..a9846134eff 100644
--- a/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/HostSuspensionApi.java
+++ b/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/HostSuspensionApi.java
@@ -6,9 +6,16 @@ import com.yahoo.vespa.orchestrator.restapi.wire.BatchOperationResult;
import javax.ws.rs.Consumes;
import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
+import java.util.List;
+/**
+ * @author hakonhall
+ */
public interface HostSuspensionApi {
/**
* Path prefix for this api. Resources implementing this API should use this with a @Path annotation.
@@ -27,5 +34,13 @@ public interface HostSuspensionApi {
@PUT
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
+ @Deprecated // TODO: Remove after 2018-04-01
BatchOperationResult suspendAll(BatchHostSuspendRequest request);
+
+ @PUT
+ @Path("/{hostname}")
+ @Produces(MediaType.APPLICATION_JSON)
+ @Consumes(MediaType.APPLICATION_JSON)
+ BatchOperationResult suspendAll(@PathParam("hostname") String parentHostname,
+ @QueryParam("hostname") List<String> hostnames);
}