forked from PaloAltoNetworks/prismacloud-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request PaloAltoNetworks#71 from tkishel/stats
stats
- Loading branch information
Showing
2 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
""" Prisma Cloud Compute API Stats Endpoints Class """ | ||
|
||
class StatsPrismaCloudAPIComputeMixin: | ||
""" Prisma Cloud Compute API Stats Endpoints Class """ | ||
|
||
def stats_app_firewall_count_read(self): | ||
# Returns the number of app firewalls in use. | ||
return self.execute_compute('GET', 'api/v1/stats/app-firewall/count') | ||
|
||
def stats_compliance_read(self, query_params=None): | ||
# Maps to the table in Monitor > Compliance > Compliance Explorer | ||
return self.execute_compute('GET', 'api/v1/stats/compliance?', query_params=query_params) | ||
|
||
def stats_compliance_download(self, query_params=None): | ||
return self.execute_compute('GET', 'api/v1/stats/compliance/download?', query_params=query_params) | ||
|
||
def stats_compliance_refresh(self, query_params=None): | ||
# Refreshes the current day's list and counts of compliance issues, as well as the list of affected running resources. | ||
# This endpoint returns the same response as /api/v1/stats/compliance, but with updated data for the current day. | ||
return self.execute_compute('GET', 'api/v1/stats/compliance/refresh?', query_params=query_params) | ||
|
||
def stats_daily_read(self): | ||
# Returns a historical list of per-day statistics for the resources protected by Prisma Cloud Compute, | ||
# including the total number of runtime audits, image vulnerabilities, and compliance violations. | ||
return self.execute_compute('GET', 'api/v1/stats/daily', paginated=True) | ||
|
||
def stats_trends_read(self): | ||
# Returns statistics about the resources protected by Prisma Cloud Compute, | ||
# including the total number of runtime audits, image vulnerabilities, and compliance violations. | ||
return self.execute_compute('GET', 'api/v1/stats/dashboard') | ||
|
||
def stats_events_read(self, query_params=None): | ||
# Returns events statistics for your environment. | ||
return self.execute_compute('GET', 'api/v1/stats/events?', query_params=query_params) | ||
|
||
def stats_license_read(self): | ||
return self.execute_compute('GET', 'api/v1/stats/license') | ||
|
||
def stats_vulnerabilities_read(self, query_params=None): | ||
# Returns a list of vulnerabilities (CVEs) in the deployed images, registry images, hosts, and serverless functions affecting your environment. | ||
return self.execute_compute('GET', 'api/v1/stats/vulnerabilities?', query_params=query_params, paginated=True) | ||
|
||
def stats_vulnerabilities_download(self, query_params=None): | ||
return self.execute_compute('GET', 'api/v1/stats/vulnerabilities/download?', query_params=query_params) | ||
|
||
def stats_vulnerabilities_impacted_resoures_read(self, query_params=None): | ||
# Generates a list of impacted resources for a specific vulnerability. This endpoint returns a list of all deployed images, registry images, hosts, and serverless functions affected by a given CVE. | ||
return self.execute_compute('GET', 'api/v1/stats/vulnerabilities/impacted-resources?', query_params=query_params) | ||
|
||
def stats_vulnerabilities_impacted_resoures_download(self, query_params=None): | ||
return self.execute_compute('GET', 'api/v1/stats/vulnerabilities/impacted-resources/download?', query_params=query_params) | ||
|
||
def stats_vulnerabilities_refresh(self, query_params=None): | ||
# Refreshes the current day's CVE counts and CVE list, as well as their descriptions. | ||
# This endpoint returns the same response as /api/v1/stats/vulnerabilities, but with updated data for the current day. | ||
return self.execute_compute('GET', 'api/v1/stats/vulnerabilities/refresh?', query_params=query_params, paginated=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
""" version file """ | ||
|
||
version = '4.0.8' | ||
version = '4.0.9' |