Convert tabs to spaces
[ccsdk/sli/adaptors.git] / aai-service / provider / src / main / java / org / openecomp / sdnc / sli / aai / AAIClient.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * openECOMP : SDN-C
4  * ================================================================================
5  * Copyright (C) 2017 ONAP Intellectual Property. All rights
6  *                                              reserved.
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  * ============LICENSE_END=========================================================
20  */
21
22 package org.openecomp.sdnc.sli.aai;
23
24 import java.io.IOException;
25 import java.net.URL;
26 import java.util.HashMap;
27 import java.util.Map;
28
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.openecomp.sdnc.sli.aai.data.notify.NotifyEvent;
56 import org.openecomp.sdnc.sli.aai.data.v1507.VServer;
57
58 import com.fasterxml.jackson.core.JsonParseException;
59 import com.fasterxml.jackson.databind.JsonMappingException;
60
61 public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin {
62
63         // VCE
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;
67
68         // Service Inteface
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;
72
73         // VPE
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;
78
79         // VServers
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;
83
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;
90
91         // VPLS-PE
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;
95
96
97     // Complexes
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;
101
102         // CTag Pool
103         public CtagPool requestCtagPoolData(String physical_location_id, String target_pe, String availability_zone_name) throws AAIServiceException;
104
105     // --------------------------------- 1507 ---------------------------
106         // Data Change
107         public VServer  dataChangeRequestVServerData(URL url) throws AAIServiceException;
108
109         public CtagPool dataChangeRequestCtagPoolData(URL url) throws AAIServiceException;
110
111         public VplsPe   dataChangeRequestVplsPeData(URL url) throws AAIServiceException;
112
113         public Vpe      dataChangeRequestVpeData(URL url) throws AAIServiceException;
114
115         public DvsSwitch dataChangeRequestDvsSwitchData(URL url) throws AAIServiceException;
116
117         public Pserver  dataChangeRequestPServerData(URL url) throws AAIServiceException;
118
119         //OAM-Network:
120         public OamNetwork  dataChangeRequestOAMNetworkData(URL url) throws AAIServiceException;
121         //Availability-Zone:
122         public AvailabilityZone  dataChangeRequestAvailabilityZoneData(URL url) throws AAIServiceException;
123         //Complex:
124         public Complex  dataChangeRequestComplexData(URL url) throws AAIServiceException;
125
126
127         /* DELETE */
128         public boolean dataChangeDeleteVServerData(URL url) throws AAIServiceException;
129
130         public boolean dataChangeDeleteCtagPoolData(URL url) throws AAIServiceException;
131
132         public boolean dataChangeDeleteVplsPeData(URL url) throws AAIServiceException;
133
134         public boolean dataChangeDeleteVpeData(URL url) throws AAIServiceException;
135
136         public boolean dataChangeDeleteDvsSwitchData(URL url) throws AAIServiceException;
137         //OAM-Network:
138         public boolean dataChangeDeleteOAMNetworkData(URL url) throws AAIServiceException;
139         //Availability-Zone:
140         public boolean dataChangeDeleteAvailabilityZoneData(URL url) throws AAIServiceException;
141         //Complex:
142         public boolean dataChangeDeleteComplexData(URL url) throws AAIServiceException;
143
144         // ----------------- Release 1510 ----------------------
145         //      // GenericVNF
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;
149
150         //      DvsSwitch
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;
154
155         //      PInterface
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;
159
160         // Physical Link
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;
164
165         // PServers
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;
169
170         // L3Networks
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;
175
176         // Vpn Bindings
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;
180
181         //VnfImage
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;
185
186         // UBB Notify
187         public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException;
188
189         // 1512
190         // Site Pair Site
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;
194
195         // Services
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;
199
200         // Node Query - 1602
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;
205
206         //      // tenant
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;
211
212
213         public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
214         public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
215
216         public void logKeyError(String keys);
217
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 ;
219
220 }