diff options
Diffstat (limited to '')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts index 6142d7359..2d49de37c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts @@ -6,6 +6,7 @@ import { Observable } from 'rxjs'; import { cdEncode } from '../decorators/cd-encode'; import { CephfsDir, CephfsQuotas } from '../models/cephfs-directory-models'; +import { shareReplay } from 'rxjs/operators'; @cdEncode @Injectable({ @@ -21,12 +22,12 @@ export class CephfsService { return this.http.get(`${this.baseURL}`); } - lsDir(id: number, path?: string): Observable<CephfsDir[]> { - let apiPath = `${this.baseUiURL}/${id}/ls_dir?depth=2`; + lsDir(id: number, path?: string, depth: number = 2): Observable<CephfsDir[]> { + let apiPath = `${this.baseUiURL}/${id}/ls_dir?depth=${depth}`; if (path) { apiPath += `&path=${encodeURIComponent(path)}`; } - return this.http.get<CephfsDir[]>(apiPath); + return this.http.get<CephfsDir[]>(apiPath).pipe(shareReplay()); } getCephfs(id: number) { @@ -49,6 +50,10 @@ export class CephfsService { return this.http.get(`${this.baseURL}/${id}/mds_counters`); } + getFsRootDirectory(id: string) { + return this.http.get(`${this.baseURL}/${id}/get_root_directory`); + } + mkSnapshot(id: number, path: string, name?: string) { let params = new HttpParams(); params = params.append('path', path); @@ -103,4 +108,13 @@ export class CephfsService { observe: 'response' }); } + + setAuth(fsName: string, clientId: number, caps: string[], rootSquash: boolean) { + return this.http.put(`${this.baseURL}/auth`, { + fs_name: fsName, + client_id: `client.${clientId}`, + caps: caps, + root_squash: rootSquash + }); + } } |