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