aboutsummaryrefslogtreecommitdiffstats
path: root/policy-management/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'policy-management/src/main')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java81
1 files changed, 41 insertions, 40 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
index 5d08d386..99b0ce6f 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2021 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -468,11 +469,11 @@ public class RestManager {
@ApiOperation(value = "Creates and starts a new Policy Controller",
notes = "Controller creation based on properties", response = PolicyController.class)
@ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid configuration information has been provided"),
- @ApiResponse(code = 304, message = "The controller already exists"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 304, message = "The controller already exists"),
+ @ApiResponse(code = 406,
message = "The administrative state of the system prevents it " + "from processing this request"),
- @ApiResponse(code = 206, message = "The controller has been created " + "but cannot be started"),
- @ApiResponse(code = 201, message = "The controller has been succesfully created and started")})
+ @ApiResponse(code = 206, message = "The controller has been created " + "but cannot be started"),
+ @ApiResponse(code = 201, message = "The controller has been succesfully created and started")})
public Response controllerAdd(
@ApiParam(value = "Configuration Properties to apply", required = true) Properties config) {
if (config == null) {
@@ -617,9 +618,9 @@ public class RestManager {
+ "as provides operational controls over drools applications",
response = PolicyController.class)
@ApiResponses(value = {@ApiResponse(code = 404, message = "The controller cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled"),
- @ApiResponse(code = 500, message = "A problem has occurred while deleting the Policy Controller")})
+ @ApiResponse(code = 500, message = "A problem has occurred while deleting the Policy Controller")})
public Response controllerDelete(@ApiParam(value = "Policy Controller Name",
required = true) @PathParam("controller") String controllerName) {
@@ -699,7 +700,7 @@ public class RestManager {
@ApiOperation(value = "Policy Controller Input Configuration Requests",
notes = "Feeds a configuration request input into the given Policy Controller")
@ApiResponses(value = {@ApiResponse(code = 400, message = "The configuration request is invalid"),
- @ApiResponse(code = 406, message = "The configuration request cannot be honored")})
+ @ApiResponse(code = 406, message = "The configuration request cannot be honored")})
public Response controllerUpdate(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@ApiParam(value = "Configuration to apply",
@@ -854,7 +855,7 @@ public class RestManager {
notes = "The fact types are the classnames of the objects inserted in the drools working memory",
responseContainer = "Map")
@ApiResponses(value = {@ApiResponse(code = 404, message = "The controller or session cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response droolsFacts(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@@ -883,7 +884,7 @@ public class RestManager {
notes = "The fact types are the classnames of the objects inserted in the drools working memory",
responseContainer = "List")
@ApiResponses(value = {@ApiResponse(code = 404, message = "The controller, session, or fact type cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response droolsFacts(
@ApiParam(value = "Fact count", required = false) @DefaultValue("false") @QueryParam("count") boolean count,
@@ -915,10 +916,10 @@ public class RestManager {
+ "for a given controller and session",
notes = "The DRL query must be defined in the DRL file", responseContainer = "List")
@ApiResponses(value = {
- @ApiResponse(code = 404, message = "The controller, session, or query information, cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 404, message = "The controller, session, or query information, cannot be found"),
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled"),
- @ApiResponse(code = 500, message = "A server error has occurred processing this request")})
+ @ApiResponse(code = 500, message = "A server error has occurred processing this request")})
public Response droolsFacts(
@ApiParam(value = "Fact count", required = false) @DefaultValue("false") @QueryParam("count") boolean count,
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@@ -951,10 +952,10 @@ public class RestManager {
+ "for a given controller and session",
notes = "The DRL query with parameters must be defined in the DRL file", responseContainer = "List")
@ApiResponses(value = {
- @ApiResponse(code = 404, message = "The controller, session, or query information, cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 404, message = "The controller, session, or query information, cannot be found"),
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled"),
- @ApiResponse(code = 500, message = "A server error has occurred processing this request")})
+ @ApiResponse(code = 500, message = "A server error has occurred processing this request")})
public Response droolsFacts(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@ApiParam(value = "Drools Session Name", required = true) @PathParam("session") String sessionName,
@@ -993,9 +994,9 @@ public class RestManager {
notes = "The fact types are the classnames of the objects inserted in the drools working memory",
responseContainer = "List")
@ApiResponses(value = {@ApiResponse(code = 404, message = "The controller, session, or fact type, cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled"),
- @ApiResponse(code = 500, message = "A server error has occurred processing this request")})
+ @ApiResponse(code = 500, message = "A server error has occurred processing this request")})
public Response droolsFactsDelete(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@ApiParam(value = "Drools Session Name", required = true) @PathParam("session") String sessionName,
@@ -1025,10 +1026,10 @@ public class RestManager {
+ "for a given controller and session",
notes = "The DRL query with parameters must be defined in the DRL file", responseContainer = "List")
@ApiResponses(value = {
- @ApiResponse(code = 404, message = "The controller, session, or query information, cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 404, message = "The controller, session, or query information, cannot be found"),
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled"),
- @ApiResponse(code = 500, message = "A server error has occurred processing this request")})
+ @ApiResponse(code = 500, message = "A server error has occurred processing this request")})
public Response droolsFactsDelete(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@ApiParam(value = "Drools Session Name", required = true) @PathParam("session") String sessionName,
@@ -1142,7 +1143,7 @@ public class RestManager {
+ " memory of the controlled drools application.",
responseContainer = "List", response = ProtocolCoderToolset.class)
@ApiResponses(value = {@ApiResponse(code = 404, message = "The controller or topic cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response decoder(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@@ -1174,7 +1175,7 @@ public class RestManager {
+ "Acceptance filters are used to filter out undesired network messages for the given controller",
responseContainer = "List", response = CoderFilters.class)
@ApiResponses(value = {@ApiResponse(code = 404, message = "The controller or topic cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response decoderFilter(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@@ -1212,7 +1213,7 @@ public class RestManager {
+ "Filters are applied on a per fact type (classname).",
responseContainer = "List", response = CoderFilters.class)
@ApiResponses(value = {@ApiResponse(code = 404, message = "The controller, topic, or fact type cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response decoderFilter(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@@ -1252,10 +1253,10 @@ public class RestManager {
+ "Filters are applied on a per fact type (classname).",
responseContainer = "List", response = CoderFilters.class)
@ApiResponses(value = {
- @ApiResponse(code = 404,
+ @ApiResponse(code = 404,
message = "The controller, topic, fact type, cannot be found, "
+ "or a filter has not been provided"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response decoderFilter(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@@ -1300,7 +1301,7 @@ public class RestManager {
+ "A Policy Controller uses filters to further specify the fact mapping. "
+ "Filters are applied on a per fact type using a jsonpath expression rule. ")
@ApiResponses(value = {@ApiResponse(code = 404, message = "The controller, topic, or fact type cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response decoderFilterRules(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@@ -1346,8 +1347,8 @@ public class RestManager {
+ "A Policy Controller uses filters to further specify the fact mapping. "
+ "Filters are applied on a per fact type using a jsonpath expression rule. ")
@ApiResponses(value = {
- @ApiResponse(code = 404, message = "The controller, topic, or fact type cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 404, message = "The controller, topic, or fact type cannot be found"),
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response decoderFilterRuleDelete(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@@ -1394,7 +1395,7 @@ public class RestManager {
+ "A Policy Controller uses filters to further specify the fact mapping. "
+ "Filters are applied on a per fact type using a jsonpath expression rule. ")
@ApiResponses(value = {@ApiResponse(code = 404, message = "The controller, topic, or fact type cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response decoderFilterRule(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@@ -1447,7 +1448,7 @@ public class RestManager {
@ApiOperation(value = "Decodes a string into a fact object, and encodes it back into a string",
notes = "Tests the decode/encode functions of a controller", response = CodingResult.class)
@ApiResponses(value = {@ApiResponse(code = 400, message = "Bad input has been provided"),
- @ApiResponse(code = 404, message = "The controller cannot be found"), @ApiResponse(code = 406,
+ @ApiResponse(code = 404, message = "The controller cannot be found"), @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response decode(
@ApiParam(value = "Policy Controller Name", required = true) @PathParam("controller") String controllerName,
@@ -1831,7 +1832,7 @@ public class RestManager {
@Path("engine/topics/sources/{comm: ueb|dmaap|noop}/{topic}/switches/activation")
@ApiOperation(value = "Starts a topic", response = TopicSource.class)
@ApiResponses(value = {@ApiResponse(code = 406,
- message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
+ message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response commSourceTopicActivation(
@ApiParam(value = "Communication Mechanism", required = true) @PathParam("comm") String comm,
@ApiParam(value = "Topic Name", required = true) @PathParam("topic") String topic
@@ -1848,7 +1849,7 @@ public class RestManager {
@Path("engine/topics/sources/{comm: ueb|dmaap|noop}/{topic}/switches/activation")
@ApiOperation(value = "Stops a topic", response = TopicSource.class)
@ApiResponses(value = {@ApiResponse(code = 406,
- message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
+ message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response commSourceTopicDeactivation(
@ApiParam(value = "Communication Mechanism", required = true) @PathParam("comm") String comm,
@ApiParam(value = "Topic Name", required = true) @PathParam("topic") String topic
@@ -1865,7 +1866,7 @@ public class RestManager {
@Path("engine/topics/sinks/{comm: ueb|dmaap|noop}/{topic}/switches/lock")
@ApiOperation(value = "Locks a topic sink", response = TopicSink.class)
@ApiResponses(value = {@ApiResponse(code = 406,
- message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
+ message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response commSinkTopicLock(
@ApiParam(value = "Communication Mechanism", required = true) @PathParam("comm") String comm,
@ApiParam(value = "Topic Name", required = true) @PathParam("topic") String topic
@@ -1882,7 +1883,7 @@ public class RestManager {
@Path("engine/topics/sinks/{comm: ueb|dmaap|noop}/{topic}/switches/lock")
@ApiOperation(value = "Unlocks a topic sink", response = TopicSink.class)
@ApiResponses(value = {@ApiResponse(code = 406,
- message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
+ message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response commSinkTopicUnlock(
@ApiParam(value = "Communication Mechanism", required = true) @PathParam("comm") String comm,
@ApiParam(value = "Topic Name", required = true) @PathParam("topic") String topic
@@ -1899,7 +1900,7 @@ public class RestManager {
@Path("engine/topics/sinks/{comm: ueb|dmaap|noop}/{topic}/switches/activation")
@ApiOperation(value = "Starts a topic sink", response = TopicSink.class)
@ApiResponses(value = {@ApiResponse(code = 406,
- message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
+ message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response commSinkTopicActivation(
@ApiParam(value = "Communication Mechanism", required = true) @PathParam("comm") String comm,
@ApiParam(value = "Topic Name", required = true) @PathParam("topic") String topic
@@ -1916,7 +1917,7 @@ public class RestManager {
@Path("engine/topics/sinks/{comm: ueb|dmaap|noop}/{topic}/switches/activation")
@ApiOperation(value = "Stops a topic", response = TopicSource.class)
@ApiResponses(value = {@ApiResponse(code = 406,
- message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
+ message = "The system is an administrative state that prevents " + "this request to be fulfilled")})
public Response commSinkTopicDeactivation(
@ApiParam(value = "Communication Mechanism", required = true) @PathParam("comm") String comm,
@ApiParam(value = "Topic Name", required = true) @PathParam("topic") String topic
@@ -1949,9 +1950,9 @@ public class RestManager {
@ApiOperation(value = "Offers an event to a topic for internal processing by the engine",
notes = "The offered event is treated as it was incoming from the network", responseContainer = "List")
@ApiResponses(value = {@ApiResponse(code = 404, message = "The topic information cannot be found"),
- @ApiResponse(code = 406,
+ @ApiResponse(code = 406,
message = "The system is an administrative state that prevents " + "this request to be fulfilled"),
- @ApiResponse(code = 500, message = "A server error has occurred processing this request")})
+ @ApiResponse(code = 500, message = "A server error has occurred processing this request")})
public Response commEventOffer(
@ApiParam(value = "Communication Mechanism", required = true) @PathParam("comm") String comm,
@ApiParam(value = "Topic Name", required = true) @PathParam("topic") String topic,
@@ -2020,7 +2021,7 @@ public class RestManager {
@Produces(MediaType.TEXT_PLAIN)
@ApiOperation(value = "logging level of a logger")
@ApiResponses(value = {@ApiResponse(code = 500, message = "logging misconfiguration"),
- @ApiResponse(code = 404, message = "logger not found")})
+ @ApiResponse(code = 404, message = "logger not found")})
public Response loggerName(
@ApiParam(value = "Logger Name", required = true) @PathParam("logger") String loggerName) {
if (!(LoggerFactory.getILoggerFactory() instanceof LoggerContext)) {
@@ -2049,7 +2050,7 @@ public class RestManager {
@Consumes(MediaType.TEXT_PLAIN)
@ApiOperation(value = "sets the logger level", notes = "Please use the SLF4J logger levels")
@ApiResponses(value = {@ApiResponse(code = 500, message = "logging misconfiguration"),
- @ApiResponse(code = 404, message = "logger not found")})
+ @ApiResponse(code = 404, message = "logger not found")})
public Response loggerName(@ApiParam(value = "Logger Name", required = true) @PathParam("logger") String loggerName,
@ApiParam(value = "Logger Level", required = true) @PathParam("level") String loggerLevel) {