2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 * NOTE: This class is auto generated by the swagger code generator program (3.0.8).
22 * https://github.com/swagger-api/swagger-codegen
23 * Do not edit the class manually.
25 package org.onap.nearric.simulator.controller;
27 import org.oransc.ric.a1med.api.model.InlineResponse200;
28 import org.oransc.ric.a1med.api.model.PolicyTypeSchema;
29 import io.swagger.annotations.*;
30 import org.springframework.http.ResponseEntity;
31 import org.springframework.validation.annotation.Validated;
32 import org.springframework.web.bind.annotation.PathVariable;
33 import org.springframework.web.bind.annotation.RequestBody;
34 import org.springframework.web.bind.annotation.RequestHeader;
35 import org.springframework.web.bind.annotation.RequestMapping;
36 import org.springframework.web.bind.annotation.RequestMethod;
37 import org.springframework.web.bind.annotation.RequestParam;
38 import org.springframework.web.bind.annotation.RequestPart;
39 import org.springframework.web.multipart.MultipartFile;
41 import javax.validation.Valid;
42 import javax.validation.constraints.*;
43 import java.util.List;
45 @javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-10-04T13:41:42.802+01:00[Europe/Dublin]")
46 @Api(value = "a1-p", description = "the a1-p API")
47 public interface A1PApi {
49 @ApiOperation(value = "", nickname = "a1ControllerCreateOrReplacePolicyInstance", notes = "Create or replace a policy instance of type policy_type_id. The schema of the PUT body is defined by the create_schema field of the policy type. ", tags={ "A1 Mediator", })
50 @ApiResponses(value = {
51 @ApiResponse(code = 201, message = "Policy instance created "),
52 @ApiResponse(code = 400, message = "Bad PUT body for this policy instance "),
53 @ApiResponse(code = 404, message = "There is no policy type with this policy_type_id ") })
54 @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}",
55 consumes = { "application/json" },
56 method = RequestMethod.PUT)
57 ResponseEntity<Void> a1ControllerCreateOrReplacePolicyInstance(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId,@ApiParam(value = "" ) @Valid @RequestBody Object body);
60 @ApiOperation(value = "", nickname = "a1ControllerCreatePolicyType", notes = "Create a new policy type . Replace is not currently allowed; to replace, for now do a DELETE and then a PUT again. ", tags={ "A1 Mediator", })
61 @ApiResponses(value = {
62 @ApiResponse(code = 201, message = "policy type successfully created"),
63 @ApiResponse(code = 400, message = "illegal ID, or object already existed") })
64 @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}",
65 consumes = { "application/json" },
66 method = RequestMethod.PUT)
67 ResponseEntity<Void> a1ControllerCreatePolicyType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "" ) @Valid @RequestBody PolicyTypeSchema body);
70 @ApiOperation(value = "", nickname = "a1ControllerDeletePolicyInstance", notes = "Delete this policy instance ", tags={ "A1 Mediator", })
71 @ApiResponses(value = {
72 @ApiResponse(code = 204, message = "policy instance successfully deleted "),
73 @ApiResponse(code = 404, message = "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id ") })
74 @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}",
75 method = RequestMethod.DELETE)
76 ResponseEntity<Void> a1ControllerDeletePolicyInstance(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId);
79 @ApiOperation(value = "", nickname = "a1ControllerDeletePolicyType", notes = "Delete this policy type. Can only be performed if there are no instances of this type ", tags={ "A1 Mediator", })
80 @ApiResponses(value = {
81 @ApiResponse(code = 204, message = "policy type successfully deleted "),
82 @ApiResponse(code = 400, message = "Policy type cannot be deleted because there are instances All instances must be removed before a policy type can be deleted "),
83 @ApiResponse(code = 404, message = "policy type not found ") })
84 @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}",
85 method = RequestMethod.DELETE)
86 ResponseEntity<Void> a1ControllerDeletePolicyType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId);
89 @ApiOperation(value = "", nickname = "a1ControllerGetAllInstancesForType", notes = "get a list of all policy instance ids for this policy type id", response = String.class, responseContainer = "List", tags={ "A1 Mediator", })
90 @ApiResponses(value = {
91 @ApiResponse(code = 200, message = "list of all policy instance ids for this policy type id", response = String.class, responseContainer = "List") })
92 @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}/policies",
93 produces = { "application/json" },
94 method = RequestMethod.GET)
95 ResponseEntity<List<String>> a1ControllerGetAllInstancesForType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId);
98 @ApiOperation(value = "", nickname = "a1ControllerGetAllPolicyTypes", notes = "Get a list of all registered policy type ids", response = Integer.class, responseContainer = "List", tags={ "A1 Mediator", })
99 @ApiResponses(value = {
100 @ApiResponse(code = 200, message = "list of all registered policy type ids", response = Integer.class, responseContainer = "List") })
101 @RequestMapping(value = "/a1-p/policytypes/",
102 produces = { "application/json" },
103 method = RequestMethod.GET)
104 ResponseEntity<List<Integer>> a1ControllerGetAllPolicyTypes();
107 @ApiOperation(value = "", nickname = "a1ControllerGetHealthcheck", notes = "Perform a healthcheck on a1 ", tags={ "A1 Mediator", })
108 @ApiResponses(value = {
109 @ApiResponse(code = 200, message = "A1 is healthy. Anything other than a 200 should be considered a1 as failing ") })
110 @RequestMapping(value = "/a1-p/healthcheck",
111 method = RequestMethod.GET)
112 ResponseEntity<Void> a1ControllerGetHealthcheck();
115 @ApiOperation(value = "", nickname = "a1ControllerGetPolicyInstance", notes = "Retrieve the policy instance ", response = Object.class, tags={ "A1 Mediator", })
116 @ApiResponses(value = {
117 @ApiResponse(code = 200, message = "The policy instance. the schema of this object is defined by the create_schema field of the policy type ", response = Object.class),
118 @ApiResponse(code = 404, message = "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id ") })
119 @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}",
120 produces = { "application/json" },
121 method = RequestMethod.GET)
122 ResponseEntity<Object> a1ControllerGetPolicyInstance(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId);
125 @ApiOperation(value = "", nickname = "a1ControllerGetPolicyInstanceStatus", notes = "Retrieve the policy instance status across all handlers of the policy ", response = InlineResponse200.class, responseContainer = "List", tags={ "A1 Mediator", })
126 @ApiResponses(value = {
127 @ApiResponse(code = 200, message = "The policy instance status. Returns a vector of statuses, where each contains a handler_id (opaque id of a RIC component that implements this policy) and the policy status as returned by that handler ", response = InlineResponse200.class, responseContainer = "List"),
128 @ApiResponse(code = 404, message = "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id ") })
129 @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}/status",
130 produces = { "application/json" },
131 method = RequestMethod.GET)
132 ResponseEntity<List<InlineResponse200>> a1ControllerGetPolicyInstanceStatus(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId);
135 @ApiOperation(value = "", nickname = "a1ControllerGetPolicyType", notes = "Get this policy type ", response = PolicyTypeSchema.class, tags={ "A1 Mediator", })
136 @ApiResponses(value = {
137 @ApiResponse(code = 200, message = "policy type successfully found", response = PolicyTypeSchema.class),
138 @ApiResponse(code = 404, message = "policy type not found ") })
139 @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}",
140 produces = { "application/json" },
141 method = RequestMethod.GET)
142 ResponseEntity<PolicyTypeSchema> a1ControllerGetPolicyType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId);