Commit df02f35a authored by Jie Yuan's avatar Jie Yuan
Browse files

add data models

parent 8b474d9d
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
export class HostNameShort {

  name: string;
  operatingSystem: string;
  productionTag: string;
  url: string;
  noOfServiceComp: number;
  nameOfServiceComp: string[];
  tagOfServiceComp: string[];
  changedDate: string[];
  productionTags: string[];
  serviceTypes: string[];


  constructor (
    name: string ,
    operatingSystem: string,
    noOfServiceComp: number,
    proudctionTag?: string,
    url?: string,
    nameOfServiceComp?: string[],
    tagOfServiceComp?: string[],
    changedDate?: string[],
    productionTags?: string[],
    serviceTypes?: string[]
    ) {
      this.name = name;
      this.operatingSystem = operatingSystem;
      this.productionTag = proudctionTag;
      this.url = url;
      this.noOfServiceComp = noOfServiceComp;
      this.nameOfServiceComp = nameOfServiceComp;
      this.tagOfServiceComp = tagOfServiceComp;
      this.changedDate = changedDate;
      this.productionTags = productionTags;
      this.serviceTypes = serviceTypes;
  }

}
+28 −0
Original line number Diff line number Diff line
import {ServiceComponent} from './service-component';

export class HostName {

  name: string;
  operatingSystem: string;
  hostNameStatus: string;
  nodeMonitored: boolean;
  url: string;
  serviceComponents: ServiceComponent[];
  scopeList: String[];
  constructor (
    name: string ,
    operatingSystem: string,
    hostNameStatus: string,
    nodeMonitored?: boolean,
    url?: string,
    serviceComponents?: ServiceComponent[],
    scopeList?: String[]) {
      this.name = name;
      this.operatingSystem = operatingSystem;
      this.hostNameStatus = hostNameStatus;
      this.nodeMonitored = nodeMonitored;
      this.serviceComponents = (serviceComponents) ? serviceComponents : [];
      this.scopeList = (scopeList) ? scopeList : [];
  }

}
+24 −0
Original line number Diff line number Diff line


export class PreparedServiceComponentShort {
    hostname: string;
  type: string;
  name: string;
  tagAtSite: string;
  updatedOn: string;

  constructor (
    hostname: string,
    name?: string,
    type?: string,
    tagAtSite?: string,
    lastChangedTime?: string
   ) {
    this.name = name;
    this.hostname = hostname;
    this.type = type;
    this.tagAtSite = tagAtSite;
    this.updatedOn = lastChangedTime;
  }

}
 No newline at end of file
+24 −0
Original line number Diff line number Diff line
export class ServiceComponentRecord {

  idServiceComponentRecord: number;
  name: string;
  tagAtSite: string;
  productionTag: string;
  serviceType: string;
  lastChangedTime: Date;
  constructor (
    name: string,
    idServiceComponentRecord?: number,
    tagAtSite?: string,
    productionTag?: string,
    serviceType?: string,
    lastChangedTime?: Date) {
    this.name = (name) ? name.toUpperCase() : name;
    this.idServiceComponentRecord = idServiceComponentRecord;
    this.tagAtSite = (tagAtSite) ? tagAtSite.toUpperCase() : tagAtSite;
    this.productionTag = (productionTag) ? productionTag.toUpperCase() : '';
    this.serviceType = (serviceType) ? serviceType.toUpperCase() : serviceType;
    this.lastChangedTime = (lastChangedTime) ? lastChangedTime : new Date();
  }

}
+36 −0
Original line number Diff line number Diff line
import {ServiceComponent} from './service-component';

export class ServiceComponentRow {

  siteName: string;
  hostName: string;
  hostNameOS: string;
  hostNameStatus: string;
  servCompName: string;
  servCompTagAtSite: string;
  servCompProdTag: string;
  servCompServiceType: string;
  servCompCreatedTime: Date;

  constructor (
    siteName: string,
    hostName?: string,
    hostNameOS?: string,
    hostNameStatus?: string,
    configParamName?: string,
    tagAtSite?: string,
    prodTag?: string,
    servType?: string,
    createdTime?: Date) {
      this.siteName = siteName;
      this.hostName = hostName;
      this.hostNameOS = hostNameOS;
      this.hostNameStatus = hostNameStatus;
      this.servCompName = configParamName;
      this.servCompTagAtSite = (tagAtSite) ? tagAtSite : '';
      this.servCompProdTag = (prodTag) ? prodTag : '';
      this.servCompServiceType = (servType) ? servType : '';
      this.servCompCreatedTime = (createdTime) ? createdTime : null;
  }

}
Loading