@Path(value="/common")
@Produces(value="application/json")
public interface CommonRestInterface
Modifier and Type | Method and Description |
---|---|
boolean |
checkPcaAdmin(String sessionId)
Check if a user has admin privilege in cloud automation service.
|
Map<String,Boolean> |
checkPermissions(String sessionId,
List<String> methods)
Check multiple methods permission.
|
Map<String,Boolean> |
checkRolePermissions(String sessionId,
List<String> roles)
Check multiple service role permission.
|
boolean |
checkSubscriptionAdmin(String sessionId)
Check if a user has admin privilege in notification service.
|
String |
currentUser(String sessionId)
Get the login string associated to a session.
|
UserData |
currentUserData(String sessionId)
Get a UserData object associated to a session.
|
Set<String> |
generateTokens(String sessionId,
int numberTokens)
Generate tokens which can be used as one-time access session identifiers
|
Map<String,String> |
getCurrentLoggers(String sessionId)
Get the state of current loggers.
|
String |
getLogLevel(String sessionId,
String name)
Get logger level.
|
boolean |
isConnected(String sessionId)
Tests whether the session is connected to the ProActive server.
|
String |
login(String username,
String password)
login to the server with username and password form.
|
String |
loginWithCredential(LoginForm multipart)
Login to the server using a multipart form.
|
void |
logout(String sessionId)
Terminates a session.
|
boolean |
portalAccess(String sessionId,
String portal)
Check single portal access.
|
List<String> |
portalsAccesses(String sessionId,
List<String> portals)
Check multiple portals accesses.
|
boolean |
setLogLevel(String sessionId,
String name,
String level)
Change logger level.
|
boolean |
setLogLevelMultiple(String sessionId,
Map<String,String> loggersConfiguration)
Change multiple loggers level.
|
@POST @Path(value="login") @Produces(value={"text/plain","application/json"}) String login(@FormParam(value="username") String username, @FormParam(value="password") String password) throws LoginException, SchedulerRestException
username
- usernamepassword
- passwordLoginException
- if the authentication failsSchedulerRestException
- if any other error occurs@POST @Consumes(value="multipart/form-data") @Path(value="login") @Produces(value={"text/plain","application/json"}) String loginWithCredential(LoginForm multipart) throws KeyException, LoginException, SchedulerRestException
multipart
- multipart formLoginException
- if the authentication failsKeyException
- if the credentials file cannot be decryptedSchedulerRestException
- if any other error occurs@PUT @Path(value="logout") void logout(@HeaderParam(value="sessionid") String sessionId) throws RestException
sessionId
- id of the session to terminateRestException
- if the server cannot be contacted@GET @Path(value="connected") @Produces(value="application/json") boolean isConnected(@HeaderParam(value="sessionid") String sessionId)
sessionId
- the session to test@POST @Path(value="tokens") @Produces(value="application/json") Set<String> generateTokens(@HeaderParam(value="sessionid") String sessionId, @QueryParam(value="numberTokens") @DefaultValue(value="1") int numberTokens)
sessionId
- id of a session (tokens will be associated with this session)numberTokens
- number of tokens to generate@GET @Path(value="currentuser") @Produces(value="text/plain") String currentUser(@HeaderParam(value="sessionid") String sessionId)
sessionId
- id of a session@GET @Path(value="currentuserdata") @Produces(value="application/json") UserData currentUserData(@HeaderParam(value="sessionid") String sessionId)
sessionId
- id of a session@GET @Path(value="permissions/portals") @Produces(value="application/json") List<String> portalsAccesses(@HeaderParam(value="sessionid") String sessionId, @QueryParam(value="portals") List<String> portals) throws RestException
sessionId
- id of a sessionportals
- a list of portals access to testRestException
- if an error occurs or the session is invalid@GET @Path(value="permissions/portals/{portal}") @Produces(value="application/json") boolean portalAccess(@HeaderParam(value="sessionid") String sessionId, @PathParam(value="portal") String portal) throws RestException
sessionId
- id of a sessionportal
- string value identifying the portalRestException
- if an error occurs or the session is invalid@GET @Path(value="permissions/notification-service/admin") @Produces(value="application/json") boolean checkSubscriptionAdmin(@HeaderParam(value="sessionid") String sessionId) throws RestException
sessionId
- id of a sessionRestException
- if an error occurs or the session is invalid@GET @Path(value="permissions/cloud-automation-service/admin") @Produces(value="application/json") boolean checkPcaAdmin(@HeaderParam(value="sessionid") String sessionId) throws RestException
sessionId
- id of a sessionRestException
- if an error occurs or the session is invalid@GET @Path(value="logger") @Produces(value="application/json") String getLogLevel(@HeaderParam(value="sessionid") String sessionId, @QueryParam(value="name") String name) throws RestException
sessionId
- id of a sessionname
- logger nameRestException
- if an error occurs or the session is invalid@PUT @Path(value="logger") @Produces(value="application/json") boolean setLogLevel(@HeaderParam(value="sessionid") String sessionId, @QueryParam(value="name") String name, @QueryParam(value="level") String level) throws RestException
sessionId
- id of a sessionname
- logger namelevel
- logger levelRestException
- if an error occurs or the session is invalid@POST @Path(value="logger") @Consumes(value="application/json") @Produces(value="application/json") boolean setLogLevelMultiple(@HeaderParam(value="sessionid") String sessionId, Map<String,String> loggersConfiguration) throws RestException
sessionId
- id of a sessionloggersConfiguration
- map of (logger_name, level)RestException
- if an error occurs or the session is invalid@GET @Path(value="logger/current") @Produces(value="application/json") Map<String,String> getCurrentLoggers(@HeaderParam(value="sessionid") String sessionId) throws RestException
sessionId
- id of a sessionRestException
- if an error occurs or the session is invalid@POST @Path(value="permissions/methods") @Consumes(value="application/json") @Produces(value="application/json") Map<String,Boolean> checkPermissions(@HeaderParam(value="sessionid") String sessionId, List<String> methods) throws RestException
sessionId
- id of a sessionmethods
- a list of methods to checkRestException
- if an error occurs or the session is invalid@POST @Path(value="permissions/roles") @Consumes(value="application/json") @Produces(value="application/json") Map<String,Boolean> checkRolePermissions(@HeaderParam(value="sessionid") String sessionId, List<String> roles) throws RestException
sessionId
- id of a sessionroles
- a list of service roles to checkRestException
- if an error occurs or the session is invalid