# All files / src/app/shared/api configuration.service.ts

93.75% Statements 15/16
66.67% Branches 2/3
80% Functions 4/5
92.86% Lines 13/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    2910x
    10x

    10x

    10x
    36x

    10x
    1x

    10x
    57x

    10x
    1x

    10x

    10x
     import { HttpClient } from '@angular/common/http';
    import { Injectable } from '@angular/core';

    import { ConfigFormCreateRequestModel } from '../../ceph/cluster/configuration/configuration-form/configuration-form-create-request.model';
    import { ApiModule } from './api.module';

    @Injectable({
      providedIn: ApiModule
    })
    export class ConfigurationService {
      constructor(private http: HttpClient) {}

      getConfigData() {
        return this.http.get('api/cluster_conf/');
      }

      get(configOption: string) {
        return this.http.get(`api/cluster_conf/${configOption}`);
      }

      create(configOption: ConfigFormCreateRequestModel) {
        return this.http.post('api/cluster_conf/', configOption);
      }

      bulkCreate(configOptions: Object) {
        return this.http.put('api/cluster_conf', configOptions);
      }
    }