|
|
|
@ -18,7 +18,6 @@ package org.wso2.carbon.device.application.mgt.api.services;/*
|
|
|
|
|
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
|
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 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.")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Path("/platforms")
|
|
|
|
|
public interface PlatformManagementAPI {
|
|
|
|
|
public final static String SCOPE = "scope";
|
|
|
|
|
|
|
|
|
|
@GET
|
|
|
|
|
@Path("platforms")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
|
@ApiOperation(
|
|
|
|
@ -42,11 +41,11 @@ public interface PlatformManagementAPI {
|
|
|
|
|
produces = MediaType.APPLICATION_JSON,
|
|
|
|
|
httpMethod = "GET",
|
|
|
|
|
value = "get all platforms",
|
|
|
|
|
notes = "This will get all applications",
|
|
|
|
|
tags = "Application Management",
|
|
|
|
|
notes = "This will get all platforms that is visible for tenants",
|
|
|
|
|
tags = "Platform Management",
|
|
|
|
|
extensions = {
|
|
|
|
|
@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.",
|
|
|
|
|
response = Platform.class,
|
|
|
|
|
responseContainer = "List"),
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
code = 304,
|
|
|
|
|
message = "Not Modified. \n " +
|
|
|
|
|
"Empty body because the client already has the latest version of the requested resource."),
|
|
|
|
|
@ApiResponse(
|
|
|
|
|
code = 500,
|
|
|
|
|
message = "Internal Server Error. \n Error occurred while getting the platform list.",
|
|
|
|
@ -79,4 +74,79 @@ public interface PlatformManagementAPI {
|
|
|
|
|
@Size(max = 45)
|
|
|
|
|
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
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|