pytan3.results.
Soap
(api_objects, response_body, request_body, method, url, status_code, origin=None, lvl='info')[source]¶Bases: pytan3.results.CommonMixin
, pytan3.results.Result
Deserialize SOAP API responses from Tanium API.
DATA_ROUTES
= ['GetResultInfo', 'GetResultData', 'GetMergedResultData']¶__call__
(raw=False, **kwargs)[source]¶Get data_api
or object_api
.
Parameters: |
|
---|
Notes
Will return object_api()
or data_api()
by
determining if command_request
is an object or data request.
Returns: | pytan3.api_models.ApiModel or object |
---|
error_map
¶Map of status codes to regex patterns and exceptions.
Notes
Keys should be int
of a status code to check patterns of.
Values should be list
of [pattern, exc], where pattern is a regex
pattern to search response body, and exc is exception to throw if pattern
match is found.
Raises: | |
---|---|
Returns: |
error_check
()[source]¶Check for errors in CommonMixin.response_body_str
.
Raises: |
---|
error_check_response
()[source]¶Check Soap.command_response
for errors.
Notes
For each key value pair in error_map
, if key matches
CommonMixin.status_code
or key is None, the patterns in value are
checked against response body, and if matched the patterns associated
exception is thrown.
error_check_code
()[source]¶Check if CommonMixin.status_code
is one of valid_codes
.
Raises: | exceptions.ResponseError |
---|
error_text
¶Get the error text from CommonMixin.response_body_str
.
Returns: | str |
---|
command_request
¶Get the “command” element from request_body_obj
.
Returns: | str |
---|
command_response
¶Get the “command” element from response_body_obj
.
Returns: | str |
---|
request_body_obj
¶Deserialize CommonMixin.request_body_str
into a python object.
Returns: | dict |
---|
request_object_obj
¶Get the request objects from request_body_obj
.
Returns: | dict |
---|
response_body_obj
¶Get CommonMixin.response_body_str
deserialized into a python object.
Returns: | dict |
---|
data_xml
¶Get the “ResultXML” element from response_body_obj
.
Returns: | str |
---|
data_api
(**kwargs)[source]¶Get data_obj
deserialized into an ApiModel object.
Parameters: | **kwargs –
|
---|---|
Returns: | pytan3.api_models.ApiModel |
object_obj
¶Get the response objects from response_body_obj
.
Returns: | dict |
---|
object_api
(**kwargs)[source]¶Get object_obj
deserialized into an ApiModel object.
Parameters: | **kwargs –
|
---|---|
Returns: | pytan3.api_models.ApiModel |
str_to_obj
(text, src, use_dict=True, try_int=True, flat_attrs=True, **kwargs)[source]¶Deserialize string into a python object.
Parameters: |
|
---|---|
Raises: |
|
Returns: |
_abc_impl
= <_abc_data object>¶