mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt
This commit is contained in:
commit
fc50b851bc
@ -26,13 +26,14 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel(value = "List of activities", description = "This contains a set of activities that matches a given " +
|
||||
"criteria as a collection")
|
||||
@ApiModel(value = "List of activities", description = "This contains a set of activities that matches a given"
|
||||
+ " criteria as a collection")
|
||||
public class ActivityList extends BasePaginatedResult {
|
||||
|
||||
private List<Activity> activities;
|
||||
|
||||
@ApiModelProperty(value = "List of devices returned")
|
||||
@ApiModelProperty(value = "Returns the list of activities that match the offset and limit parameter values"
|
||||
+ " that were specified.")
|
||||
@JsonProperty("activities")
|
||||
public List<Activity> getList() {
|
||||
return activities;
|
||||
@ -46,7 +47,6 @@ public class ActivityList extends BasePaginatedResult {
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("{\n");
|
||||
|
||||
sb.append(" count: ").append(getCount()).append(",\n");
|
||||
sb.append(" devices: [").append(activities).append("\n");
|
||||
sb.append("]}\n");
|
||||
|
||||
@ -23,15 +23,13 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class BasePaginatedResult {
|
||||
|
||||
private int count;
|
||||
private String next;
|
||||
private String previous;
|
||||
|
||||
/**
|
||||
* Number of Resources returned.
|
||||
*/
|
||||
@ApiModelProperty(value = "Number of resources returned.")
|
||||
@ApiModelProperty(value = "Number of total resources.", example = "2")
|
||||
@JsonProperty("count")
|
||||
private int count;
|
||||
|
||||
public int getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
@ -29,7 +29,8 @@ public class RoleList extends BasePaginatedResult {
|
||||
|
||||
private List<String> roles;
|
||||
|
||||
@ApiModelProperty(value = "List of roles returned")
|
||||
@ApiModelProperty(value = "Returns the list of roles that match the offset and limit parameter values "
|
||||
+ "that were specified.")
|
||||
@JsonProperty("roles")
|
||||
public List<String> getList() {
|
||||
return roles;
|
||||
|
||||
@ -34,8 +34,8 @@ import javax.ws.rs.core.Response;
|
||||
@API(name = "Configuration Management", version = "1.0.0", context = "/api/device-mgt/v1.0/configuration", tags = {"devicemgt_admin"})
|
||||
|
||||
@Path("/configuration")
|
||||
@Api(value = "Configuration Management", description = "General Tenant Configuration management capabilities are exposed " +
|
||||
"through this API")
|
||||
@Api(value = "Configuration Management", description = "The general platform configuration management capabilities are exposed " +
|
||||
"through this API.")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public interface ConfigurationManagementService {
|
||||
@ -44,14 +44,16 @@ public interface ConfigurationManagementService {
|
||||
@ApiOperation(
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "GET",
|
||||
value = "Get the general platform configurations.",
|
||||
notes = "Get the general platform level configuration details.",
|
||||
value = "Getting General Platform Configurations",
|
||||
notes = "WSO2 EMM monitors policies to verify that the devices comply with the policies enforced on them. " +
|
||||
"General platform configurations include the settings on how often the the device need to be monitored. " +
|
||||
"Using this REST API you can get the general platform level configurations.",
|
||||
tags = "Configuration Management")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully fetched general platform configuration.",
|
||||
message = "OK. \n Successfully fetched the general platform configurations.",
|
||||
response = PlatformConfiguration.class,
|
||||
responseContainer = "List",
|
||||
responseHeaders = {
|
||||
@ -70,22 +72,23 @@ public interface ConfigurationManagementService {
|
||||
),
|
||||
@ApiResponse(
|
||||
code = 304,
|
||||
message = "Not Modified. \n Empty body because the client has already the latest version of " +
|
||||
"the requested resource."),
|
||||
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource."),
|
||||
@ApiResponse(
|
||||
code = 406,
|
||||
message = "Not Acceptable.\n The requested media type is not supported"),
|
||||
message = "Not Acceptable.\n The requested media type is not supported."),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n Server error occurred while fetching the general " +
|
||||
"platform configuration.",
|
||||
"platform configurations.",
|
||||
response = ErrorResponse.class)
|
||||
})
|
||||
@Permission(name = "View Configurations", permission = "/device-mgt/platform-configurations/view")
|
||||
Response getConfiguration(
|
||||
@ApiParam(
|
||||
name = "If-Modified-Since",
|
||||
value = "Validates if the requested variant has not been modified since the time specified",
|
||||
value = "Checks if the requested variant was modified, since the specified date-time.\n" +
|
||||
"Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z." +
|
||||
"Example: Mon, 05 Jan 2014 15:10:00 +0200",
|
||||
required = false)
|
||||
@HeaderParam("If-Modified-Since")
|
||||
String ifModifiedSince);
|
||||
@ -95,14 +98,16 @@ public interface ConfigurationManagementService {
|
||||
consumes = MediaType.APPLICATION_JSON,
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "PUT",
|
||||
value = "Update General Platform Configurations.",
|
||||
notes = "This resource is used to update the general platform configuration.",
|
||||
value = "Updating General Platform Configurations",
|
||||
notes = "WSO2 EMM monitors policies to verify that the devices comply with the policies enforced on them." +
|
||||
"General platform configurations include the settings on how often the the device need to be monitored." +
|
||||
"Using this REST API you can update the general platform level configurations.",
|
||||
tags = "Configuration Management")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n General platform configuration has been updated successfully",
|
||||
message = "OK. \n Successfully updated the general platform configurations.",
|
||||
responseHeaders = {
|
||||
@ResponseHeader(
|
||||
name = "Content-Type",
|
||||
@ -120,18 +125,18 @@ public interface ConfigurationManagementService {
|
||||
message = "Bad Request. \n Invalid request or validation error."),
|
||||
@ApiResponse(
|
||||
code = 415,
|
||||
message = "Unsupported media type. \n The entity of the request was in a not supported format."),
|
||||
message = "Unsupported media type. \n The format of the requested entity was not supported."),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n " +
|
||||
"Server error occurred while modifying general platform configuration.",
|
||||
"Server error occurred while modifying the general platform configurations.",
|
||||
response = ErrorResponse.class)
|
||||
})
|
||||
@Permission(name = "Manage configurations", permission = "/device-mgt/platform-configurations/manage")
|
||||
Response updateConfiguration(
|
||||
@ApiParam(
|
||||
name = "configuration",
|
||||
value = "The required properties to be updated in the platform configuration.",
|
||||
value = "The properties required to update the platform configurations.",
|
||||
required = true)
|
||||
PlatformConfiguration configuration);
|
||||
|
||||
|
||||
@ -44,15 +44,15 @@ public interface RoleManagementService {
|
||||
@ApiOperation(
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "GET",
|
||||
value = "Get the list of roles.",
|
||||
notes = "If you wish to get the details of all the roles in EMM, you can do so using this REST API. All " +
|
||||
"internal roles, roles created for Service-providers and application related roles are omitted.",
|
||||
value = "Getting the List of Roles",
|
||||
notes = "WSO2 EMM supports role-based access control (RBAC) and role management. Using this API you can the list of roles that are in WSO2 EMM.\n" +
|
||||
"Note: Internal roles, roles created for service-providers, and application related roles will not be given in the output.",
|
||||
tags = "Role Management")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully fetched the requested list of roles.",
|
||||
message = "OK. \n Successfully fetched the list of roles in WSO2 EMM.",
|
||||
response = RoleList.class,
|
||||
responseHeaders = {
|
||||
@ResponseHeader(
|
||||
@ -69,41 +69,45 @@ public interface RoleManagementService {
|
||||
}),
|
||||
@ApiResponse(
|
||||
code = 304,
|
||||
message = "Not Modified. \n Empty body because the client has already the latest version of the requested resource."),
|
||||
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource."),
|
||||
@ApiResponse(
|
||||
code = 406,
|
||||
message = "Not Acceptable.\n The requested media type is not supported"),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n Server error occurred while fetching requested list of roles.",
|
||||
message = "Internal Server Error. \n Server error occurred while fetching list of roles.",
|
||||
response = ErrorResponse.class)
|
||||
})
|
||||
@Permission(name = "View Roles", permission = "/device-mgt/roles/view")
|
||||
Response getRoles(
|
||||
@ApiParam(
|
||||
name = "filter",
|
||||
value = "Role name or a part of it to search.",
|
||||
value = "Provide a character or a few characters in the role name.",
|
||||
required = false)
|
||||
@QueryParam("filter") String filter,
|
||||
@ApiParam(
|
||||
name = "user-store",
|
||||
value = "From which user store the roles must be fetched.",
|
||||
value = "The name of the UserStore you wish to get the list of roles.",
|
||||
required = false)
|
||||
@QueryParam("user-store") String userStoreName,
|
||||
@ApiParam(
|
||||
name = "If-Modified-Since",
|
||||
value = "Validates if the requested variant has not been modified since the time specified",
|
||||
value = "Checks if the requested variant was modified, since the specified date-time." +
|
||||
"Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" +
|
||||
"Example: Mon, 05 Jan 2014 15:10:00 +0200",
|
||||
required = false)
|
||||
@HeaderParam("If-Modified-Since") String ifModifiedSince,
|
||||
@ApiParam(
|
||||
name = "offset",
|
||||
value = "Starting point within the complete list of items qualified.",
|
||||
required = false)
|
||||
value = "The starting pagination index for the complete list qualified items.",
|
||||
required = false,
|
||||
defaultValue = "0")
|
||||
@QueryParam("offset") int offset,
|
||||
@ApiParam(
|
||||
name = "limit",
|
||||
value = "Maximum size of resource array to return.",
|
||||
required = false)
|
||||
value = "Provide how many roles details you require from the starting pagination index/offset.",
|
||||
required = false,
|
||||
defaultValue = "5")
|
||||
@QueryParam("limit") int limit);
|
||||
|
||||
@GET
|
||||
@ -111,10 +115,10 @@ public interface RoleManagementService {
|
||||
@ApiOperation(
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "GET",
|
||||
value = "Getting permission details of a role.",
|
||||
notes = "In an organization an individual is associated a with set of responsibilities based on their " +
|
||||
"role. In EMM you are able to configure permissions based on the responsibilities carried " +
|
||||
"out by a role. Therefore if you wish to retrieve the permission details of a role, you can do " +
|
||||
value = "Getting Permission Details of a Role",
|
||||
notes = "An individual is associated a with set of responsibilities based on their " +
|
||||
"role. In WSO2 EMM you are able to configure permissions based on the responsibilities carried " +
|
||||
"out by various roles. Therefore, if you wish to retrieve the permission details of a role, you can do " +
|
||||
"so using this REST API.",
|
||||
response = UIPermissionNode.class,
|
||||
responseContainer = "List",
|
||||
@ -124,7 +128,7 @@ public interface RoleManagementService {
|
||||
value = {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully fetched the permission list of the given role.",
|
||||
message = "OK. \n Successfully fetched the permissions details for the specified role.",
|
||||
response = UIPermissionNode.class,
|
||||
responseContainer = "List",
|
||||
responseHeaders = {
|
||||
@ -142,14 +146,14 @@ public interface RoleManagementService {
|
||||
}),
|
||||
@ApiResponse(
|
||||
code = 304,
|
||||
message = "Not Modified. \n Empty body because the client has already the latest version of the requested resource."),
|
||||
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource.\n"),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
message = "Bad Request. \n Invalid request or validation error.",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Role does not exist.",
|
||||
message = "Not Found. \n The specified role does not exist.",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 406,
|
||||
@ -157,19 +161,22 @@ public interface RoleManagementService {
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server ErrorResponse. \n Server error occurred while fetching the permission list of the requested role.",
|
||||
message = "Internal Server ErrorResponse. \n Server error occurred while fetching the permission list for the requested role.",
|
||||
response = ErrorResponse.class)
|
||||
})
|
||||
@Permission(name = "View Roles", permission = "/device-mgt/roles/view")
|
||||
Response getPermissionsOfRole(
|
||||
@ApiParam(
|
||||
name = "roleName",
|
||||
value = "Name of the role.",
|
||||
required = true)
|
||||
value = "The name of the role.",
|
||||
required = true,
|
||||
defaultValue = "Engineer")
|
||||
@PathParam("roleName") String roleName,
|
||||
@ApiParam(
|
||||
name = "If-Modified-Since",
|
||||
value = "Validates if the requested variant has not been modified since the time specified",
|
||||
value = "Checks if the requested variant was modified, since the specified date-time." +
|
||||
"Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" +
|
||||
"Example: Mon, 05 Jan 2014 15:10:00 +0200",
|
||||
required = false)
|
||||
@HeaderParam("If-Modified-Since") String ifModifiedSince);
|
||||
|
||||
@ -178,15 +185,15 @@ public interface RoleManagementService {
|
||||
@ApiOperation(
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "GET",
|
||||
value = "Get details of a role.",
|
||||
notes = "If you wish to get the details of a role in EMM, you can do so using this REST API.",
|
||||
value = "Getting Details of a Role",
|
||||
notes = "Get the permissions associated with a role and role specific details using this REST API.",
|
||||
response = RoleInfo.class,
|
||||
tags = "Role Management")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Successfully fetched the requested role.",
|
||||
message = "OK. \n Successfully fetched the details of the role.",
|
||||
response = RoleInfo.class,
|
||||
responseHeaders = {
|
||||
@ResponseHeader(
|
||||
@ -203,15 +210,14 @@ public interface RoleManagementService {
|
||||
}),
|
||||
@ApiResponse(
|
||||
code = 304,
|
||||
message = "Not Modified. \n Empty body because the client has already the latest version of" +
|
||||
" the requested resource."),
|
||||
message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource."),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
message = "Bad Request. \n Invalid request or validation error.",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Role does not exist.",
|
||||
message = "Not Found. \n The specified role does not exist.",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 406,
|
||||
@ -219,7 +225,7 @@ public interface RoleManagementService {
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n Server error occurred while fetching the " +
|
||||
message = "Internal Server Error. \n Server error occurred while fetching the details of" +
|
||||
"requested role.",
|
||||
response = ErrorResponse.class)
|
||||
})
|
||||
@ -227,12 +233,15 @@ public interface RoleManagementService {
|
||||
Response getRole(
|
||||
@ApiParam(
|
||||
name = "roleName",
|
||||
value = "Name of the role.",
|
||||
required = true)
|
||||
value = "The name of the role.",
|
||||
required = true,
|
||||
defaultValue = "admin")
|
||||
@PathParam("roleName") String roleName,
|
||||
@ApiParam(
|
||||
name = "If-Modified-Since",
|
||||
value = "Validates if the requested variant has not been modified since the time specified",
|
||||
value = "Checks if the requested variant was modified, since the specified date-time." +
|
||||
"Provide the value in the following format: EEE, d MMM yyyy HH:mm:ss Z.\n" +
|
||||
"Example: Mon, 05 Jan 2014 15:10:00 +0200",
|
||||
required = false)
|
||||
@HeaderParam("If-Modified-Since") String ifModifiedSince);
|
||||
|
||||
@ -241,17 +250,17 @@ public interface RoleManagementService {
|
||||
consumes = MediaType.APPLICATION_JSON,
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "POST",
|
||||
value = "Add a role.",
|
||||
notes = "You are able to add a new role to EMM using the REST API.",
|
||||
value = "Adding a Role",
|
||||
notes = "WSO2 EMM supports role-based access control (RBAC) and role management. Add a new role to WSO2 EMM using this REST API.",
|
||||
tags = "Role Management")
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(
|
||||
code = 201,
|
||||
message = "Created. \n Role has successfully been created",
|
||||
message = "Created. \n Successfully created the role.",
|
||||
responseHeaders = {
|
||||
@ResponseHeader(
|
||||
name = "Content-Location",
|
||||
description = "The URL of the role added."),
|
||||
description = "The URL to the newly added role."),
|
||||
@ResponseHeader(
|
||||
name = "Content-Type",
|
||||
description = "The content type of the body"),
|
||||
@ -265,7 +274,7 @@ public interface RoleManagementService {
|
||||
"Used by caches, or in conditional requests.")}),
|
||||
@ApiResponse(
|
||||
code = 303,
|
||||
message = "See Other. \n Source can be retrieved from the URL specified at the Location header.",
|
||||
message = "See Other. \n The source can be retrieved from the URL specified in the location header.",
|
||||
responseHeaders = {
|
||||
@ResponseHeader(
|
||||
name = "Content-Location",
|
||||
@ -276,7 +285,7 @@ public interface RoleManagementService {
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 415,
|
||||
message = "Unsupported media type. \n The entity of the request was in a not supported format.",
|
||||
message = "Unsupported media type. \n The format of the requested entity was not supported.",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
@ -287,7 +296,7 @@ public interface RoleManagementService {
|
||||
Response addRole(
|
||||
@ApiParam(
|
||||
name = "role",
|
||||
value = "Details about the role to be added.",
|
||||
value = "The properties required to add a new role.",
|
||||
required = true) RoleInfo role);
|
||||
|
||||
@PUT
|
||||
@ -296,14 +305,14 @@ public interface RoleManagementService {
|
||||
consumes = MediaType.APPLICATION_JSON,
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "PUT",
|
||||
value = "Update a role.",
|
||||
notes = "There will be situations where you will need to update the role details, such as the permissions" +
|
||||
" or the role name. In such situation you can update the role details.",
|
||||
value = "Updating Role Details",
|
||||
notes = "There will be situations where you need to update the role details, such as the permissions" +
|
||||
" or the role name. Update the role details using this REST API.",
|
||||
tags = "Role Management")
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Role has been updated successfully",
|
||||
message = "OK. \n Successfully updated the specified role.",
|
||||
responseHeaders = {
|
||||
@ResponseHeader(
|
||||
name = "Content-Type",
|
||||
@ -314,7 +323,7 @@ public interface RoleManagementService {
|
||||
"Used by caches, or in conditional requests."),
|
||||
@ResponseHeader(
|
||||
name = "Last-Modified",
|
||||
description = "Date and time the resource has been modified the last time.\n" +
|
||||
description = "Date and time the resource was last modified.\n" +
|
||||
"Used by caches, or in conditional requests.")}),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
@ -322,11 +331,11 @@ public interface RoleManagementService {
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Role to be deleted does not exist.",
|
||||
message = "Not Found. \n The specified role does not exist.",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 415,
|
||||
message = "Unsupported media type. \n The entity of the request was in a not supported format.",
|
||||
message = "Unsupported media type. \n The format of the requested entity was not supported.\n",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
@ -337,33 +346,34 @@ public interface RoleManagementService {
|
||||
Response updateRole(
|
||||
@ApiParam(
|
||||
name = "roleName",
|
||||
value = "Name of the role.",
|
||||
required = true)
|
||||
value = "The name of the role.",
|
||||
required = true,
|
||||
defaultValue = "engineer")
|
||||
@PathParam("roleName") String roleName,
|
||||
@ApiParam(
|
||||
name = "role",
|
||||
value = "Details about the role to be added.",
|
||||
value = "The properties required to update a role.",
|
||||
required = true) RoleInfo role);
|
||||
|
||||
@DELETE
|
||||
@Path("/{roleName}")
|
||||
@ApiOperation(
|
||||
httpMethod = "DELETE",
|
||||
value = "Delete a role.",
|
||||
notes = "In a situation when your Organization identifies that a specific role is no longer required you " +
|
||||
"will need to remove the role details from EMM.",
|
||||
value = "Deleting a Role",
|
||||
notes = "Roles become obsolete over time due to various reasons. In a situation where your Organization identifies that a specific role is no longer required, you " +
|
||||
"can delete a role using this REST API.",
|
||||
tags = "Role Management")
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n Role has successfully been removed"),
|
||||
message = "OK. \n Successfully removed the specified role."),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
message = "Bad Request. \n Invalid request or validation error.",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Role to be deleted does not exist.",
|
||||
message = "Not Found. \n The specified role does not exist.",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
@ -374,8 +384,9 @@ public interface RoleManagementService {
|
||||
Response deleteRole(
|
||||
@ApiParam(
|
||||
name = "roleName",
|
||||
value = "Name of the role to de deleted.",
|
||||
required = true)
|
||||
value = "The name of the role that needs to de deleted.",
|
||||
required = true,
|
||||
defaultValue = "engineer")
|
||||
@PathParam("roleName") String roleName);
|
||||
|
||||
@PUT
|
||||
@ -384,19 +395,19 @@ public interface RoleManagementService {
|
||||
consumes = MediaType.APPLICATION_JSON,
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "PUT",
|
||||
value = "Add users to a role.",
|
||||
notes = "Defining the users to a role at the point of creating a new role is optional, " +
|
||||
"therefore you are able to update the users that belong to a given role after you have created " +
|
||||
"a role using this REST API." +
|
||||
value = "Adding Users to a Role",
|
||||
notes = "Defining users to a role at the point of creating a new role is optional. " +
|
||||
"You can update the users that belong to a given role after you have created " +
|
||||
"a role using this REST API.\n" +
|
||||
"Example: Your Organization hires 30 new engineers. Updating the role details for each user can " +
|
||||
"be cumbersome, therefore you can define all the new employees that belong to the engineering " +
|
||||
"be cumbersome. Therefore, you can define all the new employees that belong to the engineering " +
|
||||
"role using this API.",
|
||||
tags = "Role Management")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
code = 200,
|
||||
message = "OK. \n User list of the role has been updated successfully",
|
||||
message = "OK. \n Successfully added the users to the specified role.",
|
||||
responseHeaders = {
|
||||
@ResponseHeader(
|
||||
name = "Content-Type",
|
||||
@ -415,17 +426,17 @@ public interface RoleManagementService {
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Resource to be deleted does not exist.",
|
||||
message = "Not Found. \n The specified role does not exist.",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 415,
|
||||
message = "Unsupported media type. \n The entity of the request was in a not " +
|
||||
message = "Unsupported media type. \n The format of the requested entity was not supported.\n" +
|
||||
"supported format.",
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n " +
|
||||
"Server error occurred while updating the user list of the role.",
|
||||
"Server error occurred while adding the user to the specified role.",
|
||||
response = ErrorResponse.class)
|
||||
})
|
||||
@Permission(name = "Manage Roles", permission = "/device-mgt/roles/manage")
|
||||
@ -437,7 +448,10 @@ public interface RoleManagementService {
|
||||
@PathParam("roleName") String roleName,
|
||||
@ApiParam(
|
||||
name = "users",
|
||||
value = "List of usernames to be added.",
|
||||
required = true) List<String> users);
|
||||
value = "Define the users that belong to the role.\n" +
|
||||
"Multiple users can be added to a role by using comma separated values. ",
|
||||
required = true,
|
||||
defaultValue = "[jim]"
|
||||
) List<String> users);
|
||||
|
||||
}
|
||||
|
||||
@ -49,14 +49,14 @@ public interface ApplicationManagementAdminService {
|
||||
consumes = MediaType.APPLICATION_JSON,
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "POST",
|
||||
value = "Application installation API.(Internal API)",
|
||||
notes = "This is an internal API used for application installation on a device.",
|
||||
value = "Installing an Application (Internal API)",
|
||||
notes = "This is an internal API that can be used to install an application on a device.",
|
||||
response = Activity.class,
|
||||
tags = "Application Management Administrative Service")
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(
|
||||
code = 202,
|
||||
message = "OK. \n Install application operation will be delivered to the given devices",
|
||||
message = "Accepted. \n The install application operation will be delivered to the specified devices",
|
||||
response = Activity.class),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
@ -64,15 +64,15 @@ public interface ApplicationManagementAdminService {
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Resource to be processed does not exist."),
|
||||
message = "Not Found. \n The specified resource does not exist."),
|
||||
@ApiResponse(
|
||||
code = 415,
|
||||
message = "Unsupported media type. \n The entity of the request was in a not supported format."),
|
||||
message = "Unsupported media type. \n The format of the requested entity was not supported."),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n " +
|
||||
"Server error occurred while bulk issuing application installation operations upon " +
|
||||
"a given set of devices.",
|
||||
"Server error occurred while executing the application install operation in bulk" +
|
||||
" for a specified set of devices.",
|
||||
response = ErrorResponse.class)
|
||||
})
|
||||
@Permission(name = "Install/Uninstall applications", permission = "/device-mgt/applications/manage")
|
||||
@ -88,14 +88,14 @@ public interface ApplicationManagementAdminService {
|
||||
consumes = MediaType.APPLICATION_JSON,
|
||||
produces = MediaType.APPLICATION_JSON,
|
||||
httpMethod = "POST",
|
||||
value = "Application un-installation API.(Internal API)",
|
||||
notes = "This is an internal API used for application un-installation on a device.",
|
||||
value = "Uninstalling an Application (Internal API)\n",
|
||||
notes = "This is an internal API that can be used to uninstall an application.",
|
||||
response = Activity.class,
|
||||
tags = "Application Management Administrative Service")
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(
|
||||
code = 202,
|
||||
message = "OK. \n Uninstall application operation will be delivered to the provided devices",
|
||||
message = "Accepted. \n The uninstall application operation will be delivered to the provided devices",
|
||||
response = Activity.class),
|
||||
@ApiResponse(
|
||||
code = 400,
|
||||
@ -103,15 +103,14 @@ public interface ApplicationManagementAdminService {
|
||||
response = ErrorResponse.class),
|
||||
@ApiResponse(
|
||||
code = 404,
|
||||
message = "Not Found. \n Resource to be processed does not exist."),
|
||||
message = "Not Found. \n The specified resource does not exist."),
|
||||
@ApiResponse(
|
||||
code = 415,
|
||||
message = "Unsupported media type. \n The entity of the request was in a not supported format."),
|
||||
@ApiResponse(
|
||||
code = 500,
|
||||
message = "Internal Server Error. \n " +
|
||||
"Server error occurred while bulk issuing application un-installation operations upon " +
|
||||
"a given set of devices.",
|
||||
message = "Internal Server Error. \n Server error occurred while executing the application install operation in bulk" +
|
||||
" for a specified set of devices.",
|
||||
response = ErrorResponse.class)
|
||||
})
|
||||
@Permission(name = "Install/Uninstall applications", permission = "/device-mgt/applications/manage")
|
||||
|
||||
@ -29,12 +29,12 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@SwaggerDefinition(
|
||||
basePath = "/api-device-mgt-v1.0",
|
||||
basePath = "/api/device-mgt/v1.0",
|
||||
host = "localhost:9443"
|
||||
)
|
||||
public class SecurityDefinitionConfigurator implements ReaderListener {
|
||||
|
||||
public static final String TOKEN_AUTH_SCHEME = "tokenAuthScheme";
|
||||
public static final String TOKEN_AUTH_SCHEME = "swagger_auth";
|
||||
|
||||
@Override
|
||||
public void beforeScan(Reader reader, Swagger swagger) {
|
||||
@ -45,9 +45,10 @@ public class SecurityDefinitionConfigurator implements ReaderListener {
|
||||
public void afterScan(Reader reader, Swagger swagger) {
|
||||
OAuth2Definition tokenScheme = new OAuth2Definition();
|
||||
tokenScheme.setType("oauth2");
|
||||
tokenScheme.setFlow("password");
|
||||
tokenScheme.setTokenUrl("https://" + swagger.getHost() + "/oauth/token");
|
||||
tokenScheme.setAuthorizationUrl("https://" + swagger.getHost() + "/oauth/authorize");
|
||||
tokenScheme.setFlow("application");
|
||||
tokenScheme.setTokenUrl("https://" + swagger.getHost() + "/oauth2/token");
|
||||
tokenScheme.setAuthorizationUrl("https://" + swagger.getHost() + "/oauth2/authorize");
|
||||
tokenScheme.addScope("write:everything", "Full access");
|
||||
|
||||
Map<String, SecuritySchemeDefinition> schemes = new HashMap<>();
|
||||
schemes.put(TOKEN_AUTH_SCHEME, tokenScheme);
|
||||
|
||||
@ -28,12 +28,20 @@ import java.io.Serializable;
|
||||
"uniquely.")
|
||||
public class DeviceIdentifier implements Serializable{
|
||||
|
||||
@ApiModelProperty(
|
||||
name = "id",
|
||||
value = "Identity of the device.",
|
||||
required = true,
|
||||
example = "123456")
|
||||
@JsonProperty(value = "id", required = true)
|
||||
@ApiModelProperty(name = "id", value = "Identity of the device.", required = true)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(
|
||||
name = "type",
|
||||
value = "Type of the device.",
|
||||
required = true,
|
||||
example = "android")
|
||||
@JsonProperty(value = "type", required = true)
|
||||
@ApiModelProperty(name = "type", value = "Type of the device.", required = true)
|
||||
private String type;
|
||||
|
||||
public DeviceIdentifier() {}
|
||||
|
||||
@ -36,14 +36,16 @@ public class Activity {
|
||||
@ApiModelProperty(
|
||||
name = "activityId",
|
||||
value = "Activity identifier",
|
||||
required = true)
|
||||
required = true,
|
||||
example = "ACTIVITY_1")
|
||||
@JsonProperty("activityId")
|
||||
private String activityId;
|
||||
|
||||
@ApiModelProperty(
|
||||
name = "code",
|
||||
value = "Activity code",
|
||||
required = true)
|
||||
required = true,
|
||||
example = "DEVICE_RING")
|
||||
@JsonProperty("code")
|
||||
private String code;
|
||||
|
||||
@ -51,14 +53,16 @@ public class Activity {
|
||||
name = "type",
|
||||
value = "Activity type",
|
||||
required = true,
|
||||
allowableValues = "CONFIG, MESSAGE, INFO, COMMAND, PROFILE, POLICY")
|
||||
allowableValues = "CONFIG, MESSAGE, INFO, COMMAND, PROFILE, POLICY",
|
||||
example = "COMMAND")
|
||||
@JsonProperty("type")
|
||||
private Type type;
|
||||
|
||||
@ApiModelProperty(
|
||||
name = "createdTimeStamp",
|
||||
value = "Timestamp recorded when the activity took place",
|
||||
required = true)
|
||||
required = true,
|
||||
example = "Thu Oct 06 11:18:47 IST 2016")
|
||||
@JsonProperty("createdTimestamp")
|
||||
private String createdTimeStamp;
|
||||
|
||||
|
||||
@ -43,7 +43,8 @@ public class ActivityStatus {
|
||||
@ApiModelProperty(
|
||||
name = "status",
|
||||
value = "Status of the activity performed.",
|
||||
required = true)
|
||||
required = true,
|
||||
example = "PENDING")
|
||||
@JsonProperty("status")
|
||||
private Status status;
|
||||
|
||||
@ -57,7 +58,8 @@ public class ActivityStatus {
|
||||
@ApiModelProperty(
|
||||
name = "updatedTimestamp ",
|
||||
value = "Last updated time of the activity.",
|
||||
required = true)
|
||||
required = true,
|
||||
example = "Thu Oct 06 11:18:47 IST 2016")
|
||||
@JsonProperty("updatedTimestamp")
|
||||
private String updatedTimestamp;
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
package org.wso2.carbon.device.mgt.common.operation.mgt;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ -26,10 +27,20 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
+ " responses")
|
||||
public class OperationResponse {
|
||||
|
||||
@ApiModelProperty(name = "response", value = "Operation response returned from the device", required = true)
|
||||
@ApiModelProperty(
|
||||
name = "response",
|
||||
value = "Operation response returned from the device",
|
||||
required = true,
|
||||
example = "SUCCESSFUL")
|
||||
@JsonProperty("response")
|
||||
private String response;
|
||||
@ApiModelProperty(name = "receivedTimeStamp", value = "Time that the operation response received",
|
||||
required = true)
|
||||
|
||||
@ApiModelProperty(
|
||||
name = "receivedTimeStamp",
|
||||
value = "Time that the operation response received",
|
||||
required = true,
|
||||
example = "Thu Oct 06 11:18:47 IST 2016")
|
||||
@JsonProperty("receivedTimeStamp")
|
||||
private String receivedTimeStamp;
|
||||
|
||||
public String getResponse() {
|
||||
|
||||
@ -19,6 +19,9 @@
|
||||
<a href="{{#defineZone "productUri"}}{{@app.context}}/{{/defineZone}}">
|
||||
<img src="{{@unit.publicUri}}/img/logo.png" alt="{{defineZone "productName"}}"
|
||||
title="{{defineZone "productName"}}" class="logo" />
|
||||
<h1>{{#defineZone "productName"}}Unified UI Template App{{/defineZone}}</h1>
|
||||
<h1>
|
||||
<span class="hidden-xs">{{#defineZone "productName"}}Unified UI Template App{{/defineZone}}</span>
|
||||
<span class="visible-xs-inline">{{#defineZone "productNameResponsive"}}UUI Tmpl. App{{/defineZone}}</span>
|
||||
</h1>
|
||||
</a>
|
||||
{{/zone}}
|
||||
@ -27,12 +27,7 @@
|
||||
{{@user.username}}<span class="caret"></span>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-right float-remove-xs position-static-xs text-center-xs remove-margin-xs slideInDown"
|
||||
role="menu">
|
||||
<li class="dropdown-header visible-xs">
|
||||
{{@user.username}}<span class="caret"></span>
|
||||
</li>
|
||||
<li class="divider visible-xs"></li>
|
||||
<ul class="dropdown-menu dropdown-menu-right slideInDown" role="menu">
|
||||
{{#defineZone "userMenu-items"}}
|
||||
<li>
|
||||
<a href="{{@app.context}}/signout">Sign Out</a>
|
||||
|
||||
@ -18,10 +18,10 @@
|
||||
{{#zone "header"}}
|
||||
<header class="header header-default">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-left brand float-remove-xs text-center-xs">
|
||||
<div class="pull-left brand">
|
||||
{{defineZone "brand"}}
|
||||
</div>
|
||||
<div class="pull-right auth float-remove-xs text-center-xs">
|
||||
<div class="pull-right auth">
|
||||
{{defineZone "userMenu"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -2791,6 +2791,7 @@ header .brand {
|
||||
}
|
||||
header .brand img.logo {
|
||||
height: 24px;
|
||||
margin-top:0px;
|
||||
}
|
||||
header .brand a {
|
||||
display: inline-block;
|
||||
@ -2822,6 +2823,9 @@ header .nav .open > a:focus {
|
||||
}
|
||||
header .nav .dropdown-menu {
|
||||
background: black;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
top:50px;
|
||||
}
|
||||
header .nav .dropdown-menu a {
|
||||
color: #fff;
|
||||
@ -2954,7 +2958,7 @@ tbody.collapse.in {
|
||||
}
|
||||
.dropdown-menu > li > a {
|
||||
display: block;
|
||||
padding: 3px 20px;
|
||||
padding: 8px 20px;
|
||||
clear: both;
|
||||
font-weight: normal;
|
||||
line-height: 1.42857;
|
||||
@ -3050,6 +3054,12 @@ tbody.collapse.in {
|
||||
right: auto;
|
||||
}
|
||||
}
|
||||
@media (max-width : 480px) {
|
||||
.navbar-right .dropdown-menu-right {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
.btn-group,
|
||||
.btn-group-vertical {
|
||||
position: relative;
|
||||
|
||||
@ -109,7 +109,7 @@ public class EmailSenderServiceImpl implements EmailSenderService {
|
||||
Options options = new Options();
|
||||
options.setProperty(MessageContext.TRANSPORT_HEADERS, headerMap);
|
||||
options.setProperty("FORCE_CONTENT_TYPE_BASED_FORMATTER", "true");
|
||||
options.setProperty(Constants.Configuration.MESSAGE_TYPE, "text/html");
|
||||
options.setProperty(Constants.Configuration.MESSAGE_TYPE, "application/xml");
|
||||
options.setProperty(Constants.Configuration.CONTENT_TYPE, "text/html");
|
||||
options.setTo(new EndpointReference(EMAIL_URI_SCHEME + to));
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user