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
APP_NAME_REGEX, 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
Constructors -
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.ResponsegetLicenceStatus(String key) getLogFile(int charSize, String logType, long offsetSize) Return server uptime and startime in millisecondsgetSettings(String appname) isAdmin()booleanisApplicationExists(String appName) jakarta.ws.rs.core.ResponseisShutdownProperly(String appNamesArray) jakarta.ws.rs.core.Responseliveness()resetBroadcast(String appname) This method resets the viewers counts and broadcast status in the db.booleansetShutdownStatus(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:CommonRestServiceAdd 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:
addUserin 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:
editUserin classCommonRestService
-
deleteUser
@DELETE @Path("/users/{username}") @Produces("application/json") @Consumes("application/x-www-form-urlencoded") public Result deleteUser(@PathParam("username") String userName) - Overrides:
deleteUserin classCommonRestService
-
getBlockedStatus
@GET @Consumes("application/json") @Path("/users/{usermail}/blocked") @Produces("application/json") public Result getBlockedStatus(@PathParam("usermail") String usermail) - Overrides:
getBlockedStatusin classCommonRestService
-
getUserList
- Overrides:
getUserListin classCommonRestService
-
isAdmin
@GET @Path("/admin-status") @Produces("application/json") @Consumes("application/json") public Result isAdmin()- Overrides:
isAdminin classCommonRestService
-
addInitialUser
@POST @Path("/users/initial") @Produces("application/json") @Consumes("application/json") public Result addInitialUser(User user) - Overrides:
addInitialUserin classCommonRestService
-
isFirstLogin
@GET @Path("/first-login-status") @Produces("application/json") @Consumes("application/json") public Result isFirstLogin()- Overrides:
isFirstLoginin classCommonRestService
-
authenticateUser
@POST @Path("/users/authenticate") @Produces("application/json") @Consumes("application/json") public Result authenticateUser(User user) Description copied from class:CommonRestServiceAuthenticates user with userName and password- Overrides:
authenticateUserin 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:
deleteSessionin classCommonRestService
-
changeUserPassword
@POST @Path("/users/password") @Produces("application/json") @Consumes("application/json") public Result changeUserPassword(User user) - Overrides:
changeUserPasswordin classCommonRestService
-
isAuthenticatedRest
@GET @Path("/authentication-status") @Produces("application/json") public Result isAuthenticatedRest()- Overrides:
isAuthenticatedRestin classCommonRestService
-
getSystemInfo
- Overrides:
getSystemInfoin classCommonRestService
-
getJVMMemoryInfo
- Overrides:
getJVMMemoryInfoin classCommonRestService
-
getSystemMemoryInfo
@GET @Path("/system-memory-status") @Produces("application/json") public String getSystemMemoryInfo()- Overrides:
getSystemMemoryInfoin classCommonRestService
-
getFileSystemInfo
- Overrides:
getFileSystemInfoin classCommonRestService
-
getCPUInfo
Description copied from class:CommonRestServicegetProcessCpuTime: 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:
getCPUInfoin classCommonRestService- Returns:
- the CPU load info
-
getThreadDump
- Overrides:
getThreadDumpin classCommonRestService
-
getThreadDumpJSON
- Overrides:
getThreadDumpJSONin classCommonRestService
-
getThreadsInfo
- Overrides:
getThreadsInfoin classCommonRestService
-
getHeapDump
@GET @Path("/heap-dump") @Produces("application/octet-stream") public jakarta.ws.rs.core.Response getHeapDump()- Overrides:
getHeapDumpin classCommonRestService
-
getServerTime
Description copied from class:CommonRestServiceReturn server uptime and startime in milliseconds- Overrides:
getServerTimein classCommonRestService- Returns:
- JSON object contains the server uptime and start time
-
getSystemResourcesInfo
@GET @Path("/system-resources") @Produces("application/json") public String getSystemResourcesInfo()- Overrides:
getSystemResourcesInfoin classCommonRestService
-
getGPUInfo
- Overrides:
getGPUInfoin classCommonRestService
-
getVersion
- Overrides:
getVersionin classCommonRestService
-
triggerGc
-
getApplications
- Overrides:
getApplicationsin classCommonRestService
-
getTotalLiveStreamSize
@GET @Path("/live-clients-size") @Produces("application/json") public String getTotalLiveStreamSize() -
getApplicationInfo
- Overrides:
getApplicationInfoin classCommonRestService
-
getAppLiveStreams
@GET @Path("/applications/live-streams/{appname}") @Produces("application/json") public String getAppLiveStreams(@PathParam("appname") String name) Description copied from class:CommonRestServiceRefactor remove this function and use ProxyServlet to get this info Before deleting check web panel does not use it- Overrides:
getAppLiveStreamsin 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:
changeSettingsin 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:
isShutdownProperlyin classCommonRestService
-
setShutdownStatus
@GET @Path("/shutdown-properly") @Produces("application/json") @Consumes("application/json") public boolean setShutdownStatus(@QueryParam("appNames") String appNamesArray) - Overrides:
setShutdownStatusin classCommonRestService
-
changeServerSettings
@POST @Path("/server-settings") @Produces("application/json") @Consumes("application/json") public String changeServerSettings(ServerSettings serverSettings) - Overrides:
changeServerSettingsin 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:
configureSslin classCommonRestService
-
isEnterpriseEdition
- Overrides:
isEnterpriseEditionin classCommonRestService
-
getSettings
@GET @Path("/applications/settings/{appname}") @Produces("application/json") public AppSettings getSettings(@PathParam("appname") String appname) - Overrides:
getSettingsin classCommonRestService
-
getServerSettings
@GET @Path("/server-settings") @Produces("application/json") public ServerSettings getServerSettings()- Overrides:
getServerSettingsin classCommonRestService
-
getLicenceStatus
@GET @Path("/licence-status") @Produces("application/json") @Consumes("application/json") public Licence getLicenceStatus(@QueryParam("key") String key) - Overrides:
getLicenceStatusin classCommonRestService
-
getLicenceStatus
@GET @Path("/last-licence-status") @Produces("application/json") @Consumes("application/json") public Licence getLicenceStatus()- Overrides:
getLicenceStatusin classCommonRestService
-
resetBroadcast
@POST @Path("/applications/{appname}/reset") @Produces("application/json") @Consumes("application/json") public Result resetBroadcast(@PathParam("appname") String appname) Description copied from class:CommonRestServiceThis 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:
resetBroadcastin classCommonRestService- Parameters:
appname- the application name that broadcasts will be reset- Returns:
-
isInClusterMode
- Overrides:
isInClusterModein 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:
getLogFilein 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:
createApplicationin classCommonRestService
-
isApplicationExists
-
deleteApplication
@DELETE @Path("/applications/{appName}") @Produces("application/json") public Result deleteApplication(@PathParam("appName") String appName, @QueryParam("deleteDB") boolean deleteDB) - Overrides:
deleteApplicationin classCommonRestService
-
liveness
@GET @Path("/liveness") @Produces("application/json") public jakarta.ws.rs.core.Response liveness() -
getHostname
-