After CloudSOC update to 3.151 CloudSOC Management API script returning error: object is not subscriptable
search cancel

After CloudSOC update to 3.151 CloudSOC Management API script returning error: object is not subscriptable

book

Article ID: 250021

calendar_today

Updated On:

Products

CASB Security Premium

Issue/Introduction

After CloudSOC update to 3.151, the CloudSOC Management API script returns error: 

 

GET / <tenant> /api/admin/v1/logs/get/ HTTP/1.1

Job Log: 2022-09-10 00:00:00 -> 2022-09-11 00:00:00 Traceback (most recent call last):

  File "c:\Scripts\cloudsoc-reporting\run.py", line 80, in <module>

    total = data['meta']['total']['value']

TypeError: 'int' object is not subscriptable

The script may run but the records returned will be outside the expected date range

Cause

In CloudSOC 3.151 the total Value of records was changed to match the documentation.

Prior to the fix, the API was returning an extra value with the return which customers would need to account for.

sending data['meta']['total']['value'] 

 

In the example above, the script accounted for the additional parameter:

    total = data['meta']['total']['value']

 

Resolution

The fix removes the extra returned value. Customers making this call that had previously included the extra value in their script, will need to update their script to account for the change.

Example:  total = data['meta']['total']     instead of  total = data['meta']['total']['value']