### File

`src/app/cluster/shared/cluster.service.ts`

### Extends

`HelixService`

### Index

###### Methods
Public activate Public create Public disable Public disableMaintenanceMode Public enable Public enableMaintenanceMode Public get Public getAll Public remove Public can Protected delete Protected errorHandler Protected getHeaders Protected getHelixKey Protected post Protected put Protected request

### Methods

Public activate
`activate(name: string, superCluster: string)`
Defined in src/app/cluster/shared/cluster.service.ts:37
Parameters :
Name | Type | Optional
name | `string` | No
superCluster | `string` | No
Returns : `any`

Public create
`create(name: string)`
Defined in src/app/cluster/shared/cluster.service.ts:21
Parameters :
Name | Type | Optional
name | `string` | No
Returns : `any`

Public disable
`disable(name: string)`
Defined in src/app/cluster/shared/cluster.service.ts:33
Parameters :
Name | Type | Optional
name | `string` | No
Returns : `any`

Public disableMaintenanceMode
`disableMaintenanceMode(name: string)`
Defined in src/app/cluster/shared/cluster.service.ts:50
Parameters :
Name | Type | Optional
name | `string` | No
Returns : `any`

Public enable
`enable(name: string)`
Defined in src/app/cluster/shared/cluster.service.ts:29
Parameters :
Name | Type | Optional
name | `string` | No
Returns : `any`

Public enableMaintenanceMode
`enableMaintenanceMode(name: string, reason: string)`
Defined in src/app/cluster/shared/cluster.service.ts:44
Parameters :
Name | Type | Optional
name | `string` | No
reason | `string` | No
Returns : `any`

Public get
`get(name: string)`
Defined in src/app/cluster/shared/cluster.service.ts:15
Parameters :
Name | Type | Optional
name | `string` | No
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 :
Name | Type | Optional
name | `string` | No
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 :
Name | Type | Optional
path | `string` | No
Returns : `Observable<any>`

Protected errorHandler
`errorHandler(error: any)`
Inherited from `HelixService`
Defined in `HelixService:68`
Parameters :
Name | Type | Optional
error | `any` | No
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`
Parameters :
Name | Type | Optional
path | `string` | No
data | `any` | No
Returns : `Observable<any>`

Protected put
`put(path: string, data: string)`
Inherited from `HelixService`
Defined in `HelixService:40`
Parameters :
Name | Type | Optional
path | `string` | No
data | `string` | No
Returns : `Observable<any>`

Protected request
`request(path: string, helix?: string)`
Inherited from `HelixService`
Defined in `HelixService:20`
Parameters :
Name | Type | Optional
path | `string` | No
helix | `string` | Yes
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);
      }
    }

# results matching ""

# No results matching ""