CMDB.Sync.Document TPL
Posted: Thu Oct 03, 2019 8:14 am
tpl 1.12 module CMDB.Host_Document;
from CMDB.Host_ComputerSystem import Host_ComputerSystem 2.2;
syncmapping Host_Document 1.0
"""
Maps Hosted info to be Documented to BMC_Document
"""
overview
tags CMDB, Extension;
end overview;
mapping from Host_ComputerSystem.host as host
document -> BMC_Document;
end mapping;
body
computersystem := Host_ComputerSystem.computersystem;
document_key := "%host.key%//DOC";
document := sync.BMC_Document(
key := document_key,
Name := "%host.name%,
NameFormat := "HostName:DOC",
ShortDescription := "%host.name%",
fileContent := "%host.name%",
DocumentType := "APMAppListJSON",
// Model := package.name,
// LastScanDate := host.last_update_success,
// Description := "%package.name% on %host.name%",
// VersionNumber := version_number,
// BuildNumber := package.revision,
// ManufacturerName := package.vendor,
// MarketVersion := version_number,
// TokenID := "%package.name%:%version_number%",
// Category := "Software",
// Type := "Software Distribution",
// Item := "Package",
// Company := computersystem.Company
);
sync.rel.BMC_Dependency(
Source := computersystem,
Destination := document,
Name := "HOSTDOCUMENT"
);
end body;
end syncmapping;
from CMDB.Host_ComputerSystem import Host_ComputerSystem 2.2;
syncmapping Host_Document 1.0
"""
Maps Hosted info to be Documented to BMC_Document
"""
overview
tags CMDB, Extension;
end overview;
mapping from Host_ComputerSystem.host as host
document -> BMC_Document;
end mapping;
body
computersystem := Host_ComputerSystem.computersystem;
document_key := "%host.key%//DOC";
document := sync.BMC_Document(
key := document_key,
Name := "%host.name%,
NameFormat := "HostName:DOC",
ShortDescription := "%host.name%",
fileContent := "%host.name%",
DocumentType := "APMAppListJSON",
// Model := package.name,
// LastScanDate := host.last_update_success,
// Description := "%package.name% on %host.name%",
// VersionNumber := version_number,
// BuildNumber := package.revision,
// ManufacturerName := package.vendor,
// MarketVersion := version_number,
// TokenID := "%package.name%:%version_number%",
// Category := "Software",
// Type := "Software Distribution",
// Item := "Package",
// Company := computersystem.Company
);
sync.rel.BMC_Dependency(
Source := computersystem,
Destination := document,
Name := "HOSTDOCUMENT"
);
end body;
end syncmapping;