X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnorthbound%2Fhosttracker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fhosttracker%2Fnorthbound%2FHostTrackerNorthbound.java;h=836bfa2d60fdd59b62e14d8d8a2c2d9fd247e898;hb=e89176e4777c3511a60e6507628dfcb5e7046e3c;hp=91185bb40573eea09b8e26c5aeb596e32eb23ab4;hpb=24c4c5d9720b0036b3587821207d96b37b783548;p=controller.git diff --git a/opendaylight/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/HostTrackerNorthbound.java b/opendaylight/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/HostTrackerNorthbound.java index 91185bb405..836bfa2d60 100644 --- a/opendaylight/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/HostTrackerNorthbound.java +++ b/opendaylight/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/HostTrackerNorthbound.java @@ -62,11 +62,7 @@ import org.opendaylight.controller.switchmanager.ISwitchManager; * Authentication realm : opendaylight
* Transport : HTTP and HTTPS
*
- * HTTPS Authentication is disabled by default. Administrator can enable it in - * tomcat-server.xml after adding a proper keystore / SSL certificate from a - * trusted authority.
- * More info : - * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration + * HTTPS Authentication is disabled by default. * */ @@ -137,7 +133,7 @@ public class HostTrackerNorthbound { * * RequestURL: * - * http://localhost:8080/controller/nb/v2/host/default + * http://localhost:8080/controller/nb/v2/hosttracker/default/hosts/active * * Response in XML * @@ -192,7 +188,7 @@ public class HostTrackerNorthbound { * } * */ - @Path("/{containerName}") + @Path("/{containerName}/hosts/active") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @TypeHint(Hosts.class) @@ -224,7 +220,7 @@ public class HostTrackerNorthbound { * * RequestURL: * - * http://localhost:8080/controller/nb/v2/host/default/inactive + * http://localhost:8080/controller/nb/v2/hosttracker/default/hosts/inactive * * Response in XML * @@ -279,7 +275,7 @@ public class HostTrackerNorthbound { * } * */ - @Path("/{containerName}/inactive") + @Path("/{containerName}/hosts/inactive") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @TypeHint(Hosts.class) @@ -312,7 +308,7 @@ public class HostTrackerNorthbound { * * RequestURL: * - * http://localhost:8080/controller/nb/v2/host/default/1.1.1.1 + * http://localhost:8080/controller/nb/v2/hosttracker/default/address/1.1.1.1 * * Response in XML * @@ -341,7 +337,7 @@ public class HostTrackerNorthbound { * } * */ - @Path("/{containerName}/{networkAddress}") + @Path("/{containerName}/address/{networkAddress}") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @TypeHint(HostConfig.class) @@ -374,7 +370,8 @@ public class HostTrackerNorthbound { } /** - * Add a Static Host configuration + * Add a Static Host configuration. If a host by the given address already + * exists, this method will respond with a non-successful status response. * * @param containerName * Name of the Container. The Container name for the base @@ -391,7 +388,7 @@ public class HostTrackerNorthbound { * * RequestURL: * - * http://localhost:8080/controller/nb/v2/host/default/1.1.1.1 + * http://localhost:8080/controller/nb/v2/hosttracker/default/address/1.1.1.1 * * Request in XML * @@ -421,7 +418,7 @@ public class HostTrackerNorthbound { * */ - @Path("/{containerName}/{networkAddress}") + @Path("/{containerName}/address/{networkAddress}") @PUT @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @StatusCodes({ @@ -432,7 +429,7 @@ public class HostTrackerNorthbound { @ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") }) public Response addHost(@Context UriInfo uriInfo, @PathParam("containerName") String containerName, @PathParam("networkAddress") String networkAddress, - @TypeHint(HostConfig.class) JAXBElement hostConfig) { + @TypeHint(HostConfig.class) HostConfig hostConfig) { if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.WRITE, this)) { return Response.status(Response.Status.UNAUTHORIZED) @@ -443,7 +440,7 @@ public class HostTrackerNorthbound { IfIptoHost hostTracker = getIfIpToHostService(containerName); - HostConfig hc = hostConfig.getValue(); + HostConfig hc = hostConfig; if (!networkAddress.equals(hc.getNetworkAddress())) { return Response.status(Response.Status.CONFLICT) .entity("Resource name in config object doesn't match URI") @@ -477,7 +474,7 @@ public class HostTrackerNorthbound { * @return Response as dictated by the HTTP Response code. */ - @Path("/{containerName}/{networkAddress}") + @Path("/{containerName}/address/{networkAddress}") @DELETE @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @StatusCodes({