|
|
@ -18,7 +18,6 @@ package org.wso2.carbon.device.application.mgt.api.services;/*
|
|
|
|
|
|
|
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
import org.wso2.carbon.device.application.mgt.api.beans.ErrorResponse;
|
|
|
|
import org.wso2.carbon.device.application.mgt.api.beans.ErrorResponse;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.ApplicationList;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.Platform;
|
|
|
|
import org.wso2.carbon.device.application.mgt.common.Platform;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.Size;
|
|
|
|
import javax.validation.constraints.Size;
|
|
|
@ -30,11 +29,11 @@ import javax.ws.rs.core.Response;
|
|
|
|
"such as get all the available platform for a tenant, etc.")
|
|
|
|
"such as get all the available platform for a tenant, etc.")
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
|
|
@Path("/platforms")
|
|
|
|
public interface PlatformManagementAPI {
|
|
|
|
public interface PlatformManagementAPI {
|
|
|
|
public final static String SCOPE = "scope";
|
|
|
|
public final static String SCOPE = "scope";
|
|
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
@GET
|
|
|
|
@Path("platforms")
|
|
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
@ApiOperation(
|
|
|
|
@ApiOperation(
|
|
|
@ -42,11 +41,11 @@ public interface PlatformManagementAPI {
|
|
|
|
produces = MediaType.APPLICATION_JSON,
|
|
|
|
produces = MediaType.APPLICATION_JSON,
|
|
|
|
httpMethod = "GET",
|
|
|
|
httpMethod = "GET",
|
|
|
|
value = "get all platforms",
|
|
|
|
value = "get all platforms",
|
|
|
|
notes = "This will get all applications",
|
|
|
|
notes = "This will get all platforms that is visible for tenants",
|
|
|
|
tags = "Application Management",
|
|
|
|
tags = "Platform Management",
|
|
|
|
extensions = {
|
|
|
|
extensions = {
|
|
|
|
@Extension(properties = {
|
|
|
|
@Extension(properties = {
|
|
|
|
@ExtensionProperty(name = SCOPE, value = "perm:get-platforms")
|
|
|
|
@ExtensionProperty(name = SCOPE, value = "perm:get-platform")
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -57,10 +56,6 @@ public interface PlatformManagementAPI {
|
|
|
|
message = "OK. \n Successfully got platforms list.",
|
|
|
|
message = "OK. \n Successfully got platforms list.",
|
|
|
|
response = Platform.class,
|
|
|
|
response = Platform.class,
|
|
|
|
responseContainer = "List"),
|
|
|
|
responseContainer = "List"),
|
|
|
|
@ApiResponse(
|
|
|
|
|
|
|
|
code = 304,
|
|
|
|
|
|
|
|
message = "Not Modified. \n " +
|
|
|
|
|
|
|
|
"Empty body because the client already has the latest version of the requested resource."),
|
|
|
|
|
|
|
|
@ApiResponse(
|
|
|
|
@ApiResponse(
|
|
|
|
code = 500,
|
|
|
|
code = 500,
|
|
|
|
message = "Internal Server Error. \n Error occurred while getting the platform list.",
|
|
|
|
message = "Internal Server Error. \n Error occurred while getting the platform list.",
|
|
|
@ -79,4 +74,79 @@ public interface PlatformManagementAPI {
|
|
|
|
@Size(max = 45)
|
|
|
|
@Size(max = 45)
|
|
|
|
String status
|
|
|
|
String status
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
|
|
|
@Path("/{code}")
|
|
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
|
|
@ApiOperation(
|
|
|
|
|
|
|
|
consumes = MediaType.APPLICATION_JSON,
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON,
|
|
|
|
|
|
|
|
httpMethod = "GET",
|
|
|
|
|
|
|
|
value = "get platform",
|
|
|
|
|
|
|
|
notes = "This will get application which was registered with {code}",
|
|
|
|
|
|
|
|
tags = "Platform Management",
|
|
|
|
|
|
|
|
extensions = {
|
|
|
|
|
|
|
|
@Extension(properties = {
|
|
|
|
|
|
|
|
@ExtensionProperty(name = SCOPE, value = "perm:get-platform")
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
@ApiResponses(
|
|
|
|
|
|
|
|
value = {
|
|
|
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
|
|
|
code = 200,
|
|
|
|
|
|
|
|
message = "OK. \n Successfully got requested platform.",
|
|
|
|
|
|
|
|
response = Platform.class),
|
|
|
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
|
|
|
code = 500,
|
|
|
|
|
|
|
|
message = "Internal Server Error. \n Error occurred while getting the platform.",
|
|
|
|
|
|
|
|
response = ErrorResponse.class)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
Response getPlatform(
|
|
|
|
|
|
|
|
@ApiParam(
|
|
|
|
|
|
|
|
name = "code",
|
|
|
|
|
|
|
|
required = true)
|
|
|
|
|
|
|
|
@PathParam("code")
|
|
|
|
|
|
|
|
@Size(max = 45)
|
|
|
|
|
|
|
|
String code
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@POST
|
|
|
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
|
|
|
@ApiOperation(
|
|
|
|
|
|
|
|
consumes = MediaType.APPLICATION_JSON,
|
|
|
|
|
|
|
|
produces = MediaType.APPLICATION_JSON,
|
|
|
|
|
|
|
|
httpMethod = "POST",
|
|
|
|
|
|
|
|
value = "Add Platform",
|
|
|
|
|
|
|
|
notes = "This will a platform for the tenant space",
|
|
|
|
|
|
|
|
tags = "Platform Management",
|
|
|
|
|
|
|
|
extensions = {
|
|
|
|
|
|
|
|
@Extension(properties = {
|
|
|
|
|
|
|
|
@ExtensionProperty(name = SCOPE, value = "perm:add-platform")
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
@ApiResponses(
|
|
|
|
|
|
|
|
value = {
|
|
|
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
|
|
|
code = 200,
|
|
|
|
|
|
|
|
message = "OK. \n Successfully added the platform"),
|
|
|
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
|
|
|
code = 400,
|
|
|
|
|
|
|
|
message = "Bad Request. \n Invalid request parameters passed."),
|
|
|
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
|
|
|
code = 500,
|
|
|
|
|
|
|
|
message = "Internal Server Error. \n Error occurred while getting the platform list.",
|
|
|
|
|
|
|
|
response = ErrorResponse.class)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
Response addPlatform(
|
|
|
|
|
|
|
|
@ApiParam(
|
|
|
|
|
|
|
|
name = "platform",
|
|
|
|
|
|
|
|
value = "The payload of the platform",
|
|
|
|
|
|
|
|
required = true)
|
|
|
|
|
|
|
|
Platform platform
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|