* Authentication realm : <b>opendaylight</b><br>
* Transport : <b>HTTP and HTTPS</b><br>
* <br>
- * 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.<br>
- * More info :
- * http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
+ * HTTPS Authentication is disabled by default.
*
*/
*
* RequestURL:
*
- * http://localhost:8080/controller/nb/v2/host/default
+ * http://localhost:8080/controller/nb/v2/hosttracker/default/hosts/active
*
* Response in XML
*
* }
* </pre>
*/
- @Path("/{containerName}")
+ @Path("/{containerName}/hosts/active")
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(Hosts.class)
*
* RequestURL:
*
- * http://localhost:8080/controller/nb/v2/host/default/inactive
+ * http://localhost:8080/controller/nb/v2/hosttracker/default/hosts/inactive
*
* Response in XML
*
* }
* </pre>
*/
- @Path("/{containerName}/inactive")
+ @Path("/{containerName}/hosts/inactive")
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(Hosts.class)
*
* 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
*
* }
* </pre>
*/
- @Path("/{containerName}/{networkAddress}")
+ @Path("/{containerName}/address/{networkAddress}")
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@TypeHint(HostConfig.class)
}
/**
- * 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
*
* 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
*
* </pre>
*/
- @Path("/{containerName}/{networkAddress}")
+ @Path("/{containerName}/address/{networkAddress}")
@PUT
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@StatusCodes({
@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> hostConfig) {
+ @TypeHint(HostConfig.class) HostConfig hostConfig) {
if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.WRITE, this)) {
return Response.status(Response.Status.UNAUTHORIZED)
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")
* @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({