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.cfgand in the [Server] section, set a value for "site_name" -
In
gv.cfgand 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:
-
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 -
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
-
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 -
Access ufmRestV3 using the access token generated earlier:
curl -k https://<ufm-ip>/ufmRest/resources/systems -H "Authorization:Basic <access_token>"
LDAP-Based Authentication
To authenticate via the configured by the user LDAP server, run:
curl -k https://<ufm-ip>/ufmRest/resources/systems -u <ldap-username>:<ldap-password>
For more info, please refer to UFM Enterprise User Manual → Manage Users → Authentication Methods → LDAP Authentication
Last updated: