diff options
author | DylanB95EST <dylan.byrne@est.tech> | 2021-11-09 13:54:35 +0000 |
---|---|---|
committer | DylanB95EST <dylan.byrne@est.tech> | 2021-11-12 15:24:27 +0000 |
commit | 5fe0daebb1360bd5d4c525125cdb0d6250583ff4 (patch) | |
tree | 3c0e08b48627b9c7c4c20c0291c6290673f061fb /src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java | |
parent | 306cadd63b69274afbb3073d35a15381a12d6389 (diff) |
Support Update and Delete operations for DS Passtrough-Running in DMI Plugin
-Add Update operation for Passthrough Running
-Use POST operatiosn for all methods as agrred
-refactor to simplify and beter reuse of common methods
-add delete operation for passthrough running
Issue-ID: CPS-637
Issue-ID: CPS-638
Change-Id: I441181f977dee2bc0be944662465d868595ea452
Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Diffstat (limited to 'src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java')
-rw-r--r-- | src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java index c6910399..0f3fcc0c 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiService.java @@ -21,18 +21,23 @@ package org.onap.cps.ncmp.dmi.service; import java.util.List; -import java.util.Map; import javax.validation.constraints.NotNull; import org.onap.cps.ncmp.dmi.exception.DmiException; +import org.onap.cps.ncmp.dmi.model.DataAccessRequest; import org.onap.cps.ncmp.dmi.model.ModuleSet; import org.onap.cps.ncmp.dmi.model.YangResources; import org.onap.cps.ncmp.dmi.service.model.ModuleReference; + + /** * Interface for handling Dmi plugin Data. */ public interface DmiService { + String RESTCONF_CONTENT_PASSTHROUGH_OPERATIONAL_QUERY_PARAM = "content=all"; + String RESTCONF_CONTENT_PASSTHROUGH_RUNNING_QUERY_PARAM = "content=config"; + /** * This method fetches all modules for given Cm Handle. * @@ -60,41 +65,24 @@ public interface DmiService { YangResources getModuleResources(String cmHandle, List<ModuleReference> modules); /** - * This method use to fetch the resource data from cm handle for datastore pass-through operational and resource - * Identifier. Options query parameter are used to filter the response from network resource. - * - * @param cmHandle cm handle identifier - * @param resourceIdentifier resource identifier - * @param acceptParamInHeader accept header parameter - * @param optionsParamInQuery options query parameter - * @param cmHandlePropertyMap cm handle properties - * @return {@code Object} response from network function - */ - Object getResourceDataOperationalForCmHandle(@NotNull String cmHandle, - @NotNull String resourceIdentifier, - String acceptParamInHeader, - String optionsParamInQuery, - Map<String, String> cmHandlePropertyMap); - - /** - * This method use to fetch the resource data from cm handle for datastore pass-through running and resource + * This method use to fetch the resource data from cm handle for the given datastore and resource * Identifier. Options query parameter are used to filter the response from network resource. * - * @param cmHandle cm handle identifier - * @param resourceIdentifier resource identifier - * @param acceptParamInHeader accept header parameter - * @param optionsParamInQuery options query parameter - * @param cmHandlePropertyMap cm handle properties + * @param cmHandle cm handle identifier + * @param resourceIdentifier resource identifier + * @param acceptParamInHeader accept header parameter + * @param optionsParamInQuery options query parameter + * @param restconfContentQueryParam restconf content i.e. datastore to use * @return {@code Object} response from network function */ - Object getResourceDataPassThroughRunningForCmHandle(@NotNull String cmHandle, + String getResourceData(@NotNull String cmHandle, @NotNull String resourceIdentifier, String acceptParamInHeader, String optionsParamInQuery, - Map<String, String> cmHandlePropertyMap); + String restconfContentQueryParam); /** - * Write resource data to sdnc using passthrough running. + * Write resource data to sdnc (will default to 'content=config', does not need to be specified). * * @param cmHandle cmHandle * @param resourceIdentifier resource identifier @@ -102,6 +90,7 @@ public interface DmiService { * @param data request data * @return response from sdnc */ - String writeResourceDataPassthroughForCmHandle(String cmHandle, String resourceIdentifier, String dataType, - String data); + String writeData(DataAccessRequest.OperationEnum operation, String cmHandle, + String resourceIdentifier, String dataType, + String data); } |