src.app.core.services.environment-admin.service.ts Maven / Gradle / Ivy
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { EnvironmentMetadata, Target } from '@model';
import { environment as server } from '../../../environments/environment';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class EnvironmentAdminService {
private baseUrl = '/api/v2/environment';
constructor(private http: HttpClient) {}
listEnvironments(): Observable> {
return this.http.get>(server.backend + this.baseUrl).pipe(map((res: Array) => {
return res.sort((t1, t2) => t1.name.toUpperCase() > t2.name.toUpperCase() ? 1 : 0);
}));
}
listEnvironmentsNames(): Observable> {
return this.http.get>(server.backend + this.baseUrl + '/names');
}
exportEnvironment(environmentName: string): Observable> {
return this.http.get>(server.backend + this.baseUrl + '/' + environmentName);
}
createEnvironment(environment: EnvironmentMetadata): Observable
© 2015 - 2025 Weber Informatics LLC | Privacy Policy