dxlmarclient.constants module¶
-
class
dxlmarclient.constants.ConditionConstants¶ Bases:
objectConstants that are used to describe a condition.
The following statement:
conditions={ "or": [{ "and": [{ "name": "HostInfo", "output": "ip_address", "op": "EQUALS", "value": "192.168.1.1" }] }] }
Can be rewritten to use
ConditionConstantsas follows:conditions={ ConditionConstants.OR: [{ ConditionConstants.AND: [{ ConditionConstants.COND_NAME: "HostInfo", ConditionConstants.COND_OUTPUT: "ip_address", ConditionConstants.COND_OP: "EQUALS", ConditionConstants.COND_VALUE: "192.168.1.1" }] }] }
-
AND= 'and'¶
-
COND_NAME= 'name'¶
-
COND_OP= 'op'¶
-
COND_OUTPUT= 'output'¶
-
COND_VALUE= 'value'¶
-
OR= 'or'¶
-
-
class
dxlmarclient.constants.OperatorConstants¶ Bases:
objectConstants that describe the operator to use within a condition.
The following statement:
conditions={ "or": [{ "and": [{ "name": "HostInfo", "output": "ip_address", "op": "EQUALS", "value": "192.168.1.1" }] }] }
Can be rewritten to use
OperatorConstantsas follows:conditions={ "or": [{ "and": [{ "name": "HostInfo", "output": "ip_address", "op": OperatorConstants.EQUALS, "value": "192.168.1.1" }] }] }
-
AFTER= 'AFTER'¶
-
BEFORE= 'BEFORE'¶
-
CONTAINS= 'CONTAINS'¶
-
ENDS_WITH= 'ENDS_WITH'¶
-
EQUALS= 'EQUALS'¶
-
GREATER_EQUAL_THAN= 'GREATER_EQUAL_THAN'¶
-
GREATER_THAN= 'GREATER_THAN'¶
-
LESS_EQUAL_THAN= 'LESS_EQUAL_THAN'¶
-
LESS_THAN= 'LESS_THAN'¶
-
STARTS_WITH= 'STARTS_WITH'¶
-
-
class
dxlmarclient.constants.ProjectionConstants¶ Bases:
objectConstants that are used to describe a projection.
The following statement:
projections=[{ "name": "HostInfo", "outputs": ["ip_address"] }]
Can be rewritten to use
ProjectionConstantsas follows:projections=[{ ProjectionConstants.NAME: "HostInfo", ProjectionConstants.OUTPUTS: ["ip_address"] }]
-
NAME= 'name'¶
-
OUTPUTS= 'outputs'¶
-
-
class
dxlmarclient.constants.ResultConstants¶ Bases:
objectConstants that are used access the information contained in the results of a search.
The following statement:
search_result = result_context.get_results(limit=10) print "Total items: " + str(search_result["totalItems"]) for item in search_result["items"]: print " " + item["output"]['HostInfo|ip_address']
Can be rewritten to use
ResultConstantsas follows:search_result = result_context.get_results(limit=10) print "Total items: " + str(search_result[ResultConstants.TOTAL_ITEMS]) for item in search_result[ResultConstants.ITEMS]: print " " + item[ResultConstants.ITEM_OUTPUT]['HostInfo|ip_address']
-
CURRENT_ITEM_COUNT= 'currentItemCount'¶
-
ITEMS= 'items'¶
-
ITEMS_PER_PAGE= 'itemsPerPage'¶
-
ITEM_COUNT= 'count'¶
-
ITEM_CREATED_AT= 'created_at'¶
-
ITEM_ID= 'id'¶
-
ITEM_OUTPUT= 'output'¶
-
START_INDEX= 'startIndex'¶
-
TOTAL_ITEMS= 'totalItems'¶
-
-
class
dxlmarclient.constants.SortConstants¶ Bases:
objectConstants that describe the direction the search results should be sorted (ascending vs. descending)
The following statement:
results = results_context.get_results(sort_by="Processes|name", sort_direction="asc")
Can be rewritten to use
SortConstantsas follows:results = results_context.get_results(sort_by="Processes|name", sort_direction=SortConstants.ASC)
-
ASC= 'asc'¶
-
DESC= 'desc'¶
-