Commit df02f35a authored by Jie Yuan's avatar Jie Yuan

add data models

parent 8b474d9d
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;
}
}
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 : [];
}
}
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
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();
}
}
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;
}
}
import {ServiceComponentRecord} from './service-component-record';
export class ServiceComponent {
name: string;
tagAtSite: string;
productionTag: string;
createdTime: Date;
serviceType: string;
serviceComponentRecords: ServiceComponentRecord[];
constructor (
name: string,
tagAtSite?: string,
productionTag?: string,
serviceType?: string,
lastChangedTime?: Date,
servCompRecords?: ServiceComponentRecord[]) {
this.name = name;
this.tagAtSite = tagAtSite;
this.productionTag = (productionTag) ? productionTag : '';
this.serviceType = serviceType;
this.createdTime = (lastChangedTime) ? lastChangedTime : new Date();
this.serviceComponentRecords = servCompRecords;
}
}
import {HostNameShort} from './host-name-short';
export class SiteShort {
siteName: string;
siteUrl: String;
siteCountry: string;
siteNoOfHosts: number;
lastUpdateOn: string;
siteNoOfServices: number;
hostNameInfos: HostNameShort[];
constructor (
siteName: string,
siteNoOfHosts: number,
siteNoOfServices: number,
lastUpdateOn: string,
siteUrl?: string,
siteCountry?: string,
hosts?: HostNameShort[]
) {
this.siteName = siteName;
this.siteUrl = siteUrl;
this.siteCountry = siteCountry;
this.lastUpdateOn = lastUpdateOn;
this.siteNoOfHosts = siteNoOfHosts;
this.hostNameInfos = hosts;
this.siteNoOfServices = siteNoOfServices;
}
}
import {HostName} from './hostname';
export class Site {
idName: string;
shortName: string;
officialName: string;
idSite: string;
primaryKey: string;
dpmtUrl: string;
gocdbUrl: string;
homeUrl: string;
contactEmail: string;
contactTel: string;
countryCode: string;
country: string;
roc: string;
productionInfrastructure: string;
certificationStatus: string;
timeZone: string;
csirtEmail: string;
domainName: string;
subgrid: string;
giisUrl: string;
description: string;
notifications: boolean;
latitude: string;
longitude: string;
sourceInformation: string;
hostNames: HostName[];
scopeList: String[];
constructor (
idName: string,
shortName?: string,
officialName?: string,
idSite?: string,
primaryKey?: string,
dpmtUrl?: string,
gocdbUrl?: string,
homeUrl?: string,
contactEmail?: string,
contactTel?: string,
countryCode?: string,
country?: string,
roc?: string,
productionInfrastructure?: string,
certificationStatus?: string,
timeZone?: string,
csirtEmail?: string,
domainName?: string,
subgrid?: string,
giisUrl?: string,
description?: string,
notifications?: boolean,
latitude?: string,
longitude?: string,
sourceInformation?: string,
hostNames?: HostName[],
scopeList?: String[]) {
this.idName = idName;
this.shortName = shortName;
this.officialName = officialName;
this.idSite = idSite;
this.primaryKey = primaryKey;
this.dpmtUrl = dpmtUrl;
this.gocdbUrl = gocdbUrl;
this.homeUrl = homeUrl;
this.contactEmail = contactEmail;
this.contactTel = contactTel;
this.countryCode = countryCode;
this.country = country;
this.roc = roc;
this.productionInfrastructure = productionInfrastructure;
this.certificationStatus = certificationStatus;
this.timeZone = timeZone;
this.csirtEmail = csirtEmail;
this.domainName = domainName;
this.subgrid = subgrid;
this.giisUrl = giisUrl;
this.description = description;
this.notifications = notifications;
this.latitude = latitude;
this.longitude = longitude;
this.sourceInformation = sourceInformation;
this.hostNames = (hostNames) ? hostNames : [];
this.scopeList = (scopeList) ? scopeList : [];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment