Search in sources :

Example 76 with Artifacts

use of org.wso2.ei.dashboard.core.rest.model.Artifacts in project product-mi-tooling by wso2.

the class GroupsApi method getLocalEntriesByNodeIds.

@GET
@Path("/{group-id}/local-entries")
@Produces({ "application/json" })
@Operation(summary = "Get local entries by node ids", description = "", tags = { "localEntries" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of local entries 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 getLocalEntriesByNodeIds(@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) {
    LocalEntriesDelegate localEntriesDelegate = new LocalEntriesDelegate();
    Artifacts localEntriesList = localEntriesDelegate.getArtifactsList(groupId, nodes);
    Response.ResponseBuilder responseBuilder = Response.ok().entity(localEntriesList);
    HttpUtils.setHeaders(responseBuilder);
    return responseBuilder.build();
}
Also used : Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.v3.oas.annotations.responses.ApiResponse) CAppArtifacts(org.wso2.ei.dashboard.core.rest.model.CAppArtifacts) Artifacts(org.wso2.ei.dashboard.core.rest.model.Artifacts) LocalEntriesDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.LocalEntriesDelegate) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Example 77 with Artifacts

use of org.wso2.ei.dashboard.core.rest.model.Artifacts in project product-mi-tooling by wso2.

the class GroupsApi method getCarbonApplicationsByNodeIds.

@GET
@Path("/{group-id}/capps")
@Produces({ "application/json" })
@Operation(summary = "Get carbon applications by node ids", description = "", tags = { "carbonApplications" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of carbon applications 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 getCarbonApplicationsByNodeIds(@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) {
    CarbonAppsDelegate cappsDelegate = new CarbonAppsDelegate();
    Artifacts cappList = cappsDelegate.getArtifactsList(groupId, nodes);
    Response.ResponseBuilder responseBuilder = Response.ok().entity(cappList);
    HttpUtils.setHeaders(responseBuilder);
    return responseBuilder.build();
}
Also used : Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.v3.oas.annotations.responses.ApiResponse) CAppArtifacts(org.wso2.ei.dashboard.core.rest.model.CAppArtifacts) Artifacts(org.wso2.ei.dashboard.core.rest.model.Artifacts) CarbonAppsDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.CarbonAppsDelegate) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Example 78 with Artifacts

use of org.wso2.ei.dashboard.core.rest.model.Artifacts in project product-mi-tooling by wso2.

the class GroupsApi method getDatasourcesByNodeIds.

@GET
@Path("/{group-id}/datasources")
@Produces({ "application/json" })
@Operation(summary = "Get datasources by node ids", description = "", tags = { "datasources" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of datsources deployed in provided nodes", content = @Content(schema = @Schema(implementation = DatasourceList.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response getDatasourcesByNodeIds(@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) {
    DataSourcesDelegate dataSourcesDelegate = new DataSourcesDelegate();
    Artifacts dataSourcesList = dataSourcesDelegate.getArtifactsList(groupId, nodes);
    Response.ResponseBuilder responseBuilder = Response.ok().entity(dataSourcesList);
    HttpUtils.setHeaders(responseBuilder);
    return responseBuilder.build();
}
Also used : Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.v3.oas.annotations.responses.ApiResponse) CAppArtifacts(org.wso2.ei.dashboard.core.rest.model.CAppArtifacts) Artifacts(org.wso2.ei.dashboard.core.rest.model.Artifacts) DataSourcesDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.DataSourcesDelegate) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Example 79 with Artifacts

use of org.wso2.ei.dashboard.core.rest.model.Artifacts in project product-mi-tooling by wso2.

the class GroupsApi method getCarbonApplicationArtifactsByNodeIds.

