*/
package org.onap.aai.sa.rest;
+import java.security.cert.X509Certificate;
+import javax.security.auth.x500.X500Principal;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import org.onap.aai.sa.auth.SearchDbServiceAuth;
import org.onap.aai.sa.rest.ApiUtils.Action;
import org.onap.aai.sa.searchdbabstraction.elasticsearch.dao.DocumentStoreInterface;
import org.springframework.http.ResponseEntity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.*;
-
-import javax.security.auth.x500.X500Principal;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.security.cert.X509Certificate;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
@Component
@EnableWebSecurity
}
@RequestMapping(value = "/indexes/{index}/documents/{id}",
- method = RequestMethod.GET,
- consumes = {"application/json"})
+ method = RequestMethod.GET)
public ResponseEntity<String> processGetDocument(HttpServletRequest request,
HttpServletResponse httpResponse,
@RequestHeader HttpHeaders headers,
}
@RequestMapping(value = "/indexes/{index}/query/{queryText}",
- method = RequestMethod.GET,
- consumes = {"application/json"})
+ method = RequestMethod.GET)
public ResponseEntity<String> processInlineQuery(HttpServletRequest request,
@RequestHeader HttpHeaders headers,
@PathVariable ("index") String index,
@RequestMapping(value = "/bulk",
method = RequestMethod.POST,
- consumes = {"application/json"})
+ consumes = {"application/json"},
+ produces = { "application/json"})
public ResponseEntity<String> processBulkRequest(@RequestBody String requestBody,
HttpServletRequest request,
@RequestHeader HttpHeaders headers) {