Exemplo n.º 1
0
def show_memory(rsd, memory):
    assert isinstance(memory,
            rsd_lib.resources.v2_2.system.memory.Memory)
    utils.print_header("Memory", memory)
    utils.print_body(memory, (
        'capacity_mib',
        'operating_speed_mhz',
        'allowed_speeds_mhz',
        'bus_width_bits',
        'data_width_bits',
        'memory_device_type',
        'manufacturer',
        'device_locator',
        'error_correction',
        'part_number',
        'rank_count',
        'redfish_version',
        'serial_number'))
    utils.print_items(memory, "memory_location")
    print("metrics: %s; health %s; %s'C" % (
        memory.metrics.identity,
        ",".join(memory.metrics.health),
        memory.metrics.temperature_celsius))
    utils.print_body_none(memory, (
        'base_module_type',
        'device_id',
        'firmware_revision',
        'frirmware_api_version',
        'function_classes',
        'max_tdp_milliwatts',
        'memory_media',
        'memory_type',
        'operating_memory_modes',
        'vendor_id'))
    print()
Exemplo n.º 2
0
def show_processor(rsd, processor):
    assert(isinstance(processor,
        rsd_lib.resources.v2_2.system.processor.Processor))
    utils.print_header("Processor", processor)
    utils.print_body(processor, (
        'processor_type',
        'total_cores',
        'total_threads',
        'max_speed_mhz',
        'socket',
        'instruction_set',
        'manufacturer',
        'model'))
    metrics = processor.metrics
    print("metrics: %s; health %s; %sW, %s/%s'C, avg %sMHz" % (
        metrics.identity,
        ",".join(metrics.health),
        metrics.consumed_power_watt,
        metrics.temperature_celsius,
        metrics.throttling_celsius,
        metrics.average_frequency_mhz))
    utils.print_items(processor, "processor_id")
    utils.print_body_none(processor, (
        'processor_architecture',))
    print()
Exemplo n.º 3
0
def show_drive(rsd, drive):
    assert isinstance(drive,
            rsd_lib.resources.v2_3.storage_service.drive.Drive)
    utils.print_header("Drive", drive)
    print("capacity: %s GiB" % _safe_bytes_to_gigs(drive.capacity_bytes))
    print("block size: %s" % drive.json["BlockSizeBytes"])
    utils.print_body(drive, (
        "manufacturer",
        "media_type",
        "model",
        "protocol",
        "serial_number"))
    utils.print_items(drive, "oem")
    print("identifiers:")
    for ident in drive.identifiers:
        print("  %s: %s" % (
            ident.durable_name_format,
            ident.durable_name))
    print("used by:")
    pools = [v["@odata.id"] for v in
             drive.json["Oem"]["Intel_RackScale"]["UsedBy"]]
    pools = [get_pool(rsd, url) for url in pools]
    show_pools(rsd, pools, 1)
    storage = drive.oem.storage
    if storage:
        print("storage: %s" % storage["@odata.id"])
    else:
        print("storage: None")
    print("links:")
    links = drive.links
    assert(3 == len(links.keys()))
    print("  chassis:")
    chassis = drive.links.chassis
    chassis = get_chassis(rsd, chassis)
    show_chassises(rsd, [chassis], 2)
    print("  endpoints:")
    endpoints = [get_endpoint(rsd, ep) for ep in drive.links.endpoints]
    show_endpoints(rsd, endpoints, 2)
    print("  volumes:")
    volumes = drive.links.volumes
    volumes = [get_volume(rsd, url) for url in volumes]
    show_volumes(rsd, volumes, 2)
    utils.print_body_none(drive, (
        "asset_tag", "capable_speed_gbs", "drive_type", "indicator_led",
        "location", "negotiated_speed_gbs", "part_number",
        "predicted_media_life_left_percent", "revision", "rotation_speed_rpm",
        "sku", "status_indicator"))
    print()
