return Response.status(Response.Status.CREATED).build();
}
+
+
+ /**
+ * Remove affinity group from the configuration database
+ *
+ * @param containerName
+ * Name of the Container
+ * @param affinityGroupName
+ * Name of the new affinity group being added
+ * @return Response as dictated by the HTTP Response Status code
+ */
+
+ @Path("/{containerName}/delete/group/{affinityGroupName}")
+ @PUT
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @TypeHint(Response.class)
+ @StatusCodes({
+ @ResponseCode(code = 200, condition = "Operation successful"),
+ @ResponseCode(code = 404, condition = "The Container Name or nodeId or configuration name is not found"),
+ @ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") })
+ public Response deleteAffinityGroup(
+ @PathParam("containerName") String containerName,
+ @PathParam("affinityGroupName") String affinityGroupName) {
+
+ if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.WRITE, this)) {
+ throw new UnauthorizedException("User is not authorized to perform this operation on container "
+ + containerName);
+ }
+ log.info("remove an affinity group = {}, containerName = {}", affinityGroupName, containerName);
+ IAffinityManager affinityManager = getIfAffinityManagerService(containerName);
+ if (affinityManager == null) {
+ throw new ServiceUnavailableException("Affinity Manager "
+ + RestMessages.SERVICEUNAVAILABLE.toString());
+ }
+
+ Status ret = affinityManager.removeAffinityGroup(affinityGroupName);
+
+ return Response.ok().build();
+ }
+
+
+ @Path("/{containerName}/delete/link/{affinityLinkName}")
+ @PUT
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @TypeHint(Response.class)
+ @StatusCodes({
+ @ResponseCode(code = 200, condition = "Operation successful"),
+ @ResponseCode(code = 404, condition = "The Container Name or nodeId or configuration name is not found"),
+ @ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") })
+ public Response deleteAffinityLink(
+ @PathParam("containerName") String containerName,
+ @PathParam("affinityLinkName") String affinityLinkName) {
+
+ if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.WRITE, this)) {
+ throw new UnauthorizedException("User is not authorized to perform this operation on container "
+ + containerName);
+ }
+ log.info("remove an affinity link = {}, containerName = {}", affinityLinkName, containerName);
+ IAffinityManager affinityManager = getIfAffinityManagerService(containerName);
+ if (affinityManager == null) {
+ throw new ServiceUnavailableException("Affinity Manager "
+ + RestMessages.SERVICEUNAVAILABLE.toString());
+ }
+ Status ret = affinityManager.removeAffinityLink(affinityLinkName);
+ return Response.ok().build();
+ }
+
/**
* Returns details of an affinity group.
*
put_url = 'http://localhost:8080/affinity/nb/v2/affinity/default/group/clients/add/ip/10.0.0.3'
rest_method(put_url, "PUT")
+def drop_ws_objects():
+
+ print "remove inflows link"
+ put_url = "http://localhost:8080/affinity/nb/v2/affinity/default/delete/link/inflows"
+ rest_method(put_url, "PUT")
+
+ print "remove web servers group"
+ put_url = "http://localhost:8080/affinity/nb/v2/affinity/default/delete/group/webservers"
+ rest_method(put_url, "PUT")
+
+ print "remove clients group"
+ put_url = "http://localhost:8080/affinity/nb/v2/affinity/default/delete/group/clients"
+ rest_method(put_url, "PUT")
+
def repeat_add_link():
print "create link inflows"
put_url = 'http://localhost:8080/affinity/nb/v2/affinity/default/create/link/inflows/from/clients/to/webservers'
rest_method(put_url, "PUT")
-
# Only one waypoint supported.
def set_waypoint_address(al, wp):
put_url = 'http://localhost:8080/affinity/nb/v2/affinity/default/link/' + al + '/setwaypoint/' + wp