2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T 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 vnfId, Vce request) throws AAIServiceException;
46 public Vce requestNetworkVceData(String vnfId) throws AAIServiceException;
47 public boolean deleteNetworkVceData(String vnfId, String resourceVersion) throws AAIServiceException;
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;
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;
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;
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;
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;
78 public CtagPool requestCtagPoolData(String physicalLocationId, String targetPe, String availabilityZoneName) throws AAIServiceException;
80 // --------------------------------- 1507 ---------------------------
82 public VServer dataChangeRequestVServerData(URL url) throws AAIServiceException;
84 public CtagPool dataChangeRequestCtagPoolData(URL url) throws AAIServiceException;
86 public VplsPe dataChangeRequestVplsPeData(URL url) throws AAIServiceException;
88 public DvsSwitch dataChangeRequestDvsSwitchData(URL url) throws AAIServiceException;
90 public Pserver dataChangeRequestPServerData(URL url) throws AAIServiceException;
93 public OamNetwork dataChangeRequestOAMNetworkData(URL url) throws AAIServiceException;
95 public AvailabilityZone dataChangeRequestAvailabilityZoneData(URL url) throws AAIServiceException;
97 public Complex dataChangeRequestComplexData(URL url) throws AAIServiceException;
101 public boolean dataChangeDeleteVServerData(URL url) throws AAIServiceException;
103 public boolean dataChangeDeleteCtagPoolData(URL url) throws AAIServiceException;
105 public boolean dataChangeDeleteVplsPeData(URL url) throws AAIServiceException;
107 public boolean dataChangeDeleteVpeData(URL url) throws AAIServiceException;
109 public boolean dataChangeDeleteDvsSwitchData(URL url) throws AAIServiceException;
111 public boolean dataChangeDeleteOAMNetworkData(URL url) throws AAIServiceException;
113 public boolean dataChangeDeleteAvailabilityZoneData(URL url) throws AAIServiceException;
115 public boolean dataChangeDeleteComplexData(URL url) throws AAIServiceException;
117 // ----------------- Release 1510 ----------------------
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;
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;
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;
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;
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;
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;
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;
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;
160 public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException;
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;
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;
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;
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;
186 public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
187 public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
189 public void logKeyError(String keys);
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);
195 String query(AAIRequest request) throws AAIServiceException;
196 String save(AAIRequest request) throws AAIServiceException;
197 boolean delete(AAIRequest request, String resourceVersion) throws AAIServiceException;