2 * Copyright 2022 Huawei Technologies Co., Ltd.
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.
17 package org.onap.usecaseui.intentanalysis.adapters.policy.apicall;
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;
29 public interface PolicyAPICall {
32 "Accept: application/json",
33 "Content-Type: application/json"
35 @POST("/policy/api/v1/policytypes")
36 Call<ResponseBody> createPolicyType(@Body RequestBody body);
39 "Accept: application/json",
40 "Content-Type: application/json"
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);
47 "Accept: application/json",
48 "Content-Type: application/json"
50 @POST("/policy/pap/v1/pdps/policies")
51 Call<ResponseBody> deployPolicy(@Body RequestBody body);
54 "Accept: application/json",
55 "Content-Type: application/json"
57 @DELETE("/policy/pap/v1/pdps/policies/{policyName}")
58 Call<ResponseBody> undeployPolicy(@Path("policyName") String policyName);
61 "Accept: application/json",
62 "Content-Type: application/json"
64 @DELETE("/policy/api/v1/policies/{policyName}/versions/{policyVersion}")
65 Call<ResponseBody> removePolicy(@Path("policyName") String policyName, @Path("policyVersion") String policyVersion);
68 "Accept: application/json",
69 "Content-Type: application/json"
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);