From 3f9206d28f882b7c9ee1124c9aa15f8782bc7406 Mon Sep 17 00:00:00 2001 From: Simon Melotte Date: Wed, 5 Jul 2023 14:16:06 +0200 Subject: [PATCH] add asset_inventory_list_read_post function --- prismacloud/api/cspm/_endpoints.py | 13 +++++++++---- prismacloud/api/version.py | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/prismacloud/api/cspm/_endpoints.py b/prismacloud/api/cspm/_endpoints.py index 71d8a1b..e54789e 100644 --- a/prismacloud/api/cspm/_endpoints.py +++ b/prismacloud/api/cspm/_endpoints.py @@ -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 @@ -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) @@ -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) @@ -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) diff --git a/prismacloud/api/version.py b/prismacloud/api/version.py index dd1172d..c391577 100644 --- a/prismacloud/api/version.py +++ b/prismacloud/api/version.py @@ -1,3 +1,3 @@ """ version file """ -version = '5.2.4' +version = '5.2.5'