@Path(value="/common")
@Produces(value="application/json")
public interface CommonRestInterface
Modifier and Type | Method and Description |
---|---|
Map<String,Collection<String>> |
addOrEditTenant(String sessionId,
String tenant,
Collection<String> groups)
Add or Edit a tenant
|
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.
|
List<OutputUserInfo> |
createUser(String sessionId,
InputUserInfo userInfo)
Create user
|
String |
currentUser(String sessionId)
Get the login string associated to a session.
|
UserData |
currentUserData(String sessionId)
Get a UserData object associated to a session.
|
List<OutputUserInfo> |
deleteUser(String sessionId,
String username)
Delete user
|
List<OutputUserInfo> |
editUser(String sessionId,
String username,
InputUserInfo userInfo)
Edit user
|
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.
|
OutputUserInfo |
getUserDetails(String sessionId,
String username)
Get user details
|
boolean |
isConnected(String sessionId)
Tests whether the session is connected to the ProActive server.
|
Map<String,Collection<String>> |
listTenants(String sessionId)
List tenants association
|
List<OutputUserInfo> |
listUsers(String sessionId)
List users
|
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.
|
JAASConfiguration |
permissionManagerGroupsRead(String sessionId)
Read existing groups roles
If the user has the RoleReaderPermission, it will return the roles of the current user's groups
If the user has the RoleAdminPermission, it will return all existing group roles
If the user does not have either of these permissions, it will return an error
|
JAASConfiguration |
permissionManagerGroupsWrite(String sessionId,
JAASConfiguration configuration)
Write groups roles
If the user has the RoleAdminPermission, new roles will be written and loaded on the server
If the user does not have this permission, it will return an error
|
boolean |
portalAccess(String sessionId,
String portal)
Check single portal access.
|
List<String> |
portalsAccesses(String sessionId,
List<String> portals)
Check multiple portals accesses.
|
Map<String,Collection<String>> |
removeTenant(String sessionId,
String tenant)
Delete a tenant
|
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="manager/groups") @Produces(value="application/json") JAASConfiguration permissionManagerGroupsRead(@HeaderParam(value="sessionid") String sessionId) throws RestException, IOException
sessionId
- id of a sessionRestException
- if an error occurs or the session is invalidIOException
@PUT @Path(value="manager/groups") @Produces(value="application/json") JAASConfiguration permissionManagerGroupsWrite(@HeaderParam(value="sessionid") String sessionId, JAASConfiguration configuration) throws RestException, IOException
sessionId
- id of a sessionconfiguration
- the new role configurationRestException
- if an error occurs or the session is invalidIOException
@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@POST @Path(value="manager/users") @Consumes(value="application/json") @Produces(value="application/json") List<OutputUserInfo> createUser(@HeaderParam(value="sessionid") String sessionId, InputUserInfo userInfo) throws NotConnectedRestException, PermissionRestException, LoginRestException
sessionId
- id of a sessionuserInfo
- new account detailsNotConnectedRestException
PermissionRestException
LoginRestException
@GET @Path(value="manager/users") @Produces(value="application/json") List<OutputUserInfo> listUsers(@HeaderParam(value="sessionid") String sessionId) throws NotConnectedRestException, PermissionRestException, LoginRestException
sessionId
- id of a sessionNotConnectedRestException
PermissionRestException
LoginRestException
@GET @Path(value="manager/users/{username}") @Produces(value="application/json") OutputUserInfo getUserDetails(@HeaderParam(value="sessionid") String sessionId, @PathParam(value="username") String username) throws NotConnectedRestException, PermissionRestException, LoginRestException
sessionId
- id of a sessionusername
- username of the userNotConnectedRestException
PermissionRestException
LoginRestException
@PUT @Path(value="manager/users/{username}") @Consumes(value="application/json") @Produces(value="application/json") List<OutputUserInfo> editUser(@HeaderParam(value="sessionid") String sessionId, @PathParam(value="username") String username, InputUserInfo userInfo) throws NotConnectedRestException, PermissionRestException, LoginRestException
sessionId
- id of a sessionusername
- username of the useruserInfo
- input modifications to the userNotConnectedRestException
PermissionRestException
LoginRestException
@DELETE @Path(value="manager/users/{username}") @Produces(value="application/json") List<OutputUserInfo> deleteUser(@HeaderParam(value="sessionid") String sessionId, @PathParam(value="username") String username) throws NotConnectedRestException, PermissionRestException, LoginRestException
sessionId
- id of a sessionusername
- username of the userNotConnectedRestException
PermissionRestException
LoginRestException
@GET @Path(value="manager/tenants") @Produces(value="application/json") Map<String,Collection<String>> listTenants(@HeaderParam(value="sessionid") String sessionId) throws NotConnectedRestException, PermissionRestException, LoginRestException
sessionId
- id of a sessionNotConnectedRestException
PermissionRestException
LoginRestException
@PUT @Path(value="manager/tenants/{tenant}") @Consumes(value="application/json") @Produces(value="application/json") Map<String,Collection<String>> addOrEditTenant(@HeaderParam(value="sessionid") String sessionId, @PathParam(value="tenant") String tenant, Collection<String> groups) throws NotConnectedRestException, PermissionRestException, LoginRestException
sessionId
- id of a sessiontenant
- tenant namegroups
- set of groups to associateNotConnectedRestException
PermissionRestException
LoginRestException
@DELETE @Path(value="manager/tenants/{tenant}") @Produces(value="application/json") Map<String,Collection<String>> removeTenant(@HeaderParam(value="sessionid") String sessionId, @PathParam(value="tenant") String tenant) throws NotConnectedRestException, PermissionRestException, LoginRestException
sessionId
- id of a sessiontenant
- tenant nameNotConnectedRestException
PermissionRestException
LoginRestException