|
|
@ -34,6 +34,7 @@ import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorag
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.services.ApplicationReleaseManager;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.services.ApplicationReleaseManager;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.util.Constants;
|
|
|
|
import org.wso2.carbon.device.application.mgt.core.util.Constants;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
@ -81,10 +82,12 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
|
|
|
|
|
|
|
|
ApplicationList applications = applicationManager.getApplications(filter);
|
|
|
|
ApplicationList applications = applicationManager.getApplications(filter);
|
|
|
|
return Response.status(Response.Status.OK).entity(applications).build();
|
|
|
|
return Response.status(Response.Status.OK).entity(applications).build();
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).build();
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
String msg = "Error occurred while getting the application list";
|
|
|
|
String msg = "Error occurred while getting the application list";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).build();
|
|
|
|
return Response.status(Response.Status.BAD_REQUEST).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -100,6 +103,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
.entity("Application with UUID " + uuid + " not found").build();
|
|
|
|
.entity("Application with UUID " + uuid + " not found").build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Response.status(Response.Status.OK).entity(application).build();
|
|
|
|
return Response.status(Response.Status.OK).entity(application).build();
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).build();
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
log.error("Error occurred while getting application with the uuid " + uuid, e);
|
|
|
|
log.error("Error occurred while getting application with the uuid " + uuid, e);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
@ -110,7 +115,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@Consumes("application/json")
|
|
|
|
@Consumes("application/json")
|
|
|
|
@Path("/{uuid}/lifecycle")
|
|
|
|
@Path("/{uuid}/lifecycle")
|
|
|
|
public Response changeLifecycleState(@PathParam("uuid") String applicationUUID,
|
|
|
|
public Response changeLifecycleState(@PathParam("uuid") String applicationUUID,
|
|
|
|
@QueryParam("state") String state) {
|
|
|
|
@QueryParam("state") String state) {
|
|
|
|
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
|
|
|
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
|
|
|
|
|
|
|
|
|
|
|
if (!Arrays.asList(Constants.LIFE_CYCLES).contains(state)) {
|
|
|
|
if (!Arrays.asList(Constants.LIFE_CYCLES).contains(state)) {
|
|
|
@ -122,13 +127,15 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
applicationManager.changeLifecycle(applicationUUID, state);
|
|
|
|
applicationManager.changeLifecycle(applicationUUID, state);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.OK)
|
|
|
|
|
|
|
|
.entity("Successfully changed the lifecycle state of the application: " + applicationUUID).build();
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).build();
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
String msg = "Error occurred while changing the lifecycle of application: " + applicationUUID;
|
|
|
|
String msg = "Error occurred while changing the lifecycle of application: " + applicationUUID;
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.BAD_REQUEST);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.BAD_REQUEST);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Response.status(Response.Status.OK)
|
|
|
|
|
|
|
|
.entity("Successfully changed the lifecycle state of the application: " + applicationUUID).build();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
@GET
|
|
|
@ -151,6 +158,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Response.status(Response.Status.OK).entity(applicationManager.getLifeCycleStates(applicationUUID))
|
|
|
|
return Response.status(Response.Status.OK).entity(applicationManager.getLifeCycleStates(applicationUUID))
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).build();
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
log.error("Application Management Exception while trying to get next states for the applications with "
|
|
|
|
log.error("Application Management Exception while trying to get next states for the applications with "
|
|
|
|
+ "the application ID", e);
|
|
|
|
+ "the application ID", e);
|
|
|
@ -176,8 +185,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@POST
|
|
|
|
@POST
|
|
|
|
@Path("upload-image-artifacts/{uuid}")
|
|
|
|
@Path("upload-image-artifacts/{uuid}")
|
|
|
|
public Response uploadApplicationArtifacts(@PathParam("uuid") String applicationUUID,
|
|
|
|
public Response uploadApplicationArtifacts(@PathParam("uuid") String applicationUUID,
|
|
|
|
@Multipart("icon")Attachment iconFile, @Multipart("banner") Attachment bannerFile, @Multipart
|
|
|
|
@Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile, @Multipart
|
|
|
|
("screenshot") List<Attachment> attachmentList) {
|
|
|
|
("screenshot") List<Attachment> attachmentList) {
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
InputStream iconFileStream;
|
|
|
|
InputStream iconFileStream;
|
|
|
@ -208,6 +217,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
.uploadImageArtifacts(applicationUUID, iconFileStream, bannerFileStream, attachments);
|
|
|
|
.uploadImageArtifacts(applicationUUID, iconFileStream, bannerFileStream, attachments);
|
|
|
|
return Response.status(Response.Status.OK)
|
|
|
|
return Response.status(Response.Status.OK)
|
|
|
|
.entity("Successfully uploaded artifacts for the application " + applicationUUID).build();
|
|
|
|
.entity("Successfully uploaded artifacts for the application " + applicationUUID).build();
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).build();
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
String msg = "Error occurred while creating the application";
|
|
|
|
String msg = "Error occurred while creating the application";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
@ -215,8 +226,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
log.error("Exception while trying to read icon, banner files for the application " + applicationUUID);
|
|
|
|
log.error("Exception while trying to read icon, banner files for the application " + applicationUUID);
|
|
|
|
return APIUtil.getResponse(new ApplicationManagementException(
|
|
|
|
return APIUtil.getResponse(new ApplicationManagementException(
|
|
|
|
"Exception while trying to read icon, " + "banner files for the application " +
|
|
|
|
"Exception while trying to read icon, " + "banner files for the application " +
|
|
|
|
applicationUUID, e), Response.Status.BAD_REQUEST);
|
|
|
|
applicationUUID, e), Response.Status.BAD_REQUEST);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -224,8 +235,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@PUT
|
|
|
|
@PUT
|
|
|
|
@Path("upload-image-artifacts/{uuid}")
|
|
|
|
@Path("upload-image-artifacts/{uuid}")
|
|
|
|
public Response updateApplicationArtifacts(@PathParam("uuid") String applicationUUID,
|
|
|
|
public Response updateApplicationArtifacts(@PathParam("uuid") String applicationUUID,
|
|
|
|
@Multipart("icon")Attachment iconFile, @Multipart("banner") Attachment bannerFile, @Multipart
|
|
|
|
@Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile, @Multipart
|
|
|
|
("screenshot") List<Attachment> attachmentList) {
|
|
|
|
("screenshot") List<Attachment> attachmentList) {
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
InputStream iconFileStream = null;
|
|
|
|
InputStream iconFileStream = null;
|
|
|
@ -262,11 +273,11 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@PUT
|
|
|
|
@PUT
|
|
|
|
@Consumes("application/json")
|
|
|
|
@Consumes("application/json")
|
|
|
|
public Response editApplication(@Valid Application application) {
|
|
|
|
public Response editApplication(@Valid Application application) {
|
|
|
|
|
|
|
|
|
|
|
|
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
|
|
|
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
application = applicationManager.editApplication(application);
|
|
|
|
application = applicationManager.editApplication(application);
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return APIUtil.getResponse(e, Response.Status.NOT_FOUND);
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
String msg = "Error occurred while creating the application";
|
|
|
|
String msg = "Error occurred while creating the application";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
@ -287,6 +298,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
applicationManager.deleteApplication(uuid);
|
|
|
|
applicationManager.deleteApplication(uuid);
|
|
|
|
String responseMsg = "Successfully deleted the application: " + uuid;
|
|
|
|
String responseMsg = "Successfully deleted the application: " + uuid;
|
|
|
|
return Response.status(Response.Status.OK).entity(responseMsg).build();
|
|
|
|
return Response.status(Response.Status.OK).entity(responseMsg).build();
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return APIUtil.getResponse(e, Response.Status.NOT_FOUND);
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
String msg = "Error occurred while deleting the application: " + uuid;
|
|
|
|
String msg = "Error occurred while deleting the application: " + uuid;
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
@ -298,8 +311,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@POST
|
|
|
|
@POST
|
|
|
|
@Path("/release/{uuid}")
|
|
|
|
@Path("/release/{uuid}")
|
|
|
|
public Response createApplicationRelease(@PathParam("uuid") String applicationUUID,
|
|
|
|
public Response createApplicationRelease(@PathParam("uuid") String applicationUUID,
|
|
|
|
@Multipart("applicationRelease") ApplicationRelease applicationRelease,
|
|
|
|
@Multipart("applicationRelease") ApplicationRelease applicationRelease,
|
|
|
|
@Multipart("binaryFile") Attachment binaryFile) {
|
|
|
|
@Multipart("binaryFile") Attachment binaryFile) {
|
|
|
|
ApplicationReleaseManager applicationReleaseManager = APIUtil.getApplicationReleaseManager();
|
|
|
|
ApplicationReleaseManager applicationReleaseManager = APIUtil.getApplicationReleaseManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -329,7 +342,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@Path("/release/{uuid}")
|
|
|
|
@Path("/release/{uuid}")
|
|
|
|
public Response updateApplicationRelease(@PathParam("uuid") String applicationUUID, @Multipart
|
|
|
|
public Response updateApplicationRelease(@PathParam("uuid") String applicationUUID, @Multipart
|
|
|
|
("applicationRelease") ApplicationRelease applicationRelease, @Multipart("binaryFile") Attachment
|
|
|
|
("applicationRelease") ApplicationRelease applicationRelease, @Multipart("binaryFile") Attachment
|
|
|
|
binaryFile) {
|
|
|
|
binaryFile) {
|
|
|
|
ApplicationReleaseManager applicationReleaseManager = APIUtil.getApplicationReleaseManager();
|
|
|
|
ApplicationReleaseManager applicationReleaseManager = APIUtil.getApplicationReleaseManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -347,14 +360,16 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
.uploadReleaseArtifacts(applicationUUID, version, binaryFile.getDataHandler().getInputStream());
|
|
|
|
.uploadReleaseArtifacts(applicationUUID, version, binaryFile.getDataHandler().getInputStream());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Response.status(Response.Status.OK).entity(applicationRelease).build();
|
|
|
|
return Response.status(Response.Status.OK).entity(applicationRelease).build();
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).build();
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
log.error("Error while updating the application release of the application with UUID " + applicationUUID);
|
|
|
|
log.error("Error while updating the application release of the application with UUID " + applicationUUID);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
log.error("Error while updating the release artifacts of the application with UUID " + applicationUUID);
|
|
|
|
log.error("Error while updating the release artifacts of the application with UUID " + applicationUUID);
|
|
|
|
return APIUtil.getResponse(new ApplicationManagementException(
|
|
|
|
return APIUtil.getResponse(new ApplicationManagementException(
|
|
|
|
"Error while updating the release artifacts of the application with UUID "
|
|
|
|
"Error while updating the release artifacts of the application with UUID "
|
|
|
|
+ applicationUUID), Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
|
+ applicationUUID), Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -363,7 +378,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
|
|
|
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
|
|
|
@Path("/release-artifacts/{uuid}/{version}")
|
|
|
|
@Path("/release-artifacts/{uuid}/{version}")
|
|
|
|
public Response getApplicationReleaseArtifacts(@PathParam("uuid") String applicationUUID,
|
|
|
|
public Response getApplicationReleaseArtifacts(@PathParam("uuid") String applicationUUID,
|
|
|
|
@PathParam("version") String version) {
|
|
|
|
@PathParam("version") String version) {
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
InputStream binaryFile = applicationStorageManager.getReleasedArtifacts(applicationUUID, version);
|
|
|
|
InputStream binaryFile = applicationStorageManager.getReleasedArtifacts(applicationUUID, version);
|
|
|
@ -386,7 +401,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@Path("/release/{uuid}")
|
|
|
|
@Path("/release/{uuid}")
|
|
|
|
@GET
|
|
|
|
@GET
|
|
|
|
public Response getApplicationReleases(@PathParam("uuid") String applicationUUID,
|
|
|
|
public Response getApplicationReleases(@PathParam("uuid") String applicationUUID,
|
|
|
|
@QueryParam("version") String version) {
|
|
|
|
@QueryParam("version") String version) {
|
|
|
|
ApplicationReleaseManager applicationReleaseManager = APIUtil.getApplicationReleaseManager();
|
|
|
|
ApplicationReleaseManager applicationReleaseManager = APIUtil.getApplicationReleaseManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (version == null || version.isEmpty()) {
|
|
|
|
if (version == null || version.isEmpty()) {
|
|
|
@ -396,6 +411,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
ApplicationRelease applicationRelease = applicationReleaseManager.getRelease(applicationUUID, version);
|
|
|
|
ApplicationRelease applicationRelease = applicationReleaseManager.getRelease(applicationUUID, version);
|
|
|
|
return Response.status(Response.Status.OK).entity(applicationRelease).build();
|
|
|
|
return Response.status(Response.Status.OK).entity(applicationRelease).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).build();
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
log.error("Error while getting all the application releases for the application with the UUID "
|
|
|
|
log.error("Error while getting all the application releases for the application with the UUID "
|
|
|
|
+ applicationUUID, e);
|
|
|
|
+ applicationUUID, e);
|
|
|
@ -407,7 +424,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@DELETE
|
|
|
|
@DELETE
|
|
|
|
@Path("/release/{uuid}")
|
|
|
|
@Path("/release/{uuid}")
|
|
|
|
public Response deleteApplicationRelease(@PathParam("uuid") String applicationUUID,
|
|
|
|
public Response deleteApplicationRelease(@PathParam("uuid") String applicationUUID,
|
|
|
|
@QueryParam("version") String version) {
|
|
|
|
@QueryParam("version") String version) {
|
|
|
|
ApplicationReleaseManager applicationReleaseManager = APIUtil.getApplicationReleaseManager();
|
|
|
|
ApplicationReleaseManager applicationReleaseManager = APIUtil.getApplicationReleaseManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -424,6 +441,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
.entity("Successfully deleted Application releases for the " + "application with UUID "
|
|
|
|
.entity("Successfully deleted Application releases for the " + "application with UUID "
|
|
|
|
+ applicationUUID).build();
|
|
|
|
+ applicationUUID).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).build();
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
log.error("Error while deleting application release with the application UUID " + applicationUUID, e);
|
|
|
|
log.error("Error while deleting application release with the application UUID " + applicationUUID, e);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
|
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
|
|
|
@ -435,7 +454,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
@Path("/image-artifacts/{uuid}")
|
|
|
|
@Path("/image-artifacts/{uuid}")
|
|
|
|
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
|
|
|
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
|
|
|
public Response getApplicationImageArtifacts(@PathParam("uuid") String applicationUUID,
|
|
|
|
public Response getApplicationImageArtifacts(@PathParam("uuid") String applicationUUID,
|
|
|
|
@QueryParam("name") String name, @QueryParam("count") int count) {
|
|
|
|
@QueryParam("name") String name, @QueryParam("count") int count) {
|
|
|
|
if (name == null || name.isEmpty()) {
|
|
|
|
if (name == null || name.isEmpty()) {
|
|
|
|
return Response.status(Response.Status.BAD_REQUEST).entity("Name should not be null. Name is mandatory to"
|
|
|
|
return Response.status(Response.Status.BAD_REQUEST).entity("Name should not be null. Name is mandatory to"
|
|
|
|
+ " retrieve the particular image artifact of the release").build();
|
|
|
|
+ " retrieve the particular image artifact of the release").build();
|
|
|
@ -466,6 +485,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
|
|
|
|
return Response.status(Response.Status.OK)
|
|
|
|
return Response.status(Response.Status.OK)
|
|
|
|
.entity("Successfully changed the default version for the " + "release channel " + channel
|
|
|
|
.entity("Successfully changed the default version for the " + "release channel " + channel
|
|
|
|
+ " for the application UUID " + applicationUUID).build();
|
|
|
|
+ " for the application UUID " + applicationUUID).build();
|
|
|
|
|
|
|
|
} catch (NotFoundException e) {
|
|
|
|
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).build();
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
} catch (ApplicationManagementException e) {
|
|
|
|
log.error("Application Release Management Exception while changing the default release for the release "
|
|
|
|
log.error("Application Release Management Exception while changing the default release for the release "
|
|
|
|
+ "channel " + channel + " for the application with UUID " + applicationUUID + " for the version "
|
|
|
|
+ "channel " + channel + " for the application with UUID " + applicationUUID + " for the version "
|
|
|
|