Commit 22c6117e authored by Spiros Koulouzis's avatar Spiros Koulouzis

removed accept headers

parent a7f2ee92
......@@ -47,7 +47,7 @@ public class CredentialApiController implements CredentialApi {
public ResponseEntity<String> createCredentials(@ApiParam(
value = "Created user object", required = true)
@Valid @RequestBody Credential body) {
String accept = request.getHeader("Accept");
// String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("application/json")) {
try {
String id = credentialService.save(body);
......@@ -63,7 +63,7 @@ public class CredentialApiController implements CredentialApi {
@Override
public ResponseEntity<List<String>> getCredentialIDs() {
String accept = request.getHeader("Accept");
// String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("application/json")) {
List<String> ids = credentialService.getAllIds();
return new ResponseEntity<>(ids, HttpStatus.OK);
......
......@@ -40,8 +40,8 @@ public class DeployerApiController implements DeployerApi {
@ApiParam(value = "ID of topolog template to deploy", required = true)
@PathVariable("id") String id) {
String accept = request.getHeader("Accept");
if (accept != null && accept.contains("")) {
// String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("")) {
try {
String planedYemplateId = dripService.deploy(id, null);
return new ResponseEntity<>(planedYemplateId, HttpStatus.OK);
......@@ -51,9 +51,9 @@ public class DeployerApiController implements DeployerApi {
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
} else {
return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE);
}
// } else {
// return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE);
// }
}
}
......@@ -40,8 +40,8 @@ public class PlannerApiController implements PlannerApi {
public ResponseEntity<String> planToscaTemplateByID(@ApiParam(
value = "ID of topolog template to plan", required = true)
@PathVariable("id") String id) {
String accept = request.getHeader("Accept");
if (accept != null && accept.contains("text/plain")) {
// String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("text/plain")) {
try {
String planedYemplateId = dripService.plan(id);
......@@ -51,9 +51,9 @@ public class PlannerApiController implements PlannerApi {
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
} else {
return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE);
}
// } else {
// return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE);
// }
}
......
......@@ -45,8 +45,8 @@ public class ProvisionerApiController implements ProvisionerApi {
public ResponseEntity<String> provisionPlanToscaTemplateByID(
@ApiParam(value = "ID of topolog template to provision", required = true)
@PathVariable("id") String id) {
String accept = request.getHeader("Accept");
if (accept != null && accept.contains("text/plain")) {
// String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("text/plain")) {
try {
String planedYemplateId = dripService.provision(id);
return new ResponseEntity<>(planedYemplateId, HttpStatus.OK);
......@@ -57,9 +57,9 @@ public class ProvisionerApiController implements ProvisionerApi {
java.util.logging.Logger.getLogger(ProvisionerApiController.class.getName()).log(Level.SEVERE, null, ex);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(ex.getMessage());
}
} else {
return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE);
}
// } else {
// return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE);
// }
}
}
......@@ -52,7 +52,7 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
@ApiParam(value = "ID of topology template to return", required = true)
@PathVariable("id") String id, @ApiParam(value = "The node(s) to delete")
@Valid @RequestParam(value = "node_names", required = false) List<String> nodeName) {
String accept = request.getHeader("Accept");
// String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("text/plain")) {
try {
dripService.delete(id, nodeName);
......@@ -70,9 +70,8 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
@Override
public ResponseEntity<String> getToscaTemplateByID(@ApiParam(value = "ID of topolog template to return", required = true) @PathVariable("id") String id) {
String accept = request.getHeader("Accept");
// String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("text/plain")) {
try {
String ymlStr = toscaTemplateService.findByID(id);
return new ResponseEntity<>(ymlStr, HttpStatus.OK);
......@@ -92,7 +91,7 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
value = "ID of topolog template to return", required = true)
@PathVariable("id") String id, @ApiParam(value = "file detail")
@Valid @RequestPart("file") MultipartFile file) {
String accept = request.getHeader("Accept");
// String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("text/plain")) {
try {
id = toscaTemplateService.updateToscaTemplateByID(id, file);
......@@ -109,7 +108,7 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
@Override
public ResponseEntity<String> uploadToscaTemplate(@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) {
String accept = request.getHeader("Accept");
// String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("*/*")) {
try {
String id = toscaTemplateService.saveFile(file);
......@@ -127,7 +126,7 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
@Override
public ResponseEntity<List<String>> getToscaTemplateIDs() {
String accept = request.getHeader("Accept");
// String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("application/json")) {
List<String> ids = toscaTemplateService.getAllIds();
return new ResponseEntity<>(ids, HttpStatus.NOT_IMPLEMENTED);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment