src/app/shared/api/nfs.service.ts
Properties |
Methods |
constructor(http: HttpClient, i18n: I18n)
|
|||||||||
Defined in src/app/shared/api/nfs.service.ts:52
|
|||||||||
Parameters :
|
buckets | ||||
buckets(user_id)
|
||||
Defined in src/app/shared/api/nfs.service.ts:82
|
||||
Parameters :
Returns :
any
|
clients |
clients()
|
Defined in src/app/shared/api/nfs.service.ts:86
|
Returns :
any
|
create | ||||
create(nfs)
|
||||
Defined in src/app/shared/api/nfs.service.ts:64
|
||||
Parameters :
Returns :
any
|
daemon |
daemon()
|
Defined in src/app/shared/api/nfs.service.ts:98
|
Returns :
any
|
delete | ||||||
delete(clusterId, exportId)
|
||||||
Defined in src/app/shared/api/nfs.service.ts:72
|
||||||
Parameters :
Returns :
any
|
filesystems |
filesystems()
|
Defined in src/app/shared/api/nfs.service.ts:94
|
Returns :
any
|
fsals |
fsals()
|
Defined in src/app/shared/api/nfs.service.ts:90
|
Returns :
any
|
get | ||||||
get(clusterId, exportId)
|
||||||
Defined in src/app/shared/api/nfs.service.ts:60
|
||||||
Parameters :
Returns :
any
|
list |
list()
|
Defined in src/app/shared/api/nfs.service.ts:56
|
Returns :
any
|
lsDir | ||||
lsDir(root_dir)
|
||||
Defined in src/app/shared/api/nfs.service.ts:78
|
||||
Parameters :
Returns :
any
|
start | ||||||
start(host_name: string)
|
||||||
Defined in src/app/shared/api/nfs.service.ts:102
|
||||||
Parameters :
Returns :
any
|
stop | ||||||
stop(host_name: string)
|
||||||
Defined in src/app/shared/api/nfs.service.ts:108
|
||||||
Parameters :
Returns :
any
|
update | ||||||||
update(clusterId, id, nfs)
|
||||||||
Defined in src/app/shared/api/nfs.service.ts:68
|
||||||||
Parameters :
Returns :
any
|
apiPath |
Type : string
|
Default value : 'api/nfs-ganesha'
|
Defined in src/app/shared/api/nfs.service.ts:12
|
nfsAccessType |
Type : []
|
Default value : [
{
value: 'RW',
help: this.i18n('Allows all operations')
},
{
value: 'RO',
help: this.i18n('Allows only operations that do not modify the server')
},
{
value: 'MDONLY',
help: this.i18n('Does not allow read or write operations, but allows any other operation')
},
{
value: 'MDONLY_RO',
help: this.i18n(
'Does not allow read, write, or any operation that modifies file \
attributes or directory content'
)
},
{
value: 'NONE',
help: this.i18n('Allows no access at all')
}
]
|
Defined in src/app/shared/api/nfs.service.ts:15
|
nfsFsal |
Type : []
|
Default value : [
{
value: 'CEPH',
descr: this.i18n('CephFS')
},
{
value: 'RGW',
descr: this.i18n('Object Gateway')
}
]
|
Defined in src/app/shared/api/nfs.service.ts:41
|
nfsSquash |
Type : []
|
Default value : ['no_root_squash', 'root_id_squash', 'root_squash', 'all_squash']
|
Defined in src/app/shared/api/nfs.service.ts:52
|
uiApiPath |
Type : string
|
Default value : 'ui-api/nfs-ganesha'
|
Defined in src/app/shared/api/nfs.service.ts:13
|
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { I18n } from '@ngx-translate/i18n-polyfill';
import { ApiModule } from './api.module';
@Injectable({
providedIn: ApiModule
})
export class NfsService {
apiPath = 'api/nfs-ganesha';
uiApiPath = 'ui-api/nfs-ganesha';
nfsAccessType = [
{
value: 'RW',
help: this.i18n('Allows all operations')
},
{
value: 'RO',
help: this.i18n('Allows only operations that do not modify the server')
},
{
value: 'MDONLY',
help: this.i18n('Does not allow read or write operations, but allows any other operation')
},
{
value: 'MDONLY_RO',
help: this.i18n(
'Does not allow read, write, or any operation that modifies file \
attributes or directory content'
)
},
{
value: 'NONE',
help: this.i18n('Allows no access at all')
}
];
nfsFsal = [
{
value: 'CEPH',
descr: this.i18n('CephFS')
},
{
value: 'RGW',
descr: this.i18n('Object Gateway')
}
];
nfsSquash = ['no_root_squash', 'root_id_squash', 'root_squash', 'all_squash'];
constructor(private http: HttpClient, private i18n: I18n) {}
list() {
return this.http.get(`${this.apiPath}/export`);
}
get(clusterId, exportId) {
return this.http.get(`${this.apiPath}/export/${clusterId}/${exportId}`);
}
create(nfs) {
return this.http.post(`${this.apiPath}/export`, nfs, { observe: 'response' });
}
update(clusterId, id, nfs) {
return this.http.put(`${this.apiPath}/export/${clusterId}/${id}`, nfs, { observe: 'response' });
}
delete(clusterId, exportId) {
return this.http.delete(`${this.apiPath}/export/${clusterId}/${exportId}`, {
observe: 'response'
});
}
lsDir(root_dir) {
return this.http.get(`${this.uiApiPath}/lsdir?root_dir=${root_dir}`);
}
buckets(user_id) {
return this.http.get(`${this.uiApiPath}/rgw/buckets?user_id=${user_id}`);
}
clients() {
return this.http.get(`${this.uiApiPath}/cephx/clients`);
}
fsals() {
return this.http.get(`${this.uiApiPath}/fsals`);
}
filesystems() {
return this.http.get(`${this.uiApiPath}/cephfs/filesystems`);
}
daemon() {
return this.http.get(`${this.apiPath}/daemon`);
}
start(host_name: string) {
return this.http.put(`${this.apiPath}/service/${host_name}/start`, null, {
observe: 'response'
});
}
stop(host_name: string) {
return this.http.put(`${this.apiPath}/service/${host_name}/stop`, null, {
observe: 'response'
});
}
}