NVIDIA UFM Enterprise REST API Guide

Unhealthy Ports REST API

  • Description – Manages unhealthy ports in OpenSM

  • Request URL – GET /ufmRest/app/unhealthy_ports

  • Main OperationsGet Unhealthy PortsGet Unhealthy PortMark Unhealthy Ports as HealthyMark Healthy Ports as UnhealthyMark All Unhealthy Ports as Healthy at OnceConnectivityDelete PoliciesGet Healthy Policy PortsGet Healthy Policy DevicesGet Port Health State

Get All Unhealthy Ports

  • Description – Gets all ports that are marked as unhealthy from OpenSM

  • Request URL – GET /ufmRest/app/unhealthy_ports

  • Request Content Type – Application/json

  • Response 

    [
        {
            "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

Get Unhealthy Port

  • 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 

    {
      "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

Mark Unhealthy Ports as Healthy

When leveraging the API to place a port into a Healthy or Unhealthy state, please be aware that the transition to the new state is not immediate. The API signals to OpenSM to make a pending change to the fabric. Once this change is completed on the fabric, UFM updates its current state and provides this information to the user via API and/or UI.

To verify a port's current health state, use the Get Port Health State API. You can use this information to determine the current port state and, therefore, decide if you need to transition to an alternate state.

  • 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 

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


  • Status Codes

    • 200 – OK

    • 400 – Bad request

Mark Healthy Ports as Unhealthy

When leveraging the API to place a port into a Healthy or Unhealthy state, please be aware that the transition to the new state is not immediate. The API signals to OpenSM to make a pending change to the fabric. Once this change is completed on the fabric, UFM updates its current state and provides this information to the user via API and/or UI.

To verify a port's current health state, use the Get Port Health State API. You can use this information to determine the current port state and, therefore, decide if you need to transition to an alternate state.

  • 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

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


  • Status Codes

    • 200 – OK

    • 400 – Bad request

Mark All Unhealthy Ports as Healthy at Once

  • 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 

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


  • Status Codes

    • 200 – OK

    • 400 – Bad request

Connectivity

  • Description – Gets unhealthy port.

  • Request URL – GET app/unhealthy_ports.

  • Parameter:Connectivityhost-to-switchswitch-to-switch

  • Example: 

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


Delete Policies

  • 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-

  • Example: 

    [
       "9c0591030085b3c0_1",
       "9c0591030085b3c1"
    ]
    


Get Healthy Policy Ports

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

  • Request URL:  GET app/unhealthy_ports/policy

  • Request datadevice_guid: Enables you to group ports by device.

  • Status Codes:

  • Response:

    [
        {
            "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",
        }
    ]
    


Get Healthy Policy Devices

  • Description – Retrieves all devices from the health policy.

  • Request URL – Get app/unhealthy_ports/policy_devices

  • Status Codes:200-OK400 – Bad request

  • Response:

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


Get Port Health State

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

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

  • Status Codes:200-OK400 – Bad request

  • Response:

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


Last updated: