Get cm-handle public properties endpoint
[cps.git] / cps-ncmp-service / src / main / java / org / onap / cps / ncmp / api / NetworkCmProxyDataService.java
1 /*
2  *  ============LICENSE_START=======================================================
3  *  Copyright (C) 2021 highstreet technologies GmbH
4  *  Modifications Copyright (C) 2021-2022 Nordix Foundation
5  *  Modifications Copyright (C) 2021 Pantheon.tech
6  *  Modifications Copyright (C) 2022 Bell Canada
7  *  ================================================================================
8  *  Licensed under the Apache License, Version 2.0 (the "License");
9  *  you may not use this file except in compliance with the License.
10  *  You may obtain a copy of the License at
11  *
12  *        http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *  Unless required by applicable law or agreed to in writing, software
15  *  distributed under the License is distributed on an "AS IS" BASIS,
16  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  *  See the License for the specific language governing permissions and
18  *  limitations under the License.
19  *
20  *  SPDX-License-Identifier: Apache-2.0
21  *  ============LICENSE_END=========================================================
22  */
23
24 package org.onap.cps.ncmp.api;
25
26 import static org.onap.cps.ncmp.api.impl.operations.DmiRequestBody.OperationEnum;
27
28 import java.util.Collection;
29 import java.util.Map;
30 import java.util.Set;
31 import org.onap.cps.ncmp.api.models.CmHandleQueryApiParameters;
32 import org.onap.cps.ncmp.api.models.DmiPluginRegistration;
33 import org.onap.cps.ncmp.api.models.DmiPluginRegistrationResponse;
34 import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
35 import org.onap.cps.spi.model.ModuleReference;
36
37 /*
38  * Datastore interface for handling CPS data.
39  */
40 public interface NetworkCmProxyDataService {
41
42     /**
43      * Registration of New CM Handles.
44      *
45      * @param dmiPluginRegistration Dmi Plugin Registration
46      * @return dmiPluginRegistrationResponse
47      */
48     DmiPluginRegistrationResponse updateDmiRegistrationAndSyncModule(DmiPluginRegistration dmiPluginRegistration);
49
50     /**
51      * Get resource data for data store pass-through operational
52      * using dmi.
53      *
54      * @param cmHandleId cm handle identifier
55      * @param resourceIdentifier resource identifier
56      * @param optionsParamInQuery options query
57      * @param topicParamInQuery topic name for (triggering) async responses
58      * @param requestId unique requestId for async request
59      * @return {@code Object} resource data
60      */
61     Object getResourceDataOperationalForCmHandle(String cmHandleId,
62                                                  String resourceIdentifier,
63                                                  String optionsParamInQuery,
64                                                  String topicParamInQuery,
65                                                  String requestId);
66
67     /**
68      * Get resource data for data store pass-through running
69      * using dmi.
70      *
71      * @param cmHandleId cm handle identifier
72      * @param resourceIdentifier resource identifier
73      * @param optionsParamInQuery options query
74      * @param topicParamInQuery topic name for (triggering) async responses
75      * @param requestId unique requestId for async request
76      * @return {@code Object} resource data
77      */
78     Object getResourceDataPassThroughRunningForCmHandle(String cmHandleId,
79                                                         String resourceIdentifier,
80                                                         String optionsParamInQuery,
81                                                         String topicParamInQuery,
82                                                         String requestId);
83
84     /**
85      * Write resource data for data store pass-through running
86      * using dmi for given cm-handle.
87      *  @param cmHandleId cm handle identifier
88      * @param resourceIdentifier resource identifier
89      * @param operation required operation
90      * @param requestBody request body to create resource
91      * @param contentType content type in body
92      * @return {@code Object} return data
93      */
94     Object writeResourceDataPassThroughRunningForCmHandle(String cmHandleId,
95                                                         String resourceIdentifier,
96                                                         OperationEnum operation,
97                                                         String requestBody,
98                                                         String contentType);
99
100     /**
101      * Retrieve module references for the given cm handle.
102      *
103      * @param cmHandleId cm handle identifier
104      * @return a collection of modules names and revisions
105      */
106     Collection<ModuleReference> getYangResourcesModuleReferences(String cmHandleId);
107
108     /**
109      * Query cm handle identifiers for the given collection of module names.
110      *
111      * @param moduleNames module names.
112      * @return a collection of cm handle identifiers. The schema set for each cm handle must include all the
113      *         given module names
114      */
115     Collection<String> executeCmHandleHasAllModulesSearch(Collection<String> moduleNames);
116
117     /**
118      * Query cm handle details by cm handle's name.
119      *
120      * @param cmHandleId cm handle identifier
121      * @return a collection of cm handle details.
122      */
123     NcmpServiceCmHandle getNcmpServiceCmHandle(String cmHandleId);
124
125     /**
126      * Get cm handle public properties by cm handle id.
127      *
128      * @param cmHandleId cm handle identifier
129      * @return a collection of cm handle public properties.
130      */
131     Map<String, String> getCmHandlePublicProperties(String cmHandleId);
132
133     /**
134      * Query and return cm handles that match the given query parameters.
135      *
136      * @param cmHandleQueryApiParameters the cm handle query parameters
137      * @return collection of cm handle ids
138      */
139     Set<String> queryCmHandles(CmHandleQueryApiParameters cmHandleQueryApiParameters);
140 }