Skip to content
This repository was archived by the owner on Jan 12, 2021. It is now read-only.

Latest commit

 

History

History
163 lines (113 loc) · 6.86 KB

File metadata and controls

163 lines (113 loc) · 6.86 KB

esp_sdk.StatsApi

All URIs are relative to https://api.evident.io

Method HTTP request Description
for_report GET /api/v2/reports/{report_id}/stats.json_api Stats for a report
latest_for_teams PUT /api/v2/stats/latest_for_teams.json_api Statistics for teams
show GET /api/v2/stats/{id}.json_api Show a single Stat

for_report

Stat for_report(report_id, include=include)

Stats for a report

A successful call to this API returns all the stats of all the alerts for a report identified by the report_id parameter. Said report contains all statistics for this alert triggered from signatures contained in all regions for the selected hour.

Example

from __future__ import print_statement
import time
import esp_sdk
from esp_sdk.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = esp_sdk.StatsApi()
report_id = 56 # int | The ID of the report to retrieve stats for
include = 'include_example' # str | Related objects that can be included in the response:  report, regions, services, signatures, custom_signatures, custom_compliance_controls, compliance_controls See Including Objects for more information. (optional)

try: 
    # Stats for a report
    api_response = api_instance.for_report(report_id, include=include)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling StatsApi->for_report: %s\n" % e)

Parameters

Name Type Description Notes
report_id int The ID of the report to retrieve stats for
include str Related objects that can be included in the response: report, regions, services, signatures, custom_signatures, custom_compliance_controls, compliance_controls See Including Objects for more information. [optional]

Return type

Stat

Authorization

See https://github.com/EvidentSecurity/esp-sdk-python#set-your-hmac-security-keys

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

latest_for_teams

PaginatedCollection latest_for_teams(include=include, filter=filter, page=page)

Statistics for teams

A successful call to this API returns all the statistics for the most recent report of each team accessible by the given API key

Example

from __future__ import print_statement
import time
import esp_sdk
from esp_sdk.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = esp_sdk.StatsApi()
include = 'include_example' # str | Related objects that can be included in the response:  report, regions, services, signatures, custom_signatures, custom_compliance_controls, compliance_controls See Including Objects for more information. (optional)
filter = {'key': 'filter_example'} # dict(str, str) | Filter Params for Searching.      Searchable Association: [report] See Searching Lists for more information. See the filter parameter of the association's list action to see what attributes are searchable on each association. See Conditions on Relationships in Searching Lists for more information. (optional)
page = '{:number=>1,+:size=>20}' # str | Page Number and Page Size.  Number is the page number of the collection to return, size is the number of items to return per page. (optional) (default to {:number=>1,+:size=>20})

try: 
    # Statistics for teams
    api_response = api_instance.latest_for_teams(include=include, filter=filter, page=page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling StatsApi->latest_for_teams: %s\n" % e)

Parameters

Name Type Description Notes
include str Related objects that can be included in the response: report, regions, services, signatures, custom_signatures, custom_compliance_controls, compliance_controls See Including Objects for more information. [optional]
filter dict(str, str) Filter Params for Searching. Searchable Association: [report] See Searching Lists for more information. See the filter parameter of the association's list action to see what attributes are searchable on each association. See Conditions on Relationships in Searching Lists for more information. [optional]
page str Page Number and Page Size. Number is the page number of the collection to return, size is the number of items to return per page. [optional] [default to {:number=>1,+:size=>20}]

Return type

PaginatedCollection

Authorization

See https://github.com/EvidentSecurity/esp-sdk-python#set-your-hmac-security-keys

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

show

Stat show(id, include=include)

Show a single Stat

Example

from __future__ import print_statement
import time
import esp_sdk
from esp_sdk.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = esp_sdk.StatsApi()
id = 56 # int | Stat ID
include = 'include_example' # str | Related objects that can be included in the response:  report, regions, services, signatures, custom_signatures, custom_compliance_controls, compliance_controls See Including Objects for more information. (optional)

try: 
    # Show a single Stat
    api_response = api_instance.show(id, include=include)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling StatsApi->show: %s\n" % e)

Parameters

Name Type Description Notes
id int Stat ID
include str Related objects that can be included in the response: report, regions, services, signatures, custom_signatures, custom_compliance_controls, compliance_controls See Including Objects for more information. [optional]

Return type

Stat

Authorization

See https://github.com/EvidentSecurity/esp-sdk-python#set-your-hmac-security-keys

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]