Brownie Requester

class BrownieRequester(host: String, var sessionId: String?, language: String, debugMode: Boolean = false) : Requester

The BrownieRequester class is useful to communicate with Brownie's backend

Author

N7ghtm4r3 - Tecknobit

Parameters

host

The host address where is running the backend

sessionId

The identifier of the session

language

The language of the device

debugMode

Whether the requester is still in development and who is developing needs the log of the requester's workflow, if it is enabled all the details of the requests sent and the errors occurred will be printed in the console

Constructors

Link copied to clipboard
constructor(host: String, sessionId: String?, language: String, debugMode: Boolean = false)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun addService(hostId: String, serviceName: String, programArguments: String, purgeNohupOutAfterReboot: Boolean, autoRunAfterHostReboot: Boolean): JsonObject

Request to add a service to a host

Link copied to clipboard
fun attachInterceptorOnRequest(interceptor: () -> Unit)
Link copied to clipboard
open override fun changeHost(host: String)

Method used to change, during the runtime for example when the session changed, the host address to make the requests

Link copied to clipboard
open fun clearSession()
Link copied to clipboard
suspend fun connectToSession(serverSecret: String, joinCode: String, password: String): JsonObject

Request to connect to a specific session

Link copied to clipboard
suspend fun createSession(serverSecret: String, password: String): JsonObject

Request to create a new session

Link copied to clipboard
suspend fun deleteService(hostId: String, serviceId: String): JsonObject

Request to delete the service

Link copied to clipboard
suspend fun deleteSession(password: String): JsonObject

Request to delete an existing session

Link copied to clipboard
suspend fun editHost(hostId: String, hostName: String, hostAddress: String, sshUser: String, sshPassword: String): JsonObject

Request to edit an existing host

Link copied to clipboard
suspend fun editService(hostId: String, serviceId: String, serviceName: String, programArguments: String, purgeNohupOutAfterReboot: Boolean, autoRunAfterHostReboot: Boolean): JsonObject

Request to edit an existing service

Link copied to clipboard
suspend fun getHost(hostId: String): JsonObject

Request to get a specific host

Link copied to clipboard
suspend fun getHostOverview(hostId: String): JsonObject

Request to get the host overview

Link copied to clipboard
suspend fun getHosts(page: Int, keywords: String, statuses: List<HostStatus>): JsonObject

Request to get the hosts related to the session

Link copied to clipboard
suspend fun getHostsStatus(currentHosts: List<SavedHost.SavedHostImpl>?): JsonObject

Request to get the current status of the specified hosts

Link copied to clipboard
suspend fun getService(hostId: String, serviceId: String): JsonObject

Request to get a service

Link copied to clipboard
suspend fun getServices(hostId: String, page: Int, keywords: String, statuses: List<ServiceStatus>): JsonObject

Request to get the services of a host

Link copied to clipboard
suspend fun getServicesStatus(hostId: String, currentServices: List<HostService>?): JsonObject

Request to get the current status of the specified services

Link copied to clipboard
suspend fun handleHostStatus(host: SavedHost, newStatus: HostStatus): JsonObject

Request to handle the status of a host

Link copied to clipboard
suspend fun handleServiceStatus(hostId: String, service: HostService, newStatus: ServiceStatus): JsonObject

Request to handle the status of a service

Link copied to clipboard
suspend fun rebootHost(host: SavedHost): JsonObject

Request to reboot a host

Link copied to clipboard
suspend fun rebootService(hostId: String, service: HostService): JsonObject

Request to reboot a service

Link copied to clipboard
suspend fun registerHost(hostName: String, hostAddress: String, sshUser: String, sshPassword: String): JsonObject

Request to register a new host

Link copied to clipboard
suspend fun removeService(hostId: String, serviceId: String, removeFromTheHost: Boolean = false): JsonObject

Request to delete the service

Link copied to clipboard
fun setUserCredentials(userId: String?, userToken: String?)
Link copied to clipboard
suspend fun unregisterHost(host: SavedHost): JsonObject

Request to unregister a host from the system