NVIDIA UFM Enterprise REST API Guide

REST API Complementary Information

The section provides complementary information with regard to all UFM REST APIs.

Exposing site_name field in REST API

In addition to the existing REST API, users can configure the UFM to expose the site_name (configurable) field in all the supported REST APIs. The site_name field can be used to identify the current InfiniBand fabric that is managed by the UFM Enterprise.

To expose the site_name field, perform the following:

  • In gv.cfg and in the [Server] section, set a value for "site_name"

  • In gv.cfg and in the [Server] section, set "expose_site_name" to "true"

  • Restart UFM for the changes to take effect

Examples of REST APIs Using Various Authentication Types

Basic Authentication

For basic authentication, run: 

curl -k https://<ufm-ip>/ufmRest/resources/systems -u <username>:<password>

Session-Based Authentication

For session-based Authentication, follow the below instructions: 

  1. Run the below command to log in and store the session in a cookie file.

    curl -k -f -X POST -c cookies.txt -d "httpd_username=<user>" -d "httpd_password=<password>" https://<ufm-ip>/dologin
    
  2. Use the session saved earlier to make as many ufmRestV2 requests as needed, for instance:

    curl -k –cookie cookies.txt https://<ufm-ip>/ufmRestV2/reources/systems
    

Token-Based Authentication

For token-based authentication, follow the below instructions

  1. Create an access token using either the user's credentials or session:

    curl -k -X POST https://<ufm-ip>/ufmRest/app/tokens -u username:password
    
  2. Access ufmRestV3 using the access token generated earlier:

    curl -k https://<ufm-ip>/ufmRest/resources/systems -H "Authorization:Basic <access_token>"
    

Last updated: