File

src/app/cluster/shared/cluster.model.ts

Index

Properties

Constructor

constructor(obj: any)
Parameters :
Name Type Optional
obj any No

Properties

config
Type : Object
Readonly controller
Type : string
Readonly enabled
Type : boolean
Readonly inMaintenance
Type : boolean
Readonly instances
Type : Instance[]
Readonly name
Type : string
Readonly resources
Type : string[]
Readonly stateModels
Type : string[]
import { Instance } from '../../instance/shared/instance.model';

export class Cluster {
  readonly name: string;
  readonly controller: string;
  readonly enabled: boolean;
  readonly instances: Instance[];
  readonly inMaintenance: boolean;

  // TODO vxu: Resources are useless here. Remove it please.
  readonly resources: string[];

  // TODO vxu: convert it to use StateModel[]
  readonly stateModels: string[];

  config: Object;

  constructor(obj: any) {
    this.name = obj.id;
    this.controller = obj.controller;
    this.enabled = !obj.paused;
    this.resources = obj.resources;
    this.inMaintenance = obj.maintenance;

    const ins: Instance[] = [];
    for (const instance of obj.instances) {
      ins.push(
        new Instance(
          instance,
          this.name,
          false, // here's a dummy value. should not be used
          obj.liveInstances.indexOf(instance) >= 0
        )
      );
    }
    this.instances = ins;
  }
}

results matching ""

    No results matching ""