Skip to main content

Class: BaseAdminRoute

Defined in: service-core/src/routes/BaseAdminRoute.ts:65

The BaseAdminRoute class provides a base set of endpoints that gives trusted users the ability to perform common adminstrative actions with the server.

Exposed endpoints:

NameHTTP MethodWhat it does
clearCacheGET /<base_path>/clear-cacheClears the Redis-based cache system.
logsUPGRADE /<base_path>/logsLive tail the service logs
getReleaseNotesGET /<base_path>/release-notesRetrieve the server release notes.
restartGET /<base_path>/restart` Restart the server

!!Note!! that the BaseAdminRoute is not automatically registered with a server by default. You must create your own class that extends AdminRoute and apply the desired base path with @Route().

Example

import \{ BaseAdminRoute, RouteDecorators \} from "@rapidrest/service-core";
const \{ Route \} = RouteDecorators;

@Route("/admin")
export class AdminRoute extends BaseAdminRoute \{\}

Constructors

Constructor

new BaseAdminRoute(): BaseAdminRoute

Returns

BaseAdminRoute

Properties

activeSockets

protected activeSockets: Map<string, any[]>

Defined in: service-core/src/routes/BaseAdminRoute.ts:67

A map of user uid's to active sockets.


cacheClient?

protected optional cacheClient?: Redis

Defined in: service-core/src/routes/BaseAdminRoute.ts:70


cacheConnConfig

protected cacheConnConfig: any

Defined in: service-core/src/routes/BaseAdminRoute.ts:73


logger

protected logger: any

Defined in: service-core/src/routes/BaseAdminRoute.ts:76


logsConnConfig

protected logsConnConfig: any

Defined in: service-core/src/routes/BaseAdminRoute.ts:79


redisClient?

protected optional redisClient?: Redis

Defined in: service-core/src/routes/BaseAdminRoute.ts:81


releaseNotes?

protected optional releaseNotes?: string

Defined in: service-core/src/routes/BaseAdminRoute.ts:84

The underlying ReleaseNotes specification.


serviceName?

protected optional serviceName?: string

Defined in: service-core/src/routes/BaseAdminRoute.ts:87


trustedRoles

protected trustedRoles: string[] = []

Defined in: service-core/src/routes/BaseAdminRoute.ts:90

Methods

clearCache()

clearCache(user?): Promise<void>

Defined in: service-core/src/routes/BaseAdminRoute.ts:134

Parameters

user?

JWTUser

Returns

Promise<void>


getReleaseNotes()

getReleaseNotes(user?): string | undefined

Defined in: service-core/src/routes/BaseAdminRoute.ts:235

Parameters

user?

JWTUser

Returns

string | undefined


init()

protected init(): Promise<void>

Defined in: service-core/src/routes/BaseAdminRoute.ts:93

Returns

Promise<void>


logs()

logs(socket, user): Promise<void>

Defined in: service-core/src/routes/BaseAdminRoute.ts:165

Parameters

socket

IWebSocketShim

user

JWTUser

Returns

Promise<void>


restart()

restart(user?): void

Defined in: service-core/src/routes/BaseAdminRoute.ts:248

Parameters

user?

JWTUser

Returns

void