pyfgt_policy_getΒΆ
Import the Task you like:
from nornir_pyfgt.plugins.tasks import pyfgt_policy_get
Use in a script:
from nornir_pyfgt.plugins.tasks import pyfgt_policy_get from nornir_utils.plugins.functions import print_result from nornir import InitNornir nr = InitNornir(config_file="your/config") results = nr.run(task=pyfgt_policy_get, filter="name==test") print_result(results)
Output:
[ { 'action': 'accept',
'anti-replay': 'enable',
'application-list': '',
'auth-cert': '',
'auth-path': 'disable',
'auth-redirect-addr': '',
'auto-asic-offload': 'enable',
'av-profile': '',
'block-notification': 'disable',
'captive-portal-exempt': 'disable',
'capture-packet': 'disable',
'cifs-profile': '',
'comments': '',
'custom-log-fields': [],
'decrypted-traffic-mirror': '',
'delay-tcp-npu-session': 'disable',
'diffserv-copy': 'disable',
'diffserv-forward': 'disable',
'diffserv-reverse': 'disable',
'diffservcode-forward': '000000',
'diffservcode-rev': '000000',
'disclaimer': 'disable',
'dlp-profile': '',
'dnsfilter-profile': '',
'dsri': 'disable',
'dstaddr': [{'name': 'all', 'q_origin_key': 'all'}],
'dstaddr-negate': 'disable',
'dstaddr6': [],
'dstaddr6-negate': 'disable',
'dstintf': [{'name': 'port2', 'q_origin_key': 'port2'}],
'dynamic-shaping': 'disable',
'email-collect': 'disable',
'emailfilter-profile': '',
'fec': 'disable',
'file-filter-profile': '',
'firewall-session-dirty': 'check-all',
'fixedport': 'disable',
'fsso-agent-for-ntlm': '',
'fsso-groups': [],
'geoip-anycast': 'disable',
'geoip-match': 'physical-location',
'global-label': '',
'groups': [],
'http-policy-redirect': 'disable',
'icap-profile': '',
'identity-based-route': '',
'inbound': 'disable',
'inspection-mode': 'flow',
'internet-service': 'disable',
'internet-service-custom': [],
'internet-service-custom-group': [],
'internet-service-group': [],
'internet-service-name': [],
'internet-service-negate': 'disable',
'internet-service-src': 'disable',
'internet-service-src-custom': [],
'internet-service-src-custom-group': [],
'internet-service-src-group': [],
'internet-service-src-name': [],
'internet-service-src-negate': 'disable',
'internet-service6': 'disable',
'internet-service6-custom': [],
'internet-service6-custom-group': [],
'internet-service6-group': [],
'internet-service6-name': [],
'internet-service6-negate': 'disable',
'internet-service6-src': 'disable',
'internet-service6-src-custom': [],
'internet-service6-src-custom-group': [],
'internet-service6-src-group': [],
'internet-service6-src-name': [],
'internet-service6-src-negate': 'disable',
'ippool': 'disable',
'ips-sensor': '',
'label': '',
'logtraffic': 'utm',
'logtraffic-start': 'disable',
'match-vip': 'enable',
'match-vip-only': 'disable',
'name': 'test',
'nat': 'enable',
'nat46': 'disable',
'nat64': 'disable',
'natinbound': 'disable',
'natip': '0.0.0.0 0.0.0.0',
'natoutbound': 'disable',
'network-service-dynamic': [],
'network-service-src-dynamic': [],
'ntlm': 'disable',
'ntlm-enabled-browsers': [],
'ntlm-guest': 'disable',
'outbound': 'enable',
'passive-wan-health-measurement': 'disable',
'per-ip-shaper': '',
'permit-any-host': 'disable',
'permit-stun-host': 'disable',
'policy-expiry': 'disable',
'policy-expiry-date-utc': '',
'policyid': 1,
'poolname': [],
'poolname6': [],
'profile-group': '',
'profile-protocol-options': 'default',
'profile-type': 'single',
'q_origin_key': 1,
'radius-mac-auth-bypass': 'disable',
'redirect-url': '',
'replacemsg-override-group': '',
'reputation-direction': 'destination',
'reputation-direction6': 'destination',
'reputation-minimum': 0,
'reputation-minimum6': 0,
'rtp-addr': [],
'rtp-nat': 'disable',
'schedule': 'always',
'schedule-timeout': 'disable',
'sctp-filter-profile': '',
'send-deny-packet': 'disable',
'service': [{'name': 'ALL', 'q_origin_key': 'ALL'}],
'service-negate': 'disable',
'session-ttl': '0',
'sgt': [],
'sgt-check': 'disable',
'src-vendor-mac': [],
'srcaddr': [{'name': 'all', 'q_origin_key': 'all'}],
'srcaddr-negate': 'disable',
'srcaddr6': [],
'srcaddr6-negate': 'disable',
'srcintf': [{'name': 'port1', 'q_origin_key': 'port1'}],
'ssh-filter-profile': '',
'ssh-policy-redirect': 'disable',
'ssl-ssh-profile': 'no-inspection',
'status': 'enable',
'tcp-mss-receiver': 0,
'tcp-mss-sender': 0,
'tcp-session-without-syn': 'disable',
'timeout-send-rst': 'disable',
'tos': '0x00',
'tos-mask': '0x00',
'tos-negate': 'disable',
'traffic-shaper': '',
'traffic-shaper-reverse': '',
'users': [],
'utm-status': 'disable',
'uuid': 'aa5c82f4-a713-51ed-3431-4787e93055ba',
'uuid-idx': 15749,
'videofilter-profile': '',
'vlan-cos-fwd': 255,
'vlan-cos-rev': 255,
'vlan-filter': '',
'voip-profile': '',
'vpntunnel': '',
'waf-profile': '',
'wanopt': 'disable',
'wanopt-detection': 'active',
'wanopt-passive-opt': 'default',
'wanopt-peer': '',
'wanopt-profile': '',
'wccp': 'disable',
'webcache': 'disable',
'webcache-https': 'disable',
'webfilter-profile': '',
'webproxy-forward-server': '',
'webproxy-profile': '',
'ztna-device-ownership': 'disable',
'ztna-ems-tag': [],
'ztna-geo-tag': [],
'ztna-policy-redirect': 'disable',
'ztna-status': 'disable',
'ztna-tags-match-logic': 'or'}]