66e0e1f23b32e7bcb0ef349d79846d8b6e87afa7
[usecase-ui/server.git] / server / src / main / java / org / onap / usecaseui / server / service / lcm / domain / aai / AAIService.java
1 /**
2  * Copyright 2016-2017 ZTE Corporation.
3  * Copyright 2020 Huawei Corporation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 package org.onap.usecaseui.server.service.lcm.domain.aai;
18
19 import org.onap.usecaseui.server.bean.sotn.PinterfaceRsp;
20 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAICustomer;
21 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAICustomerRsp;
22 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAIOrchestratorRsp;
23 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAIServiceSubscription;
24 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAISingleOrchestratorRsp;
25 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.SDNCControllerRsp;
26 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.ServiceSubscriptionRsp;
27 import org.onap.usecaseui.server.service.lcm.domain.aai.bean.VimInfoRsp;
28
29
30 import okhttp3.RequestBody;
31 import okhttp3.ResponseBody;
32 import retrofit2.Call;
33 import retrofit2.http.Body;
34 import retrofit2.http.DELETE;
35 import retrofit2.http.GET;
36 import retrofit2.http.Headers;
37 import retrofit2.http.PUT;
38 import retrofit2.http.Path;
39 import retrofit2.http.Query;
40
41 public interface AAIService {
42
43     @Headers({
44             "X-TransactionId: 7777",
45             "X-FromAppId: uui",
46             "Authorization: Basic QUFJOkFBSQ==",
47             "Accept: application/json"
48     })
49 //    @GET("/api/aai-business/v11/customers")
50     @GET("/api/aai-business/v13/customers")
51     Call<AAICustomerRsp> listCustomer();
52     
53     @Headers({
54         "X-TransactionId: 7777",
55         "X-FromAppId: uui",
56         "Authorization: Basic QUFJOkFBSQ==",
57         "Accept: application/json"
58         })
59         @GET("/api/aai-externalSystem/v16/esr-nfvo-list")
60         Call<AAIOrchestratorRsp> listOrchestrator();
61     
62     @Headers({
63         "X-TransactionId: 7777",
64         "X-FromAppId: uui",
65         "Authorization: Basic QUFJOkFBSQ==",
66         "Accept: application/json"
67         })
68         @GET("/api/aai-externalSystem/v16/esr-nfvo-list/esr-nfvo/{nfvo-id}?depth=all")
69         Call<AAISingleOrchestratorRsp> getOrchestrator(@Path("nfvo-id") String nfvoId);
70     
71     @Headers({
72         "X-TransactionId: 7777",
73         "X-FromAppId: uui",
74         "Authorization: Basic QUFJOkFBSQ==",
75         "Accept: application/json"
76     })
77     @PUT("/api/aai-business/v13/customers/customer/{global-customer-id}")
78     Call<ResponseBody> createOrUpdateCustomer(@Path("global-customer-id") String customerId,@Body RequestBody body);
79     
80     @Headers({
81         "X-TransactionId: 7777",
82         "X-FromAppId: uui",
83         "Authorization: Basic QUFJOkFBSQ==",
84         "Accept: application/json"
85     })
86     @DELETE("/api/aai-business/v13//customers/customer/{global-customer-id}")
87     Call<ResponseBody> deleteCustomer(@Path("global-customer-id") String customerId,@Query("resource-version") String resourceVersion);
88     
89     @Headers({
90         "X-TransactionId: 7777",
91         "X-FromAppId: uui",
92         "Authorization: Basic QUFJOkFBSQ==",
93         "Accept: application/json"
94     })
95     @GET("/api/aai-business/v13//customers/customer/{global-customer-id}")
96     Call<AAICustomer> getCustomerById(@Path("global-customer-id") String customerId);
97     
98     @Headers({
99             "X-TransactionId: 7777",
100             "X-FromAppId: uui",
101             "Authorization: Basic QUFJOkFBSQ==",
102             "Accept: application/json"
103     })
104 //    @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances")
105     @GET("/api/aai-business/v16/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances")
106     Call<ResponseBody> listServiceInstances(@Path("global-customer-id") String customerId, @Path("service-type") String serviceType);
107
108     @Headers({
109             "X-TransactionId: 7777",
110             "X-FromAppId: uui",
111             "Authorization: Basic QUFJOkFBSQ==",
112             "Accept: application/json"
113     })
114 //    @GET("/cloud-infrastructure/cloud-regions")
115     @GET("/api/aai-cloudInfrastructure/v11/cloud-regions")
116     Call<VimInfoRsp> listVimInfo();
117
118     @Headers({
119             "X-TransactionId: 7777",
120             "X-FromAppId: uui",
121             "Authorization: Basic QUFJOkFBSQ==",
122             "Accept: application/json"
123     })
124 //    @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions")
125     @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions")
126     Call<ServiceSubscriptionRsp> listServiceSubscriptions(@Path("global-customer-id") String customerId);
127     
128     @Headers({
129         "X-TransactionId: 7777",
130         "X-FromAppId: uui",
131         "Authorization: Basic QUFJOkFBSQ==",
132         "Accept: application/json"
133         })
134         //@GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions")
135         @PUT("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}")
136         Call<ResponseBody> createOrUpdateServiceType(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType,@Body RequestBody body);
137     
138     @Headers({
139         "X-TransactionId: 7777",
140         "X-FromAppId: uui",
141         "Authorization: Basic QUFJOkFBSQ==",
142         "Accept: application/json"
143         })
144         //@GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions")
145         @DELETE("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}")
146         Call<ResponseBody> deleteServiceType(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType,@Query("resource-version") String resourceVersion);
147     
148     @Headers({
149         "X-TransactionId: 7777",
150         "X-FromAppId: uui",
151         "Authorization: Basic QUFJOkFBSQ==",
152         "Accept: application/json"
153         })
154         //@GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions")
155         @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}")
156         Call<AAIServiceSubscription> getServiceTypeById(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType);
157     
158     @Headers({
159             "X-TransactionId: 7777",
160             "X-FromAppId: uui",
161             "Authorization: Basic QUFJOkFBSQ==",
162             "Accept: application/json"
163     })
164     @GET("/api/aai-externalSystem/v11/esr-thirdparty-sdnc-list")
165     Call<SDNCControllerRsp> listSdncControllers();
166     
167     @Headers({
168         "X-TransactionId: 7777",
169         "X-FromAppId: uui",
170         "Authorization: Basic QUFJOkFBSQ==",
171         "Accept: application/json"
172         })
173         @GET("/api/aai-business/v11/customers/customer/{customerId}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{serviceId}")
174         Call<ResponseBody> getAAIServiceInstance(@Path("customerId") String customerId,@Path("service-type") String seviceType,@Path("serviceId") String serviceId);
175     
176     @Headers({
177         "X-TransactionId: 7777",
178         "X-FromAppId: uui",
179         "Authorization: Basic QUFJOkFBSQ==",
180         "Accept: application/json"
181     })
182         @GET("/api/aai-network/v14/network-resources")
183         Call<ResponseBody> listNetWorkResources();
184     
185     @Headers({
186         "X-TransactionId: 7777",
187         "X-FromAppId: uui",
188         "Authorization: Basic QUFJOkFBSQ==",
189         "Accept: application/json"
190     })
191         @GET("/api/aai-network/v14/pnfs/pnf/{pnfName}/p-interfaces")
192         Call<PinterfaceRsp> getPinterfaceByPnfName(@Path("pnfName") String pnfName);
193     
194     @Headers({
195         "X-TransactionId: 7777",
196         "X-FromAppId: uui",
197         "Authorization: Basic QUFJOkFBSQ==",
198         "Accept: application/json"
199     })
200         @GET("/api/aai-network/v24/logical-links")
201         Call<ResponseBody> getLogicalLinks();
202     
203     @Headers({
204         "X-TransactionId: 7777",
205         "X-FromAppId: uui",
206         "Authorization: Basic QUFJOkFBSQ==",
207         "Accept: application/json"
208     })
209     @GET("/api/aai-network/v14/logical-links/logical-link/{link-name}")
210     Call<ResponseBody> getSpecificLogicalLink(@Path("link-name") String linkName);
211     
212     @Headers({
213         "X-TransactionId: 7777",
214         "X-FromAppId: uui",
215         "Authorization: Basic QUFJOkFBSQ==",
216         "Accept: application/json"
217     })
218     @PUT("/api/aai-network/v14/network-resources/network-resource/{networkId}")
219     Call<ResponseBody> createTopoNetwork(@Body RequestBody body,@Path("networkId") String networkId);
220     
221     @Headers({
222         "X-TransactionId: 7777",
223         "X-FromAppId: uui",
224         "Authorization: Basic QUFJOkFBSQ==",
225         "Accept: application/json"
226     })
227     @PUT("/api/aai-network/v14/ext-aai-networks/ext-aai-network/{aai-id}")
228     Call<ResponseBody> createHostUrl(@Body RequestBody body,@Path("aai-id") String aaiId);
229     
230     @Headers({
231         "X-TransactionId: 7777",
232         "X-FromAppId: uui",
233         "Authorization: Basic QUFJOkFBSQ==",
234         "Accept: application/json"
235     })
236         @GET("/api/aai-network/v14/ext-aai-networks/ext-aai-network/{aai-id}")
237         Call<ResponseBody> getExtAaiId(@Path("aai-id") String aaiId);
238     
239     @Headers({
240         "X-TransactionId: 7777",
241         "X-FromAppId: uui",
242         "Authorization: Basic QUFJOkFBSQ==",
243         "Accept: application/json"
244     })
245         @GET("/api/aai-network/v14/ext-aai-networks/ext-aai-network/{aai-id}/esr-system-info")
246         Call<ResponseBody> getHostUrl(@Path("aai-id") String aaiId);
247     
248     @Headers({
249         "X-TransactionId: 7777",
250         "X-FromAppId: uui",
251         "Authorization: Basic QUFJOkFBSQ==",
252         "Accept: application/json"
253     })
254     @PUT("/api/aai-network/v14/pnfs/pnf/{pnfName}/p-interfaces/p-interface/{tp-id}")
255     Call<ResponseBody> createTerminationPoint(@Body RequestBody body,@Path("pnfName") String pnfName,@Path("tp-id") String tpId);
256     
257     @Headers({
258         "X-TransactionId: 7777",
259         "X-FromAppId: uui",
260         "Authorization: Basic QUFJOkFBSQ==",
261         "Accept: application/json"
262     })
263     @PUT("/api/aai-network/v14/pnfs/pnf/{pnfname}")
264     Call<ResponseBody> createPnf(@Body RequestBody body,@Path("pnfname") String pnfname);
265     
266     @Headers({
267         "X-TransactionId: 7777",
268         "X-FromAppId: uui",
269         "Authorization: Basic QUFJOkFBSQ==",
270         "Accept: application/json"
271     })
272     @PUT("/api/aai-network/v14/logical-links/logical-link/{linkName}")
273     Call<ResponseBody> createLink(@Body RequestBody body,@Path("linkName") String linkName);
274     
275     @Headers({
276         "X-TransactionId: 7777",
277         "X-FromAppId: uui",
278         "Authorization: Basic QUFJOkFBSQ==",
279         "Accept: application/json"
280     })
281     @DELETE("/api/aai-network/v14/logical-links/logical-link/{linkName}")
282     Call<ResponseBody> deleteLink(@Path("linkName") String linkName,@Query("resource-version") String resourceVersion);
283     
284     @Headers({
285         "X-TransactionId: 7777",
286         "X-FromAppId: uui",
287         "Authorization: Basic QUFJOkFBSQ==",
288         "Accept: application/json"
289     })
290     @GET("/api/aai-business/v14/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances")
291     Call<ResponseBody> getServiceInstances(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType);
292     
293     @Headers({
294         "X-TransactionId: 7777",
295         "X-FromAppId: uui",
296         "Authorization: Basic QUFJOkFBSQ==",
297         "Accept: application/json"
298     })
299     @GET("/api/aai-business/v14/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances")
300     Call<ResponseBody> serviceInstaneInfo(@Path("global-customer-id") String globalCustomerId,@Path("service-type") String serviceType,@Query("service-instance-id") String serviceInstanceId);
301     
302     @Headers({
303         "X-TransactionId: 7777",
304         "X-FromAppId: uui",
305         "Authorization: Basic QUFJOkFBSQ==",
306         "Accept: application/json"
307     })
308     @GET("/api/aai-business/v14/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}/allotted-resources")
309     Call<ResponseBody> getAllottedResources(@Path("global-customer-id") String globalCustomerId,@Path("service-type") String serviceType,@Path("service-instance-id") String serviceInstanceId);
310     
311     @Headers({
312         "X-TransactionId: 7777",
313         "X-FromAppId: uui",
314         "Authorization: Basic QUFJOkFBSQ==",
315         "Accept: application/json"
316     })
317     @GET("/api/aai-network/v14/pnfs/pnf/{pnfName}")
318     Call<ResponseBody> getPnfInfo(@Path("pnfName") String pnfName);
319     
320     @Headers({
321         "X-TransactionId: 7777",
322         "X-FromAppId: uui",
323         "Authorization: Basic QUFJOkFBSQ==",
324         "Accept: application/json"
325     })
326     @GET("/api/aai-network/v24/connectivities")
327     Call<ResponseBody> getConnectivityInfo(@Query("connectivity-id") String connectivityId);
328     
329     @Headers({
330         "X-TransactionId: 7777",
331         "X-FromAppId: uui",
332         "Authorization: Basic QUFJOkFBSQ==",
333         "Accept: application/json"
334     })
335     @GET("/api/aai-network/v14/vpn-bindings")
336     Call<ResponseBody> getPinterfaceByVpnId(@Query("vpn-id") String vpnId);
337     
338     @Headers({
339         "X-TransactionId: 7777",
340         "X-FromAppId: uui",
341         "Authorization: Basic QUFJOkFBSQ==",
342         "Accept: application/json"
343     })
344     @DELETE("/api/aai-network/v14/ext-aai-networks/ext-aai-network/{aai-id}")
345     Call<ResponseBody> deleteExtNetwork(@Path("aai-id") String aaiId,@Query("resource-version") String resourceVersion);
346
347     
348     @Headers({
349         "X-TransactionId: 7777",
350         "X-FromAppId: uui",
351         "Authorization: Basic QUFJOkFBSQ==",
352         "Accept: application/json"
353     })
354     @PUT("/api/aai-query/v19?format=resource")
355     Call<ResponseBody> querynNetworkResourceList(@Body RequestBody body);
356     @Headers({
357             "X-TransactionId: 7777",
358             "X-FromAppId: uui",
359             "Authorization: Basic QUFJOkFBSQ==",
360             "Accept: application/json"
361     })
362     @GET("/api/aai-business/v14/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}")
363     Call<ResponseBody> getServiceInstancesForEdge(@Path("global-customer-id") String globalCustomerId,@Path("service-type") String serviceType,
364                                                   @Path("service-instance-id") String serviceinstanceid);
365
366     @Headers({
367             "X-TransactionId: 7777",
368             "X-FromAppId: uui",
369             "Authorization: Basic QUFJOkFBSQ==",
370             "Accept: application/json"
371     })
372     @GET("/api/aai-network/v14/connectivities/connectivity")
373     Call<ResponseBody> getConnectivityInformation(@Query("connectivity-id") String connectivityId);
374
375     @Headers({
376             "X-TransactionId: 7777",
377             "X-FromAppId: uui",
378             "Authorization: Basic QUFJOkFBSQ==",
379             "Accept: application/json"
380     })
381     @GET("/api/aai-network/v14/pnfs/pnf/{pnfName}/p-interfaces/p-interface/{tp-id}")
382     Call<ResponseBody> getTerminationPoint(@Path("pnfName") String pnfName,@Path("tp-id") String tpId);
383
384     @Headers({
385             "X-TransactionId: 7777",
386             "X-FromAppId: uui",
387             "Authorization: Basic QUFJOkFBSQ==",
388             "Accept: application/json"
389     })
390     @GET("/api/aai-business/v16/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}/allotted-resources/allotted-resource/{allotted-resource-id}")
391     Call<ResponseBody> getAllotedResourceFor5G(@Path("global-customer-id") String globalCustomerId,@Path("service-type") String serviceType,
392                                                @Path("service-instance-id") String serviceinstanceid,@Path("allotted-resource-id") String allottedResourceId);
393     @Headers({
394             "X-TransactionId: 7777",
395             "X-FromAppId: uui",
396             "Authorization: Basic QUFJOkFBSQ==",
397             "Accept: application/json"
398     })
399     @GET("/api/aai-network/v14/site-resources/site-resource/{site-resource-id}")
400     Call<ResponseBody> getSiteResourceInfo(@Path("site-resource-id") String siteResourceId);
401
402     @Headers({
403             "X-TransactionId: 7777",
404             "X-FromAppId: uui",
405             "Authorization: Basic QUFJOkFBSQ==",
406             "Accept: application/json"
407     })
408     @GET("/api/aai-cloudInfrastructure/v14/complexes/complex/{complex-id}")
409     Call<ResponseBody> getComplexObject(@Path("complex-id") String complexId);
410
411     @Headers({
412             "X-TransactionId: 7777",
413             "X-FromAppId: uui",
414             "Authorization: Basic QUFJOkFBSQ==",
415             "Accept: application/json"
416     })
417
418     @GET("/api/aai-business/v14/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances")
419     Call<ResponseBody> getAllServiceInformation(@Path("global-customer-id") String customerId, @Path("service-type") String serviceType);
420 //    @Headers({
421 //            "X-TransactionId: 7777",
422 //            "X-FromAppId: uui",
423 //            "Authorization: Basic QUFJOkFBSQ==",
424 //            "Accept: application/json"
425 //    })
426 //    @GET("/api/aai-network/v14/pnfs/pnf/{pnfName}")
427 //    Call<ResponseBody> getPnfInfo(@Path("pnfName") String pnfName);
428
429     @Headers({
430             "X-TransactionId: 7777",
431             "X-FromAppId: uui",
432             "Authorization: Basic QUFJOkFBSQ==",
433             "Accept: application/json"
434     })
435
436     @GET("/api/aai-business/v13/customers/customer/{global-customer-id}/service-subscriptions")
437     Call<ResponseBody> getServiceSubscription(@Path("global-customer-id") String customerID);
438
439     @Headers({
440             "X-TransactionId: 7777",
441             "X-FromAppId: uui",
442             "Authorization: Basic QUFJOkFBSQ==",
443             "Accept: application/json"
444     })
445
446     @GET("/aai/v19/network/generic-vnfs/generic-vnf/{vnf-id}")
447     Call<ResponseBody> getVNFsDetail(@Path("vnf-id") String vnfId);
448
449     @Headers({
450             "X-TransactionId: 7777",
451             "X-FromAppId: uui",
452             "Authorization: Basic QUFJOkFBSQ==",
453             "Accept: application/json"
454     })
455
456     @GET("/aai/v19/network/unis/uni/{uni-id}")
457     Call<ResponseBody> getUNIInfo(@Path("uni-id") String uniId);
458 }