]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/server-commands/server/stats-command.ts
Fix tests
[github/Chocobozzz/PeerTube.git] / shared / server-commands / server / stats-command.ts
CommitLineData
4c7e60bc 1import { HttpStatusCode, ServerStats } from '@shared/models'
bc809041
C
2import { AbstractCommand, OverrideCommandOptions } from '../shared'
3
4export class StatsCommand extends AbstractCommand {
5
6 get (options: OverrideCommandOptions & {
7 useCache?: boolean // default false
8 } = {}) {
9 const { useCache = false } = options
10 const path = '/api/v1/server/stats'
11
12 const query = {
13 t: useCache ? undefined : new Date().getTime()
14 }
15
16 return this.getRequestBody<ServerStats>({
17 ...options,
18
19 path,
20 query,
a1637fa1 21 implicitToken: false,
bc809041
C
22 defaultExpectedStatus: HttpStatusCode.OK_200
23 })
24 }
25}