function deleteNe(rowId, row) {
var instanceId = row.serviceId;
var serviceType = row.serviceType;
- var gatewayService = '/openoapi/servicegateway/v1/services';
+ var gatewayService = '/openoapi/servicegateway/v1/services/' + instanceId + '/terminate';
var remove = function () {
$('#sai').bootstrapTable('remove', {field: 'serviceId', values: [instanceId]});
};
'gatewayUri': instanceUri
};
return $.ajax({
- type: "DELETE",
+ type: "POST",
url: gatewayService,
contentType: "application/json",
dataType: "json",
'gatewayUri': nsTerminateUri
};
return $.ajax({
- type: "DELETE",
+ type: "POST",
url: gatewayService,
contentType: "application/json",
dataType: "json",
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
* @throws ServiceException when operate database or parameter is wrong.
* @since GSO 0.5
*/
- @DELETE
+ @POST
@Produces({"application/json"})
@Consumes({"application/json"})
- @Path("/{serviceId}")
+ @Path("/{serviceId}/terminate")
Response deleteService(@PathParam("serviceId") String serviceId, @Context HttpServletRequest servletReq)
throws ServiceException;
// Parse request
String reqContent = RestUtils.getRequestBody(httpRequest);
Map<String, Object> requestBody = JsonUtil.unMarshal(reqContent, Map.class);
- Map<String, Object> service = (Map<String, Object>)requestBody.get(Constant.SERVICE_INDENTIFY);
- if(null == service)
- {
- service = requestBody;
- }
ValidateUtil.assertObjectNotNull(requestBody);
// Validate data
- String gatewayUri = (String)service.get(Constant.SERVICE_GATEWAY_URI);
+ String gatewayUri = (String)requestBody.get(Constant.SERVICE_GATEWAY_URI);
ValidateUtil.assertStringNotNull(gatewayUri);
- service.remove(Constant.SERVICE_GATEWAY_URI);
+ requestBody.remove(Constant.SERVICE_GATEWAY_URI);
- String operation = (String) service.get(Constant.SERVICE_OPERATION);
+ String operation = (String) requestBody.get(Constant.SERVICE_OPERATION);
ValidateUtil.assertStringNotNull(operation);
- service.remove(Constant.SERVICE_OPERATION);
+ requestBody.remove(Constant.SERVICE_OPERATION);
// call the restful
try {