Пример #1
0
def _reportJavaServer(inst, system, isScs, hostOsh, systemOsh):
    '''
    @types: Instance, System, bool, osh, osh -> oshv
    '''
    vector = ObjectStateHolderVector()
    reportInstName = False
    clusterOsh = sap_jee.reportClusterOnSystem(system, systemOsh)
    reporter, pdo = None, None

    if not isScs:
        builder = sap_jee.InstanceBuilder(reportInstName=reportInstName)
        reporter = sap_jee.InstanceReporter(builder)
        pdo = sap_jee.InstanceBuilder.InstancePdo(inst, system)
    else:
        builder = sap_jee.ScsInstanceBuilder(reportInstName=reportInstName)
        reporter = sap_jee.InstanceReporter(builder)
        pdo = sap_jee.InstanceBuilder.InstancePdo(inst, system)

    instOsh = reporter.reportInstancePdo(pdo, hostOsh)
    vector.add(instOsh)

    linkReporter = sap.LinkReporter()
    vector.add(linkReporter.reportMembership(clusterOsh, instOsh))
    vector.add(linkReporter.reportMembership(systemOsh, instOsh))
    return vector
Пример #2
0
def _reportSapSystem(system, userName=None):
    r'@types: System, str -> tuple[osh[sap_system], osh[j2eecluster], oshv]'
    vector = ObjectStateHolderVector()
    systemPdo = sap.Builder.SystemPdo(system, username=userName)
    systemReporter = sap.Reporter(sap.Builder())
    systemOsh = systemReporter.reportSystemPdo(systemPdo)
    vector.add(systemOsh)
    clusterOsh = reportClusterOnSystem(system, systemOsh)
    vector.add(clusterOsh)
    return systemOsh, clusterOsh, vector