2017-11-23 13:18:23 +01:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import {Server} from "../models/server";
|
2018-07-06 11:31:44 +02:00
|
|
|
import {Observable} from "rxjs";
|
2017-11-23 13:18:23 +01:00
|
|
|
import {HttpServer} from "./http-server.service";
|
|
|
|
import {Snapshot} from "../models/snapshot";
|
|
|
|
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class SnapshotService {
|
|
|
|
|
|
|
|
constructor(private httpServer: HttpServer) { }
|
|
|
|
|
2018-03-20 16:02:41 +01:00
|
|
|
create(server: Server, project_id: string, snapshot: Snapshot) {
|
2017-11-23 13:18:23 +01:00
|
|
|
return this.httpServer
|
2018-03-20 16:02:41 +01:00
|
|
|
.post<Snapshot>(server, `/projects/${project_id}/snapshots`, snapshot);
|
2017-11-23 13:18:23 +01:00
|
|
|
}
|
|
|
|
|
2018-03-20 16:02:41 +01:00
|
|
|
list(server: Server, project_id: string) {
|
2017-11-23 13:18:23 +01:00
|
|
|
return this.httpServer
|
2018-03-20 16:02:41 +01:00
|
|
|
.get<Snapshot[]>(server, `/projects/${project_id}/snapshots`);
|
2017-11-23 13:18:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|