+ @GetMapping(value = "/resources/{csarId}/metadata",
+ produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public ResponseEntity<Metadata> getResourceMetadata(@PathVariable("csarId") final String csarId) {
+ LOGGER.info("Running getResourceMetadata for {} ...", csarId);
+ final Optional<Metadata> resource = resourceProvider.getMetadata(csarId, AssetType.RESOURCES);
+ if (resource.isPresent()) {
+ return new ResponseEntity<>(resource.get(), HttpStatus.OK);
+ }
+ LOGGER.error("Unable to find metadata for csarId: {}", csarId);
+
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+
+
+ @GetMapping(value = "/services", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public ResponseEntity<?> getServices() {
+ LOGGER.info("Running getServices ...");
+ return ResponseEntity.ok().body(resourceProvider.getAssetInfo(AssetType.SERVICES));
+ }
+
+ @GetMapping(value = "/services/{csarId}/metadata",
+ produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public ResponseEntity<Metadata> getServiceMetadata(@PathVariable("csarId") final String csarId) {
+ LOGGER.info("Running getServiceMetadata for {} ...", csarId);
+ final Optional<Metadata> resource = resourceProvider.getMetadata(csarId, AssetType.SERVICES);
+ if (resource.isPresent()) {
+ return new ResponseEntity<>(resource.get(), HttpStatus.OK);
+ }
+ LOGGER.error("Unable to find metadata for csarId: {}", csarId);
+
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+
+