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.adaptors.aai.data.notify.NotifyEvent;
37 import com.fasterxml.jackson.core.JsonParseException;
38 import com.fasterxml.jackson.databind.JsonMappingException;
40 public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin {
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;
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;
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;
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;
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;
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;
76 public CtagPool requestCtagPoolData(String physicalLocationId, String targetPe, String availabilityZoneName) throws AAIServiceException;
78 // --------------------------------- 1507 ---------------------------
80 public Vserver dataChangeRequestVServerData(URL url) throws AAIServiceException;
82 public CtagPool dataChangeRequestCtagPoolData(URL url) throws AAIServiceException;
84 public VplsPe dataChangeRequestVplsPeData(URL url) throws AAIServiceException;
86 public DvsSwitch dataChangeRequestDvsSwitchData(URL url) throws AAIServiceException;
88 public Pserver dataChangeRequestPServerData(URL url) throws AAIServiceException;
91 public OamNetwork dataChangeRequestOAMNetworkData(URL url) throws AAIServiceException;
93 public AvailabilityZone dataChangeRequestAvailabilityZoneData(URL url) throws AAIServiceException;
95 public Complex dataChangeRequestComplexData(URL url) throws AAIServiceException;
99 public boolean dataChangeDeleteVServerData(URL url) throws AAIServiceException;
101 public boolean dataChangeDeleteCtagPoolData(URL url) throws AAIServiceException;
103 public boolean dataChangeDeleteVplsPeData(URL url) throws AAIServiceException;
105 public boolean dataChangeDeleteVpeData(URL url) throws AAIServiceException;
107 public boolean dataChangeDeleteDvsSwitchData(URL url) throws AAIServiceException;
109 public boolean dataChangeDeleteOAMNetworkData(URL url) throws AAIServiceException;
111 public boolean dataChangeDeleteAvailabilityZoneData(URL url) throws AAIServiceException;
113 public boolean dataChangeDeleteComplexData(URL url) throws AAIServiceException;
115 // ----------------- Release 1510 ----------------------
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;
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;
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;
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;
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;
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;
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;
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;
158 public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException;
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;
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;
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;
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;
184 public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
185 public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
187 public void logKeyError(String keys);
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);
193 String query(AAIRequest request) throws AAIServiceException;
194 String save(AAIRequest request) throws AAIServiceException;
195 boolean delete(AAIRequest request, String resourceVersion) throws AAIServiceException;