mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -04:00
Docs: Add more documentation to the public api
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
0e44f545a1
commit
53f5093630
6 changed files with 199 additions and 7 deletions
|
@ -7,8 +7,19 @@
|
|||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import { MonitoringService } from '../../../monitoring/monitoring.service';
|
||||
import { TokenAuthGuard } from '../../../auth/token-auth.guard';
|
||||
import { ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import {
|
||||
ApiForbiddenResponse,
|
||||
ApiOkResponse,
|
||||
ApiProduces,
|
||||
ApiSecurity,
|
||||
ApiTags,
|
||||
ApiUnauthorizedResponse,
|
||||
} from '@nestjs/swagger';
|
||||
import { ServerStatusDto } from '../../../monitoring/server-status.dto';
|
||||
import {
|
||||
forbiddenDescription,
|
||||
unauthorizedDescription,
|
||||
} from '../../utils/descriptions';
|
||||
|
||||
@ApiTags('monitoring')
|
||||
@ApiSecurity('token')
|
||||
|
@ -18,6 +29,12 @@ export class MonitoringController {
|
|||
|
||||
@UseGuards(TokenAuthGuard)
|
||||
@Get()
|
||||
@ApiOkResponse({
|
||||
description: 'The server info',
|
||||
type: ServerStatusDto,
|
||||
})
|
||||
@ApiUnauthorizedResponse({ description: unauthorizedDescription })
|
||||
@ApiForbiddenResponse({ description: forbiddenDescription })
|
||||
getStatus(): Promise<ServerStatusDto> {
|
||||
// TODO: toServerStatusDto.
|
||||
return this.monitoringService.getServerStatus();
|
||||
|
@ -25,6 +42,12 @@ export class MonitoringController {
|
|||
|
||||
@UseGuards(TokenAuthGuard)
|
||||
@Get('prometheus')
|
||||
@ApiOkResponse({
|
||||
description: 'Prometheus compatible monitoring data',
|
||||
})
|
||||
@ApiUnauthorizedResponse({ description: unauthorizedDescription })
|
||||
@ApiForbiddenResponse({ description: forbiddenDescription })
|
||||
@ApiProduces('text/plain')
|
||||
getPrometheusStatus(): string {
|
||||
return '';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue