604b236e69733d5adc16589fe879062f2dd3701b
[ccsdk/sli/adaptors.git] / aai-service / provider / src / main / java / org / onap / ccsdk / sli / adaptors / aai / AAIClient.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * openECOMP : SDN-C
4  * ================================================================================
5  * Copyright (C) 2017 AT&T 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.onap.ccsdk.sli.adaptors.aai;
23
24 import java.io.IOException;
25 import java.net.MalformedURLException;
26 import java.net.URL;
27 import java.util.HashMap;
28 import java.util.Map;
29
30 import org.openecomp.aai.inventory.v11.*;
31 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
32 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
33 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
34 import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
35 import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
36 import org.onap.ccsdk.sli.adaptors.aai.data.notify.NotifyEvent;
37 import org.onap.ccsdk.sli.adaptors.aai.data.v1507.VServer;
38
39 import com.fasterxml.jackson.core.JsonParseException;
40 import com.fasterxml.jackson.databind.JsonMappingException;
41
42 public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin {
43
44         // VCE
45         public boolean postNetworkVceData(String vnf_id, Vce request) throws AAIServiceException;
46         public Vce requestNetworkVceData(String vnf_id) throws AAIServiceException;
47         public boolean deleteNetworkVceData(String vnf_id, String resourceVersion) throws AAIServiceException;
48
49         // Service Inteface
50         public ServiceInstance requestServiceInterfaceData(String customer_id, String service_type, String svc_instance_id) throws AAIServiceException;
51         public boolean postServiceInterfaceData(String customer_id, String service_type, String svc_instance_id, ServiceInstance request)       throws AAIServiceException;
52         public SearchResults requestServiceInstanceURL(String svc_instance_id) throws AAIServiceException;
53
54         // VPE
55 //      public Vpes requestNetworkVpeList() throws AAIServiceException;
56         public Vpe requestNetworkVpeData(String vnf_id) throws AAIServiceException;
57         public boolean postNetworkVpeData(String vnf_id, Vpe request) throws AAIServiceException;
58         public boolean deleteNetworkVpeData(String vnf_id, String resourceVersion) throws AAIServiceException;
59
60         // VServers
61         public Vserver requestVServerData(String tenant_id, String vserver_id, String cloudOwner, String cloudRegionId) throws AAIServiceException;
62         public boolean postVServerData(String tenantId, String vserverId, String cloudOwner, String cloudRegionId, Vserver request) throws AAIServiceException;
63         public boolean deleteVServerData(String tenant_id, String vserver_id, String cloudOwner, String cloudRegionId, String resourceVersion) throws AAIServiceException;
64
65         public URL requestVserverURLNodeQuery(String vserver_name) throws AAIServiceException;
66         public String getTenantIdFromVserverUrl(URL url);
67         public String getCloudOwnerFromVserverUrl(URL url);
68         public String getCloudRegionFromVserverUrl(URL url);
69         public String getVServerIdFromVserverUrl(URL url, String tennantId);
70         public Vserver requestVServerDataByURL(URL url) throws AAIServiceException;
71
72         // VPLS-PE
73         public VplsPe requestNetworkVplsPeData(String equipment_name) throws AAIServiceException;
74         public boolean postNetworkVplsPeData(String vnf_id, VplsPe request) throws AAIServiceException;
75         public boolean deleteNetworkVplsPeData(String vnf_id, String resourceVersion) throws AAIServiceException;
76
77
78     // Complexes
79         public Complex   requestNetworkComplexData(String vnf_id) throws AAIServiceException;
80         public boolean postNetworkComplexData(String vnf_id, Complex request) throws AAIServiceException;
81         public boolean deleteNetworkComplexData(String vnf_id, String resourceVersion) throws AAIServiceException;
82
83         // CTag Pool
84         public CtagPool requestCtagPoolData(String physical_location_id, String target_pe, String availability_zone_name) throws AAIServiceException;
85
86     // --------------------------------- 1507 ---------------------------
87         // Data Change
88         public VServer  dataChangeRequestVServerData(URL url) throws AAIServiceException;
89
90         public CtagPool dataChangeRequestCtagPoolData(URL url) throws AAIServiceException;
91
92         public VplsPe   dataChangeRequestVplsPeData(URL url) throws AAIServiceException;
93
94         public Vpe      dataChangeRequestVpeData(URL url) throws AAIServiceException;
95
96         public DvsSwitch dataChangeRequestDvsSwitchData(URL url) throws AAIServiceException;
97
98         public Pserver  dataChangeRequestPServerData(URL url) throws AAIServiceException;
99
100         //OAM-Network:
101         public OamNetwork  dataChangeRequestOAMNetworkData(URL url) throws AAIServiceException;
102         //Availability-Zone:
103         public AvailabilityZone  dataChangeRequestAvailabilityZoneData(URL url) throws AAIServiceException;
104         //Complex:
105         public Complex  dataChangeRequestComplexData(URL url) throws AAIServiceException;
106
107
108         /* DELETE */
109         public boolean dataChangeDeleteVServerData(URL url) throws AAIServiceException;
110
111         public boolean dataChangeDeleteCtagPoolData(URL url) throws AAIServiceException;
112
113         public boolean dataChangeDeleteVplsPeData(URL url) throws AAIServiceException;
114
115         public boolean dataChangeDeleteVpeData(URL url) throws AAIServiceException;
116
117         public boolean dataChangeDeleteDvsSwitchData(URL url) throws AAIServiceException;
118         //OAM-Network:
119         public boolean dataChangeDeleteOAMNetworkData(URL url) throws AAIServiceException;
120         //Availability-Zone:
121         public boolean dataChangeDeleteAvailabilityZoneData(URL url) throws AAIServiceException;
122         //Complex:
123         public boolean dataChangeDeleteComplexData(URL url) throws AAIServiceException;
124
125         // ----------------- Release 1510 ----------------------
126         //      // GenericVNF
127         public GenericVnf requestGenericVnfData(String vnf_id) throws AAIServiceException;
128         public boolean postGenericVnfData(String vnf_id, GenericVnf request) throws AAIServiceException;
129         public boolean deleteGenericVnfData(String vnf_id, String resourceVersion) throws AAIServiceException;
130
131         //      DvsSwitch
132         public DvsSwitch requestDvsSwitchData(String vnf_id) throws AAIServiceException;
133         public boolean postDvsSwitchData(String vnf_id, DvsSwitch request) throws AAIServiceException;
134         public boolean deleteDvsSwitchData(String vnf_id, String resourceVersion) throws AAIServiceException;
135
136         //      PInterface
137         public PInterface requestPInterfaceData(String hostname, String interfaceName) throws AAIServiceException;
138         public boolean postPInterfaceData(String hostname, String interfaceName, PInterface request) throws AAIServiceException;
139         public boolean deletePInterfaceData(String hostname, String interfaceName, String resourceVersion) throws AAIServiceException;
140
141         // Physical Link
142         public PhysicalLink requestPhysicalLinkData(String vnf_id) throws AAIServiceException;
143         public boolean postPhysicalLinkData(String vnf_id, PhysicalLink request) throws AAIServiceException;
144         public boolean deletePhysicalLinkData(String vnf_id, String resourceVersion) throws AAIServiceException;
145
146         // PServers
147         public Pserver requestPServerData(String hostname) throws AAIServiceException;
148         public boolean postPServerData(String hostname, Pserver server) throws AAIServiceException;
149         public boolean deletePServerData(String hostname, String resourceVersion) throws AAIServiceException;
150
151         // L3Networks
152         public L3Network requestL3NetworkData(String networkId) throws AAIServiceException;
153         public L3Network requestL3NetworkQueryByName(String networkId) throws AAIServiceException;
154         public boolean postL3NetworkData(String networkId, L3Network request) throws AAIServiceException;
155         public boolean deleteL3NetworkData(String networkId, String resourceVersion) throws AAIServiceException;
156
157         // Vpn Bindings
158         public VpnBinding requestVpnBindingData(String vpnId) throws AAIServiceException;
159 //      public boolean postVpnBindingData(String vpnId, VpnBinding request) throws AAIServiceException;
160         public boolean deleteVpnBindingData(String vpnId, String resourceVersion) throws AAIServiceException;
161
162         //VnfImage
163         public VnfImage requestVnfImageData(String vpnId) throws AAIServiceException;
164         public VnfImage requestVnfImageDataByVendorModel(String vendor, String model) throws AAIServiceException;
165         public VnfImage requestVnfImageDataByVendorModelVersion(String vendor, String model, String version) throws AAIServiceException;
166
167         // UBB Notify
168         public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException;
169
170         // 1512
171         // Site Pair Site
172         public SitePairSet requestSitePairSetData(String sitePairSetId) throws AAIServiceException;
173         public boolean postSitePairSetData(String sitePairSetId, SitePairSet request) throws AAIServiceException;
174         public boolean deleteSitePairSetData(String sitePairSetId, String resourceVersion) throws AAIServiceException;
175
176         // Services
177         public Service requestServiceData(String serviceId) throws AAIServiceException;
178         public boolean postServiceData(String serviceId, Service request) throws AAIServiceException;
179         public boolean deleteServiceData(String serviceId, String resourceVersion) throws AAIServiceException;
180
181         // Node Query - 1602
182         public SearchResults requestNodeQuery(String type, String entityIdentifier, String entityName) throws AAIServiceException;
183         public String requestDataByURL(URL url) throws AAIServiceException;
184 //      public Object requestDataInstanceNodeQuery(String type, String vnf_name) throws AAIServiceException;
185         public GenericVnf requestGenericVnfeNodeQuery(String vnf_name) throws AAIServiceException;
186
187         //      // tenant
188         public Tenant requestTenantData(String tenant_id, String cloudOwner, String cloudRegionId) throws AAIServiceException;
189         public Tenant requestTenantDataByName(String tenant_name, String cloudOwner, String cloudRegionId) throws AAIServiceException;
190         public boolean postTenantData(String tenant_id, String cloudOwner, String cloudRegionId, Tenant request) throws AAIServiceException;
191 //      public boolean deleteGenericVnfData(String vnf_id, String resourceVersion) throws AAIServiceException;
192
193
194         public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
195         public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
196
197         public void logKeyError(String keys);
198
199         public QueryStatus processResponseData(String rv, String resource, AAIRequest request, String prefix,  SvcLogicContext ctx, HashMap<String, String> nameValues, String modifier) throws JsonParseException, JsonMappingException, IOException, AAIServiceException ;
200         public String getPathTemplateForResource(String resoourceName, String join, SvcLogicContext ctx) throws MalformedURLException;
201         public boolean isDeprecatedFormat(String resource, HashMap<String, String> nameValues);
202
203 }