Skip to content

Commit

Permalink
add asset_inventory_list_read_post function
Browse files Browse the repository at this point in the history
  • Loading branch information
SimOnPanw committed Jul 5, 2023
1 parent 55b30dd commit 3f9206d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions prismacloud/api/cspm/_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,15 @@ def cloud_account_group_delete(self, cloud_account_group_id):
[ ] DELETE
Additional:
[x] LIST (v2)
[x] LIST WITH FILTERS(v2)
"""

def asset_inventory_list_read(self, query_params=None):
return self.execute('GET', 'v2/inventory', query_params=query_params)

def asset_inventory_list_read_post(self, body_params=None):
return self.execute('POST', 'v2/inventory', body_params=body_params)

"""
(Assets) Resources
Expand Down Expand Up @@ -487,7 +491,7 @@ def search_config_read(self, search_params):
next_page_token = api_response['data'].pop('nextPageToken', None)
while next_page_token:
api_response = self.execute(
'POST', 'search/config/page', body_params={'limit':1000,'pageToken': next_page_token, 'withResourceJson':'true'})
'POST', 'search/config/page', body_params={'limit': 1000, 'pageToken': next_page_token, 'withResourceJson': 'true'})
if 'items' in api_response:
result.extend(api_response['items'])
next_page_token = api_response.pop('nextPageToken', None)
Expand All @@ -512,7 +516,7 @@ def search_event_read(self, search_params, subsearch=None):
next_page_token = api_response['data'].pop('nextPageToken', None)
while next_page_token:
api_response = self.execute(
'POST', 'search/config/page', body_params={'limit':1000,'pageToken': next_page_token})
'POST', 'search/config/page', body_params={'limit': 1000, 'pageToken': next_page_token})
if 'items' in api_response:
result.extend(api_response['items'])
next_page_token = api_response.pop('nextPageToken', None)
Expand All @@ -521,13 +525,14 @@ def search_event_read(self, search_params, subsearch=None):
def search_iam_read(self, search_params):
result = []
next_page_token = None
api_response = self.execute('POST', 'api/v1/permission', body_params=search_params)
api_response = self.execute(
'POST', 'api/v1/permission', body_params=search_params)
if 'data' in api_response and 'items' in api_response['data']:
result = api_response['data']['items']
next_page_token = api_response['data'].pop('nextPageToken', None)
while next_page_token:
api_response = self.execute(
'POST', 'api/v1/permission/page', body_params={'limit':1000,'pageToken': next_page_token, 'withResourceJson':'true'})
'POST', 'api/v1/permission/page', body_params={'limit': 1000, 'pageToken': next_page_token, 'withResourceJson': 'true'})
if 'items' in api_response:
result.extend(api_response['items'])
next_page_token = api_response.pop('nextPageToken', None)
Expand Down
2 changes: 1 addition & 1 deletion prismacloud/api/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" version file """

version = '5.2.4'
version = '5.2.5'

0 comments on commit 3f9206d

Please sign in to comment.