use of org.wso2.ei.dashboard.core.rest.model.Artifacts in project carbon-business-process by wso2.
the class BPELUploader method uploadService.
public void uploadService(UploadedFileItem[] fileItems) throws AxisFault {
// First lets filter for jar resources
ConfigurationContext configurationContext = getConfigContext();
String repo = configurationContext.getAxisConfiguration().getRepository().getPath();
if (CarbonUtils.isURL(repo)) {
throw new AxisFault("URL Repositories are not supported: " + repo);
}
// Writting the artifacts to the proper location
String bpelDirectory = repo + File.separator + BPELConstants.BPEL_REPO_DIRECTORY;
String bpelTemp = CarbonUtils.getCarbonHome() + BPELConstants.BPEL_PACKAGE_TEMP_DIRECTORY;
File bpelTempDir = new File(bpelTemp);
if (!bpelTempDir.exists() && !bpelTempDir.mkdirs()) {
throw new AxisFault("Fail to create the directory: " + bpelTempDir.getAbsolutePath());
}
File bpelDir = new File(bpelDirectory);
if (!bpelDir.exists() && !bpelDir.mkdirs()) {
throw new AxisFault("Fail to create the directory: " + bpelDir.getAbsolutePath());
}
for (UploadedFileItem uploadedFile : fileItems) {
String fileName = uploadedFile.getFileName();
if (fileName == null || fileName.equals("")) {
throw new AxisFault("Invalid file name. File name is not available");
}
if (uploadedFile.getFileType().equals(BPELConstants.BPEL_PACKAGE_EXTENSION)) {
try {
writeResource(uploadedFile.getDataHandler(), bpelTemp, fileName, bpelDir);
} catch (IOException e) {
throw new AxisFault("IOError: Writing resource failed.", e);
}
} else {
throw new AxisFault("Invalid file type : " + uploadedFile.getFileType() + " ." + BPELConstants.BPEL_PACKAGE_EXTENSION + " file type is expected");
}
}
}
use of org.wso2.ei.dashboard.core.rest.model.Artifacts in project product-mi-tooling by wso2.
the class GroupsApi method getTasksByNodeIds.
@GET
@Path("/{group-id}/tasks")
@Produces({ "application/json" })
@Operation(summary = "Get tasks by node ids", description = "", tags = { "tasks" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of tasks deployed in provided nodes", content = @Content(schema = @Schema(implementation = Artifacts.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response getTasksByNodeIds(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @NotNull @QueryParam("nodes") @Parameter(description = "ID/IDs of the nodes") List<String> nodes) {
TasksDelegate tasksDelegate = new TasksDelegate();
Artifacts tasksList = tasksDelegate.getArtifactsList(groupId, nodes);
Response.ResponseBuilder responseBuilder = Response.ok().entity(tasksList);
HttpUtils.setHeaders(responseBuilder);
return responseBuilder.build();
}
use of org.wso2.ei.dashboard.core.rest.model.Artifacts in project product-mi-tooling by wso2.
the class GroupsApi method getApisByNodeIds.
@GET
@Path("/{group-id}/apis")
@Produces({ "application/json" })
@Operation(summary = "Get APIs by node ids", description = "", tags = { "apis" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of APIs deployed in provided nodes", content = @Content(schema = @Schema(implementation = Artifacts.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response getApisByNodeIds(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @NotNull @QueryParam("nodes") @Parameter(description = "ID/IDs of the nodes") List<String> nodes) {
ApisDelegate apisDelegate = new ApisDelegate();
Artifacts apiList = apisDelegate.getArtifactsList(groupId, nodes);
Response.ResponseBuilder responseBuilder = Response.ok().entity(apiList);
HttpUtils.setHeaders(responseBuilder);
return responseBuilder.build();
}
use of org.wso2.ei.dashboard.core.rest.model.Artifacts in project product-mi-tooling by wso2.
the class HeartBeatDelegate method deleteAllNodeData.
private void deleteAllNodeData(String productName, HeartbeatObject heartbeat) {
logger.info("Deleting all artifacts and server information in node : " + heartbeat.getNodeId() + " in group: " + heartbeat.getGroupId());
ArtifactsManager artifactsManager = getArtifactManager(productName, heartbeat);
artifactsManager.runDeleteAllExecutorService();
}
use of org.wso2.ei.dashboard.core.rest.model.Artifacts in project product-mi-tooling by wso2.
the class GroupsApi method getProxyServicesByNodeIds.
@GET
@Path("/{group-id}/proxy-services")
@Produces({ "application/json" })
@Operation(summary = "Get proxy services by node ids", description = "", tags = { "proxyServices" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of proxy services deployed in provided nodes", content = @Content(schema = @Schema(implementation = Artifacts.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response getProxyServicesByNodeIds(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @NotNull @QueryParam("nodes") @Parameter(description = "ID/IDs of the nodes") List<String> nodes) {
ProxyServiceDelegate proxyServiceDelegate = new ProxyServiceDelegate();
Artifacts proxyList = proxyServiceDelegate.getArtifactsList(groupId, nodes);
Response.ResponseBuilder responseBuilder = Response.ok().entity(proxyList);
HttpUtils.setHeaders(responseBuilder);
return responseBuilder.build();
}
Aggregations