diff options
author | 2024-11-20 11:00:49 +0000 | |
---|---|---|
committer | 2024-11-20 11:01:55 +0000 | |
commit | 9060818e7974ca09a06b715533161876b94fde84 (patch) | |
tree | b0844b358694e6fc4ae3c4c59afcb820ffe10fd7 /cps-ncmp-rest | |
parent | d8af6808847b8fbd044077e7c4688ca869b70169 (diff) |
Update error response for ncmp endpoints
Issue-ID: CPS-2386
Change-Id: I0d1f09cff202e055be255b365fc2271a5ee43b37
Signed-off-by: seanbeirne <sean.beirne@est.tech>
Diffstat (limited to 'cps-ncmp-rest')
3 files changed, 5 insertions, 4 deletions
diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml index e564c6b0cf..637a1386f4 100644 --- a/cps-ncmp-rest/docs/openapi/components.yaml +++ b/cps-ncmp-rest/docs/openapi/components.yaml @@ -516,7 +516,7 @@ components: outputAlternateIdOptionInQuery: name: outputAlternateId in: query - description: Boolean parameter to determine if returned value(s) will be cm handle Ids or alternate Ids for a given query + description: Boolean parameter to determine if returned value(s) will be cm handle ids or alternate ids for a given query required: false schema: type: boolean diff --git a/cps-ncmp-rest/docs/openapi/ncmp.yml b/cps-ncmp-rest/docs/openapi/ncmp.yml index 4624bc1060..15b8b37231 100755 --- a/cps-ncmp-rest/docs/openapi/ncmp.yml +++ b/cps-ncmp-rest/docs/openapi/ncmp.yml @@ -417,7 +417,7 @@ getCmHandleStateById: searchCmHandleIds: post: - description: Execute cm handle query search and return a list of cm handle references. Any number of conditions can be applied. To be included in the result a cm-handle must fulfill ALL the conditions. An empty collection will be returned in the case that the cm handle does not match a condition. For more on cm handle query search please refer to <a href="https://docs.onap.org/projects/onap-cps/en/latest/ncmp-cmhandle-querying.html">cm handle query search Read the Docs</a>.<br/>By supplying a CPS Path it is possible to query on any data related to the cm handle. For more on CPS Path please refer to <a href="https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html">CPS Path Read the Docs</a>. The cm handle ancestor is automatically returned for this query. + description: Execute cm handle query search and return a list of cm handle references. Any number of conditions can be applied. To be included in the result a cm handle must fulfill ALL the conditions. An empty collection will be returned in the case that the cm handle does not match a condition. For more on cm handle query search please refer to <a href="https://docs.onap.org/projects/onap-cps/en/latest/ncmp-cmhandle-querying.html">cm handle query search Read the Docs</a>.<br/>By supplying a CPS Path it is possible to query on any data related to the cm handle. For more on CPS Path please refer to <a href="https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html">CPS Path Read the Docs</a>. The cm handle ancestor is automatically returned for this query. tags: - network-cm-proxy summary: Execute cm handle query upon a given set of query parameters diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandler.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandler.java index 6910003c54..7255743c67 100644 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandler.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandler.java @@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j; import org.onap.cps.ncmp.api.data.exceptions.InvalidDatastoreException; import org.onap.cps.ncmp.api.data.exceptions.InvalidOperationException; import org.onap.cps.ncmp.api.data.exceptions.OperationNotSupportedException; +import org.onap.cps.ncmp.api.exceptions.CmHandleNotFoundException; import org.onap.cps.ncmp.api.exceptions.DmiClientRequestException; import org.onap.cps.ncmp.api.exceptions.DmiRequestException; import org.onap.cps.ncmp.api.exceptions.InvalidTopicException; @@ -90,8 +91,8 @@ public class NetworkCmProxyRestExceptionHandler { return buildErrorResponse(HttpStatus.CONFLICT, exception); } - @ExceptionHandler({DataNodeNotFoundException.class}) - public static ResponseEntity<Object> handleNotFoundExceptions(final Exception exception) { + @ExceptionHandler({CmHandleNotFoundException.class, DataNodeNotFoundException.class}) + public static ResponseEntity<Object> cmHandleNotFoundExceptions(final Exception exception) { return buildErrorResponse(HttpStatus.NOT_FOUND, exception); } |