ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Add Devices to Device Group via uimapi (swagger): 401 Unauthorized

book

Article ID: 239797

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

I am receiving a 401 Unauthorized message on some device groups in the UIMAPI. 

  1. Account: all ACL permissions
  2. Group: retrieved from group list API request. <id> = 192, <variables><group_id> = 191
  3. Empty device group confirmed by API request GET
  4. Device identified from a list and cs_id or name retrieved and tried:
  5. curl -X PUT "https://xxxxx-01:8443/uimapi/devicegroups/192/members/2389?lookup=by_cs_id" -H "accept: application/xml"
  6. Returns:   <errorCode>401</errorCode>  <errorMsg>Access for requested resource denied. Please check log for more information.</errorMsg>

In the uimapi log from the UAT oc server for 500 or 401:

  • 2022-04-05 16:35:42,782 ERROR com.ca.uimapi.services.controller.DeviceGroupResource:addGroupMember:139 [https-jsse-nio-443-exec-12]   - An unexpected error occured. 
  • com.nimsoft.selfservice.exceptions.AccessDeniedException: [MCS-800] Access to the entity group with id 79 was denied to user null, Access denied. You do not have sufficient privileges. [MCS-800], MCS-800

What are we doing wrong? 

Cause

Adding devices to Dynamic Device Group via this method is not allowed. 

Environment

Release : UIM 20.3, 20.4 

Component : UIMAPI 

Resolution

The above method would not be the correct method to add devices via UIMAPI to a dynamic group. The best method for adding devices to a dynamic group via UIMAPI can be found here:

https://knowledge.broadcom.com/external/article/239944

Additional Information

uimapi APIs (broadcom.com)