本文整理汇总了Python中modeling.createIpOSH函数的典型用法代码示例。如果您正苦于以下问题:Python createIpOSH函数的具体用法?Python createIpOSH怎么用?Python createIpOSH使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createIpOSH函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: reporterMSCluster
def reporterMSCluster(self, vector, ms_cluster, groups, ipDictByGroupName, nodesWithIP):
clusterOsh = ms_cluster.create_osh()
vector.add(clusterOsh)
vector.add(modeling.createLinkOSH('membership', clusterOsh, self.applicationOsh))
for node in nodesWithIP:
ips = nodesWithIP[node]
hostOsh = (modeling.createHostOSH(str(ips[0]), 'nt')
or ObjectStateHolder('nt'))
hostOsh.setStringAttribute('name', node)
hostOsh.setStringAttribute('os_family', 'windows')
for ip_obj in ips:
ipOSH = modeling.createIpOSH(ip_obj)
vector.add(ipOSH)
vector.add(modeling.createLinkOSH('containment', hostOsh, ipOSH))
softwareOsh = modeling.createClusterSoftwareOSH(hostOsh,
'Microsoft Cluster SW', ms_cluster.version)
softwareOsh.setAttribute("application_version_number", ms_cluster.version)
vector.add(softwareOsh)
vector.add(modeling.createLinkOSH('membership', clusterOsh, softwareOsh))
for group in groups:
ips = ipDictByGroupName.get(group.name, None)
if ips:
for ip in ips:
groupOsh = group.create_osh()
vector.add(groupOsh)
vector.add(modeling.createLinkOSH('contained', clusterOsh, groupOsh))
ipOsh = modeling.createIpOSH(ip)
vector.add(modeling.createLinkOSH('contained', groupOsh, ipOsh))
vector.add(ipOsh)
self.__crgMap[str(ip)] = groupOsh
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:33,代码来源:plugin_mscluster_ntcmd_version.py
示例2: setObjectVectorByResStringArray
def setObjectVectorByResStringArray(objectVector, ipsResult, virtualMode, netAddress=None, netMask=None):
# create new network for link object
if netAddress and netMask:
networkOSHForLink = modeling.createNetworkOSH(netAddress, netMask)
else:
networkOSHForLink = None
# run on the string array (Holding all live pinged ips)
for ipResult in ipsResult:
isVirtual = 0
# pingedIp - the ip we sent the ping to
# replyIp - the ip replied to the ping
# Break the curr result by ':' <Reply-IP>:<Pinged-IP>
token = ipResult.split(':')
if (len(token) == 2):
# In case where we ping a virtual ip we get the reply from the real ip
# If we are pinging a virtual ip
if virtualMode:
replyIp, pingedIp = token[0], token[1]
isVirtual = 1
else:
replyIp, pingedIp = token[1], token[1]
else:
replyIp, pingedIp = ipResult, ipResult
# Create Ip OSH and add to vector
pingedIpOSH = modeling.createIpOSH(ip_addr.IPAddress(pingedIp), netMask)
objectVector.add(pingedIpOSH)
if networkOSHForLink:
# Create MEMBER link and set end1(discovered network) and end2(host)
objectVector.add(modeling.createLinkOSH('member', networkOSHForLink, pingedIpOSH))
if isVirtual:
# Create Ip OSH
replyIpOSH = modeling.createIpOSH(replyIp, netMask)
# Create a depend link and set end1(pingedIp) and end2(replyIp)
newDependLink = modeling.createLinkOSH('depend', pingedIpOSH, replyIpOSH)
objectVector.add(replyIpOSH)
objectVector.add(newDependLink)
if networkOSHForLink:
replyIpNetAddress = IPv4(replyIp, netMask).getFirstIp().toString()
if replyIpNetAddress == netAddress:
# Create MEMBER link and set end1(discovered network) and end2(host)
objectVector.add(modeling.createLinkOSH('member', networkOSHForLink, replyIpOSH))
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:49,代码来源:icmp_utils.py
示例3: DiscoveryMain
def DiscoveryMain(Framework):
OSHVResult = ObjectStateHolderVector()
jobId = Framework.getDiscoveryJobId()
host_id = Framework.getDestinationAttribute('id')
host_name = Framework.getTriggerCIData('host_name')
dnsServers = Framework.getTriggerCIDataAsList('dnsServers') or None
try:
host_name = host_name.split(" ")
ips = pi_utils.getIPs(host_name[0], Framework)
if not ips:
raise ValueError()
hostOSH = modeling.createOshByCmdbIdString('node', host_id)
modeling.addHostAttributes(hostOSH, None, host_name[0])
#OSHVResult.add(hostOSH)
for ip in ips:
ipRes = pi_utils.getIPOSHV(Framework, ip, None, dnsServers, False, True)
if ipRes.size() > 0:
OSHVResult.add(modeling.createLinkOSH('containment',hostOSH,modeling.createIpOSH(ip)))
OSHVResult.addAll(ipRes)
if OSHVResult.size() <=0:
raise ValueError()
except Exception, e:
msg = logger.prepareJythonStackTrace("Error getting IPs for %s: " % (host_name), e)
errormessages.resolveAndReport(msg, jobId, Framework)
logger.error(msg)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:29,代码来源:DNS_Discovery_Host.py
示例4: createScpOSHV
def createScpOSHV(container, type, host, port, context, shell, localIP=None, dnsServers=None):
OSHVResult = ObjectStateHolderVector()
if not host:
return OSHVResult
ipAddresses = []
if (host in LOCALHOST) and localIP:
logger.debug("found local ip: %s , use %s instead" % (host, localIP))
host = localIP
if netutils.isValidIp(host):
ipAddresses.append(host)
else:
# try to resolve ip address from hostname
logger.debug('Trying to resolve ip address from hostname:', host)
ipAddresses = resolveIPByNsLookup(dnsServers, shell, host)
if len(ipAddresses) == 0:
ipAddresses = resolveIPByINet(host, port)
if len(ipAddresses) == 0:
ipAddresses = resolveIPBySocket(host)
for ipAddress in ipAddresses:
if not netutils.isValidIp(ipAddress):
logger.debug("ignore invalid ip address: ", ipAddress)
continue
scpOsh = createScpOsh(container, type, ipAddress, port, context, host)
OSHVResult.add(scpOsh)
# Add additional ip CIs for all next hops to make sure new jobs could be triggered.
ip = ip_addr.IPAddress(ipAddress)
OSHVResult.add(modeling.createIpOSH(ip))
return OSHVResult
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:30,代码来源:scp.py
示例5: DiscoveryMain
def DiscoveryMain(Framework):
OSHVResult = ObjectStateHolderVector()
# # Write implementation to return new result CIs here...
ipList = Framework.getTriggerCIDataAsList('PHYSICAL_IP_ADDRESS')
portList = Framework.getTriggerCIDataAsList('PHYSICAL_PORT')
service_context = Framework.getDestinationAttribute('SERVICE_CONTEXT')
service_type = Framework.getDestinationAttribute('SERVICE_TYPE')
cluster_id = Framework.getDestinationAttribute('CLUSTER_ID')
application_resource_id = Framework.getDestinationAttribute('APPLICATION_RESOURCE_ID')
cluster_root_class = Framework.getDestinationAttribute('CLUSTER_CLASS')
application_resource_class = Framework.getDestinationAttribute('APPLICATION_RESOURCE_CLASS')
SCPId = Framework.getDestinationAttribute('id')
clusterOsh = modeling.createOshByCmdbIdString(cluster_root_class, cluster_id)
OSHVResult.addAll(scp.createCPLink(application_resource_id, application_resource_class, cluster_id,
cluster_root_class, SCPId, service_context))
for index in range(len(ipList)):
scpOsh = scp.createScpOsh(clusterOsh, service_type, ip=ipList[index], port=portList[index], context=service_context)
ipOsh = modeling.createIpOSH(ipList[index])
OSHVResult.add(scpOsh)
OSHVResult.add(ipOsh)
return OSHVResult
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:26,代码来源:cluster_tunnel.py
示例6: createIPEndpointOSHV
def createIPEndpointOSHV(framework, ipAddress, portNum, portName, hostname = None, protocol = modeling.SERVICEADDRESS_TYPE_TCP):
OSHVResult = ObjectStateHolderVector()
if ip_addr.isValidIpAddress(hostname):
hostname = None
fqdn, aliasList = getHostNames(ipAddress, framework)
hostOSH = modeling.createHostOSH(ipAddress, 'node', None, fqdn)
ipOSH = modeling.createIpOSH(ipAddress, None, fqdn)
link = modeling.createLinkOSH('containment', hostOSH, ipOSH)
OSHVResult.add(hostOSH)
OSHVResult.add(ipOSH)
OSHVResult.add(link)
ipPort = modeling.createServiceAddressOsh(hostOSH, ipAddress, portNum, protocol, portName)
if fqdn:
ipPort.setStringAttribute('ipserver_address', fqdn)
if isValidFQDN(hostname):
ipPort.setStringAttribute('ipserver_address', hostname)
#ipPort.addAttributeToList('itrc_alias', sv)
#ipOSH.addAttributeToList('itrc_alias', sv)
#OSHVResult.add(modeling.createLinkOSH('usage', ipPort, ipOSH))
OSHVResult.add(ipPort)
return hostOSH, ipOSH, OSHVResult
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:29,代码来源:pi_utils.py
示例7: discoveryILOs
def discoveryILOs(client, hostOSH):
vector = ObjectStateHolderVector()
logger.debug("Try to detect iLO...")
controllerTable = SNMP_Networking_Utils.getILOsControllerBySNMP(client)
logger.debug("controllerTable:", controllerTable)
controlModel = None
if controllerTable:
controlModel = int(controllerTable[0].cpqSm2CntlrModel)
desc = ILO_CARD_MODEL_DESC_DICT.get(controlModel) or 'Remote Lights-Out'
table = SNMP_Networking_Utils.getILOsTableBySNMP(client)
if table:
for nic in table:
logger.debug("iLO:", nic)
iLODesc = desc + '( ' + nic.cpqSm2NicModel + ' )'
iLO = createILOCard(hostOSH, iLODesc, nic)
if nic.cpqSm2NicIpAddress:
try:
ipaddress = ip_addr_util.IPAddress(nic.cpqSm2NicIpAddress)
ipOSH = modeling.createIpOSH(ipaddress, nic.cpqSm2NicIpSubnetMask)
link = modeling.createLinkOSH('containment', iLO, ipOSH)
vector.add(ipOSH)
vector.add(link)
except:
logger.debug('got an invalid ipaddress: %s' %nic.cpqSm2NicIpAddress)
vector.add(iLO)
return vector
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:27,代码来源:SNMP_Connection_Utils.py
示例8: DiscoveryMain
def DiscoveryMain(Framework):
OSHVResult = ObjectStateHolderVector()
# # Write implementation to return new result CIs here...
ipList = Framework.getTriggerCIDataAsList('PHYSICAL_IP_ADDRESS')
portList = Framework.getTriggerCIDataAsList('PHYSICAL_PORT')
service_context = Framework.getDestinationAttribute('SERVICE_CONTEXT')
service_type = Framework.getDestinationAttribute('SERVICE_TYPE')
application_resource_id = Framework.getDestinationAttribute('APPLICATION_RESOURCE_ID')
application_resource_class = Framework.getDestinationAttribute('APPLICATION_RESOURCE_CLASS')
junction_id = Framework.getDestinationAttribute('JUNCTION_ID')
junction_root_class = Framework.getDestinationAttribute('JUNCTION_CLASS')
junction_name = Framework.getDestinationAttribute('JUNCTION_NAME')
SCPId = Framework.getDestinationAttribute('id')
junctionOsh = modeling.createOshByCmdbIdString(junction_root_class, junction_id)
url = urlparse(service_context)
if url:
# get context root path from url
path = url.path
if path.startswith(junction_name + '/'):
logger.info('Create one consumer-provider link between application and junction')
OSHVResult.addAll(scp.createCPLink(application_resource_id, application_resource_class, junction_id,
junction_root_class, SCPId, service_context))
for index in range(len(ipList)):
scpOsh = scp.createScpOsh(junctionOsh, service_type, ip=ipList[index], port=portList[index], context=service_context)
logger.info('Create scp with ip %s and port %s' % (ipList[index], portList[index]))
ipOsh = modeling.createIpOSH(ipList[index])
OSHVResult.add(scpOsh)
OSHVResult.add(ipOsh)
return OSHVResult
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:33,代码来源:webseal_tunnel.py
示例9: _buildVirtualServerOsh
def _buildVirtualServerOsh(self):
domainName = DomainScopeManager.getDomainByIp(self.ipAddress.strip())
name = '%s:%s %s' % (self.ipAddress, self.port, domainName)
virtualServerOsh = modeling.createCompleteHostOSH('clusteredservice', name, None, self.name)
self.ipOSH = modeling.createIpOSH(self.ipAddress)
self.linkIpOSH = modeling.createLinkOSH('contained', virtualServerOsh, self.ipOSH)
self.osh = virtualServerOsh
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:7,代码来源:F5_BIGIP_LTM_by_SNMP.py
示例10: processIpsAndSubnets
def processIpsAndSubnets(_vector, hostIpMap, hostId, ipMap, nwMap, hostOSH):
if hostIpMap.has_key(hostId):
iplist = hostIpMap[hostId]
for ip in iplist:
if ipMap.has_key(ip):
ipObj = ipMap[ip]
## create IPs and contained links for the rest of the IPs of that host
ipOSH = modeling.createIpOSH(ipObj.ipValue)
containedLink = modeling.createLinkOSH('contained', hostOSH, ipOSH)
_vector.add(ipOSH)
_vector.add(containedLink)
## create the network for each IP
ipSubnetId = ipObj.ipSubnetId
if nwMap.has_key(ipSubnetId):
netmaskPrefixLength = nwMap[ipSubnetId].prefixLength
if notNull(netmaskPrefixLength):
netOSH = modeling.createNetworkOSH(ipObj.ipValue, computeStringNetmaskFromPrefix(netmaskPrefixLength))
_vector.add(netOSH)
## create member link between ip and network
memberLink = modeling.createLinkOSH('member', netOSH, ipOSH)
_vector.add(memberLink)
## create member link between host and network
memberLink = modeling.createLinkOSH('member', netOSH, hostOSH)
_vector.add(memberLink)
return _vector
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:28,代码来源:NNM_Integration_Utils_9.py
示例11: _buildIp
def _buildIp(ipAddress, netmask=None, dnsname=None, ipProps = None):
r'@types: str, str, str, dict -> bool'
if _isValidIpV4(ipAddress):
return modeling.createIpOSH(ipAddress, netmask, dnsname, ipProps)
elif _isValidIpV6(ipAddress):
return _buildIpV6(ipAddress, netmask, dnsname, ipProps)
raise ValueError("Invalid IP format %s" % ipAddress)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:7,代码来源:nnm_netutils.py
示例12: reportAddressRecord
def reportAddressRecord(self, record, zoneOsh):
r''' Report address `realization` link between `dns_record`
and `ip_address`
@types: ResourceRecord, ObjectStateHolder \
-> tuple[ObjectStateHolder, ObjectStateHolder, ObjectStateHolderVector]
@raise ValueError: Record is not specified
@raise ValueError: Record is not of A type (address)
@raise ValueError: Zone OSH is not specified
@raise ValueError: Canonical name is not IP address
@return: tuple of IP OSH, record OSH itself and resulted vector
'''
if not record:
raise ValueError("Record is not specified")
if not record.type in (ResourceRecord.Type.A,
ResourceRecord.Type.AAAA):
raise ValueError("Record is not of A type (address)")
if not zoneOsh:
raise ValueError("Zone OSH is not specified")
ipAddress = ip_addr.IPAddress(record.cname)
ipOsh = modeling.createIpOSH(ipAddress)
recordOsh = self.reportRecord(record, zoneOsh)
vector = ObjectStateHolderVector()
vector.add(modeling.createLinkOSH('realization', recordOsh, ipOsh))
vector.add(ipOsh)
vector.add(recordOsh)
return (ipOsh, recordOsh, vector)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:26,代码来源:dns.py
示例13: reportMqServerWithEndpoint
def reportMqServerWithEndpoint(self, server):
r''' Make reporting of MQ server based on its IP where contains
is incomplete host built using IP address and if port specified
linked with corresponding service endpoint
@types: jms.MqServer -> ObjectStateHolderVector
@raise ValueError: JMS Server is not specified
@raise ValueError: MQ Server IP address is empty or not resolved
'''
if not server:
raise ValueError("JMS Server is not specified")
ip = server.address
if not (ip and netutils.isValidIp(ip)):
raise ValueError("MQ Server IP address is empty or not resolved")
vector = ObjectStateHolderVector()
hostOsh = modeling.createIpOSH(ip)
vector.add(hostOsh)
serverOsh = self.reportMqServer(server, hostOsh)
vector.add(serverOsh)
if server.getPort() is not None:
vector.add(modeling.createServiceAddressOsh(hostOsh, ip,
server.getPort(),
modeling.SERVICEADDRESS_TYPE_TCP
)
)
return vector
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:26,代码来源:jms.py
示例14: reportIpAddressOfVm
def reportIpAddressOfVm(self, vm):
'''
VmComputerSystem -> ObjectStateHolder
'''
if vm.primaryIpAddress:
ipOsh = modeling.createIpOSH(vm.primaryIpAddress)
return ipOsh
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:7,代码来源:vmware_cim_report.py
示例15: getUrl
def getUrl(WSDLUrl, containerOSH):
res = ObjectStateHolderVector()
urlIP = None
try:
url = URL(WSDLUrl)
hostName = url.getHost()
urlIP = netutils.getHostAddress(hostName, None)
if (not netutils.isValidIp(urlIP)) or netutils.isLocalIp(urlIP):
urlIP = None
except:
urlIP = None
urlOSH = modeling.createUrlOsh(containerOSH, WSDLUrl, 'wsdl')
urlIpOSH = None
if urlIP != None:
try:
urlIpOSH = modeling.createIpOSH(urlIP)
except:
urlIpOSH = None
res.add(urlOSH)
if urlIpOSH:
res.add(urlIpOSH)
urlToIpOSH = modeling.createLinkOSH('depend', urlOSH, urlIpOSH)
res.add(urlToIpOSH)
return res
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:31,代码来源:OracleAplicationServer.py
示例16: reportRemotePeer
def reportRemotePeer(remote_peer, localInterfaceOsh, local_mac):
vector = ObjectStateHolderVector()
if remote_peer.peer_ips:
hostOsh = modeling.createHostOSH(str(remote_peer.peer_ips[0]))
if remote_peer.platform in VIRTUAL_HOST_PLATFORMS:
hostOsh.setBoolAttribute('host_isvirtual', 1)
vector.add(hostOsh)
for ip in remote_peer.peer_ips:
ipOsh = modeling.createIpOSH(ip)
linkOsh = modeling.createLinkOSH('containment', hostOsh, ipOsh)
vector.add(ipOsh)
vector.add(linkOsh)
else:
hostOsh = ObjectStateHolder('node')
hostOsh.setBoolAttribute('host_iscomplete', 1)
hostOsh.setStringAttribute('name', remote_peer.system_name)
if remote_peer.platform in VIRTUAL_HOST_PLATFORMS:
hostOsh.setBoolAttribute('host_isvirtual', 1)
vector.add(hostOsh)
if remote_peer.interface_name or remote_peer.interface_mac:
remoteInterfaceOsh = modeling.createInterfaceOSH(mac = remote_peer.interface_mac, hostOSH = hostOsh, name = remote_peer.interface_name)
if not remoteInterfaceOsh:
return ObjectStateHolderVector()
if remote_peer.interface_name:
remoteInterfaceOsh.setStringAttribute('name', remote_peer.interface_name)
vector.add(remoteInterfaceOsh)
l2id = str(hash(':'.join([remote_peer.interface_mac or remote_peer.interface_name, local_mac])))
vector.addAll(reportLayer2Connection(localInterfaceOsh, remoteInterfaceOsh, l2id))
return vector
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:30,代码来源:layer2.py
示例17: reportPrivateIpAddress
def reportPrivateIpAddress(self, ipAddress, hostOsh):
r'@types: str, OSH -> OSHV'
vector = self._createOshVector()
ipOsh = modeling.createIpOSH(ipAddress)
vector.add(ipOsh)
vector.add(modeling.createLinkOSH('containment', hostOsh, ipOsh))
return vector
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:7,代码来源:ec2.py
示例18: build_network_device
def build_network_device(device):
'''
Build Layer 2 connection end.
@type param: NetworkDevice -> OSH
'''
device_osh = None
device_ip_address_osh = None
device_interface_osh = None
device_member_ip = None
if device.ucmdb_id:
device_osh = modeling.createOshByCmdbIdString('node', device.ucmdb_id)
if device.mac_address:
if not device_osh:
device_osh = modeling.createCompleteHostOSH('node', device.mac_address)
device_interface_osh = modeling.createInterfaceOSH(device.mac_address, device_osh)
if device.ip_address:
if not device_osh:
device_osh = modeling.createHostOSH(device.ip_address)
device_ip_address_osh = modeling.createIpOSH(device.ip_address)
device_member_ip = modeling.createLinkOSH('contained', device_osh, device_ip_address_osh)
if device.port:
if device_interface_osh:
device_interface_osh.setAttribute('interface_name', device.port)
elif device_osh:
device_interface_osh = ObjectStateHolder('interface')
device_interface_osh.setContainer(device_osh)
device_interface_osh.setAttribute('interface_name', device.port)
return device_osh, device_ip_address_osh, device_interface_osh, device_member_ip
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:28,代码来源:SNMP_CDP_LLDP.py
示例19: osh_createIpOsh
def osh_createIpOsh(lparOsh, tcpStacks):
ipstoexclude = ['127.0.0.1']
# tcpStacks [ip, network, mask, interface name, status, type, mac address]str_name = 'name'
str_name = 'name'
str_mac_address = 'mac_address'
_vector = ObjectStateHolderVector()
for mac, tcpentry in tcpStacks.items():
ipAddress = tcpentry[0].strip()
if ipAddress not in ipstoexclude:
ipOsh = modeling.createIpOSH(ipAddress)
probeName = CollectorsParameters.getValue(CollectorsParameters.KEY_COLLECTORS_PROBE_NAME)
if isNotNull(probeName):
ipOsh.setAttribute('ip_probename', probeName)
containedOsh = modeling.createLinkOSH('contained', lparOsh, ipOsh)
_vector.add(lparOsh)
_vector.add(ipOsh)
_vector.add(containedOsh)
# create interface ----------------------------------------------------
ifOsh = ObjectStateHolder('interface')
interfacename = tcpentry[3].strip()
ifOsh.setAttribute(str_name, interfacename)
# default the mac address attribute to linkName and update later if MAC found
ifOsh.setAttribute(str_mac_address, mac) # if MAC not found for set #linkName as key
ifOsh.setContainer(lparOsh)
_vector.add(ifOsh)
if tcpStacks.has_key(mac):
parentLinkOsh = modeling.createLinkOSH('containment', ifOsh, ipOsh)
_vector.add(parentLinkOsh)
return _vector
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:32,代码来源:eview400_resources.py
示例20: report
def report(self, region_osh, event_osh=None):
vector = ObjectStateHolderVector()
osh = ObjectStateHolder('host_node')
osh.setAttribute('name', self.name)
logger.debug("self.id:", self.id)
vector.add(osh)
if self.ips:
for ip in self.ips:
ip_osh = modeling.createIpOSH(str(ip))
vector.add(ip_osh)
vector.add(modeling.createLinkOSH('contained', osh, ip_osh))
if self.image:
imageOsh, image_vector = self.image.report(region_osh)
vector.addAll(image_vector)
vector.add(modeling.createLinkOSH('dependency', osh, imageOsh))
if self.hypervisorHostName:
hypervisorOsh, hypervisor_vector = Hypervisor(self.hypervisorHostName).report(region_osh)
vector.addAll(hypervisor_vector)
vector.add(modeling.createLinkOSH('execution_environment', hypervisorOsh, osh))
if self.flavor:
flavorOsh, flavor_vector = self.flavor.report(region_osh)
vector.addAll(flavor_vector)
vector.add(modeling.createLinkOSH('dependency', osh, flavorOsh))
if event_osh:
vector.add(modeling.createLinkOSH('dependency', osh, event_osh))
return osh, vector
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:27,代码来源:openstack.py
注:本文中的modeling.createIpOSH函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论