2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 ONAP Intellectual Property. All rights
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.
19 * ============LICENSE_END=========================================================
22 package org.onap.ccsdk.sli.adaptors.aai;
24 import java.io.IOException;
26 import java.util.HashMap;
29 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
30 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
31 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
32 import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
33 import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
34 import org.openecomp.aai.inventory.v10.AvailabilityZone;
35 import org.openecomp.aai.inventory.v10.Complex;
36 import org.openecomp.aai.inventory.v10.CtagPool;
37 import org.openecomp.aai.inventory.v10.DvsSwitch;
38 import org.openecomp.aai.inventory.v10.GenericVnf;
39 import org.openecomp.aai.inventory.v10.L3Network;
40 import org.openecomp.aai.inventory.v10.OamNetwork;
41 import org.openecomp.aai.inventory.v10.PInterface;
42 import org.openecomp.aai.inventory.v10.PhysicalLink;
43 import org.openecomp.aai.inventory.v10.Pserver;
44 import org.openecomp.aai.inventory.v10.SearchResults;
45 import org.openecomp.aai.inventory.v10.Service;
46 import org.openecomp.aai.inventory.v10.ServiceInstance;
47 import org.openecomp.aai.inventory.v10.SitePairSet;
48 import org.openecomp.aai.inventory.v10.Tenant;
49 import org.openecomp.aai.inventory.v10.Vce;
50 import org.openecomp.aai.inventory.v10.VnfImage;
51 import org.openecomp.aai.inventory.v10.Vpe;
52 import org.openecomp.aai.inventory.v10.VplsPe;
53 import org.openecomp.aai.inventory.v10.VpnBinding;
54 import org.openecomp.aai.inventory.v10.Vserver;
55 import org.onap.ccsdk.sli.adaptors.aai.data.notify.NotifyEvent;
56 import org.onap.ccsdk.sli.adaptors.aai.data.v1507.VServer;
58 import com.fasterxml.jackson.core.JsonParseException;
59 import com.fasterxml.jackson.databind.JsonMappingException;
61 public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin {
64 public boolean postNetworkVceData(String vnf_id, Vce request) throws AAIServiceException;
65 public Vce requestNetworkVceData(String vnf_id) throws AAIServiceException;
66 public boolean deleteNetworkVceData(String vnf_id, String resourceVersion) throws AAIServiceException;
69 public ServiceInstance requestServiceInterfaceData(String customer_id, String service_type, String svc_instance_id) throws AAIServiceException;
70 public boolean postServiceInterfaceData(String customer_id, String service_type, String svc_instance_id, ServiceInstance request) throws AAIServiceException;
71 public SearchResults requestServiceInstanceURL(String svc_instance_id) throws AAIServiceException;
74 // public Vpes requestNetworkVpeList() throws AAIServiceException;
75 public Vpe requestNetworkVpeData(String vnf_id) throws AAIServiceException;
76 public boolean postNetworkVpeData(String vnf_id, Vpe request) throws AAIServiceException;
77 public boolean deleteNetworkVpeData(String vnf_id, String resourceVersion) throws AAIServiceException;
80 public Vserver requestVServerData(String tenant_id, String vserver_id, String cloudOwner, String cloudRegionId) throws AAIServiceException;
81 public boolean postVServerData(String tenantId, String vserverId, String cloudOwner, String cloudRegionId, Vserver request) throws AAIServiceException;
82 public boolean deleteVServerData(String tenant_id, String vserver_id, String cloudOwner, String cloudRegionId, String resourceVersion) throws AAIServiceException;
84 public URL requestVserverURLNodeQuery(String vserver_name) throws AAIServiceException;
85 public String getTenantIdFromVserverUrl(URL url);
86 public String getCloudOwnerFromVserverUrl(URL url);
87 public String getCloudRegionFromVserverUrl(URL url);
88 public String getVServerIdFromVserverUrl(URL url, String tennantId);
89 public Vserver requestVServerDataByURL(URL url) throws AAIServiceException;
92 public VplsPe requestNetworkVplsPeData(String equipment_name) throws AAIServiceException;
93 public boolean postNetworkVplsPeData(String vnf_id, VplsPe request) throws AAIServiceException;
94 public boolean deleteNetworkVplsPeData(String vnf_id, String resourceVersion) throws AAIServiceException;
98 public Complex requestNetworkComplexData(String vnf_id) throws AAIServiceException;
99 public boolean postNetworkComplexData(String vnf_id, Complex request) throws AAIServiceException;
100 public boolean deleteNetworkComplexData(String vnf_id, String resourceVersion) throws AAIServiceException;
103 public CtagPool requestCtagPoolData(String physical_location_id, String target_pe, String availability_zone_name) throws AAIServiceException;
105 // --------------------------------- 1507 ---------------------------
107 public VServer dataChangeRequestVServerData(URL url) throws AAIServiceException;
109 public CtagPool dataChangeRequestCtagPoolData(URL url) throws AAIServiceException;
111 public VplsPe dataChangeRequestVplsPeData(URL url) throws AAIServiceException;
113 public Vpe dataChangeRequestVpeData(URL url) throws AAIServiceException;
115 public DvsSwitch dataChangeRequestDvsSwitchData(URL url) throws AAIServiceException;
117 public Pserver dataChangeRequestPServerData(URL url) throws AAIServiceException;
120 public OamNetwork dataChangeRequestOAMNetworkData(URL url) throws AAIServiceException;
122 public AvailabilityZone dataChangeRequestAvailabilityZoneData(URL url) throws AAIServiceException;
124 public Complex dataChangeRequestComplexData(URL url) throws AAIServiceException;
128 public boolean dataChangeDeleteVServerData(URL url) throws AAIServiceException;
130 public boolean dataChangeDeleteCtagPoolData(URL url) throws AAIServiceException;
132 public boolean dataChangeDeleteVplsPeData(URL url) throws AAIServiceException;
134 public boolean dataChangeDeleteVpeData(URL url) throws AAIServiceException;
136 public boolean dataChangeDeleteDvsSwitchData(URL url) throws AAIServiceException;
138 public boolean dataChangeDeleteOAMNetworkData(URL url) throws AAIServiceException;
140 public boolean dataChangeDeleteAvailabilityZoneData(URL url) throws AAIServiceException;
142 public boolean dataChangeDeleteComplexData(URL url) throws AAIServiceException;
144 // ----------------- Release 1510 ----------------------
146 public GenericVnf requestGenericVnfData(String vnf_id) throws AAIServiceException;
147 public boolean postGenericVnfData(String vnf_id, GenericVnf request) throws AAIServiceException;
148 public boolean deleteGenericVnfData(String vnf_id, String resourceVersion) throws AAIServiceException;
151 public DvsSwitch requestDvsSwitchData(String vnf_id) throws AAIServiceException;
152 public boolean postDvsSwitchData(String vnf_id, DvsSwitch request) throws AAIServiceException;
153 public boolean deleteDvsSwitchData(String vnf_id, String resourceVersion) throws AAIServiceException;
156 public PInterface requestPInterfaceData(String hostname, String interfaceName) throws AAIServiceException;
157 public boolean postPInterfaceData(String hostname, String interfaceName, PInterface request) throws AAIServiceException;
158 public boolean deletePInterfaceData(String hostname, String interfaceName, String resourceVersion) throws AAIServiceException;
161 public PhysicalLink requestPhysicalLinkData(String vnf_id) throws AAIServiceException;
162 public boolean postPhysicalLinkData(String vnf_id, PhysicalLink request) throws AAIServiceException;
163 public boolean deletePhysicalLinkData(String vnf_id, String resourceVersion) throws AAIServiceException;
166 public Pserver requestPServerData(String hostname) throws AAIServiceException;
167 public boolean postPServerData(String hostname, Pserver server) throws AAIServiceException;
168 public boolean deletePServerData(String hostname, String resourceVersion) throws AAIServiceException;
171 public L3Network requestL3NetworkData(String networkId) throws AAIServiceException;
172 public L3Network requestL3NetworkQueryByName(String networkId) throws AAIServiceException;
173 public boolean postL3NetworkData(String networkId, L3Network request) throws AAIServiceException;
174 public boolean deleteL3NetworkData(String networkId, String resourceVersion) throws AAIServiceException;
177 public VpnBinding requestVpnBindingData(String vpnId) throws AAIServiceException;
178 // public boolean postVpnBindingData(String vpnId, VpnBinding request) throws AAIServiceException;
179 public boolean deleteVpnBindingData(String vpnId, String resourceVersion) throws AAIServiceException;
182 public VnfImage requestVnfImageData(String vpnId) throws AAIServiceException;
183 public VnfImage requestVnfImageDataByVendorModel(String vendor, String model) throws AAIServiceException;
184 public VnfImage requestVnfImageDataByVendorModelVersion(String vendor, String model, String version) throws AAIServiceException;
187 public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException;
191 public SitePairSet requestSitePairSetData(String sitePairSetId) throws AAIServiceException;
192 public boolean postSitePairSetData(String sitePairSetId, SitePairSet request) throws AAIServiceException;
193 public boolean deleteSitePairSetData(String sitePairSetId, String resourceVersion) throws AAIServiceException;
196 public Service requestServiceData(String serviceId) throws AAIServiceException;
197 public boolean postServiceData(String serviceId, Service request) throws AAIServiceException;
198 public boolean deleteServiceData(String serviceId, String resourceVersion) throws AAIServiceException;
201 public SearchResults requestNodeQuery(String type, String entityIdentifier, String entityName) throws AAIServiceException;
202 public String requestDataByURL(URL url) throws AAIServiceException;
203 // public Object requestDataInstanceNodeQuery(String type, String vnf_name) throws AAIServiceException;
204 public GenericVnf requestGenericVnfeNodeQuery(String vnf_name) throws AAIServiceException;
207 public Tenant requestTenantData(String tenant_id, String cloudOwner, String cloudRegionId) throws AAIServiceException;
208 public Tenant requestTenantDataByName(String tenant_name, String cloudOwner, String cloudRegionId) throws AAIServiceException;
209 public boolean postTenantData(String tenant_id, String cloudOwner, String cloudRegionId, Tenant request) throws AAIServiceException;
210 // public boolean deleteGenericVnfData(String vnf_id, String resourceVersion) throws AAIServiceException;
213 public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
214 public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
216 public void logKeyError(String keys);
218 public QueryStatus processResponseData(String rv, String resource, AAIRequest request, String prefix, SvcLogicContext ctx, HashMap<String, String> nameValues, String modifier) throws JsonParseException, JsonMappingException, IOException, AAIServiceException ;