File

src/app/shared/api/mgr-module.service.ts

Index

Properties
Methods

Constructor

constructor(http: HttpClient)
Parameters :
Name Type Optional
http HttpClient No

Methods

disable
disable(module: string)

Disable the Ceph Mgr module.

Parameters :
Name Type Optional Description
module string No

The name of the mgr module.

Returns : any
enable
enable(module: string)

Enable the Ceph Mgr module.

Parameters :
Name Type Optional Description
module string No

The name of the mgr module.

Returns : any
getConfig
getConfig(module: string)

Get the Ceph Mgr module configuration.

Parameters :
Name Type Optional Description
module string No

The name of the mgr module.

Returns : Observable<Object>
getOptions
getOptions(module: string)

Get the Ceph Mgr module options.

Parameters :
Name Type Optional Description
module string No

The name of the mgr module.

Returns : Observable<Object>
list
list()

Get the list of Ceph Mgr modules and their state (enabled/disabled).

Returns : Observable<Object[]>
updateConfig
updateConfig(module: string, config: Object)

Update the Ceph Mgr module configuration.

Parameters :
Name Type Optional Description
module string No

The name of the mgr module.

config Object No

The configuration.

Returns : Observable<Object>

Properties

Private url
Type : string
Default value : 'api/mgr/module'
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

import { Observable } from 'rxjs';

import { ApiModule } from './api.module';

@Injectable({
  providedIn: ApiModule
})
export class MgrModuleService {
  private url = 'api/mgr/module';

  constructor(private http: HttpClient) {}

  /**
   * Get the list of Ceph Mgr modules and their state (enabled/disabled).
   * @return {Observable<Object[]>}
   */
  list(): Observable<Object[]> {
    return this.http.get<Object[]>(`${this.url}`);
  }

  /**
   * Get the Ceph Mgr module configuration.
   * @param {string} module The name of the mgr module.
   * @return {Observable<Object>}
   */
  getConfig(module: string): Observable<Object> {
    return this.http.get(`${this.url}/${module}`);
  }

  /**
   * Update the Ceph Mgr module configuration.
   * @param {string} module The name of the mgr module.
   * @param {object} config The configuration.
   * @return {Observable<Object>}
   */
  updateConfig(module: string, config: Object): Observable<Object> {
    return this.http.put(`${this.url}/${module}`, { config: config });
  }

  /**
   * Enable the Ceph Mgr module.
   * @param {string} module The name of the mgr module.
   */
  enable(module: string) {
    return this.http.post(`${this.url}/${module}/enable`, null);
  }

  /**
   * Disable the Ceph Mgr module.
   * @param {string} module The name of the mgr module.
   */
  disable(module: string) {
    return this.http.post(`${this.url}/${module}/disable`, null);
  }

  /**
   * Get the Ceph Mgr module options.
   * @param {string} module The name of the mgr module.
   * @return {Observable<Object>}
   */
  getOptions(module: string): Observable<Object> {
    return this.http.get(`${this.url}/${module}/options`);
  }
}

result-matching ""

    No results matching ""