Package io.antmedia.console.rest
Class RestServiceV2
java.lang.Object
io.antmedia.console.rest.CommonRestService
io.antmedia.console.rest.RestServiceV2
-
Field Summary
Fields inherited from class io.antmedia.console.rest.CommonRestService
applicationContext, gson, IS_AUTHENTICATED, LICENSE_KEY, logger, MARKET_BUILD, NODE_GROUP, SCOPE_SYSTEM, SERVER_NAME, SESSION_SCOPE_KEY, USER_EMAIL, USER_PASSWORD, USER_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddInitialUser
(User user) Add user account on db.authenticateUser
(User user) Authenticates user with userName and passwordchangeServerSettings
(ServerSettings serverSettings) changeSettings
(String appname, AppSettings newSettings) changeUserPassword
(User user) configureSsl
(String domain, String type, InputStream fullChainFile, org.glassfish.jersey.media.multipart.FormDataContentDisposition fullChainFileDetail, InputStream privateKeyFile, org.glassfish.jersey.media.multipart.FormDataContentDisposition privateKeyFileDetail, InputStream chainFile, org.glassfish.jersey.media.multipart.FormDataContentDisposition chainFileDetail) createApplication
(String appName) createApplication
(String appName, InputStream inputStream) deleteApplication
(String appName, boolean deleteDB) deleteUser
(String userName) getAppLiveStreams
(String name) Refactor remove this function and use ProxyServlet to get this info Before deleting check web panel does not use itgetBlockedStatus
(String usermail) getProcessCpuTime: microseconds CPU time used by the process getSystemCpuLoad: "% recent cpu usage" for the whole system.jakarta.ws.rs.core.Response
getLicenceStatus
(String key) getLogFile
(int charSize, String logType, long offsetSize) Return server uptime and startime in millisecondsgetSettings
(String appname) isAdmin()
boolean
isApplicationExists
(String appName) jakarta.ws.rs.core.Response
isShutdownProperly
(String appNamesArray) jakarta.ws.rs.core.Response
liveness()
resetBroadcast
(String appname) This method resets the viewers counts and broadcast status in the db.boolean
setShutdownStatus
(String appNamesArray) Methods inherited from class io.antmedia.console.rest.CommonRestService
changeLogSettings, changeUserPasswordInternal, currentLevelDetect, deleteVoDStream, extractFQDN, getAllowedLoginAttempts, getAppAdaptor, getApplication, getContext, getDataStore, getDataStoreFactory, getHttpClient, getLicenceServiceInstance, getLiveClientsSize, getMD5Hash, getServerSettingsInternal, getShutdownStatus, getStatsCollector, getTmpDirectory, getWebAppsDirectory, isAuthenticated, isClusterMode, sendUserInfo, setDataStore, setDataStoreFactory, setRequestForTest
-
Constructor Details
-
RestServiceV2
public RestServiceV2()
-
-
Method Details
-
addUser
@POST @Path("/users") @Produces("application/json") @Consumes("application/json") public Result addUser(User user) Description copied from class:CommonRestService
Add user account on db. Username must be unique, if there is a user with the same name, user will not be created userType = 0 means ready only account userType = 1 means read-write account Post method should be used. application/json form parameters - case sensitive "userName", "password", "userType- Overrides:
addUser
in classCommonRestService
- Parameters:
user
- : The user to be added- Returns:
- JSON data if user is added success will be true if user is not added success will be false if user is not added, errorId = 1 means username already exist
-
editUser
@PUT @Path("/users") @Produces("application/json") @Consumes("application/json") public Result editUser(User user) - Overrides:
editUser
in classCommonRestService
-
deleteUser
@DELETE @Path("/users/{username}") @Produces("application/json") @Consumes("application/x-www-form-urlencoded") public Result deleteUser(@PathParam("username") String userName) - Overrides:
deleteUser
in classCommonRestService
-
getBlockedStatus
@GET @Consumes("application/json") @Path("/users/{usermail}/blocked") @Produces("application/json") public Result getBlockedStatus(@PathParam("usermail") String usermail) - Overrides:
getBlockedStatus
in classCommonRestService
-
getUserList
- Overrides:
getUserList
in classCommonRestService
-
isAdmin
@GET @Path("/admin-status") @Produces("application/json") @Consumes("application/json") public Result isAdmin()- Overrides:
isAdmin
in classCommonRestService
-
addInitialUser
@POST @Path("/users/initial") @Produces("application/json") @Consumes("application/json") public Result addInitialUser(User user) - Overrides:
addInitialUser
in classCommonRestService
-
isFirstLogin
@GET @Path("/first-login-status") @Produces("application/json") @Consumes("application/json") public Result isFirstLogin()- Overrides:
isFirstLogin
in classCommonRestService
-
authenticateUser
@POST @Path("/users/authenticate") @Produces("application/json") @Consumes("application/json") public Result authenticateUser(User user) Description copied from class:CommonRestService
Authenticates user with userName and password- Overrides:
authenticateUser
in classCommonRestService
- Parameters:
user
- : The User object to be authenticated- Returns:
- json that shows user is authenticated or not
-
deleteSession
@DELETE @Path("/users/logout") @Produces("application/json") @Consumes("application/json") public Result deleteSession()- Overrides:
deleteSession
in classCommonRestService
-
changeUserPassword
@POST @Path("/users/password") @Produces("application/json") @Consumes("application/json") public Result changeUserPassword(User user) - Overrides:
changeUserPassword
in classCommonRestService
-
isAuthenticatedRest
@GET @Path("/authentication-status") @Produces("application/json") public Result isAuthenticatedRest()- Overrides:
isAuthenticatedRest
in classCommonRestService
-
getSystemInfo
- Overrides:
getSystemInfo
in classCommonRestService
-
getJVMMemoryInfo
- Overrides:
getJVMMemoryInfo
in classCommonRestService
-
getSystemMemoryInfo
@GET @Path("/system-memory-status") @Produces("application/json") public String getSystemMemoryInfo()- Overrides:
getSystemMemoryInfo
in classCommonRestService
-
getFileSystemInfo
- Overrides:
getFileSystemInfo
in classCommonRestService
-
getCPUInfo
Description copied from class:CommonRestService
getProcessCpuTime: microseconds CPU time used by the process getSystemCpuLoad: "% recent cpu usage" for the whole system. getProcessCpuLoad: "% recent cpu usage" for the Java Virtual Machine process.- Overrides:
getCPUInfo
in classCommonRestService
- Returns:
- the CPU load info
-
getThreadDump
- Overrides:
getThreadDump
in classCommonRestService
-
getThreadDumpJSON
- Overrides:
getThreadDumpJSON
in classCommonRestService
-
getThreadsInfo
- Overrides:
getThreadsInfo
in classCommonRestService
-
getHeapDump
@GET @Path("/heap-dump") @Produces("application/octet-stream") public jakarta.ws.rs.core.Response getHeapDump()- Overrides:
getHeapDump
in classCommonRestService
-
getServerTime
Description copied from class:CommonRestService
Return server uptime and startime in milliseconds- Overrides:
getServerTime
in classCommonRestService
- Returns:
- JSON object contains the server uptime and start time
-
getSystemResourcesInfo
@GET @Path("/system-resources") @Produces("application/json") public String getSystemResourcesInfo()- Overrides:
getSystemResourcesInfo
in classCommonRestService
-
getGPUInfo
- Overrides:
getGPUInfo
in classCommonRestService
-
getVersion
- Overrides:
getVersion
in classCommonRestService
-
triggerGc
-
getApplications
- Overrides:
getApplications
in classCommonRestService
-
getTotalLiveStreamSize
@GET @Path("/live-clients-size") @Produces("application/json") public String getTotalLiveStreamSize() -
getApplicationInfo
- Overrides:
getApplicationInfo
in classCommonRestService
-
getAppLiveStreams
@GET @Path("/applications/live-streams/{appname}") @Produces("application/json") public String getAppLiveStreams(@PathParam("appname") String name) Description copied from class:CommonRestService
Refactor remove this function and use ProxyServlet to get this info Before deleting check web panel does not use it- Overrides:
getAppLiveStreams
in classCommonRestService
- Parameters:
name
- : application name- Returns:
- live streams in the application
-
changeSettings
@POST @Path("/applications/settings/{appname}") @Produces("application/json") @Consumes("application/json") public String changeSettings(@PathParam("appname") String appname, AppSettings newSettings) - Overrides:
changeSettings
in classCommonRestService
-
isShutdownProperly
@GET @Path("/shutdown-proper-status") @Produces("application/json") @Consumes("application/json") public jakarta.ws.rs.core.Response isShutdownProperly(@QueryParam("appNames") String appNamesArray) - Overrides:
isShutdownProperly
in classCommonRestService
-
setShutdownStatus
@GET @Path("/shutdown-properly") @Produces("application/json") @Consumes("application/json") public boolean setShutdownStatus(@QueryParam("appNames") String appNamesArray) - Overrides:
setShutdownStatus
in classCommonRestService
-
changeServerSettings
@POST @Path("/server-settings") @Produces("application/json") @Consumes("application/json") public String changeServerSettings(ServerSettings serverSettings) - Overrides:
changeServerSettings
in classCommonRestService
-
configureSsl
@POST @Path("/ssl-settings") @Consumes("multipart/form-data") @Produces("application/json") public Result configureSsl(@QueryParam("domain") String domain, @QueryParam("type") String type, InputStream fullChainFile, org.glassfish.jersey.media.multipart.FormDataContentDisposition fullChainFileDetail, InputStream privateKeyFile, org.glassfish.jersey.media.multipart.FormDataContentDisposition privateKeyFileDetail, InputStream chainFile, org.glassfish.jersey.media.multipart.FormDataContentDisposition chainFileDetail) - Overrides:
configureSsl
in classCommonRestService
-
isEnterpriseEdition
- Overrides:
isEnterpriseEdition
in classCommonRestService
-
getSettings
@GET @Path("/applications/settings/{appname}") @Produces("application/json") public AppSettings getSettings(@PathParam("appname") String appname) - Overrides:
getSettings
in classCommonRestService
-
getServerSettings
@GET @Path("/server-settings") @Produces("application/json") public ServerSettings getServerSettings()- Overrides:
getServerSettings
in classCommonRestService
-
getLicenceStatus
@GET @Path("/licence-status") @Produces("application/json") @Consumes("application/json") public Licence getLicenceStatus(@QueryParam("key") String key) - Overrides:
getLicenceStatus
in classCommonRestService
-
getLicenceStatus
@GET @Path("/last-licence-status") @Produces("application/json") @Consumes("application/json") public Licence getLicenceStatus()- Overrides:
getLicenceStatus
in classCommonRestService
-
resetBroadcast
@POST @Path("/applications/{appname}/reset") @Produces("application/json") @Consumes("application/json") public Result resetBroadcast(@PathParam("appname") String appname) Description copied from class:CommonRestService
This method resets the viewers counts and broadcast status in the db. This should be used to recover db after server crashes. It's not intended to use to ignore the crash- Overrides:
resetBroadcast
in classCommonRestService
- Parameters:
appname
- the application name that broadcasts will be reset- Returns:
-
isInClusterMode
- Overrides:
isInClusterMode
in classCommonRestService
-
getLogFile
@GET @Path("/log-file/{offsetSize}/{charSize}") @Produces("application/json") public String getLogFile(@PathParam("charSize") int charSize, @QueryParam("logType") String logType, @PathParam("offsetSize") long offsetSize) throws IOException - Overrides:
getLogFile
in classCommonRestService
- Throws:
IOException
-
createApplication
-
createApplication
@PUT @Consumes("multipart/form-data") @Path("/applications/{appName}") @Produces("application/json") public Result createApplication(@PathParam("appName") String appName, InputStream inputStream) - Overrides:
createApplication
in classCommonRestService
-
isApplicationExists
-
deleteApplication
@DELETE @Path("/applications/{appName}") @Produces("application/json") public Result deleteApplication(@PathParam("appName") String appName, @QueryParam("deleteDB") boolean deleteDB) - Overrides:
deleteApplication
in classCommonRestService
-
liveness
@GET @Path("/liveness") @Produces("application/json") public jakarta.ws.rs.core.Response liveness() -
getHostname
-