]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/server-commands/server/stats-command.ts
Add Podcast RSS feeds (#5487)
[github/Chocobozzz/PeerTube.git] / shared / server-commands / server / stats-command.ts
1 import { HttpStatusCode, ServerStats } from '@shared/models'
2 import { AbstractCommand, OverrideCommandOptions } from '../shared'
3
4 export 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,
21 implicitToken: false,
22 defaultExpectedStatus: HttpStatusCode.OK_200
23 })
24 }
25 }