src/app/shared/api/osd.service.ts
Properties |
|
Methods |
constructor(http: HttpClient, i18n: I18n)
|
|||||||||
Defined in src/app/shared/api/osd.service.ts:57
|
|||||||||
Parameters :
|
destroy | ||||||
destroy(id: number)
|
||||||
Defined in src/app/shared/api/osd.service.ts:105
|
||||||
Parameters :
Returns :
any
|
getDetails | ||||||
getDetails(id: number)
|
||||||
Defined in src/app/shared/api/osd.service.ts:65
|
||||||
Parameters :
Returns :
any
|
getFlags |
getFlags()
|
Defined in src/app/shared/api/osd.service.ts:73
|
Returns :
any
|
getList |
getList()
|
Defined in src/app/shared/api/osd.service.ts:61
|
Returns :
any
|
markDown | ||||||
markDown(id: number)
|
||||||
Defined in src/app/shared/api/osd.service.ts:89
|
||||||
Parameters :
Returns :
any
|
markIn | ||||||
markIn(id: number)
|
||||||
Defined in src/app/shared/api/osd.service.ts:85
|
||||||
Parameters :
Returns :
any
|
markLost | ||||||
markLost(id: number)
|
||||||
Defined in src/app/shared/api/osd.service.ts:97
|
||||||
Parameters :
Returns :
any
|
markOut | ||||||
markOut(id: number)
|
||||||
Defined in src/app/shared/api/osd.service.ts:81
|
||||||
Parameters :
Returns :
any
|
purge | ||||||
purge(id: number)
|
||||||
Defined in src/app/shared/api/osd.service.ts:101
|
||||||
Parameters :
Returns :
any
|
reweight |
reweight(id: number, weight: number)
|
Defined in src/app/shared/api/osd.service.ts:93
|
Returns :
any
|
safeToDestroy | ||||||
safeToDestroy(id: number)
|
||||||
Defined in src/app/shared/api/osd.service.ts:109
|
||||||
Parameters :
Returns :
any
|
scrub | ||||||
scrub(id, deep)
|
||||||
Defined in src/app/shared/api/osd.service.ts:69
|
||||||
Parameters :
Returns :
any
|
updateFlags | ||||||
updateFlags(flags: string[])
|
||||||
Defined in src/app/shared/api/osd.service.ts:77
|
||||||
Parameters :
Returns :
any
|
osdRecvSpeedModalPriorities |
Type : object
|
Default value : {
KNOWN_PRIORITIES: [
{
name: null,
text: this.i18n('-- Select the priority --'),
values: {
osd_max_backfills: null,
osd_recovery_max_active: null,
osd_recovery_max_single_start: null,
osd_recovery_sleep: null
}
},
{
name: 'low',
text: this.i18n('Low'),
values: {
osd_max_backfills: 1,
osd_recovery_max_active: 1,
osd_recovery_max_single_start: 1,
osd_recovery_sleep: 0.5
}
},
{
name: 'default',
text: this.i18n('Default'),
values: {
osd_max_backfills: 1,
osd_recovery_max_active: 3,
osd_recovery_max_single_start: 1,
osd_recovery_sleep: 0
}
},
{
name: 'high',
text: this.i18n('High'),
values: {
osd_max_backfills: 4,
osd_recovery_max_active: 4,
osd_recovery_max_single_start: 4,
osd_recovery_sleep: 0
}
}
]
}
|
Defined in src/app/shared/api/osd.service.ts:14
|
Private path |
Type : string
|
Default value : 'api/osd'
|
Defined in src/app/shared/api/osd.service.ts:12
|
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 OsdService {
private path = 'api/osd';
osdRecvSpeedModalPriorities = {
KNOWN_PRIORITIES: [
{
name: null,
text: this.i18n('-- Select the priority --'),
values: {
osd_max_backfills: null,
osd_recovery_max_active: null,
osd_recovery_max_single_start: null,
osd_recovery_sleep: null
}
},
{
name: 'low',
text: this.i18n('Low'),
values: {
osd_max_backfills: 1,
osd_recovery_max_active: 1,
osd_recovery_max_single_start: 1,
osd_recovery_sleep: 0.5
}
},
{
name: 'default',
text: this.i18n('Default'),
values: {
osd_max_backfills: 1,
osd_recovery_max_active: 3,
osd_recovery_max_single_start: 1,
osd_recovery_sleep: 0
}
},
{
name: 'high',
text: this.i18n('High'),
values: {
osd_max_backfills: 4,
osd_recovery_max_active: 4,
osd_recovery_max_single_start: 4,
osd_recovery_sleep: 0
}
}
]
};
constructor(private http: HttpClient, private i18n: I18n) {}
getList() {
return this.http.get(`${this.path}`);
}
getDetails(id: number) {
return this.http.get(`${this.path}/${id}`);
}
scrub(id, deep) {
return this.http.post(`${this.path}/${id}/scrub?deep=${deep}`, null);
}
getFlags() {
return this.http.get(`${this.path}/flags`);
}
updateFlags(flags: string[]) {
return this.http.put(`${this.path}/flags`, { flags: flags });
}
markOut(id: number) {
return this.http.post(`${this.path}/${id}/mark_out`, null);
}
markIn(id: number) {
return this.http.post(`${this.path}/${id}/mark_in`, null);
}
markDown(id: number) {
return this.http.post(`${this.path}/${id}/mark_down`, null);
}
reweight(id: number, weight: number) {
return this.http.post(`${this.path}/${id}/reweight`, { weight: weight });
}
markLost(id: number) {
return this.http.post(`${this.path}/${id}/mark_lost`, null);
}
purge(id: number) {
return this.http.post(`${this.path}/${id}/purge`, null);
}
destroy(id: number) {
return this.http.post(`${this.path}/${id}/destroy`, null);
}
safeToDestroy(id: number) {
interface SafeToDestroyResponse {
'safe-to-destroy': boolean;
message?: string;
}
return this.http.get<SafeToDestroyResponse>(`${this.path}/${id}/safe_to_destroy`);
}
}