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