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;
25 import java.net.MalformedURLException;
27 import java.util.HashMap;
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;
39 import com.fasterxml.jackson.core.JsonParseException;
40 import com.fasterxml.jackson.databind.JsonMappingException;
42 public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin {
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;
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;
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;
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;
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;
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;
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;
84 public CtagPool requestCtagPoolData(String physical_location_id, String target_pe, String availability_zone_name) throws AAIServiceException;
86 // --------------------------------- 1507 ---------------------------
88 public VServer dataChangeRequestVServerData(URL url) throws AAIServiceException;
90 public CtagPool dataChangeRequestCtagPoolData(URL url) throws AAIServiceException;
92 public VplsPe dataChangeRequestVplsPeData(URL url) throws AAIServiceException;
94 public Vpe dataChangeRequestVpeData(URL url) throws AAIServiceException;
96 public DvsSwitch dataChangeRequestDvsSwitchData(URL url) throws AAIServiceException;
98 public Pserver dataChangeRequestPServerData(URL url) throws AAIServiceException;
101 public OamNetwork dataChangeRequestOAMNetworkData(URL url) throws AAIServiceException;
103 public AvailabilityZone dataChangeRequestAvailabilityZoneData(URL url) throws AAIServiceException;
105 public Complex dataChangeRequestComplexData(URL url) throws AAIServiceException;
109 public boolean dataChangeDeleteVServerData(URL url) throws AAIServiceException;
111 public boolean dataChangeDeleteCtagPoolData(URL url) throws AAIServiceException;
113 public boolean dataChangeDeleteVplsPeData(URL url) throws AAIServiceException;
115 public boolean dataChangeDeleteVpeData(URL url) throws AAIServiceException;
117 public boolean dataChangeDeleteDvsSwitchData(URL url) throws AAIServiceException;
119 public boolean dataChangeDeleteOAMNetworkData(URL url) throws AAIServiceException;
121 public boolean dataChangeDeleteAvailabilityZoneData(URL url) throws AAIServiceException;
123 public boolean dataChangeDeleteComplexData(URL url) throws AAIServiceException;
125 // ----------------- Release 1510 ----------------------
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;
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;
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;
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;
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;
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;
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;
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;
168 public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException;
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;
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;
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;
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;
194 public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
195 public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
197 public void logKeyError(String keys);
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);