8240661db3330b1b6b3df9c2d15c3a051e3d4d24
[usecase-ui/intent-analysis.git] /
1 /*
2  * Copyright 2022 Huawei Technologies Co., Ltd.
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
17 package org.onap.usecaseui.intentanalysis.adapters.policy.apicall;
18
19 import okhttp3.RequestBody;
20 import okhttp3.ResponseBody;
21 import retrofit2.Call;
22 import retrofit2.http.Body;
23 import retrofit2.http.DELETE;
24 import retrofit2.http.GET;
25 import retrofit2.http.Headers;
26 import retrofit2.http.POST;
27 import retrofit2.http.Path;
28
29 public interface PolicyAPICall {
30
31     @Headers({
32         "Accept: application/json",
33         "Content-Type: application/json"
34     })
35     @POST("/policy/api/v1/policytypes")
36     Call<ResponseBody> createPolicyType(@Body RequestBody body);
37
38     @Headers({
39         "Accept: application/json",
40         "Content-Type: application/json"
41     })
42     @POST("/policy/api/v1/policytypes/{policyType}/versions/{policyTypeVersion}/policies")
43     Call<ResponseBody> createPolicy(@Path("policyType") String policyType,
44         @Path("policyTypeVersion") String policyTypeVersion, @Body RequestBody body);
45
46     @Headers({
47         "Accept: application/json",
48         "Content-Type: application/json"
49     })
50     @POST("/policy/pap/v1/pdps/policies")
51     Call<ResponseBody> deployPolicy(@Body RequestBody body);
52
53     @Headers({
54         "Accept: application/json",
55         "Content-Type: application/json"
56     })
57     @DELETE("/policy/pap/v1/pdps/policies/{policyName}")
58     Call<ResponseBody> undeployPolicy(@Path("policyName") String policyName);
59
60     @Headers({
61         "Accept: application/json",
62         "Content-Type: application/json"
63     })
64     @DELETE("/policy/api/v1/policies/{policyName}/versions/{policyVersion}")
65     Call<ResponseBody> removePolicy(@Path("policyName") String policyName, @Path("policyVersion") String policyVersion);
66
67     @Headers({
68         "Accept: application/json",
69         "Content-Type: application/json"
70     })
71     @GET(
72         "/policy/api/v1/policytypes/{policyType}/versions/{policyTypeVersion}/policies/{policyName}/versions/{policyVersion}")
73     Call<ResponseBody> getPolicy(@Path("policyType") String policyType,
74         @Path("policyTypeVersion") String policyTypeVersion, @Path("policyName") String policyName,
75         @Path("policyVersion") String policyVersion);
76
77 }