src/app/cluster/shared/cluster.service.ts
Methods |
|
Public activate |
activate(name: string, superCluster: string)
|
Defined in src/app/cluster/shared/cluster.service.ts:37
|
Returns :
any
|
Public create | ||||||
create(name: string)
|
||||||
Defined in src/app/cluster/shared/cluster.service.ts:21
|
||||||
Parameters :
Returns :
any
|
Public disable | ||||||
disable(name: string)
|
||||||
Defined in src/app/cluster/shared/cluster.service.ts:33
|
||||||
Parameters :
Returns :
any
|
Public disableMaintenanceMode | ||||||
disableMaintenanceMode(name: string)
|
||||||
Defined in src/app/cluster/shared/cluster.service.ts:50
|
||||||
Parameters :
Returns :
any
|
Public enable | ||||||
enable(name: string)
|
||||||
Defined in src/app/cluster/shared/cluster.service.ts:29
|
||||||
Parameters :
Returns :
any
|
Public enableMaintenanceMode |
enableMaintenanceMode(name: string, reason: string)
|
Defined in src/app/cluster/shared/cluster.service.ts:44
|
Returns :
any
|
Public get | ||||||
get(name: string)
|
||||||
Defined in src/app/cluster/shared/cluster.service.ts:15
|
||||||
Parameters :
Returns :
any
|
Public getAll |
getAll()
|
Defined in src/app/cluster/shared/cluster.service.ts:9
|
Returns :
any
|
Public remove | ||||||
remove(name: string)
|
||||||
Defined in src/app/cluster/shared/cluster.service.ts:25
|
||||||
Parameters :
Returns :
any
|
Public can |
can()
|
Inherited from
HelixService
|
Defined in
HelixService:14
|
Returns :
Observable<any>
|
Protected delete | ||||||
delete(path: string)
|
||||||
Inherited from
HelixService
|
||||||
Defined in
HelixService:48
|
||||||
Parameters :
Returns :
Observable<any>
|
Protected errorHandler | ||||||
errorHandler(error: any)
|
||||||
Inherited from
HelixService
|
||||||
Defined in
HelixService:68
|
||||||
Parameters :
Returns :
any
|
Protected getHeaders |
getHeaders()
|
Inherited from
HelixService
|
Defined in
HelixService:61
|
Returns :
any
|
Protected getHelixKey |
getHelixKey()
|
Inherited from
HelixService
|
Defined in
HelixService:56
|
Returns :
string
|
Protected post |
post(path: string, data: any)
|
Inherited from
HelixService
|
Defined in
HelixService:32
|
Returns :
Observable<any>
|
Protected put |
put(path: string, data: string)
|
Inherited from
HelixService
|
Defined in
HelixService:40
|
Returns :
Observable<any>
|
Protected request |
request(path: string, helix?: string)
|
Inherited from
HelixService
|
Defined in
HelixService:20
|
Returns :
Observable<any>
|
import { map } from 'rxjs/operators';
import { Injectable } from '@angular/core';
import { Cluster } from './cluster.model';
import { HelixService } from '../../core/helix.service';
@Injectable()
export class ClusterService extends HelixService {
public getAll() {
return this.request('/clusters').pipe(
map((data) => data.clusters.sort().map((name) => <Cluster>{ name }))
);
}
public get(name: string) {
return this.request(`/clusters/${name}`).pipe(
map((data) => new Cluster(data))
);
}
public create(name: string) {
return this.put(`/clusters/${name}`, null);
}
public remove(name: string) {
return this.delete(`/clusters/${name}`);
}
public enable(name: string) {
return this.post(`/clusters/${name}?command=enable`, null);
}
public disable(name: string) {
return this.post(`/clusters/${name}?command=disable`, null);
}
public activate(name: string, superCluster: string) {
return this.post(
`/clusters/${name}?command=activate&superCluster=${superCluster}`,
null
);
}
public enableMaintenanceMode(name: string, reason: string) {
return this.post(`/clusters/${name}?command=enableMaintenanceMode`, {
reason,
});
}
public disableMaintenanceMode(name: string) {
return this.post(`/clusters/${name}?command=disableMaintenanceMode`, null);
}
}