Source code for api.reputation.v1.calculated.calculated_domain

"""Autogenerated API"""
import requests
from argus_cli.plugin import register_command


[docs]@register_command(extending=('reputation','v1','calculated','domain')) def list_domain_reputation(fromDomain: str = None, afterDomain: str = None, sourceID: int = None, minimumValue: int = None, limit: int = 25, offset: int = 0,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """List up calculated domain reputation values (INTERNAL) :param str fromDomain: List observed domains after this domain, including (sorted by reverse domain) :param str afterDomain: List observed domains after this domain, excluding (sorted by reverse domain) :param int sourceID: Limit to domains observed in this source :param int minimumValue: Limit to domains which have a reputation score at lease this large :param int limit: Limit output :param int offset: Offset result :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {"offset": 383, "limit": 393, "responseCode": 200, "count": 894, "data": [{"override": false, "reason": "Believe explain table man strong offer.", "value": 796}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Culture yeah teach behind pick million.", "messageTemplate": "Traditional attention something money on high usually.", "field": "Expect fire provide training.", "parameter": {}, "timestamp": 521124238}], "currentPage": 432, "size": 821} """ from requests import get from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reputation/v1/calculated/domain".format() headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = {} if limit: body.update({"limit": limit}) if offset: body.update({"offset": offset}) if fromDomain: body.update({"fromDomain": fromDomain}) if afterDomain: body.update({"afterDomain": afterDomain}) if sourceID: body.update({"sourceID": sourceID}) if minimumValue: body.update({"minimumValue": minimumValue}) response = get(url, json=body if body else None, verify=verify, headers=headers) errors = [] if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=('reputation','v1','calculated','domain')) def find_domain_reputation(limit: int = None, offset: int = None, includeFlags: int = None, excludeFlags: int = None, subCriteria: list = None, minimumValue: int = None, sourceID: list = None, fromDomainName: str = None, afterDomainName: str = None, domainNames: list = None, includeDeleted: bool = 'False', exclude: bool = 'False', required: bool = 'False',json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Search for calculated domain reputation values (INTERNAL) :param int limit: Set this value to set max number of results. By default, no restriction on result set size. :param int offset: Set this value to skip the first (offset) objects. By default, return result from first object. :param int includeFlags: Only include objects which have includeFlags set. :param int excludeFlags: Exclude objects which have excludeFlags set. :param list subCriteria: :param int minimumValue: :param list sourceID: :param str fromDomainName: :param str afterDomainName: :param list domainNames: Full Qualified Domain Names :param bool includeDeleted: Set to true to include deleted objects. By default, exclude deleted objects. :param bool exclude: Only relevant for subcriteria. If set to true, objects matching this subcriteria object will be excluded. :param bool required: Only relevant for subcriteria. If set to true, objects matching this subcriteria are required (AND-ed together with parent criteria). :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {"offset": 196, "limit": 308, "responseCode": 200, "count": 679, "data": [{"override": false, "reason": "Model science as professor prepare daughter send bad.", "value": 938}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "What speak sound least test near knowledge.", "messageTemplate": "Help according cultural song.", "field": "Hold green yet standard.", "parameter": {}, "timestamp": 1495982312}], "currentPage": 183, "size": 812} """ from requests import post from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reputation/v1/calculated/domain/search".format() headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = {} if limit: body.update({"limit": limit}) if offset: body.update({"offset": offset}) if includeDeleted: body.update({"includeDeleted": includeDeleted}) if includeFlags: body.update({"includeFlags": includeFlags}) if excludeFlags: body.update({"excludeFlags": excludeFlags}) if subCriteria: body.update({"subCriteria": subCriteria}) if exclude: body.update({"exclude": exclude}) if required: body.update({"required": required}) if minimumValue: body.update({"minimumValue": minimumValue}) if sourceID: body.update({"sourceID": sourceID}) if fromDomainName: body.update({"fromDomainName": fromDomainName}) if afterDomainName: body.update({"afterDomainName": afterDomainName}) if domainNames: body.update({"domainNames": domainNames}) response = post(url, json=body if body else None, verify=verify, headers=headers) errors = [] if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=('reputation','v1','calculated','domain')) def calculate_reputation_for_domain(fqdn: str,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Look up the calculated reputation value for the given Domain (INTERNAL) :param str fqdn: Domain to look up :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {"offset": 437, "limit": 789, "responseCode": 200, "count": 433, "data": [{"override": true, "reason": "Institution college everybody month worry character debate commercial.", "value": 48}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Total movement whole land fear seven campaign.", "messageTemplate": "Ten I type billion.", "field": "Personal hour yard defense analysis.", "parameter": {}, "timestamp": 785964758}], "currentPage": 487, "size": 263} """ from requests import get from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reputation/v1/calculated/domain/{fqdn}".format(fqdn=fqdn) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = {} response = get(url, json=body if body else None, verify=verify, headers=headers) errors = [] if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=('reputation','v1','calculated','domain')) def list_address_reputation(fromAddress: str = None, afterAddress: str = None, sourceID: int = None, minimumValue: int = None, limit: int = 25, offset: int = 0,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """List up calculated IP reputation values (INTERNAL) :param str fromAddress: List observed domains after this domain, including (sorted by reverse domain) :param str afterAddress: List observed domains after this domain, excluding (sorted by reverse domain) :param int sourceID: Limit to domains observed in this source :param int minimumValue: Limit to domains which have a reputation score at lease this large :param int limit: Limit output :param int offset: Offset result :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {"offset": 621, "limit": 30, "responseCode": 200, "count": 175, "data": [{"override": false, "reason": "Lawyer share positive time law southern.", "value": 347}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Ever fear threat government place wait most.", "messageTemplate": "Drug entire spend reality travel line.", "field": "Almost kid chair Mrs lawyer while close.", "parameter": {}, "timestamp": 1300657304}], "currentPage": 903, "size": 692} """ from requests import get from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reputation/v1/calculated/ip".format() headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = {} if limit: body.update({"limit": limit}) if offset: body.update({"offset": offset}) if fromAddress: body.update({"fromAddress": fromAddress}) if afterAddress: body.update({"afterAddress": afterAddress}) if sourceID: body.update({"sourceID": sourceID}) if minimumValue: body.update({"minimumValue": minimumValue}) response = get(url, json=body if body else None, verify=verify, headers=headers) errors = [] if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=('reputation','v1','calculated','domain')) def find_address_reputation(limit: int = None, offset: int = None, includeFlags: int = None, excludeFlags: int = None, subCriteria: list = None, minimumValue: int = None, sourceID: list = None, fromAddress: str = None, afterAddress: str = None, addresses: list = None, includeDeleted: bool = 'False', exclude: bool = 'False', required: bool = 'False',json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Search for calculated IP reputation values (INTERNAL) :param int limit: Set this value to set max number of results. By default, no restriction on result set size. :param int offset: Set this value to skip the first (offset) objects. By default, return result from first object. :param int includeFlags: Only include objects which have includeFlags set. :param int excludeFlags: Exclude objects which have excludeFlags set. :param list subCriteria: :param int minimumValue: :param list sourceID: :param str fromAddress: :param str afterAddress: :param list addresses: List of IP addresses :param bool includeDeleted: Set to true to include deleted objects. By default, exclude deleted objects. :param bool exclude: Only relevant for subcriteria. If set to true, objects matching this subcriteria object will be excluded. :param bool required: Only relevant for subcriteria. If set to true, objects matching this subcriteria are required (AND-ed together with parent criteria). :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {"offset": 206, "limit": 919, "responseCode": 200, "count": 979, "data": [{"override": true, "reason": "Audience none actually through similar he improve office.", "value": 793}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Member fast nearly modern dark site.", "messageTemplate": "Analysis policy month rest reason deep.", "field": "Raise service foot.", "parameter": {}, "timestamp": 814841100}], "currentPage": 245, "size": 682} """ from requests import post from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reputation/v1/calculated/ip/search".format() headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = {} if limit: body.update({"limit": limit}) if offset: body.update({"offset": offset}) if includeDeleted: body.update({"includeDeleted": includeDeleted}) if includeFlags: body.update({"includeFlags": includeFlags}) if excludeFlags: body.update({"excludeFlags": excludeFlags}) if subCriteria: body.update({"subCriteria": subCriteria}) if exclude: body.update({"exclude": exclude}) if required: body.update({"required": required}) if minimumValue: body.update({"minimumValue": minimumValue}) if sourceID: body.update({"sourceID": sourceID}) if fromAddress: body.update({"fromAddress": fromAddress}) if afterAddress: body.update({"afterAddress": afterAddress}) if addresses: body.update({"addresses": addresses}) response = post(url, json=body if body else None, verify=verify, headers=headers) errors = [] if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response
[docs]@register_command(extending=('reputation','v1','calculated','domain')) def calculate_reputation_for_i_p(ip: str,json: bool = True, verify: bool = True, apiKey: str = "", authentication: dict = {}) -> dict: """Look up the calculated reputation value for the given IP (INTERNAL) :param str ip: IP address to look up :raises AuthenticationFailedException: on 401 :raises ValidationErrorException: on 412 :raises AccessDeniedException: on 403 :returns: {"offset": 436, "limit": 280, "responseCode": 200, "count": 829, "data": [{"override": true, "reason": "Bit dog door choose no force central church.", "value": 533}], "metaData": {"additionalProperties": {}}, "messages": [{"message": "Detail TV final to easy education talk party.", "messageTemplate": "Culture action sport official like structure him.", "field": "Conference deep tree painting during appear authority mission.", "parameter": {}, "timestamp": 1366085168}], "currentPage": 795, "size": 44} """ from requests import get from argus_api.exceptions import http url = "https://osl-argus-trunk-web1.mnemonic.no/web/api/reputation/v1/calculated/ip/{ip}".format(ip=ip) headers = { 'Content-Type': 'application/json', 'User-Agent': 'ArgusToolbelt/1.0' } if apiKey: headers["Argus-API-Key"] = apiKey elif authentication and isinstance(authentication, dict): headers.update(authentication) elif callable(authentication): headers.update(authentication(url)) body = {} response = get(url, json=body if body else None, verify=verify, headers=headers) errors = [] if response.status_code == 401: raise http.AuthenticationFailedException(response) elif response.status_code == 403: raise http.AccessDeniedException(response) elif response.status_code == 412: raise http.ValidationErrorException(response) elif response.status_code == 404: raise http.ObjectNotFoundException(response) return response.json() if json else response