2 * Copyright (C) 2017 CTC, Inc. and others. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.usecaseui.server.service.intent;
19 import com.alibaba.fastjson.JSONObject;
20 import okhttp3.RequestBody;
21 import retrofit2.Call;
22 import retrofit2.http.*;
24 public interface IntentApiService {
27 "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
28 "Accept: application/json"
30 @POST("/so/infra/serviceIntent/v1/create")
31 Call<JSONObject> createIntentInstance(@Body RequestBody body);
33 // curl -X GET -H "content-type:application/json" http://so:8080/onap/so/infra/e2eServiceInstances/v3/cll-101/operations/0d698405-9109-49f2-9939-fd02ead31660 --user 'InfraPortalClient:password1$'
36 "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
37 "Accept: application/json"
39 @GET("/so/infra/e2eServiceInstances/v3/{serviceId}/operations/{operationId}")
40 Call<JSONObject> queryOperationProgress(@Path("serviceId") String serviceId, @Path("operationId") String operationId);
43 "X-TransactionId: 9999",
45 "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
46 "Accept: application/json"
48 @GET("/aai/v24/business/customers/customer/IBNCustomer/service-subscriptions/service-subscription/IBN/service-instances/service-instance/{resource-service-id}?depth=all")
49 Call<JSONObject> getInstanceNetworkInfo(@Path("resource-service-id") String resourceServiceId);
52 "X-TransactionId: 9999",
54 "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
55 "Accept: application/json"
57 @GET("/aai/v24/network/network-policies/network-policy/{networkPolicyId}?depth=all")
58 Call<JSONObject> getInstanceNetworkPolicyInfo(@Path("networkPolicyId") String networkPolicyId);
61 "X-TransactionId: 9999",
63 "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
64 "Accept: application/json"
66 @GET("/aai/v24/business/customers/customer/IBNCustomer/service-subscriptions/service-subscription/IBN/service-instances/service-instance/{resource-service-id}/metadata")
67 Call<JSONObject> getInstanceBandwidth(@Path("resource-service-id") String resourceServiceId);
70 "X-TransactionId: 9999",
72 "Authorization: Basic QUFJOkFBSQ==",
73 "Accept: application/json"
75 @GET("/aai/v24/business/customers/customer/IBNCustomer/service-subscriptions/service-subscription/IBN/service-instances/service-instance/{resource-service-id}")
76 Call<JSONObject> getInstanceInfo(@Path("resource-service-id") String resourceServiceId);
79 "X-TransactionId: 9999",
81 "Authorization: Basic QUFJOkFBSQ==",
82 "Accept: application/json"
84 @PUT("/aai/v24/business/customers/customer/{globalCustomerId}")
85 Call<Void> addCustomer(@Path("globalCustomerId") String globalCustomerId,@Body RequestBody body);
88 "X-TransactionId: 9999",
90 "Authorization: Basic QUFJOkFBSQ==",
91 "Accept: application/json"
93 @GET("/aai/v24/business/customers/customer/{globalCustomerId}")
94 Call<JSONObject> queryCustomer(@Path("globalCustomerId") String globalCustomerId);
96 "X-TransactionId: 9999",
98 "Authorization: Basic QUFJOkFBSQ==",
99 "Accept: application/json"
101 @PUT("/aai/v24/business/customers/customer/{globalCustomerId}/service-subscriptions/service-subscription/{serviceType}")
102 Call<Void> addSubscription(@Path("globalCustomerId") String globalCustomerId, @Path("serviceType") String serviceType,@Body RequestBody body);
105 "X-TransactionId: 9999",
107 "Authorization: Basic QUFJOkFBSQ==",
108 "Accept: application/json"
110 @GET("/aai/v24/business/customers/customer/{globalCustomerId}/service-subscriptions/service-subscription/{serviceType}")
111 Call<JSONObject> querySubscription(@Path("globalCustomerId") String globalCustomerId, @Path("serviceType") String serviceType);
114 "X-TransactionId: 9999",
116 "Authorization: Basic QUFJOkFBSQ==",
117 "Accept: application/json"
119 @PUT("/aai/v24/business/customers/customer/{globalCustomerId}/service-subscriptions/service-subscription/{serviceType}/service-instances/service-instance/{serviceInstanceId}")
120 Call<Void> saveServiceInstance(@Path("globalCustomerId") String globalCustomerId, @Path("serviceType") String serviceType, @Path("serviceInstanceId") String serviceInstanceId, @Body RequestBody body);
124 "X-TransactionId: 9999",
126 "Authorization: Basic QUFJOkFBSQ==",
127 "Accept: application/json"
129 @GET("/aai/v24/business/customers/customer/{globalCustomerId}/service-subscriptions/service-subscription/{serviceType}/service-instances/service-instance/{serviceInstanceId}")
130 Call<JSONObject> queryServiceInstance(@Path("globalCustomerId") String globalCustomerId, @Path("serviceType") String serviceType, @Path("serviceInstanceId") String serviceInstanceId);
134 "X-TransactionId: 9999",
136 "Authorization: Basic QUFJOkFBSQ==",
137 "Accept: application/json"
139 @DELETE("/aai/v24/business/customers/customer/{globalCustomerId}/service-subscriptions/service-subscription/{serviceType}/service-instances/service-instance/{serviceInstanceId}?resource-version={resourceVersion}")
140 Call<Void> deleteServiceInstance(@Path("globalCustomerId") String globalCustomerId, @Path("serviceType") String serviceType, @Path("serviceInstanceId") String serviceInstanceId, @Path("resourceVersion") String resourceVersion);
143 "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
144 "Accept: application/json"
146 @HTTP(method="DELETE", path="/so/infra/serviceIntent/v1/delete", hasBody = true)
147 Call<JSONObject> deleteIntentInstance(@Body RequestBody body);
150 "X-TransactionId: 9999",
152 "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
153 "Accept: application/json"
155 @GET("/aai/v24/network/network-routes")
156 Call<JSONObject> queryNetworkRoute();