Exemplo n.º 4
0
def show_endpoint(rsd, endpoint):
    assert isinstance(endpoint,
            rsd_lib.resources.v2_3.fabric.endpoint.Endpoint)

    utils.print_header("Endpoint", endpoint)
    utils.print_body(endpoint, ("protocol",))
    assert(1 == len(endpoint.oem))
    utils.print_items(endpoint, "oem.authentication")

    print("connected entities:")
    for c_ent in endpoint.connected_entities:
        if c_ent.entity_role == "Initiator":
            print("  %s-%s:" % (c_ent.entity_role,
                                c_ent.entity_type))
            system = get_system(rsd, c_ent.entity_link)
            show_systems(rsd, [system], 2)
        elif c_ent.entity_role == "Target":
            print("  %s-%s:" % (c_ent.entity_role,
                                c_ent.entity_type))
            volume = get_volume(rsd, c_ent.entity_link)
            show_volumes(rsd, [volume], 2)
        else:
            print("  %s-%s: %s" % (c_ent.entity_role,
                                   c_ent.entity_type,
                                   c_ent.entity_link))
    print("identifiers:")
    for ident in endpoint.identifiers:
        print("  %s: %s" % (ident.name_format, ident.name))
    print("ip transport:")
    for ip in endpoint.ip_transport_details:
        print("  %s://%s(%s):%s" % (ip.transport_protocol,
                                   ip.ipv4_address,
                                   ip.ipv6_address,
                                   ip.port))
    print("links:")
    links = endpoint.links
    assert(4 == len(links))
    print("  zones:")
    zones = links.zones
    zones = [get_zone(rsd, url) for url in zones]
    show_zones(rsd, zones, 2)
    print("  endpoints: %s" % links.endpoints)
    print("  interface: %s" % links.interface)
    print("  ports: ")
    for port in links.ports:
        print("    %s" % port)
    print()
Exemplo n.º 5
0
def show_system(rsd, system):
    assert isinstance(system,
            rsd_lib.resources.v2_2.system.system.System)
    utils.print_header("System", system)
    utils.print_body(system, (
        'uuid',
        'system_type',
        'power_state',
        'bios_version',
        'manufacturer',
        'serial_number',
        'part_number',
        'sku'))
    print("allowed reset vals: %s" %
            ",".join(system.get_allowed_reset_system_values()))
    print("allowed boot vals: %s" %
            ",".join(system.get_allowed_system_boot_source_values()))
    metrics = system.metrics
    print("metrics: health %s, io %sGbps, mem/cpu %s/%s%%, "
            "mem/cpu %s/%sW, mem throttle %s%%" % (
            ",".join(metrics.health),
            metrics.io_bandwidth_gbps,
            metrics.memory_bandwidth_percent,
            metrics.processor_bandwidth_percent,
            metrics.memory_power_watt,
            metrics.processor_power_watt,
            metrics.memory_throttled_cycles_percent))
    ps = system.json["ProcessorSummary"]
    print("processor_summary: %s; %s; %s" % (
        ps["Count"], ps["Status"]["State"], ps["Model"]))
    print("processors:")
    show_processors(rsd, system.processors.get_members(), 1)
    utils.print_items(system, "memory_summary")
    print("memories:")
    show_memories(rsd, system.memory.get_members(), 1)
    print("interfaces:")
    show_interfaces(rsd, system.ethernet_interfaces.get_members(), 1)
    print("oem: %s" % ", ".join(system.json["Oem"].keys()))
    print("PCIeDevices: %s" % len(system.json["PCIeDevices"]))
    print("PCIeFunctions: %s" % len(system.json["PCIeFunctions"]))
    print("SimpleStorage: %s" % system.json["SimpleStorage"]["@odata.id"])
    print("Storage: %s" % system.json["Storage"]["@odata.id"])
    print("links:")
    links = system.json["Links"]
    assert(5 == len(links))
    print("  Chassises:")
    chassises = [v["@odata.id"] for v in links["Chassis"]]
    chassises = [get_chassis(rsd, url) for url in chassises]
    show_chassises(rsd, chassises, 2)
    print("  Endpoints:")
    endpoints = [v["@odata.id"] for v in links["Endpoints"]]
    endpoints = [get_endpoint(rsd, url) for url in endpoints]
    show_endpoints(rsd, endpoints, 2)
    print("  Managers:")
    for v in links["ManagedBy"]:
        # TODO
        print("    %s" % v["@odata.id"])
    print("  Oem: %s" % links["Oem"])
    utils.print_body_none(system, (
        'asset_tag',
        'hostname',
        'indicator_led'))
    print()