def process(self, context, discoverer, dnsresolver, installpath): try: server = discoverer.getHanaDatabaseServer() instances = discoverer.getHanaDatabaseInstances() get_sql_ports = Sfn(discoverer.getHanaDatabaseInstanceSqlPorts) instance_ports_pairs = [(instance, get_sql_ports(instance.hostname)) for instance in instances] resolve_ips = Sfn(dnsresolver.resolve_ips) instance_descriptors = [] for instance, ports in instance_ports_pairs: instance_pdo = buildDatabaseInstancePdo(instance, installpath, server=server) host_pdo = hana_host.parse_from_address(instance.hostname, resolve_ips) # ignore the name as it is could be an alias and not a real hostname host_pdo = host_pdo._replace(name=None) instance_descriptors.append((instance_pdo, host_pdo, ports)) reporter = hana.DatabaseTopologyReporter() _, _, _, oshs = reporter.report_database_with_instances(server, instance_descriptors) context.resultsVector.addAll(oshs) except command.ExecuteException, e: raise Exception(e.result.output)
def process(self, context, discoverer, dnsresolver, installpath): try: server = discoverer.getHanaDatabaseServer() instances = discoverer.getHanaDatabaseInstances() get_sql_ports = Sfn(discoverer.getHanaDatabaseInstanceSqlPorts) instance_ports_pairs = [(instance, get_sql_ports(instance.hostname)) for instance in instances] resolve_ips = Sfn(dnsresolver.resolve_ips) instance_descriptors = [] for instance, ports in instance_ports_pairs: instance_pdo = buildDatabaseInstancePdo(instance, installpath, server=server) host_pdo = hana_host.parse_from_address( instance.hostname, resolve_ips) # ignore the name as it is could be an alias and not a real hostname host_pdo = host_pdo._replace(name=None) instance_descriptors.append((instance_pdo, host_pdo, ports)) reporter = hana.DatabaseTopologyReporter() _, _, _, oshs = reporter.report_database_with_instances( server, instance_descriptors) context.resultsVector.addAll(oshs) except command.ExecuteException, e: raise Exception(e.result.output)
def getReplicationHosts(self, resolve_ips_fn): r'''Returns all other side replication hosts. @types: callable(str, [ip_addr.IPAddress])-> list[hana_host.Host]''' return [ hana_host.parse_from_address(address, resolve_ips_fn) for address in self.getReplicationHostnames() ]
def getDeploymentHosts(self, resolve_ips_fn): r'''Returns all hosts current deployment resides on. @types: callable(str, [ip_addr.IPAddress])-> list[hana_host.Host]''' return [ hana_host.parse_from_address(address, resolve_ips_fn) for address in self.getDeploymentHostnames() ]
def getReplicationHosts(self, resolve_ips_fn): r'''Returns all other side replication hosts. @types: callable(str, [ip_addr.IPAddress])-> list[hana_host.Host]''' return [hana_host.parse_from_address(address, resolve_ips_fn) for address in self.getReplicationHostnames()]
def getDeploymentHosts(self, resolve_ips_fn): r'''Returns all hosts current deployment resides on. @types: callable(str, [ip_addr.IPAddress])-> list[hana_host.Host]''' return [hana_host.parse_from_address(address, resolve_ips_fn) for address in self.getDeploymentHostnames()]