import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
/**
* @author Waqas Ikram (waqas.ikram@est.tech)
*
*/
-@RestController
+@Controller
@RequestMapping(path = CATALOG_URL)
public class CatalogController {
private static final Logger LOGGER = LoggerFactory.getLogger(CatalogController.class);
this.resourceProvider = resourceProvider;
}
+ @GetMapping(value = "/resources", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public ResponseEntity<?> getResources() {
+ LOGGER.info("Running getResources ...");
+ return ResponseEntity.ok().body(resourceProvider.getResource());
+ }
+
@GetMapping(value = "/resources/{csarId}/toscaModel", produces = MediaType.APPLICATION_OCTET_STREAM)
public ResponseEntity<byte[]> getCsar(@PathVariable("csarId") final String csarId) {
LOGGER.info("Running getCsar for {} ...", csarId);