summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhebingning <[email protected]>2024-06-03 11:52:37 +0800
committerhebingning <[email protected]>2024-06-03 11:52:37 +0800
commiteec210812d8877c707fe1eb2341747bd4f5d229a (patch)
tree3731bbb05e66e46d9cd177bed0de94017d5b0dcc
parent275897527164cb6fd6d318f34cbf005961f69b2b (diff)
24.06必填参数statistics_option增加
-rw-r--r--createObject.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/createObject.py b/createObject.py
index 6e5f048..9d06535 100644
--- a/createObject.py
+++ b/createObject.py
@@ -99,6 +99,7 @@ class CreateObject():
is_negate = 0
obj_template_dict['object']['type'] = obj_type
obj_template_dict['object']['sub_type'] = obj_sub_type
+ obj_template_dict['object']['statistics_option'] = 'none'
obj_template_dict['vsys_id'] = vsys_id
for obj in obj_list:
add_item_list = obj['addItemList']
@@ -241,8 +242,8 @@ class CreateObject():
def import_object(self, obj_type, vsys_id, add_item_list, api_host, token, is_repeat):
headers = {"Authorization": token}
- data = {'type': obj_type, 'vsys_id': vsys_id}
- dry_data = {'type': obj_type, 'vsys_id': vsys_id, 'is_dry_run':1}
+ data = {'type': obj_type, 'vsys_id': vsys_id, 'statistics_option': 'none'}
+ dry_data = {'type': obj_type, 'vsys_id': vsys_id, 'is_dry_run':1, 'statistics_option': 'none'}
for item in add_item_list:
object_file = item['keywordArray'][0]
file_name = object_file.split("/")[-1]
@@ -355,11 +356,10 @@ class CreateObject():
temp_geo_name_id_list = []
if obj_type == 'geolocation':
object_id = response_dict['data']['object']['member']['geolocation']['country_object_id']
- else:
- object_id = response_dict['data']['object']['id']
- if obj_type == 'geolocation':
geoname_id = response_dict['data']['object']['member']['geolocation']['geoname_id']
temp_geo_name_id_list.append(geoname_id)
+ else:
+ object_id = response_dict['data']['object']['id']
temp_list.append(object_id)
return temp_list,temp_geo_name_id_list