Unhealthy Ports REST API

NVIDIA UFM Enterprise REST API Guide v6.17.1
  • Description – Gets all ports that are marked as unhealthy from OpenSM

  • Request URL – GET /ufmRest/app/unhealthy_ports

  • Request Content Type – Application/json

  • Response

    Copy
    Copied!
                

    [ { "PeerLID": "18", "PeerPortNumber": 6, "UnhealthyPortNumber": 1, "PeerGUID": "248a070300f88fe0", "PeerPort": "switch-ec4034/6", "UnhealthyNode": "r-dmz-ufm135", "UnhealthyPort": "r-dmz-ufm135/HCA-1/1", "State": "Info", "PeerPortDname": "6", "Condition": "MANUAL", "PeerNode": "switch-ec4034", "StatusTime": "Wed Apr 29 00:05:32 2020", "UnhealthyPortDname": "HCA-1/1", "UnhealthyGUID": "248a0703002e628e" } ]

  • Status Codes

    • 200 – OK

    • 400 – Bad request

  • Description – Gets specific port that are marked as unhealthy from OpenSM

  • Request URL – GET /ufmRest/app/unhealthy_ports/<port_name>

  • Request Content Type – Application/json

  • Response

    Copy
    Copied!
                

    { "PeerPort": "sw-ufm-ib01 / 35", "PeerGUID": "0002c903007e5220", "StatusTime": "Sun Apr 21 12:22:13 2024", "UnhealthyGUID": "ec0d9a0300d42e54", "UnhealthyPort": "1", "PeerNode": "sw-ufm-ib01", "PeerNodeType": "switch", "UnhealthyNodeType": "Unknown", "UnhealthyNode": "r-ufm59 mlx5_0", "UnhealthyPortNumber": 1, "UnhealthyPortNodeDesc": "1", "UnhealthyPortPeerNodeDesc": "sw-ufm-ib01:35", "UnhealthyPortDname": "Unknown", "Condition": [ "MANUAL" ], "State": "Warning", "PeerLID": "2", "PeerPortNumber": 35, "PeerPortDname": "35" }

  • Status Codes

    • 200 – OK

    • 400 – Bad request

  • Description – Marks unhealthy ports or devices as healthy. Once device GUID is passed as a parameter, its unhealthy ports are marked as healthy.

  • Request URL – PUT /ufmRest/app/unhealthy_ports

  • Request Content Type – Application/json

  • Request Data

    Copy
    Copied!
                

    {   "ports":[ "0002c9030060dc20_10" ], "devices":[ “0002c9030060dc20" ], "ports_policy":"HEALTHY" }

  • Status Codes

    • 200 – OK

    • 400 – Bad request

  • Description – Mark healthy ports as unhealthy, and send the action that you want to apply on this port
    Action: ["no_discover", "isolate"]

  • Request URL – PUT /ufmRest/app/unhealthy_ports

  • URL Parameters:

    • force_set: An optional boolean value. If set to true, will set the port as unhealthy in the policy file without validating if the port exists.
      Request Example: /ufmRest/app/unhealthy_ports?force_set=true

  • Request Content Type – Application/json

  • Request Data

    Copy
    Copied!
                

    { "ports":[ "0002c9030060dc20_10" ], "ports_policy":"UNHEALTHY", "action":"no_discover" }

  • Status Codes

    • 200 – OK

    • 400 – Bad request

  • Description – Marks a list of ports as unhealthy in the UFM server. If the optional boolean value is set to true, the REST API sets the port as unhealthy in the policy file without validating if the port exists. (This parameter allows setting non-discovered or disabled ports as unhealthy)

  • Request URL – PUT /ufmRest/app/unhealthy_ports

  • URL Parameters:

    • force_set: An optional boolean value. If set to true, will set the port as unhealthy in the policy file without validating if the port exists.
      Request Example: /ufmRest/app/unhealthy_ports?force_set=true

  • Request Content Type – Application/json

  • Request Data

    Copy
    Copied!
                

    { "ports": [ "ALL" ], "ports_policy": "HEALTHY" }

  • Status Codes

    • 200 – OK

    • 400 – Bad request

  • Description – Gets unhealthy port.

  • Request URL – GET app/unhealthy_ports.

  • Parameter:

    • Connectivity

      • host-to-switch

      • switch-to-switch

  • Example:

    Copy
    Copied!
                

    /ufmRestV2/app/unhealthy_ports?connectivity=host-to-switch

  • Description: Deletes unhealthy/healthy ports from health policy file.

  • Request URL: DELETE app/unhealthy_ports/policy

  • Request data (one list)- List of strings:

    • Port names - Deletes all the ports specified in the list.

    • Device GUID - Deletes all the ports in the health policy of that specified device GUID.

    • all_healthy - Deletes all the healthy ports in the health policy.

  • Status Codes-

    • 200 – OK

    • 400 – Bad request

  • Example:

    Copy
    Copied!
                

    [ "9c0591030085b3c0_1", "9c0591030085b3c1" ]

  • Description: Retrieves all unhealthy/healthy ports from the health policy file.

  • Request URL: GET app/unhealthy_ports/policy

  • Request data

    • device_guid: Enables you to group ports by device.

  • Status Codes:

    • 200-OK

    • 400 – Bad request

  • Response:

    Copy
    Copied!
                

    [    {        "node_guid": "248a070300f88fe0",        "port_number": 6,        "policy": Healthy,        "action":"",        "last_updated": "Wed Apr 29 00:05:32 2020",        "node_description": "r-dmz-ufm135",        "node_name": "r-dmz-ufm135/HCA-1/1",        "capabilities": "mark_port_unhealthy",    } ]

  • Description – Retrieves all devices from the health policy.

  • Request URL – Get app/unhealthy_ports/policy_devices

  • Status Codes:

    • 200-OK

    • 400 – Bad request

  • Response:

    Copy
    Copied!
                

    [    {        "guid": "248a070300f88fe0",        "type": host,        "name":” r-dmz-ufm135/HCA-1/1”,        "number_of_policies”: 7    } ]

  • Description – Returns health state of a given port name.

  • Request URL – Get app/unhealthy_ports /port_health_state/<port_name>

  • Status Codes:

    • 200-OK

    • 400 – Bad request

  • Response:

    Copy
    Copied!
                

    { "port_name": "0002c903007e5220_35", "healthiness_state": "UNHEALTHY", "node_description": "sw-ufm-ib01:35" }

© Copyright 2024, NVIDIA. Last updated on Jun 11, 2024.