Commit cf85aed9 authored by Spiros Koulouzis's avatar Spiros Koulouzis

simplify api. We use only one controller/service/dao for tosca

parent a772559e
...@@ -33,37 +33,6 @@ public interface DeployerApi { ...@@ -33,37 +33,6 @@ public interface DeployerApi {
ResponseEntity<String> deployProvisionToscaTemplateByID(@ApiParam(value = "ID of topolog template to deploy",required=true) @PathVariable("id") String id); ResponseEntity<String> deployProvisionToscaTemplateByID(@ApiParam(value = "ID of topolog template to deploy",required=true) @PathVariable("id") String id);
@ApiOperation(value = "get the deployment topolog template", nickname = "getDeployToscaTemplateByID", notes = "Returns the deployment topolog template", response = String.class, authorizations = {
@Authorization(value = "drip_auth", scopes = {
@AuthorizationScope(scope = "read:ToscaTemplate", description = "read your topolog template"),
@AuthorizationScope(scope = "write:ToscaTemplate", description = "modify topolog template in your account")
})
}, tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "ToscaTemplate not found"),
@ApiResponse(code = 405, message = "Invalid input") })
@RequestMapping(value = "/deployer/{id}",
produces = { "text/plain" },
method = RequestMethod.GET)
ResponseEntity<String> getDeployToscaTemplateByID(@ApiParam(value = "ID of topolog template to deploy",required=true) @PathVariable("id") String id);
@ApiOperation(value = "Get all topolog template IDs", nickname = "getDeployedToscaTemplateIDs", notes = "Returns all IDss ", response = String.class, responseContainer = "List", authorizations = {
@Authorization(value = "drip_auth", scopes = {
@AuthorizationScope(scope = "read:ToscaTemplate", description = "read your topolog template"),
@AuthorizationScope(scope = "write:ToscaTemplate", description = "modify topolog template in your account")
})
}, tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = String.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "ToscaTemplate not found"),
@ApiResponse(code = 405, message = "Invalid input") })
@RequestMapping(value = "/deployer/ids",
produces = { "application/json" },
method = RequestMethod.GET)
ResponseEntity<List<String>> getDeployedToscaTemplateIDs();
} }
...@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-10T17:15:46.465Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-10T17:15:46.465Z")
@Controller @Controller
...@@ -28,37 +29,17 @@ public class DeployerApiController implements DeployerApi { ...@@ -28,37 +29,17 @@ public class DeployerApiController implements DeployerApi {
this.request = request; this.request = request;
} }
public ResponseEntity<String> deployProvisionToscaTemplateByID(@ApiParam(value = "ID of topolog template to deploy",required=true) @PathVariable("id") String id) { @Override
String accept = request.getHeader("Accept"); public ResponseEntity<String> deployProvisionToscaTemplateByID(@ApiParam(value = "ID of topolog template to deploy", required = true) @PathVariable("id") String id) {
if (accept != null && accept.contains("")) {
try {
return new ResponseEntity<String>(objectMapper.readValue("", String.class), HttpStatus.NOT_IMPLEMENTED);
} catch (IOException e) {
log.error("Couldn't serialize response for content type ", e);
return new ResponseEntity<String>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
return new ResponseEntity<String>(HttpStatus.NOT_IMPLEMENTED);
}
public ResponseEntity<String> getDeployToscaTemplateByID(@ApiParam(value = "ID of topolog template to deploy",required=true) @PathVariable("id") String id) {
String accept = request.getHeader("Accept"); String accept = request.getHeader("Accept");
if (accept != null && accept.contains("")) { if (accept != null && accept.contains("")) {
try { try {
return new ResponseEntity<String>(objectMapper.readValue("", String.class), HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(objectMapper.readValue("", String.class), HttpStatus.NOT_IMPLEMENTED);
} catch (IOException e) { } catch (IOException e) {
log.error("Couldn't serialize response for content type ", e); log.error("Couldn't serialize response for content type ", e);
return new ResponseEntity<String>(HttpStatus.INTERNAL_SERVER_ERROR); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
} }
return new ResponseEntity<String>(HttpStatus.NOT_IMPLEMENTED);
} }
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@Override
public ResponseEntity<List<String>> getDeployedToscaTemplateIDs() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} }
} }
...@@ -16,39 +16,8 @@ import java.util.List; ...@@ -16,39 +16,8 @@ import java.util.List;
@Api(value = "planner", description = "the planner API") @Api(value = "planner", description = "the planner API")
public interface PlannerApi { public interface PlannerApi {
@ApiOperation(value = "get the plan tosca template", nickname = "getPlanToscaTemplateByID", notes = "Returns the plan topolog template", response = String.class, authorizations = {
@Authorization(value = "drip_auth", scopes = {
@AuthorizationScope(scope = "read:ToscaTemplate", description = "read your topolog template"),
@AuthorizationScope(scope = "write:ToscaTemplate", description = "modify topolog template in your account")
})
}, tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "ToscaTemplate not found"),
@ApiResponse(code = 405, message = "Invalid input") })
@RequestMapping(value = "/planner/{id}",
produces = { "text/plain" },
method = RequestMethod.GET)
ResponseEntity<String> getPlanToscaTemplateByID(@ApiParam(value = "ID of topolog template plan",required=true) @PathVariable("id") String id);
@ApiOperation(value = "Get all topolog template IDs", nickname = "getPlanToscaTemplateIDs", notes = "Returns all IDss ", response = String.class, responseContainer = "List", authorizations = {
@Authorization(value = "drip_auth", scopes = {
@AuthorizationScope(scope = "read:ToscaTemplate", description = "read your topolog template"),
@AuthorizationScope(scope = "write:ToscaTemplate", description = "modify topolog template in your account")
})
}, tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = String.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "ToscaTemplate not found"),
@ApiResponse(code = 405, message = "Invalid input") })
@RequestMapping(value = "/planner/ids",
produces = { "application/json" },
method = RequestMethod.GET)
ResponseEntity<List<String>> getPlanToscaTemplateIDs();
@ApiOperation(value = "plan tosca template", nickname = "planToscaTemplateByID", notes = "Returns the ID of the planed topolog template", response = String.class, authorizations = { @ApiOperation(value = "plan tosca template", nickname = "planToscaTemplateByID", notes = "Returns the ID of the planed topolog template", response = String.class, authorizations = {
@Authorization(value = "drip_auth", scopes = { @Authorization(value = "drip_auth", scopes = {
......
...@@ -11,6 +11,9 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -11,6 +11,9 @@ import org.springframework.web.bind.annotation.PathVariable;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import nl.uva.sne.drip.service.PlannerService;
import nl.uva.sne.drip.service.ToscaTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-10T17:15:46.465Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-10T17:15:46.465Z")
@Controller @Controller
...@@ -22,25 +25,21 @@ public class PlannerApiController implements PlannerApi { ...@@ -22,25 +25,21 @@ public class PlannerApiController implements PlannerApi {
private final HttpServletRequest request; private final HttpServletRequest request;
@Autowired
private PlannerService plannerService;
@Autowired
private ToscaTemplateService toscaTemplateService;
@org.springframework.beans.factory.annotation.Autowired @org.springframework.beans.factory.annotation.Autowired
public PlannerApiController(ObjectMapper objectMapper, HttpServletRequest request) { public PlannerApiController(ObjectMapper objectMapper, HttpServletRequest request) {
this.objectMapper = objectMapper; this.objectMapper = objectMapper;
this.request = request; this.request = request;
} }
public ResponseEntity<String> getPlanToscaTemplateByID(@ApiParam(value = "ID of topolog template plan",required=true) @PathVariable("id") String id) {
String accept = request.getHeader("Accept");
if (accept != null && accept.contains("")) {
try {
return new ResponseEntity<String>(objectMapper.readValue("", String.class), HttpStatus.NOT_IMPLEMENTED);
} catch (IOException e) {
log.error("Couldn't serialize response for content type ", e);
return new ResponseEntity<String>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
return new ResponseEntity<String>(HttpStatus.NOT_IMPLEMENTED);
}
public ResponseEntity<String> planToscaTemplateByID(@ApiParam(value = "ID of topolog template to plan",required=true) @PathVariable("id") String id) { public ResponseEntity<String> planToscaTemplateByID(@ApiParam(value = "ID of topolog template to plan",required=true) @PathVariable("id") String id) {
String accept = request.getHeader("Accept"); String accept = request.getHeader("Accept");
...@@ -53,12 +52,7 @@ public class PlannerApiController implements PlannerApi { ...@@ -53,12 +52,7 @@ public class PlannerApiController implements PlannerApi {
} }
} }
return new ResponseEntity<String>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@Override
public ResponseEntity<List<String>> getPlanToscaTemplateIDs() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} }
} }
...@@ -16,38 +16,6 @@ import java.util.List; ...@@ -16,38 +16,6 @@ import java.util.List;
@Api(value = "provisioner", description = "the provisioner API") @Api(value = "provisioner", description = "the provisioner API")
public interface ProvisionerApi { public interface ProvisionerApi {
@ApiOperation(value = "the provisioned tosca template", nickname = "getProvisionToscaTemplateByID", notes = "Returns the provisioned tosca template", response = String.class, authorizations = {
@Authorization(value = "drip_auth", scopes = {
@AuthorizationScope(scope = "read:ToscaTemplate", description = "read your topolog template"),
@AuthorizationScope(scope = "write:ToscaTemplate", description = "modify topolog template in your account")
})
}, tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "ToscaTemplate not found"),
@ApiResponse(code = 405, message = "Invalid input") })
@RequestMapping(value = "/provisioner/{id}",
produces = { "text/plain" },
method = RequestMethod.GET)
ResponseEntity<String> getProvisionToscaTemplateByID(@ApiParam(value = "ID of topolog template to plan",required=true) @PathVariable("id") String id);
@ApiOperation(value = "Get all topolog template IDs", nickname = "getProvisionedToscaTemplateIDs", notes = "Returns all IDss ", response = String.class, responseContainer = "List", authorizations = {
@Authorization(value = "drip_auth", scopes = {
@AuthorizationScope(scope = "read:ToscaTemplate", description = "read your topolog template"),
@AuthorizationScope(scope = "write:ToscaTemplate", description = "modify topolog template in your account")
})
}, tags={ })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = String.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "ToscaTemplate not found"),
@ApiResponse(code = 405, message = "Invalid input") })
@RequestMapping(value = "/provisioner/ids",
produces = { "application/json" },
method = RequestMethod.GET)
ResponseEntity<List<String>> getProvisionedToscaTemplateIDs();
@ApiOperation(value = "provision tosca template", nickname = "provisionPlanToscaTemplateByID", notes = "provosions the operationId: Plan Tosca Template Returns the provision ID", response = String.class, authorizations = { @ApiOperation(value = "provision tosca template", nickname = "provisionPlanToscaTemplateByID", notes = "provosions the operationId: Plan Tosca Template Returns the provision ID", response = String.class, authorizations = {
......
...@@ -29,37 +29,23 @@ public class ProvisionerApiController implements ProvisionerApi { ...@@ -29,37 +29,23 @@ public class ProvisionerApiController implements ProvisionerApi {
this.request = request; this.request = request;
} }
public ResponseEntity<String> getProvisionToscaTemplateByID(@ApiParam(value = "ID of topolog template to plan", required = true) @PathVariable("id") String id) {
String accept = request.getHeader("Accept");
if (accept != null && accept.contains("")) {
try {
return new ResponseEntity<String>(objectMapper.readValue("", String.class), HttpStatus.NOT_IMPLEMENTED);
} catch (IOException e) {
log.error("Couldn't serialize response for content type ", e);
return new ResponseEntity<String>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
return new ResponseEntity<String>(HttpStatus.NOT_IMPLEMENTED);
}
public ResponseEntity<String> provisionPlanToscaTemplateByID(@ApiParam(value = "ID of topolog template to plan", required = true) @PathVariable("id") String id) { @Override
public ResponseEntity<String> provisionPlanToscaTemplateByID(
@ApiParam(value = "ID of topolog template to plan", required = true)
@PathVariable("id") String id) {
String accept = request.getHeader("Accept"); String accept = request.getHeader("Accept");
if (accept != null && accept.contains("")) { if (accept != null && accept.contains("")) {
try { try {
return new ResponseEntity<String>(objectMapper.readValue("", String.class), HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(objectMapper.readValue("", String.class), HttpStatus.NOT_IMPLEMENTED);
} catch (IOException e) { } catch (IOException e) {
log.error("Couldn't serialize response for content type ", e); log.error("Couldn't serialize response for content type ", e);
return new ResponseEntity<String>(HttpStatus.INTERNAL_SERVER_ERROR); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
} }
} }
return new ResponseEntity<String>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@Override
public ResponseEntity<List<String>> getProvisionedToscaTemplateIDs() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
} }
} }
...@@ -10,16 +10,13 @@ import org.springframework.http.ResponseEntity; ...@@ -10,16 +10,13 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import javax.validation.Valid; import javax.validation.Valid;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.util.List;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-10T17:15:46.465Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-10T17:15:46.465Z")
@Controller @Controller
...@@ -37,61 +34,73 @@ public class UserApiController implements UserApi { ...@@ -37,61 +34,73 @@ public class UserApiController implements UserApi {
this.request = request; this.request = request;
} }
public ResponseEntity<String> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { @Override
public ResponseEntity<String> createUser(
@ApiParam(value = "Created user object", required = true)
@Valid @RequestBody User body) {
String accept = request.getHeader("Accept"); String accept = request.getHeader("Accept");
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
try { try {
return new ResponseEntity<String>(objectMapper.readValue("\"\"", String.class), HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(objectMapper.readValue("\"\"", String.class), HttpStatus.NOT_IMPLEMENTED);
} catch (IOException e) { } catch (IOException e) {
log.error("Couldn't serialize response for content type application/json", e); log.error("Couldn't serialize response for content type application/json", e);
return new ResponseEntity<String>(HttpStatus.INTERNAL_SERVER_ERROR); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
} }
} }
return new ResponseEntity<String>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
public ResponseEntity<String> userLoginGet(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) { @Override
public ResponseEntity<String> userLoginGet(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password) {
String accept = request.getHeader("Accept"); String accept = request.getHeader("Accept");
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
try { try {
return new ResponseEntity<String>(objectMapper.readValue("\"\"", String.class), HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(objectMapper.readValue("\"\"", String.class), HttpStatus.NOT_IMPLEMENTED);
} catch (IOException e) { } catch (IOException e) {
log.error("Couldn't serialize response for content type application/json", e); log.error("Couldn't serialize response for content type application/json", e);
return new ResponseEntity<String>(HttpStatus.INTERNAL_SERVER_ERROR); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
} }
} }
return new ResponseEntity<String>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@Override
public ResponseEntity<Void> userLogoutGet() { public ResponseEntity<Void> userLogoutGet() {
String accept = request.getHeader("Accept"); String accept = request.getHeader("Accept");
return new ResponseEntity<Void>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
public ResponseEntity<Void> userUsernameDelete(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { @Override
public ResponseEntity<Void> userUsernameDelete(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username) {
String accept = request.getHeader("Accept"); String accept = request.getHeader("Accept");
return new ResponseEntity<Void>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
public ResponseEntity<User> userUsernameGet(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathVariable("username") String username) { @Override
public ResponseEntity<User> userUsernameGet(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ", required = true) @PathVariable("username") String username) {
String accept = request.getHeader("Accept"); String accept = request.getHeader("Accept");
if (accept != null && accept.contains("application/json")) { if (accept != null && accept.contains("application/json")) {
try { try {
return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}", User.class), HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<User>(objectMapper.readValue("{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}", User.class), HttpStatus.NOT_IMPLEMENTED);
} catch (IOException e) { } catch (IOException e) {
log.error("Couldn't serialize response for content type application/json", e); log.error("Couldn't serialize response for content type application/json", e);
return new ResponseEntity<User>(HttpStatus.INTERNAL_SERVER_ERROR); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
} }
} }
return new ResponseEntity<User>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
public ResponseEntity<Void> userUsernamePut(@ApiParam(value = "name that need to be updated",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body) { @Override
public ResponseEntity<Void> userUsernamePut(
@ApiParam(value = "name that need to be updated", required = true)
@PathVariable("username") String username,
@ApiParam(value = "Updated user object", required = true)
@Valid @RequestBody User body) {
String accept = request.getHeader("Accept"); String accept = request.getHeader("Accept");
return new ResponseEntity<Void>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
} }
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package nl.uva.sne.drip.service;
/**
*
* @author S. Koulouzis
*/
public class PlannerService {
}
...@@ -7,24 +7,18 @@ package nl.uva.sne.drip.service; ...@@ -7,24 +7,18 @@ package nl.uva.sne.drip.service;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.SerializationConfig;
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature; import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Optional;
import nl.uva.sne.drip.api.ApiException; import nl.uva.sne.drip.api.ApiException;
import nl.uva.sne.drip.dao.ToscaTemplateDAO; import nl.uva.sne.drip.dao.ToscaTemplateDAO;
import nl.uva.sne.drip.model.ToscaTemplate; import nl.uva.sne.drip.model.ToscaTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import nl.uva.sne.drip.commons.utils.Converter;
import org.springframework.data.domain.Example;
/** /**
* *
......
...@@ -173,58 +173,6 @@ paths: ...@@ -173,58 +173,6 @@ paths:
- drip_auth: - drip_auth:
- "write:ToscaTemplate" - "write:ToscaTemplate"
- "read:ToscaTemplate" - "read:ToscaTemplate"
/planner/ids:
get:
summary: "Get all topolog template IDs"
description: "Returns all IDss "
operationId: "getPlanToscaTemplateIDs"
produces:
- "application/json"
responses:
200:
description: "successful operation"
schema:
type: array
items:
type: string
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/planner/{id}:
get:
summary: "get the plan tosca template"
description: "Returns the plan topolog template"
operationId: "getPlanToscaTemplateByID"
produces:
- "text/plain"
parameters:
- name: "id"
in: "path"
description: "ID of topolog template plan"
required: true
type: "string"
responses:
200:
description: "successful operation"
schema:
type: "string"
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/provisioner/provision/{id}: /provisioner/provision/{id}:
get: get:
summary: "provision tosca template" summary: "provision tosca template"
...@@ -253,58 +201,6 @@ paths: ...@@ -253,58 +201,6 @@ paths:
- drip_auth: - drip_auth:
- "write:ToscaTemplate" - "write:ToscaTemplate"
- "read:ToscaTemplate" - "read:ToscaTemplate"
/provisioner/{id}:
get:
summary: "the provisioned tosca template"
description: "Returns the provisioned tosca template"
operationId: "getProvisionToscaTemplateByID"
produces:
- "text/plain"
parameters:
- name: "id"
in: "path"
description: "ID of topolog template to plan"
required: true
type: "string"
responses:
200:
description: "successful operation"
schema:
type: "string"
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/provisioner/ids:
get:
summary: "Get all topolog template IDs"
description: "Returns all IDss "
operationId: "getProvisionedToscaTemplateIDs"
produces:
- "application/json"
responses:
200:
description: "successful operation"
schema:
type: array
items:
type: string
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/deployer/deploy/{id}: /deployer/deploy/{id}:
get: get:
summary: "deploy the software tosca template" summary: "deploy the software tosca template"
...@@ -333,58 +229,6 @@ paths: ...@@ -333,58 +229,6 @@ paths:
- drip_auth: - drip_auth:
- "write:ToscaTemplate" - "write:ToscaTemplate"
- "read:ToscaTemplate" - "read:ToscaTemplate"
/deployer/{id}:
get:
summary: "get the deployment topolog template"
description: "Returns the deployment topolog template"
operationId: "getDeployToscaTemplateByID"
produces:
- "text/plain"
parameters:
- name: "id"
in: "path"
description: "ID of topolog template to deploy"
required: true
type: "string"
responses:
200:
description: "successful operation"
schema:
type: "string"
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/deployer/ids:
get:
summary: "Get all topolog template IDs"
description: "Returns all IDss "
operationId: "getDeployedToscaTemplateIDs"
produces:
- "application/json"
responses:
200:
description: "successful operation"
schema:
type: array
items:
type: string
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/credential: /credential:
post: post:
summary: "Create credentials" summary: "Create credentials"
......
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