2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2021 highstreet technologies GmbH
4 * Modifications Copyright (C) 2021-2024 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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 * SPDX-License-Identifier: Apache-2.0
21 * ============LICENSE_END=========================================================
24 package org.onap.cps.ncmp.api;
26 import java.util.Collection;
28 import org.onap.cps.ncmp.api.impl.inventory.CompositeState;
29 import org.onap.cps.ncmp.api.impl.operations.OperationType;
30 import org.onap.cps.ncmp.api.models.CmHandleQueryApiParameters;
31 import org.onap.cps.ncmp.api.models.CmHandleQueryServiceParameters;
32 import org.onap.cps.ncmp.api.models.CmResourceAddress;
33 import org.onap.cps.ncmp.api.models.DataOperationRequest;
34 import org.onap.cps.ncmp.api.models.DmiPluginRegistration;
35 import org.onap.cps.ncmp.api.models.DmiPluginRegistrationResponse;
36 import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
37 import org.onap.cps.spi.FetchDescendantsOption;
38 import org.onap.cps.spi.model.ModuleDefinition;
39 import org.onap.cps.spi.model.ModuleReference;
42 * Datastore interface for handling CPS data.
44 public interface NetworkCmProxyDataService {
47 * Registration of New CM Handles.
49 * @param dmiPluginRegistration Dmi Plugin Registration
50 * @return dmiPluginRegistrationResponse
52 DmiPluginRegistrationResponse updateDmiRegistrationAndSyncModule(DmiPluginRegistration dmiPluginRegistration);
55 * Get resource data for given data store using dmi.
57 * @param cmResourceAddress target datastore, cm handle and resource identifier
58 * @param optionsParamInQuery options query
59 * @param topicParamInQuery topic name for (triggering) async responses
60 * @param requestId unique requestId for async request
61 * @param authorization contents of Authorization header, or null if not present
62 * @return {@code Object} resource data
64 Object getResourceDataForCmHandle(CmResourceAddress cmResourceAddress,
65 String optionsParamInQuery,
66 String topicParamInQuery,
68 String authorization);
71 * Get resource data for operational.
73 * @param cmResourceAddress target datastore, cm handle and resource identifier
74 * @Link FetchDescendantsOption fetch descendants option
75 * @return {@code Object} resource data
77 Object getResourceDataForCmHandle(CmResourceAddress cmResourceAddress,
78 FetchDescendantsOption fetchDescendantsOption);
81 * Execute (async) data operation for group of cm handles using dmi.
83 * @param topicParamInQuery topic name for (triggering) async responses
84 * @param dataOperationRequest contains a list of operation definitions(multiple operations)
85 * @param requestId request ID
86 * @param authorization contents of Authorization header, or null if not present
88 void executeDataOperationForCmHandles(String topicParamInQuery,
89 DataOperationRequest dataOperationRequest,
91 String authorization);
95 * Write resource data for data store pass-through running using dmi for given cm-handle.
97 * @param cmHandleId cm handle identifier
98 * @param resourceIdentifier resource identifier
99 * @param operationType required operation type
100 * @param requestBody request body to create resource
101 * @param contentType content type in body
102 * @param authorization contents of Authorization header, or null if not present
103 * @return {@code Object} return data
105 Object writeResourceDataPassThroughRunningForCmHandle(String cmHandleId,
106 String resourceIdentifier,
107 OperationType operationType,
110 String authorization);
113 * Retrieve module references for the given cm handle.
115 * @param cmHandleId cm handle identifier
116 * @return a collection of modules names and revisions
118 Collection<ModuleReference> getYangResourcesModuleReferences(String cmHandleId);
121 * Retrieve module definitions for the given cm handle.
123 * @param cmHandleId cm handle identifier
124 * @return a collection of module definition (moduleName, revision and yang resource content)
126 Collection<ModuleDefinition> getModuleDefinitionsByCmHandleId(String cmHandleId);
129 * Get module definitions for the given parameters.
131 * @param cmHandleId cm-handle identifier
132 * @param moduleName module name
133 * @param moduleRevision the revision of the module
134 * @return list of module definitions (module name, revision, yang resource content)
136 Collection<ModuleDefinition> getModuleDefinitionsByCmHandleAndModule(String cmHandleId,
138 String moduleRevision);
141 * Query cm handle details by cm handle's name.
143 * @param cmHandleId cm handle identifier
144 * @return a collection of cm handle details.
146 NcmpServiceCmHandle getNcmpServiceCmHandle(String cmHandleId);
149 * Get cm handle public properties by cm handle id.
151 * @param cmHandleId cm handle identifier
152 * @return a collection of cm handle public properties.
154 Map<String, String> getCmHandlePublicProperties(String cmHandleId);
157 * Get cm handle composite state by cm handle id.
159 * @param cmHandleId cm handle identifier
160 * @return a cm handle composite state
162 CompositeState getCmHandleCompositeState(String cmHandleId);
165 * Query and return cm handles that match the given query parameters.
167 * @param cmHandleQueryApiParameters the cm handle query parameters
168 * @return collection of cm handles
170 Collection<NcmpServiceCmHandle> executeCmHandleSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
173 * Query and return cm handle ids that match the given query parameters.
175 * @param cmHandleQueryApiParameters the cm handle query parameters
176 * @return collection of cm handle ids
178 Collection<String> executeCmHandleIdSearch(CmHandleQueryApiParameters cmHandleQueryApiParameters);
181 * Set the data sync enabled flag, along with the data sync state to true or false based on the cm handle id.
183 * @param cmHandleId cm handle id
184 * @param dataSyncEnabled data sync enabled flag
186 void setDataSyncEnabled(String cmHandleId, Boolean dataSyncEnabled);
189 * Get all cm handle IDs by DMI plugin identifier.
191 * @param dmiPluginIdentifier DMI plugin identifier
192 * @return collection of cm handle IDs
194 Collection<String> getAllCmHandleIdsByDmiPluginIdentifier(String dmiPluginIdentifier);
197 * Get all cm handle IDs by various search criteria.
199 * @param cmHandleQueryServiceParameters cm handle query parameters
200 * @return collection of cm handle IDs
202 Collection<String> executeCmHandleIdSearchForInventory(CmHandleQueryServiceParameters
203 cmHandleQueryServiceParameters);