Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
mscheiber
New Contributor

FMG API import Policy

HI

 

anyone already successfully imported a Policy to FMG?

 

i successfully imported the device but i am not able to import the policy from the device into fmg.

 

This is my data iam using.

 

data2 = {
"add_mappings": "enabled",
"adom": "DEV",
"dst_name": "FGT1",
"if_all_objs": "none",
"if_all_policy": "enabled",
"import_action": "obj_search",
"name": "FGT1",
"vdom": "root"
}


addpolicy2=fmg_instance.execute('/securityconsole/import/dev/objs', **data2)

data1 = {
"add_mappings": "enabled",
"adom": "DEV",
"dst_name": "FGT1",
"if_all_objs": "none",
"if_all_policy": "enabled",
"import_action": "policy_search",
"name": "FGT1",
"vdom": "root"


}

addpolicy1=fmg_instance.execute('/securityconsole/import/dev/objs', **data1)

data3 = {
"adom": "DEV",
"dst_name": "FGT1",
"if_all_policy": "enabled",
"import_action": "do",
"if_all_objs": "filter",
"position": "bottom",
"name": "FGT1",
"vdom": "root"
}

addpolicy3=fmg_instance.execute('/securityconsole/import/dev/objs', **data3)

I really like to use this feature.

 

That is a debug ouput directly from the FMG

 

2020-01-23 16:55:59 { "client": "\/usr\/local\/apache2\/bin\/httpd:7032", "id": 3, "method": "exec", "params": [{ "data": { "add_mappings": "enabled", "adom": "DEV", "dst_name": "FGT1", "if_all_objs": "none", "if_all_policy": "enabled", "import_action": "policy_search", "name": "FGT1", "vdom": "root"}, "url": "\/securityconsole\/import\/dev\/objs"}], "session": "B+FtKmwQwMqE5cLXGcnyRuO+f512PCg5KxiT1dOLo76QQrJDX0HkhKPTTpc\/x7LYXYzhLwWs5IBbs1a2g4\/HY062lEWoXFt8", "src": "XXX"} 2020-01-23 16:55:59 Request: 2020-01-23 16:55:59 { "client": "\/usr\/local\/apache2\/bin\/httpd:7032", "id": 4, "method": "exec", "params": [{ "data": { "add_mappings": "enabled", "adom": "DEV", "dst_name": "FGT1", "if_all_objs": "none", "if_all_policy": "enabled", "import_action": "obj_search", "name": "FGT1", "vdom": "root"}, "url": "\/securityconsole\/import\/dev\/objs"}], "session": "B+FtKmwQwMqE5cLXGcnyRuO+f512PCg5KxiT1dOLo76QQrJDX0HkhKPTTpc\/x7LYXYzhLwWs5IBbs1a2g4\/HY062lEWoXFt8", "src": "XXX"} 2020-01-23 16:55:59 Request: 2020-01-23 16:55:59 { "client": "\/usr\/local\/apache2\/bin\/httpd:7032", "id": 5, "method": "exec", "params": [{ "data": { "adom": "DEV", "dst_name": "FGT1", "if_all_objs": "filter", "if_all_policy": "enabled", "import_action": "do", "name": "FGT1", "vdom": "root"}, "url": "\/securityconsole\/import\/dev\/objs"}], "session": "B+FtKmwQwMqE5cLXGcnyRuO+f512PCg5KxiT1dOLo76QQrJDX0HkhKPTTpc\/x7LYXYzhLwWs5IBbs1a2g4\/HY062lEWoXFt8", "src": "XXXX"} 2020-01-23 16:55:59 Request:

FMG is 6.0.8.

FOS 6.0.6

 

Somehow in the eventviewer import from the objects seems to fail for no reason.

 

regards

Manu

0 REPLIES 0
Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors