### File

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

### Extends

`HelixService`

### Index

###### Methods
Public deleteClusterConfig Public deleteInstanceConfig Public deleteResourceConfig Public getClusterConfig Public getInstanceConfig Public getResourceConfig Public setClusterConfig Public setInstanceConfig Public setResourceConfig Public can Protected delete Protected errorHandler Protected getHeaders Protected getHelixKey Protected post Protected put Protected request

### Methods

Public deleteClusterConfig
`deleteClusterConfig(name: string, config: Node)`
Defined in src/app/configuration/shared/configuration.service.ts:19
Parameters :
Name | Type | Optional
name | `string` | No
config | `Node` | No
Returns : `any`

Public deleteInstanceConfig
`deleteInstanceConfig(clusterName: string, instanceName: string, config: Node)`
Defined in src/app/configuration/shared/configuration.service.ts:43
Parameters :
Name | Type | Optional
clusterName | `string` | No
instanceName | `string` | No
config | `Node` | No
Returns : `any`

Public deleteResourceConfig
`deleteResourceConfig(clusterName: string, resourceName: string, config: Node)`
Defined in src/app/configuration/shared/configuration.service.ts:71
Parameters :
Name | Type | Optional
clusterName | `string` | No
resourceName | `string` | No
config | `Node` | No
Returns : `any`

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

Public getInstanceConfig
`getInstanceConfig(clusterName: string, instanceName: string)`
Defined in src/app/configuration/shared/configuration.service.ts:26
Parameters :
Name | Type | Optional
clusterName | `string` | No
instanceName | `string` | No
Returns : `any`

Public getResourceConfig
`getResourceConfig(clusterName: string, resourceName: string)`
Defined in src/app/configuration/shared/configuration.service.ts:54
Parameters :
Name | Type | Optional
clusterName | `string` | No
resourceName | `string` | No
Returns : `any`

Public setClusterConfig
`setClusterConfig(name: string, config: Node)`
Defined in src/app/configuration/shared/configuration.service.ts:12
Parameters :
Name | Type | Optional
name | `string` | No
config | `Node` | No
Returns : `any`

Public setInstanceConfig
`setInstanceConfig(clusterName: string, instanceName: string, config: Node)`
Defined in src/app/configuration/shared/configuration.service.ts:32
Parameters :
Name | Type | Optional
clusterName | `string` | No
instanceName | `string` | No
config | `Node` | No
Returns : `any`

Public setResourceConfig
`setResourceConfig(clusterName: string, resourceName: string, config: Node)`
Defined in src/app/configuration/shared/configuration.service.ts:60
Parameters :
Name | Type | Optional
clusterName | `string` | No
resourceName | `string` | No
config | `Node` | 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 { Injectable } from '@angular/core';

    import { HelixService } from '../../core/helix.service';
    import { Node } from '../../shared/models/node.model';

    @Injectable()
    export class ConfigurationService extends HelixService {
      public getClusterConfig(name: string) {
        return this.request(`/clusters/${name}/configs`);
      }

      public setClusterConfig(name: string, config: Node) {
        return this.post(
          `/clusters/${name}/configs?command=update`,
          JSON.parse(config.json(name))
        );
      }

      public deleteClusterConfig(name: string, config: Node) {
        return this.post(
          `/clusters/${name}/configs?command=delete`,
          JSON.parse(config.json(name))
        );
      }

      public getInstanceConfig(clusterName: string, instanceName: string) {
        return this.request(
          `/clusters/${clusterName}/instances/${instanceName}/configs`
        );
      }

      public setInstanceConfig(
        clusterName: string,
        instanceName: string,
        config: Node
      ) {
        return this.post(
          `/clusters/${clusterName}/instances/${instanceName}/configs?command=update`,
          JSON.parse(config.json(instanceName))
        );
      }

      public deleteInstanceConfig(
        clusterName: string,
        instanceName: string,
        config: Node
      ) {
        return this.post(
          `/clusters/${clusterName}/instances/${instanceName}/configs?command=delete`,
          JSON.parse(config.json(instanceName))
        );
      }

      public getResourceConfig(clusterName: string, resourceName: string) {
        return this.request(
          `/clusters/${clusterName}/resources/${resourceName}/configs`
        );
      }

      public setResourceConfig(
        clusterName: string,
        resourceName: string,
        config: Node
      ) {
        return this.post(
          `/clusters/${clusterName}/resources/${resourceName}/configs?command=update`,
          JSON.parse(config.json(resourceName))
        );
      }

      public deleteResourceConfig(
        clusterName: string,
        resourceName: string,
        config: Node
      ) {
        return this.post(
          `/clusters/${clusterName}/resources/${resourceName}/configs?command=delete`,
          JSON.parse(config.json(resourceName))
        );
      }
    }

# results matching ""

# No results matching ""