mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-13 06:25:21 +00:00
26 lines
939 B
TypeScript
26 lines
939 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Server } from '../models/server';
|
|
import { HttpServer } from './http-server.service';
|
|
import { Snapshot } from '../models/snapshot';
|
|
|
|
@Injectable()
|
|
export class SnapshotService {
|
|
constructor(private httpServer: HttpServer) {}
|
|
|
|
create(server: Server, project_id: string, snapshot: Snapshot) {
|
|
return this.httpServer.post<Snapshot>(server, `/projects/${project_id}/snapshots`, snapshot);
|
|
}
|
|
|
|
delete(server: Server, project_id: string, snapshot_id: string) {
|
|
return this.httpServer.delete(server, `/projects/${project_id}/snapshots/${snapshot_id}`);
|
|
}
|
|
|
|
list(server: Server, project_id: string) {
|
|
return this.httpServer.get<Snapshot[]>(server, `/projects/${project_id}/snapshots`);
|
|
}
|
|
|
|
restore(server: Server, project_id: string, snapshot_id: string) {
|
|
return this.httpServer.post(server, `/projects/${project_id}/snapshots/${snapshot_id}/restore`, {});
|
|
}
|
|
}
|