@GET
@Path("/{group-id}/nodes/{node-id}/capps/{capp-name}/artifacts")
@Produces({ "application/json" })
@Operation(summary = "Get artifact list of carbon application by node id", description = "", tags = { "carbonApplications" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of artifacts in carbon applications deployed in provided nodes", content = @Content(schema = @Schema(implementation = CAppArtifacts.class))), @ApiResponse(responseCode = "200", description = "Unexpected error", content = @Content(schema = @Schema(implementation = Error.class))) })
public Response getCarbonApplicationArtifactsByNodeIds(@PathParam("group-id") @Parameter(description = "Group ID of the node") String groupId, @PathParam("node-id") @Parameter(description = "Node ID") String nodeId, @PathParam("capp-name") @Parameter(description = "Carbon application name") String cappName) throws ManagementApiException {
    CarbonAppsDelegate cappsDelegate = new CarbonAppsDelegate();
    CAppArtifacts cAppArtifactList = cappsDelegate.getCAppArtifactList(groupId, nodeId, cappName);
    Response.ResponseBuilder responseBuilder = Response.ok().entity(cAppArtifactList);
    HttpUtils.setHeaders(responseBuilder);
    return responseBuilder.build();
}
Also used : Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.v3.oas.annotations.responses.ApiResponse) CAppArtifacts(org.wso2.ei.dashboard.core.rest.model.CAppArtifacts) CarbonAppsDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.CarbonAppsDelegate) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Example 80 with Artifacts

use of org.wso2.ei.dashboard.core.rest.model.Artifacts in project product-mi-tooling by wso2.

the class GroupsApi method getDataServicesByNodeIds.

@GET
@Path("/{group-id}/data-services")
@Produces({ "application/json" })
@Operation(summary = "Get data-services by node ids", description = "", tags = { "data-services" })
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "List of data-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 getDataServicesByNodeIds(@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) {
    DataServicesDelegate dataServicesDelegate = new DataServicesDelegate();
    Artifacts dataServicesList = dataServicesDelegate.getArtifactsList(groupId, nodes);
    Response.ResponseBuilder responseBuilder = Response.ok().entity(dataServicesList);
    HttpUtils.setHeaders(responseBuilder);
    return responseBuilder.build();
}
Also used : DataServicesDelegate(org.wso2.ei.dashboard.micro.integrator.delegates.DataServicesDelegate) Response(javax.ws.rs.core.Response) ApiResponse(io.swagger.v3.oas.annotations.responses.ApiResponse) CAppArtifacts(org.wso2.ei.dashboard.core.rest.model.CAppArtifacts) Artifacts(org.wso2.ei.dashboard.core.rest.model.Artifacts) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Aggregations

File (java.io.File)23 IOException (java.io.IOException)18 APIManagementException (org.wso2.carbon.apimgt.api.APIManagementException)18 ArrayList (java.util.ArrayList)17 CAppArtifacts (org.wso2.ei.dashboard.core.rest.model.CAppArtifacts)16 Operation (io.swagger.v3.oas.annotations.Operation)15 ApiResponse (io.swagger.v3.oas.annotations.responses.ApiResponse)15 ApiResponses (io.swagger.v3.oas.annotations.responses.ApiResponses)15 Response (javax.ws.rs.core.Response)15 Artifact (org.wso2.carbon.application.deployer.config.Artifact)15 Artifacts (org.wso2.ei.dashboard.core.rest.model.Artifacts)15 DeploymentException (org.apache.axis2.deployment.DeploymentException)11 CappFile (org.wso2.carbon.application.deployer.config.CappFile)11 Deployer (org.apache.axis2.deployment.Deployer)10 ArtifactSynchronizerException (org.wso2.carbon.apimgt.impl.gatewayartifactsynchronizer.exception.ArtifactSynchronizerException)10 Organization (org.wso2.carbon.apimgt.persistence.dto.Organization)10 InputStream (java.io.InputStream)9 FileInputStream (java.io.FileInputStream)7 APIRuntimeArtifactDto (org.wso2.carbon.apimgt.impl.dto.APIRuntimeArtifactDto)7 APIPersistenceException (org.wso2.carbon.apimgt.persistence.exceptions.APIPersistenceException)7