Removing deployed from policy/api
[policy/api.git] / main / src / main / java / org / onap / policy / api / main / rest / ApiRestController.java
index f9eff4c..60ccba0 100644 (file)
@@ -36,11 +36,7 @@ import io.swagger.annotations.Info;
 import io.swagger.annotations.ResponseHeader;\r
 import io.swagger.annotations.SecurityDefinition;\r
 import io.swagger.annotations.SwaggerDefinition;\r
-\r
-import java.util.List;\r
-import java.util.Map;\r
 import java.util.UUID;\r
-\r
 import javax.ws.rs.Consumes;\r
 import javax.ws.rs.DELETE;\r
 import javax.ws.rs.GET;\r
@@ -50,8 +46,6 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;\r
 import javax.ws.rs.Produces;\r
 import javax.ws.rs.core.Response;\r
-\r
-import org.apache.commons.lang3.tuple.Pair;\r
 import org.onap.policy.api.main.rest.provider.HealthCheckProvider;\r
 import org.onap.policy.api.main.rest.provider.PolicyProvider;\r
 import org.onap.policy.api.main.rest.provider.PolicyTypeProvider;\r
@@ -62,7 +56,6 @@ import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
 import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;\r
 import org.onap.policy.models.base.PfModelException;\r
 import org.onap.policy.models.base.PfModelRuntimeException;\r
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;\r
 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
@@ -695,62 +688,6 @@ public class ApiRestController extends CommonRestController {
         }\r
     }\r
 \r
-    /**\r
-     * Retrieves deployed versions of a particular policy in PDP groups.\r
-     *\r
-     * @param policyTypeId the ID of specified policy type\r
-     * @param policyTypeVersion the version of specified policy type\r
-     * @param policyId the ID of specified policy\r
-     *\r
-     * @return the Response object containing the results of the API operation\r
-     */\r
-    @GET\r
-    @Path("/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/deployed")\r
-    @ApiOperation(value = "Retrieve deployed versions of a particular policy in pdp groups",\r
-            notes = "Returns deployed versions of specified policy in pdp groups", response = ToscaPolicy.class,\r
-            responseContainer = "List",\r
-            responseHeaders = {\r
-                @ResponseHeader(name = "X-MinorVersion",\r
-                        description = "Used to request or communicate a MINOR version back from the client"\r
-                                + " to the server, and from the server back to the client",\r
-                        response = String.class),\r
-                @ResponseHeader(name = "X-PatchVersion",\r
-                        description = "Used only to communicate a PATCH version in a response for"\r
-                                + " troubleshooting purposes only, and will not be provided by"\r
-                                + " the client on request",\r
-                        response = String.class),\r
-                @ResponseHeader(name = "X-LatestVersion",\r
-                        description = "Used only to communicate an API's latest version", response = String.class),\r
-                @ResponseHeader(name = "X-ONAP-RequestID",\r
-                        description = "Used to track REST transactions for logging purpose", response = UUID.class)},\r
-            authorizations = @Authorization(value = "basicAuth"), tags = {"Policy",},\r
-            extensions = {@Extension(name = "interface info",\r
-                    properties = {@ExtensionProperty(name = "api-version", value = "1.0.0"),\r
-                        @ExtensionProperty(name = "last-mod-release", value = "Dublin")})})\r
-    @ApiResponses(value = {@ApiResponse(code = 401, message = "Authentication Error"),\r
-        @ApiResponse(code = 403, message = "Authorization Error"),\r
-        @ApiResponse(code = 404, message = "Resource Not Found"),\r
-        @ApiResponse(code = 500, message = "Internal Server Error")})\r
-    public Response getDeployedVersionsOfPolicy(\r
-            @PathParam("policyTypeId") @ApiParam(value = "ID of policy type", required = true) String policyTypeId,\r
-            @PathParam("policyTypeVersion") @ApiParam(value = "Version of policy type",\r
-                    required = true) String policyTypeVersion,\r
-            @PathParam("policyId") @ApiParam(value = "ID of policy", required = true) String policyId,\r
-            @HeaderParam("X-ONAP-RequestID") @ApiParam("RequestID for http transaction") UUID requestId) {\r
-\r
-        try (PolicyProvider policyProvider = new PolicyProvider()) {\r
-            Map<Pair<String, String>, List<ToscaPolicy>> deployedPolicies =\r
-                    policyProvider.fetchDeployedPolicies(policyTypeId, policyTypeVersion, policyId);\r
-            updateApiStatisticsCounter(Target.POLICY, Result.SUCCESS, HttpMethod.GET);\r
-            return makeOkResponse(requestId, deployedPolicies);\r
-        } catch (PfModelException | PfModelRuntimeException pfme) {\r
-            LOGGER.debug("GET /policytypes/{}/versions/{}/policies/{}/versions/deployed", policyTypeId,\r
-                    policyTypeVersion, policyId, pfme);\r
-            updateApiStatisticsCounter(Target.POLICY, Result.FAILURE, HttpMethod.GET);\r
-            return makeErrorResponse(requestId, pfme);\r
-        }\r
-    }\r
-\r
     /**\r
      * Creates a new policy for a particular policy type and version.\r
      *\r