From 8985b7b1f2666c87c15d52e207f34b83eee4676e Mon Sep 17 00:00:00 2001 From: Simon Melotte Date: Thu, 15 Feb 2024 16:34:05 +0100 Subject: [PATCH 1/3] fix code policies --- prismacloud/api/pccs/_code_policies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prismacloud/api/pccs/_code_policies.py b/prismacloud/api/pccs/_code_policies.py index dafc308..135f1aa 100644 --- a/prismacloud/api/pccs/_code_policies.py +++ b/prismacloud/api/pccs/_code_policies.py @@ -5,5 +5,5 @@ class CodePoliciesPrismaCloudAPIPCCSMixin: """ Prisma Cloud Code Security API Code Policies Endpoints Class """ - def suppressions_justifications_list_read(self, policy_id): + def code_policies_list_read(self, policy_id): return self.execute_code_security('GET', 'code/api/v2/policies/%s' % policy_id) From 7b42e73d92de45ee65eefe1429a034df536da16b Mon Sep 17 00:00:00 2001 From: Simon Melotte Date: Thu, 15 Feb 2024 16:35:57 +0100 Subject: [PATCH 2/3] set policy_id optional --- prismacloud/api/pccs/_code_policies.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/prismacloud/api/pccs/_code_policies.py b/prismacloud/api/pccs/_code_policies.py index 135f1aa..0cf7fe3 100644 --- a/prismacloud/api/pccs/_code_policies.py +++ b/prismacloud/api/pccs/_code_policies.py @@ -4,6 +4,11 @@ class CodePoliciesPrismaCloudAPIPCCSMixin: """ Prisma Cloud Code Security API Code Policies Endpoints Class """ - - def code_policies_list_read(self, policy_id): - return self.execute_code_security('GET', 'code/api/v2/policies/%s' % policy_id) + + def code_policies_list_read(self, policy_id=None): + if policy_id: + # Fetch details for a specific policy + return self.execute_code_security('GET', 'code/api/v2/policies/%s' % policy_id) + else: + # Fetch a list of all policies if no specific policy_id is provided + return self.execute_code_security('GET', 'code/api/v2/policies') From fbcf4dfdc72f9a230090e50a70df713defee0af7 Mon Sep 17 00:00:00 2001 From: Simon Melotte Date: Thu, 15 Feb 2024 16:37:07 +0100 Subject: [PATCH 3/3] bump the version to 5.2.14 --- prismacloud/api/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prismacloud/api/version.py b/prismacloud/api/version.py index 9e74770..c846aaa 100644 --- a/prismacloud/api/version.py +++ b/prismacloud/api/version.py @@ -1 +1 @@ -version = "5.2.13" +version = "5.2.14"