dba140a36d4d025faf9f852c082da756e9aedb8f
[usecase-ui/server.git] / server / src / main / java / org / onap / usecaseui / server / service / intent / IntentApiService.java
1 /*
2  * Copyright (C) 2017 CTC, Inc. and others. All rights reserved.
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 package org.onap.usecaseui.server.service.intent;
17
18
19 import com.alibaba.fastjson.JSONObject;
20 import okhttp3.RequestBody;
21 import retrofit2.Call;
22 import retrofit2.http.*;
23
24 public interface IntentApiService {
25
26     @Headers({
27             "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
28             "Accept: application/json"
29     })
30     @POST("/so/infra/serviceIntent/v1/create")
31     Call<JSONObject> createIntentInstance(@Body RequestBody body);
32
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$'
34
35     @Headers({
36             "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
37             "Accept: application/json"
38     })
39     @GET("/so/infra/e2eServiceInstances/v3/{serviceId}/operations/{operationId}")
40     Call<JSONObject> queryOperationProgress(@Path("serviceId") String serviceId, @Path("operationId") String operationId);
41
42     @Headers({
43             "X-TransactionId: 9999",
44             "X-FromAppId: MSO",
45             "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
46             "Accept: application/json"
47     })
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);
50
51     @Headers({
52             "X-TransactionId: 9999",
53             "X-FromAppId: MSO",
54             "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
55             "Accept: application/json"
56     })
57     @GET("/aai/v24/network/network-policies/network-policy/{networkPolicyId}?depth=all")
58     Call<JSONObject> getInstanceNetworkPolicyInfo(@Path("networkPolicyId") String networkPolicyId);
59
60     @Headers({
61             "X-TransactionId: 9999",
62             "X-FromAppId: MSO",
63             "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
64             "Accept: application/json"
65     })
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);
68
69     @Headers({
70             "X-TransactionId: 9999",
71             "X-FromAppId: MSO",
72             "Authorization: Basic QUFJOkFBSQ==",
73             "Accept: application/json"
74     })
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);
77
78     @Headers({
79             "X-TransactionId: 9999",
80             "X-FromAppId: MSO",
81             "Authorization: Basic QUFJOkFBSQ==",
82             "Accept: application/json"
83     })
84     @PUT("/aai/v24/business/customers/customer/{globalCustomerId}")
85     Call<Void> addCustomer(@Path("globalCustomerId") String globalCustomerId,@Body RequestBody body);
86
87     @Headers({
88             "X-TransactionId: 9999",
89             "X-FromAppId: MSO",
90             "Authorization: Basic QUFJOkFBSQ==",
91             "Accept: application/json"
92     })
93     @GET("/aai/v24/business/customers/customer/{globalCustomerId}")
94     Call<JSONObject> queryCustomer(@Path("globalCustomerId") String globalCustomerId);
95     @Headers({
96             "X-TransactionId: 9999",
97             "X-FromAppId: MSO",
98             "Authorization: Basic QUFJOkFBSQ==",
99             "Accept: application/json"
100     })
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);
103
104     @Headers({
105             "X-TransactionId: 9999",
106             "X-FromAppId: MSO",
107             "Authorization: Basic QUFJOkFBSQ==",
108             "Accept: application/json"
109     })
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);
112
113     @Headers({
114             "X-TransactionId: 9999",
115             "X-FromAppId: MSO",
116             "Authorization: Basic QUFJOkFBSQ==",
117             "Accept: application/json"
118     })
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);
121
122
123     @Headers({
124             "X-TransactionId: 9999",
125             "X-FromAppId: MSO",
126             "Authorization: Basic QUFJOkFBSQ==",
127             "Accept: application/json"
128     })
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);
131
132
133     @Headers({
134             "X-TransactionId: 9999",
135             "X-FromAppId: MSO",
136             "Authorization: Basic QUFJOkFBSQ==",
137             "Accept: application/json"
138     })
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);
141
142     @Headers({
143             "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
144             "Accept: application/json"
145     })
146     @HTTP(method="DELETE", path="/so/infra/serviceIntent/v1/delete", hasBody = true)
147     Call<JSONObject> deleteIntentInstance(@Body RequestBody body);
148
149     @Headers({
150             "X-TransactionId: 9999",
151             "X-FromAppId: MSO",
152             "Authorization: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==",
153             "Accept: application/json"
154     })
155     @GET("/aai/v24/network/network-routes")
156     Call<JSONObject> queryNetworkRoute();
157
158 }