summaryrefslogtreecommitdiffstats
path: root/a1-policy-management/src/main
diff options
context:
space:
mode:
authorPatrikBuhr <patrik.buhr@est.tech>2020-11-04 13:48:27 +0100
committerPatrikBuhr <patrik.buhr@est.tech>2020-11-04 13:49:52 +0100
commit4dec4dc6aa0b526bb21aedee4b1120d795300978 (patch)
treee9e45e9e3b147423e7a8375d469b4e4c5cc71cef /a1-policy-management/src/main
parentbad7324bcc4900dfe3a31b4856da67aa3b6f6eeb (diff)
Bugfix path elements containing dot
Springboot trunkates last URL path element if it contains a dot '.'. This is a workaround. Change-Id: I1ae4139468a2669bfd6e33ae9eff88b2fc2a2004 Issue-ID: CCSDK-2502 Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Diffstat (limited to 'a1-policy-management/src/main')
-rw-r--r--a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java10
-rw-r--r--a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java4
2 files changed, 7 insertions, 7 deletions
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java
index 256b4782..8dd2df61 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java
@@ -97,13 +97,13 @@ public class PolicyController {
private static Gson gson = new GsonBuilder() //
.create(); //
- @GetMapping(path = Consts.V2_API_ROOT + "/policy-types/{policyTypeId}", produces = MediaType.APPLICATION_JSON_VALUE)
+ @GetMapping(path = "/v2/policy-types/{policytype_id:.+}", produces = MediaType.APPLICATION_JSON_VALUE)
@ApiOperation(value = "Returns a policy type definition")
@ApiResponses(value = { //
@ApiResponse(code = 200, message = "Policy type", response = PolicyTypeInfo.class), //
- @ApiResponse(code = 404, message = "Near-RT RIC is not found", response = ErrorResponse.ErrorInfo.class)})
+ @ApiResponse(code = 404, message = "Policy type is not found", response = ErrorResponse.ErrorInfo.class)})
public ResponseEntity<Object> getPolicyType( //
- @PathVariable("policyTypeId") String policyTypeId) {
+ @PathVariable("policytype_id") String policyTypeId) {
try {
PolicyType type = policyTypes.getType(policyTypeId);
PolicyTypeInfo info = new PolicyTypeInfo(type.schema());
@@ -134,7 +134,7 @@ public class PolicyController {
}
}
- @GetMapping(path = Consts.V2_API_ROOT + "/policies/{policy_id}", produces = MediaType.APPLICATION_JSON_VALUE)
+ @GetMapping(path = Consts.V2_API_ROOT + "/policies/{policy_id:.+}", produces = MediaType.APPLICATION_JSON_VALUE)
@ApiOperation(value = "Returns a policy") //
@ApiResponses(value = { //
@ApiResponse(code = 200, message = "Policy found", response = PolicyInfo.class), //
@@ -150,7 +150,7 @@ public class PolicyController {
}
}
- @DeleteMapping(Consts.V2_API_ROOT + "/policies/{policy_id}")
+ @DeleteMapping(Consts.V2_API_ROOT + "/policies/{policy_id:.+}")
@ApiOperation(value = "Delete a policy")
@ApiResponses(value = { //
@ApiResponse(code = 200, message = "Not used", response = VoidResponse.class),
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java
index b2fa029a..a8fc7e6d 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java
@@ -143,9 +143,9 @@ public class ServiceController {
@ApiResponse(code = 204, message = "Service unregistered"),
@ApiResponse(code = 200, message = "Not used", response = VoidResponse.class),
@ApiResponse(code = 404, message = "Service not found", response = ErrorResponse.ErrorInfo.class)})
- @DeleteMapping(Consts.V2_API_ROOT + "/services/{serviceId}")
+ @DeleteMapping(Consts.V2_API_ROOT + "/services/{service_id:.+}")
public ResponseEntity<Object> deleteService(//
- @PathVariable("serviceId") String serviceId) {
+ @PathVariable("service_id") String serviceId) {
try {
Service service = removeService(serviceId);
// Remove the policies from the repo and let the consistency monitoring