From a5f4ad7037014a1a4cade0cdaef017a606e0cb1a Mon Sep 17 00:00:00 2001 From: tkishel Date: Thu, 26 Jan 2023 16:42:07 -0800 Subject: [PATCH 1/3] rename directories and files to normalize to module acronyms --- prismacloud/api/__init__.py | 4 ++-- prismacloud/api/{code_security => ccs}/README.md | 0 prismacloud/api/{code_security => ccs}/__init__.py | 12 ++++++------ .../api/{code_security => ccs}/_checkov_version.py | 0 prismacloud/api/{code_security => ccs}/_errors.py | 0 prismacloud/api/{code_security => ccs}/_fixes.py | 0 .../api/{code_security => ccs}/_repositories.py | 0 prismacloud/api/{code_security => ccs}/_scans.py | 0 .../api/{code_security => ccs}/_suppressions.py | 0 .../{code_security/code_security.py => ccs/ccs.py} | 0 prismacloud/api/{posture => cspm}/README.md | 0 prismacloud/api/{posture => cspm}/__init__.py | 2 +- prismacloud/api/{posture => cspm}/_endpoints.py | 0 prismacloud/api/{posture => cspm}/_extended.py | 0 prismacloud/api/{posture/posture.py => cspm/cspm.py} | 0 prismacloud/api/{compute => cwpp}/README.md | 0 prismacloud/api/{compute => cwpp}/__init__.py | 2 +- prismacloud/api/{compute => cwpp}/_audits.py | 0 prismacloud/api/{compute => cwpp}/_cloud.py | 0 prismacloud/api/{compute => cwpp}/_collections.py | 0 prismacloud/api/{compute => cwpp}/_containers.py | 0 prismacloud/api/{compute => cwpp}/_credentials.py | 0 prismacloud/api/{compute => cwpp}/_defenders.py | 0 prismacloud/api/{compute => cwpp}/_hosts.py | 0 prismacloud/api/{compute => cwpp}/_images.py | 0 prismacloud/api/{compute => cwpp}/_logs.py | 0 prismacloud/api/{compute => cwpp}/_policies.py | 0 prismacloud/api/{compute => cwpp}/_registry.py | 0 prismacloud/api/{compute => cwpp}/_scans.py | 0 prismacloud/api/{compute => cwpp}/_settings.py | 0 prismacloud/api/{compute => cwpp}/_stats.py | 0 prismacloud/api/{compute => cwpp}/_status.py | 0 prismacloud/api/{compute => cwpp}/_tags.py | 0 prismacloud/api/{compute/compute.py => cwpp/cwpp.py} | 0 prismacloud/api/pc_lib_api.py | 7 ++++--- 35 files changed, 14 insertions(+), 13 deletions(-) rename prismacloud/api/{code_security => ccs}/README.md (100%) rename prismacloud/api/{code_security => ccs}/__init__.py (68%) rename prismacloud/api/{code_security => ccs}/_checkov_version.py (100%) rename prismacloud/api/{code_security => ccs}/_errors.py (100%) rename prismacloud/api/{code_security => ccs}/_fixes.py (100%) rename prismacloud/api/{code_security => ccs}/_repositories.py (100%) rename prismacloud/api/{code_security => ccs}/_scans.py (100%) rename prismacloud/api/{code_security => ccs}/_suppressions.py (100%) rename prismacloud/api/{code_security/code_security.py => ccs/ccs.py} (100%) rename prismacloud/api/{posture => cspm}/README.md (100%) rename prismacloud/api/{posture => cspm}/__init__.py (93%) rename prismacloud/api/{posture => cspm}/_endpoints.py (100%) rename prismacloud/api/{posture => cspm}/_extended.py (100%) rename prismacloud/api/{posture/posture.py => cspm/cspm.py} (100%) rename prismacloud/api/{compute => cwpp}/README.md (100%) rename prismacloud/api/{compute => cwpp}/__init__.py (96%) rename prismacloud/api/{compute => cwpp}/_audits.py (100%) rename prismacloud/api/{compute => cwpp}/_cloud.py (100%) rename prismacloud/api/{compute => cwpp}/_collections.py (100%) rename prismacloud/api/{compute => cwpp}/_containers.py (100%) rename prismacloud/api/{compute => cwpp}/_credentials.py (100%) rename prismacloud/api/{compute => cwpp}/_defenders.py (100%) rename prismacloud/api/{compute => cwpp}/_hosts.py (100%) rename prismacloud/api/{compute => cwpp}/_images.py (100%) rename prismacloud/api/{compute => cwpp}/_logs.py (100%) rename prismacloud/api/{compute => cwpp}/_policies.py (100%) rename prismacloud/api/{compute => cwpp}/_registry.py (100%) rename prismacloud/api/{compute => cwpp}/_scans.py (100%) rename prismacloud/api/{compute => cwpp}/_settings.py (100%) rename prismacloud/api/{compute => cwpp}/_stats.py (100%) rename prismacloud/api/{compute => cwpp}/_status.py (100%) rename prismacloud/api/{compute => cwpp}/_tags.py (100%) rename prismacloud/api/{compute/compute.py => cwpp/cwpp.py} (100%) diff --git a/prismacloud/api/__init__.py b/prismacloud/api/__init__.py index eecee35..019495b 100644 --- a/prismacloud/api/__init__.py +++ b/prismacloud/api/__init__.py @@ -2,9 +2,9 @@ import sys -from .pc_lib_api import PrismaCloudAPI +from .pc_lib_api import PrismaCloudAPI from .pc_lib_utility import PrismaCloudUtility -from .version import version as api_version +from .version import version as api_version __author__ = 'Palo Alto Networks CSE/SE/SA Teams' __version__ = api_version diff --git a/prismacloud/api/code_security/README.md b/prismacloud/api/ccs/README.md similarity index 100% rename from prismacloud/api/code_security/README.md rename to prismacloud/api/ccs/README.md diff --git a/prismacloud/api/code_security/__init__.py b/prismacloud/api/ccs/__init__.py similarity index 68% rename from prismacloud/api/code_security/__init__.py rename to prismacloud/api/ccs/__init__.py index 0788e1c..abf7db2 100644 --- a/prismacloud/api/code_security/__init__.py +++ b/prismacloud/api/ccs/__init__.py @@ -2,13 +2,13 @@ import sys -from .code_security import * +from .ccs import * from ._checkov_version import * -from ._errors import * -from ._fixes import * -from ._repositories import * -from ._scans import * -from ._suppressions import * +from ._errors import * +from ._fixes import * +from ._repositories import * +from ._scans import * +from ._suppressions import * mixin_classes_as_strings = list(filter(lambda x: x.endswith('PrismaCloudAPICodeSecurityMixin'), dir())) mixin_classes = [getattr(sys.modules[__name__], x) for x in mixin_classes_as_strings] diff --git a/prismacloud/api/code_security/_checkov_version.py b/prismacloud/api/ccs/_checkov_version.py similarity index 100% rename from prismacloud/api/code_security/_checkov_version.py rename to prismacloud/api/ccs/_checkov_version.py diff --git a/prismacloud/api/code_security/_errors.py b/prismacloud/api/ccs/_errors.py similarity index 100% rename from prismacloud/api/code_security/_errors.py rename to prismacloud/api/ccs/_errors.py diff --git a/prismacloud/api/code_security/_fixes.py b/prismacloud/api/ccs/_fixes.py similarity index 100% rename from prismacloud/api/code_security/_fixes.py rename to prismacloud/api/ccs/_fixes.py diff --git a/prismacloud/api/code_security/_repositories.py b/prismacloud/api/ccs/_repositories.py similarity index 100% rename from prismacloud/api/code_security/_repositories.py rename to prismacloud/api/ccs/_repositories.py diff --git a/prismacloud/api/code_security/_scans.py b/prismacloud/api/ccs/_scans.py similarity index 100% rename from prismacloud/api/code_security/_scans.py rename to prismacloud/api/ccs/_scans.py diff --git a/prismacloud/api/code_security/_suppressions.py b/prismacloud/api/ccs/_suppressions.py similarity index 100% rename from prismacloud/api/code_security/_suppressions.py rename to prismacloud/api/ccs/_suppressions.py diff --git a/prismacloud/api/code_security/code_security.py b/prismacloud/api/ccs/ccs.py similarity index 100% rename from prismacloud/api/code_security/code_security.py rename to prismacloud/api/ccs/ccs.py diff --git a/prismacloud/api/posture/README.md b/prismacloud/api/cspm/README.md similarity index 100% rename from prismacloud/api/posture/README.md rename to prismacloud/api/cspm/README.md diff --git a/prismacloud/api/posture/__init__.py b/prismacloud/api/cspm/__init__.py similarity index 93% rename from prismacloud/api/posture/__init__.py rename to prismacloud/api/cspm/__init__.py index 830c666..2d72264 100644 --- a/prismacloud/api/posture/__init__.py +++ b/prismacloud/api/cspm/__init__.py @@ -2,7 +2,7 @@ import sys -from .posture import * +from .cspm import * from ._endpoints import * from ._extended import * diff --git a/prismacloud/api/posture/_endpoints.py b/prismacloud/api/cspm/_endpoints.py similarity index 100% rename from prismacloud/api/posture/_endpoints.py rename to prismacloud/api/cspm/_endpoints.py diff --git a/prismacloud/api/posture/_extended.py b/prismacloud/api/cspm/_extended.py similarity index 100% rename from prismacloud/api/posture/_extended.py rename to prismacloud/api/cspm/_extended.py diff --git a/prismacloud/api/posture/posture.py b/prismacloud/api/cspm/cspm.py similarity index 100% rename from prismacloud/api/posture/posture.py rename to prismacloud/api/cspm/cspm.py diff --git a/prismacloud/api/compute/README.md b/prismacloud/api/cwpp/README.md similarity index 100% rename from prismacloud/api/compute/README.md rename to prismacloud/api/cwpp/README.md diff --git a/prismacloud/api/compute/__init__.py b/prismacloud/api/cwpp/__init__.py similarity index 96% rename from prismacloud/api/compute/__init__.py rename to prismacloud/api/cwpp/__init__.py index 09b2553..9677382 100644 --- a/prismacloud/api/compute/__init__.py +++ b/prismacloud/api/cwpp/__init__.py @@ -2,7 +2,7 @@ import sys -from .compute import * +from .cwpp import * from ._audits import * from ._cloud import * from ._collections import * diff --git a/prismacloud/api/compute/_audits.py b/prismacloud/api/cwpp/_audits.py similarity index 100% rename from prismacloud/api/compute/_audits.py rename to prismacloud/api/cwpp/_audits.py diff --git a/prismacloud/api/compute/_cloud.py b/prismacloud/api/cwpp/_cloud.py similarity index 100% rename from prismacloud/api/compute/_cloud.py rename to prismacloud/api/cwpp/_cloud.py diff --git a/prismacloud/api/compute/_collections.py b/prismacloud/api/cwpp/_collections.py similarity index 100% rename from prismacloud/api/compute/_collections.py rename to prismacloud/api/cwpp/_collections.py diff --git a/prismacloud/api/compute/_containers.py b/prismacloud/api/cwpp/_containers.py similarity index 100% rename from prismacloud/api/compute/_containers.py rename to prismacloud/api/cwpp/_containers.py diff --git a/prismacloud/api/compute/_credentials.py b/prismacloud/api/cwpp/_credentials.py similarity index 100% rename from prismacloud/api/compute/_credentials.py rename to prismacloud/api/cwpp/_credentials.py diff --git a/prismacloud/api/compute/_defenders.py b/prismacloud/api/cwpp/_defenders.py similarity index 100% rename from prismacloud/api/compute/_defenders.py rename to prismacloud/api/cwpp/_defenders.py diff --git a/prismacloud/api/compute/_hosts.py b/prismacloud/api/cwpp/_hosts.py similarity index 100% rename from prismacloud/api/compute/_hosts.py rename to prismacloud/api/cwpp/_hosts.py diff --git a/prismacloud/api/compute/_images.py b/prismacloud/api/cwpp/_images.py similarity index 100% rename from prismacloud/api/compute/_images.py rename to prismacloud/api/cwpp/_images.py diff --git a/prismacloud/api/compute/_logs.py b/prismacloud/api/cwpp/_logs.py similarity index 100% rename from prismacloud/api/compute/_logs.py rename to prismacloud/api/cwpp/_logs.py diff --git a/prismacloud/api/compute/_policies.py b/prismacloud/api/cwpp/_policies.py similarity index 100% rename from prismacloud/api/compute/_policies.py rename to prismacloud/api/cwpp/_policies.py diff --git a/prismacloud/api/compute/_registry.py b/prismacloud/api/cwpp/_registry.py similarity index 100% rename from prismacloud/api/compute/_registry.py rename to prismacloud/api/cwpp/_registry.py diff --git a/prismacloud/api/compute/_scans.py b/prismacloud/api/cwpp/_scans.py similarity index 100% rename from prismacloud/api/compute/_scans.py rename to prismacloud/api/cwpp/_scans.py diff --git a/prismacloud/api/compute/_settings.py b/prismacloud/api/cwpp/_settings.py similarity index 100% rename from prismacloud/api/compute/_settings.py rename to prismacloud/api/cwpp/_settings.py diff --git a/prismacloud/api/compute/_stats.py b/prismacloud/api/cwpp/_stats.py similarity index 100% rename from prismacloud/api/compute/_stats.py rename to prismacloud/api/cwpp/_stats.py diff --git a/prismacloud/api/compute/_status.py b/prismacloud/api/cwpp/_status.py similarity index 100% rename from prismacloud/api/compute/_status.py rename to prismacloud/api/cwpp/_status.py diff --git a/prismacloud/api/compute/_tags.py b/prismacloud/api/cwpp/_tags.py similarity index 100% rename from prismacloud/api/compute/_tags.py rename to prismacloud/api/cwpp/_tags.py diff --git a/prismacloud/api/compute/compute.py b/prismacloud/api/cwpp/cwpp.py similarity index 100% rename from prismacloud/api/compute/compute.py rename to prismacloud/api/cwpp/cwpp.py diff --git a/prismacloud/api/pc_lib_api.py b/prismacloud/api/pc_lib_api.py index a044011..18c09a9 100644 --- a/prismacloud/api/pc_lib_api.py +++ b/prismacloud/api/pc_lib_api.py @@ -2,9 +2,10 @@ import logging -from .posture import PrismaCloudAPIPosture -from .code_security import PrismaCloudAPICodeSecurity -from .compute import PrismaCloudAPICompute +from .cspm import PrismaCloudAPIPosture +from .cwpp import PrismaCloudAPICompute +from .ccs import PrismaCloudAPICodeSecurity + from .pc_lib_utility import PrismaCloudUtility # --Description-- # From 7be0bce1c57982d0f460e7b9771600d7ede4b3b1 Mon Sep 17 00:00:00 2001 From: tkishel Date: Fri, 10 Feb 2023 13:00:16 -0800 Subject: [PATCH 2/3] use simpler, matching api names --- prismacloud/api/cspm/__init__.py | 2 +- prismacloud/api/cwpp/__init__.py | 4 ++-- prismacloud/api/cwpp/_audits.py | 2 +- prismacloud/api/cwpp/_cloud.py | 2 +- prismacloud/api/cwpp/_collections.py | 2 +- prismacloud/api/cwpp/_containers.py | 2 +- prismacloud/api/cwpp/_credentials.py | 2 +- prismacloud/api/cwpp/_defenders.py | 2 +- prismacloud/api/cwpp/_hosts.py | 2 +- prismacloud/api/cwpp/_images.py | 2 +- prismacloud/api/cwpp/_logs.py | 2 +- prismacloud/api/cwpp/_policies.py | 2 +- prismacloud/api/cwpp/_registry.py | 6 +++++- prismacloud/api/cwpp/_scans.py | 2 +- prismacloud/api/cwpp/_settings.py | 2 +- prismacloud/api/cwpp/_stats.py | 2 +- prismacloud/api/cwpp/_status.py | 2 +- prismacloud/api/cwpp/_tags.py | 2 +- prismacloud/api/cwpp/cwpp.py | 2 +- prismacloud/api/pc_lib_api.py | 8 ++++---- prismacloud/api/{ccs => pccs}/README.md | 0 prismacloud/api/{ccs => pccs}/__init__.py | 6 +++--- prismacloud/api/{ccs => pccs}/_checkov_version.py | 2 +- prismacloud/api/{ccs => pccs}/_errors.py | 2 +- prismacloud/api/{ccs => pccs}/_fixes.py | 2 +- prismacloud/api/{ccs => pccs}/_repositories.py | 2 +- prismacloud/api/{ccs => pccs}/_scans.py | 2 +- prismacloud/api/{ccs => pccs}/_suppressions.py | 2 +- prismacloud/api/{ccs/ccs.py => pccs/pccs.py} | 2 +- 29 files changed, 38 insertions(+), 34 deletions(-) rename prismacloud/api/{ccs => pccs}/README.md (100%) rename prismacloud/api/{ccs => pccs}/__init__.py (80%) rename prismacloud/api/{ccs => pccs}/_checkov_version.py (84%) rename prismacloud/api/{ccs => pccs}/_errors.py (95%) rename prismacloud/api/{ccs => pccs}/_fixes.py (86%) rename prismacloud/api/{ccs => pccs}/_repositories.py (94%) rename prismacloud/api/{ccs => pccs}/_scans.py (84%) rename prismacloud/api/{ccs => pccs}/_suppressions.py (95%) rename prismacloud/api/{ccs/ccs.py => pccs/pccs.py} (99%) diff --git a/prismacloud/api/cspm/__init__.py b/prismacloud/api/cspm/__init__.py index 2d72264..ff13273 100644 --- a/prismacloud/api/cspm/__init__.py +++ b/prismacloud/api/cspm/__init__.py @@ -10,5 +10,5 @@ mixin_classes = [getattr(sys.modules[__name__], x) for x in mixin_classes_as_strings] # pylint: disable=too-few-public-methods -class PrismaCloudAPIPosture(*mixin_classes): +class PrismaCloudAPICSPM(*mixin_classes): """ Prisma Cloud CSPM API Class """ diff --git a/prismacloud/api/cwpp/__init__.py b/prismacloud/api/cwpp/__init__.py index 9677382..a289929 100644 --- a/prismacloud/api/cwpp/__init__.py +++ b/prismacloud/api/cwpp/__init__.py @@ -20,9 +20,9 @@ from ._status import * from ._tags import * -mixin_classes_as_strings = list(filter(lambda x: x.endswith('PrismaCloudAPIComputeMixin'), dir())) +mixin_classes_as_strings = list(filter(lambda x: x.endswith('PrismaCloudAPICWPPMixin'), dir())) mixin_classes = [getattr(sys.modules[__name__], x) for x in mixin_classes_as_strings] # pylint: disable=too-few-public-methods -class PrismaCloudAPICompute(*mixin_classes): +class PrismaCloudAPICWPP(*mixin_classes): """ Prisma Cloud CWP API Class """ diff --git a/prismacloud/api/cwpp/_audits.py b/prismacloud/api/cwpp/_audits.py index 0a2650b..49af2ab 100644 --- a/prismacloud/api/cwpp/_audits.py +++ b/prismacloud/api/cwpp/_audits.py @@ -1,6 +1,6 @@ """ Prisma Cloud Compute API Audits Endpoints Class """ -class AuditsPrismaCloudAPIComputeMixin: +class AuditsPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Audit Endpoints Class """ # The audits/incidents endpoint is the only documented audits endpoint. diff --git a/prismacloud/api/cwpp/_cloud.py b/prismacloud/api/cwpp/_cloud.py index 280a104..7d00c1e 100644 --- a/prismacloud/api/cwpp/_cloud.py +++ b/prismacloud/api/cwpp/_cloud.py @@ -2,7 +2,7 @@ # Cloud -class CloudPrismaCloudAPIComputeMixin: +class CloudPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Cloud Endpoints Class """ def cloud_discovery_read(self): diff --git a/prismacloud/api/cwpp/_collections.py b/prismacloud/api/cwpp/_collections.py index bb58fff..8847c87 100644 --- a/prismacloud/api/cwpp/_collections.py +++ b/prismacloud/api/cwpp/_collections.py @@ -2,7 +2,7 @@ # Containers -class CollectionsPrismaCloudAPIComputeMixin: +class CollectionsPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Collections Endpoints Class """ def collections_list_read(self, query_params=None): diff --git a/prismacloud/api/cwpp/_containers.py b/prismacloud/api/cwpp/_containers.py index 49aa058..1346707 100644 --- a/prismacloud/api/cwpp/_containers.py +++ b/prismacloud/api/cwpp/_containers.py @@ -2,7 +2,7 @@ # Containers -class ContainersPrismaCloudAPIComputeMixin: +class ContainersPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Containers Endpoints Class """ def containers_list_read(self, image_id=None, query_params=None): diff --git a/prismacloud/api/cwpp/_credentials.py b/prismacloud/api/cwpp/_credentials.py index ad78e39..5ba565e 100644 --- a/prismacloud/api/cwpp/_credentials.py +++ b/prismacloud/api/cwpp/_credentials.py @@ -5,7 +5,7 @@ # Credentials (Manage > Authentication > Credentials store) -class CredentialsPrismaCloudAPIComputeMixin: +class CredentialsPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Credentials Endpoints Class """ def credential_list_read(self): diff --git a/prismacloud/api/cwpp/_defenders.py b/prismacloud/api/cwpp/_defenders.py index 0d2e506..5d5f47e 100644 --- a/prismacloud/api/cwpp/_defenders.py +++ b/prismacloud/api/cwpp/_defenders.py @@ -2,7 +2,7 @@ # Containers -class DefendersPrismaCloudAPIComputeMixin: +class DefendersPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Defenders Endpoints Class """ def defenders_list_read(self, query_params=None): diff --git a/prismacloud/api/cwpp/_hosts.py b/prismacloud/api/cwpp/_hosts.py index ba9bb32..6893cfe 100644 --- a/prismacloud/api/cwpp/_hosts.py +++ b/prismacloud/api/cwpp/_hosts.py @@ -2,7 +2,7 @@ # Containers -class HostsPrismaCloudAPIComputeMixin: +class HostsPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Hosts Endpoints Class """ # Running hosts table in Monitor > Vulnerabilities > Hosts > Running Hosts diff --git a/prismacloud/api/cwpp/_images.py b/prismacloud/api/cwpp/_images.py index fa8c8ba..d5a612c 100644 --- a/prismacloud/api/cwpp/_images.py +++ b/prismacloud/api/cwpp/_images.py @@ -2,7 +2,7 @@ # Images (Monitor > Vulnerabilities/Compliance > Images > Deployed) -class ImagesPrismaCloudAPIComputeMixin: +class ImagesPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Images Endpoints Class """ def images_list_read(self, image_id=None, query_params=None): diff --git a/prismacloud/api/cwpp/_logs.py b/prismacloud/api/cwpp/_logs.py index 4c91a69..7bfa208 100644 --- a/prismacloud/api/cwpp/_logs.py +++ b/prismacloud/api/cwpp/_logs.py @@ -2,7 +2,7 @@ # Containers -class LogsPrismaCloudAPIComputeMixin: +class LogsPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Logs Endpoints Class """ # Undocumented endpoints. diff --git a/prismacloud/api/cwpp/_policies.py b/prismacloud/api/cwpp/_policies.py index 6c851c5..714c996 100644 --- a/prismacloud/api/cwpp/_policies.py +++ b/prismacloud/api/cwpp/_policies.py @@ -2,7 +2,7 @@ # Credentials (Defend > Compliance) -class PoliciesPrismaCloudAPIComputeMixin: +class PoliciesPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Credentials Endpoints Class """ def policies_cloud_platforms_read(self): diff --git a/prismacloud/api/cwpp/_registry.py b/prismacloud/api/cwpp/_registry.py index a67c523..7fbe010 100644 --- a/prismacloud/api/cwpp/_registry.py +++ b/prismacloud/api/cwpp/_registry.py @@ -2,7 +2,7 @@ # Images (Monitor > Vulnerabilities/Compliance > Images > Deployed) -class RegistryPrismaCloudAPIComputeMixin: +class RegistryPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Images Endpoints Class """ def registry_list_read(self, image_id=None): @@ -12,6 +12,10 @@ def registry_list_read(self, image_id=None): images = self.execute_compute('GET', 'api/v1/registry?filterBaseImage=true', paginated=True) return images + def registry_list_image_names(self, query_params=None): + result = self.execute_compute('GET', 'api/v1/registry/names?', query_params=query_params) + return result + def registry_scan(self, body_params=None): result = self.execute_compute('POST', 'api/v1/registry/scan', body_params=body_params) return result diff --git a/prismacloud/api/cwpp/_scans.py b/prismacloud/api/cwpp/_scans.py index 21e50f4..c2687ec 100644 --- a/prismacloud/api/cwpp/_scans.py +++ b/prismacloud/api/cwpp/_scans.py @@ -2,7 +2,7 @@ # Scans (Monitor > Vulnerabilities/Compliance > Images > CI) -class ScansPrismaCloudAPIComputeMixin: +class ScansPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Scans Endpoints Class """ def scans_list_read(self, image_id=None): diff --git a/prismacloud/api/cwpp/_settings.py b/prismacloud/api/cwpp/_settings.py index 1883267..5f1f381 100644 --- a/prismacloud/api/cwpp/_settings.py +++ b/prismacloud/api/cwpp/_settings.py @@ -2,7 +2,7 @@ # Credentials (Defend > Compliance) -class SettingsPrismaCloudAPIComputeMixin: +class SettingsPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Settings Endpoints Class """ def settings_serverless_scan_read(self): diff --git a/prismacloud/api/cwpp/_stats.py b/prismacloud/api/cwpp/_stats.py index 6792828..5353aab 100644 --- a/prismacloud/api/cwpp/_stats.py +++ b/prismacloud/api/cwpp/_stats.py @@ -1,6 +1,6 @@ """ Prisma Cloud Compute API Stats Endpoints Class """ -class StatsPrismaCloudAPIComputeMixin: +class StatsPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Stats Endpoints Class """ def stats_app_firewall_count_read(self): diff --git a/prismacloud/api/cwpp/_status.py b/prismacloud/api/cwpp/_status.py index 5481c6b..8d2b849 100644 --- a/prismacloud/api/cwpp/_status.py +++ b/prismacloud/api/cwpp/_status.py @@ -1,6 +1,6 @@ """ Prisma Cloud Compute API Statuses Endpoints Class """ -class StatusPrismaCloudAPIComputeMixin: +class StatusPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Statuses Endpoints Class """ def statuses_intelligence(self): diff --git a/prismacloud/api/cwpp/_tags.py b/prismacloud/api/cwpp/_tags.py index 8af4dfb..72cdef2 100644 --- a/prismacloud/api/cwpp/_tags.py +++ b/prismacloud/api/cwpp/_tags.py @@ -2,7 +2,7 @@ # Tags are predefined labels that help you manage your vulnerabilities via the Console UI and Prisma Cloud Compute API. -class TagsPrismaCloudAPIComputeMixin: +class TagsPrismaCloudAPICWPPMixin: """ Prisma Cloud Compute API Tags Endpoints Class """ def tags_list_read(self): diff --git a/prismacloud/api/cwpp/cwpp.py b/prismacloud/api/cwpp/cwpp.py index 1a4a56d..2a7d946 100644 --- a/prismacloud/api/cwpp/cwpp.py +++ b/prismacloud/api/cwpp/cwpp.py @@ -5,7 +5,7 @@ import requests -class PrismaCloudAPIComputeMixin(): +class PrismaCloudAPICWPPMixin(): """ Requests and Output """ def login_compute(self): diff --git a/prismacloud/api/pc_lib_api.py b/prismacloud/api/pc_lib_api.py index 18c09a9..26789bf 100644 --- a/prismacloud/api/pc_lib_api.py +++ b/prismacloud/api/pc_lib_api.py @@ -2,9 +2,9 @@ import logging -from .cspm import PrismaCloudAPIPosture -from .cwpp import PrismaCloudAPICompute -from .ccs import PrismaCloudAPICodeSecurity +from .cspm import PrismaCloudAPICSPM +from .cwpp import PrismaCloudAPICWPP +from .pccs import PrismaCloudAPIPCCS from .pc_lib_utility import PrismaCloudUtility @@ -24,7 +24,7 @@ def __call__(self, *args, **kwargs): return self.method(*args, **kwargs) # pylint: disable=too-many-instance-attributes -class PrismaCloudAPI(PrismaCloudAPIPosture, PrismaCloudAPICompute, PrismaCloudAPICodeSecurity): +class PrismaCloudAPI(PrismaCloudAPICSPM, PrismaCloudAPICWPP, PrismaCloudAPIPCCS): """ Prisma Cloud API Class """ # pylint: disable=super-init-not-called def __init__(self): diff --git a/prismacloud/api/ccs/README.md b/prismacloud/api/pccs/README.md similarity index 100% rename from prismacloud/api/ccs/README.md rename to prismacloud/api/pccs/README.md diff --git a/prismacloud/api/ccs/__init__.py b/prismacloud/api/pccs/__init__.py similarity index 80% rename from prismacloud/api/ccs/__init__.py rename to prismacloud/api/pccs/__init__.py index abf7db2..575aa88 100644 --- a/prismacloud/api/ccs/__init__.py +++ b/prismacloud/api/pccs/__init__.py @@ -2,7 +2,7 @@ import sys -from .ccs import * +from .pccs import * from ._checkov_version import * from ._errors import * from ._fixes import * @@ -10,9 +10,9 @@ from ._scans import * from ._suppressions import * -mixin_classes_as_strings = list(filter(lambda x: x.endswith('PrismaCloudAPICodeSecurityMixin'), dir())) +mixin_classes_as_strings = list(filter(lambda x: x.endswith('PrismaCloudAPIPCCSMixin'), dir())) mixin_classes = [getattr(sys.modules[__name__], x) for x in mixin_classes_as_strings] # pylint: disable=too-few-public-methods -class PrismaCloudAPICodeSecurity(*mixin_classes): +class PrismaCloudAPIPCCS(*mixin_classes): """ Prisma Cloud Code Security API Class """ diff --git a/prismacloud/api/ccs/_checkov_version.py b/prismacloud/api/pccs/_checkov_version.py similarity index 84% rename from prismacloud/api/ccs/_checkov_version.py rename to prismacloud/api/pccs/_checkov_version.py index 9a73139..0b7b895 100644 --- a/prismacloud/api/ccs/_checkov_version.py +++ b/prismacloud/api/pccs/_checkov_version.py @@ -2,7 +2,7 @@ # Checkov Version -class CheckovVersionPrismaCloudAPICodeSecurityMixin: +class CheckovVersionPrismaCloudAPIPCCSMixin: """ Prisma Cloud Code Security API Checkov Version Endpoint Class """ def checkov_version(self): diff --git a/prismacloud/api/ccs/_errors.py b/prismacloud/api/pccs/_errors.py similarity index 95% rename from prismacloud/api/ccs/_errors.py rename to prismacloud/api/pccs/_errors.py index c31535b..e172ce3 100644 --- a/prismacloud/api/ccs/_errors.py +++ b/prismacloud/api/pccs/_errors.py @@ -2,7 +2,7 @@ # Errors -class ErrorsPrismaCloudAPICodeSecurityMixin: +class ErrorsPrismaCloudAPIPCCSMixin: """ Prisma Cloud Code Security API Errors Endpoints Class """ def errors_files_list(self, criteria): diff --git a/prismacloud/api/ccs/_fixes.py b/prismacloud/api/pccs/_fixes.py similarity index 86% rename from prismacloud/api/ccs/_fixes.py rename to prismacloud/api/pccs/_fixes.py index 100286e..7bc9c99 100644 --- a/prismacloud/api/ccs/_fixes.py +++ b/prismacloud/api/pccs/_fixes.py @@ -2,7 +2,7 @@ # Fixes -class FixesPrismaCloudAPICodeSecurityMixin: +class FixesPrismaCloudAPIPCCSMixin: """ Prisma Cloud Code Security API Fixes Endpoints Class """ def fixes_list(self, body_params): diff --git a/prismacloud/api/ccs/_repositories.py b/prismacloud/api/pccs/_repositories.py similarity index 94% rename from prismacloud/api/ccs/_repositories.py rename to prismacloud/api/pccs/_repositories.py index af50402..a405405 100644 --- a/prismacloud/api/ccs/_repositories.py +++ b/prismacloud/api/pccs/_repositories.py @@ -2,7 +2,7 @@ # Repositories -class RepositoriesPrismaCloudAPICodeSecurityMixin: +class RepositoriesPrismaCloudAPIPCCSMixin: """ Prisma Cloud Code Security API Repositories Endpoints Class """ def repositories_list_read(self, query_params=None): diff --git a/prismacloud/api/ccs/_scans.py b/prismacloud/api/pccs/_scans.py similarity index 84% rename from prismacloud/api/ccs/_scans.py rename to prismacloud/api/pccs/_scans.py index c2465b7..0e9498d 100644 --- a/prismacloud/api/ccs/_scans.py +++ b/prismacloud/api/pccs/_scans.py @@ -2,7 +2,7 @@ # Scans -class ScansPrismaCloudAPICodeSecurityMixin: +class ScansPrismaCloudAPIPCCSMixin: """ Prisma Cloud Code Security API Scans Endpoints Class """ def scan(self): diff --git a/prismacloud/api/ccs/_suppressions.py b/prismacloud/api/pccs/_suppressions.py similarity index 95% rename from prismacloud/api/ccs/_suppressions.py rename to prismacloud/api/pccs/_suppressions.py index 2b48b80..b631d16 100644 --- a/prismacloud/api/ccs/_suppressions.py +++ b/prismacloud/api/pccs/_suppressions.py @@ -2,7 +2,7 @@ # Suppressions -class SuppressionsPrismaCloudAPICodeSecurityMixin: +class SuppressionsPrismaCloudAPIPCCSMixin: """ Prisma Cloud Code Security API Suppressions Endpoints Class """ def suppressions_list_read(self): diff --git a/prismacloud/api/ccs/ccs.py b/prismacloud/api/pccs/pccs.py similarity index 99% rename from prismacloud/api/ccs/ccs.py rename to prismacloud/api/pccs/pccs.py index b5e45a4..3d8e305 100644 --- a/prismacloud/api/ccs/ccs.py +++ b/prismacloud/api/pccs/pccs.py @@ -5,7 +5,7 @@ import requests -class PrismaCloudAPICodeSecurityMixin(): +class PrismaCloudAPIPCCSMixin(): """ Requests and Output """ # pylint: disable=too-many-arguments,too-many-branches,too-many-locals,too-many-statements From 1cf244ebae70583b2915f47e484d757a27fd6565 Mon Sep 17 00:00:00 2001 From: tkishel Date: Fri, 10 Feb 2023 13:00:46 -0800 Subject: [PATCH 3/3] Version 5.2.0 --- 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 691a287..1405d7a 100644 --- a/prismacloud/api/version.py +++ b/prismacloud/api/version.py @@ -1,3 +1,3 @@ """ version file """ -version = '5.1.0' +version = '5.2.0'