aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java
blob: fce94ba0ab7e03fc0f6625599c69dae2707c08a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
/**
 * Copyright 2016-2017 ZTE Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.onap.usecaseui.server.service.lcm.domain.aai;

import org.onap.usecaseui.server.bean.sotn.PinterfaceRsp;
import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAICustomer;
import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAICustomerRsp;
import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAIOrchestratorRsp;
import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAIServiceSubscription;
import org.onap.usecaseui.server.service.lcm.domain.aai.bean.AAISingleOrchestratorRsp;
import org.onap.usecaseui.server.service.lcm.domain.aai.bean.SDNCControllerRsp;
import org.onap.usecaseui.server.service.lcm.domain.aai.bean.ServiceInstanceRsp;
import org.onap.usecaseui.server.service.lcm.domain.aai.bean.ServiceSubscriptionRsp;
import org.onap.usecaseui.server.service.lcm.domain.aai.bean.VimInfoRsp;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface AAIService {

    @Headers({
            "X-TransactionId: 7777",
            "X-FromAppId: uui",
            "Authorization: Basic QUFJOkFBSQ==",
            "Accept: application/json"
    })
//    @GET("/api/aai-business/v11/customers")
    @GET("/api/aai-business/v13/customers")
    Call<AAICustomerRsp> listCustomer();
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
	})
	@GET("/api/aai-externalSystem/v16/esr-nfvo-list")
	Call<AAIOrchestratorRsp> listOrchestrator();
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
	})
	@GET("/api/aai-externalSystem/v16/esr-nfvo-list/esr-nfvo/{nfvo-id}?depth=all")
	Call<AAISingleOrchestratorRsp> getOrchestrator(@Path("nfvo-id") String nfvoId);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
    @PUT("/api/aai-business/v13/customers/customer/{global-customer-id}")
    Call<ResponseBody> createOrUpdateCustomer(@Path("global-customer-id") String customerId,@Body RequestBody body);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
    @DELETE("/api/aai-business/v13//customers/customer/{global-customer-id}")
    Call<ResponseBody> deleteCustomer(@Path("global-customer-id") String customerId,@Query("resource-version") String resourceVersion);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
    @GET("/api/aai-business/v13//customers/customer/{global-customer-id}")
    Call<AAICustomer> getCustomerById(@Path("global-customer-id") String customerId);
    
    @Headers({
            "X-TransactionId: 7777",
            "X-FromAppId: uui",
            "Authorization: Basic QUFJOkFBSQ==",
            "Accept: application/json"
    })
//    @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances")
    @GET("/api/aai-business/v13/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances")
    Call<ResponseBody> listServiceInstances(@Path("global-customer-id") String customerId, @Path("service-type") String serviceType);

    @Headers({
            "X-TransactionId: 7777",
            "X-FromAppId: uui",
            "Authorization: Basic QUFJOkFBSQ==",
            "Accept: application/json"
    })
//    @GET("/cloud-infrastructure/cloud-regions")
    @GET("/api/aai-cloudInfrastructure/v11/cloud-regions")
    Call<VimInfoRsp> listVimInfo();

    @Headers({
            "X-TransactionId: 7777",
            "X-FromAppId: uui",
            "Authorization: Basic QUFJOkFBSQ==",
            "Accept: application/json"
    })
//    @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions")
    @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions")
    Call<ServiceSubscriptionRsp> listServiceSubscriptions(@Path("global-customer-id") String customerId);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
	})
	//@GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions")
	@PUT("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}")
	Call<ResponseBody> createOrUpdateServiceType(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType,@Body RequestBody body);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
	})
	//@GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions")
	@PUT("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}")
	Call<ResponseBody> deleteServiceType(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType,@Query("resource-version") String resourceVersion);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
	})
	//@GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions")
	@GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}")
	Call<AAIServiceSubscription> getServiceTypeById(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType);
    
    @Headers({
            "X-TransactionId: 7777",
            "X-FromAppId: uui",
            "Authorization: Basic QUFJOkFBSQ==",
            "Accept: application/json"
    })
    @GET("/api/aai-externalSystem/v11/esr-thirdparty-sdnc-list")
    Call<SDNCControllerRsp> listSdncControllers();
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
	})
	@GET("/api/aai-business/v11/customers/customer/{customerId}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{serviceId}")
	Call<ResponseBody> getAAIServiceInstance(@Path("customerId") String customerId,@Path("service-type") String seviceType,@Path("serviceId") String serviceId);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
	@GET("/api/aai-network/v14/network-resources")
	Call<ResponseBody> listNetWorkResources();
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
	@GET("/api/aai-network/v14/pnfs/pnf/{pnfName}/p-interfaces")
	Call<PinterfaceRsp> getPinterfaceByPnfName(@Path("pnfName") String pnfName);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
	@GET("/api/aai-network/v14/logical-links")
	Call<ResponseBody> getLogicalLinks();
    
    @Headers({
    	"X-TransactionId: 7777",
    	"X-FromAppId: uui",
    	"Authorization: Basic QUFJOkFBSQ==",
    	"Accept: application/json"
    })
    @GET("/api/aai-network/v14/logical-links/logical-link/{link-name}")
    Call<ResponseBody> getSpecificLogicalLink(@Path("link-name") String linkName);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
    @PUT("/api/aai-network/v14/network-resources/network-resource/{networkId}")
    Call<ResponseBody> createTopoNetwork(@Body RequestBody body,@Path("networkId") String networkId);
    
    @Headers({
    	"X-TransactionId: 7777",
    	"X-FromAppId: uui",
    	"Authorization: Basic QUFJOkFBSQ==",
    	"Accept: application/json"
    })
    @PUT("/api/aai-network/v14/ext-aai-networks/ext-aai-network/{aai-id}")
    Call<ResponseBody> createHostUrl(@Body RequestBody body,@Path("aai-id") String aaiId);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
	@GET("/api/aai-network/v14/ext-aai-networks/ext-aai-network/{aai-id}")
	Call<ResponseBody> getExtAaiId(@Path("aai-id") String aaiId);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
	@GET("/api/aai-network/v14/ext-aai-networks/ext-aai-network/{aai-id}/esr-system-info")
	Call<ResponseBody> getHostUrl(@Path("aai-id") String aaiId);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
    @PUT("/api/aai-network/v14/pnfs/pnf/{pnfName}/p-interfaces/p-interface/{tp-id}")
    Call<ResponseBody> createTerminationPoint(@Body RequestBody body,@Path("pnfName") String pnfName,@Path("tp-id") String tpId);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
    @PUT("/api/aai-network/v14/pnfs/pnf/{pnfname}")
    Call<ResponseBody> createPnf(@Body RequestBody body,@Path("pnfname") String pnfname);
    
    @Headers({
    	"X-TransactionId: 7777",
    	"X-FromAppId: uui",
    	"Authorization: Basic QUFJOkFBSQ==",
    	"Accept: application/json"
    })
    @PUT("/api/aai-network/v14/logical-links/logical-link/{linkName}")
    Call<ResponseBody> createLink(@Body RequestBody body,@Path("linkName") String linkName);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
    @DELETE("/api/aai-network/v14/logical-links/logical-link/{linkName}")
    Call<ResponseBody> deleteLink(@Path("linkName") String linkName,@Query("resource-version") String resourceVersion);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
    @GET("/api/aai-business/v14/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances")
    Call<ResponseBody> getServiceInstances(@Path("global-customer-id") String customerId,@Path("service-type") String serviceType);
    
    @Headers({
        "X-TransactionId: 7777",
        "X-FromAppId: uui",
        "Authorization: Basic QUFJOkFBSQ==",
        "Accept: application/json"
    })
    @GET("/api/aai-business/v14/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances")
    Call<ResponseBody> serviceInstaneInfo(@Path("global-customer-id") String globalCustomerId,@Path("service-type") String serviceType,@Query("service-instance-id") String serviceInstanceId);
    
    @Headers({
    	"X-TransactionId: 7777",
    	"X-FromAppId: uui",
    	"Authorization: Basic QUFJOkFBSQ==",
    	"Accept: application/json"
    })
    @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")
    Call<ResponseBody> getAllottedResources(@Path("global-customer-id") String globalCustomerId,@Path("service-type") String serviceType,@Path("service-instance-id") String serviceInstanceId);
    
    @Headers({
    	"X-TransactionId: 7777",
    	"X-FromAppId: uui",
    	"Authorization: Basic QUFJOkFBSQ==",
    	"Accept: application/json"
    })
    @GET("/api/aai-network/v14/pnfs/pnf/{pnfName}")
    Call<ResponseBody> getPnfInfo(@Path("pnfName") String pnfName);
    
    @Headers({
    	"X-TransactionId: 7777",
    	"X-FromAppId: uui",
    	"Authorization: Basic QUFJOkFBSQ==",
    	"Accept: application/json"
    })
    @GET("/api/aai-network/v14/connectivities")
    Call<ResponseBody> getConnectivityInfo(@Query("connectivity-id") String connectivityId);
    
    @Headers({
    	"X-TransactionId: 7777",
    	"X-FromAppId: uui",
    	"Authorization: Basic QUFJOkFBSQ==",
    	"Accept: application/json"
    })
    @GET("/api/aai-network/v14/vpn-bindings")
    Call<ResponseBody> getPinterfaceByVpnId(@Query("vpn-id") String vpnId);
    
    @Headers({
    	"X-TransactionId: 7777",
    	"X-FromAppId: uui",
    	"Authorization: Basic QUFJOkFBSQ==",
    	"Accept: application/json"
    })
    @DELETE("/api/aai-network/v14/ext-aai-networks/ext-aai-network/{aai-id}")
    Call<ResponseBody> deleteExtNetwork(@Path("aai-id") String aaiId,@Query("resource-version") String resourceVersion);
}