�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
d d
l m Z d d l Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust networkt supported_bys
---
module: checkpoint_host_facts
short_description: Get host objects facts on Check Point over Web Services API
description:
- Get host objects facts on Check Point devices.
All operations are performed over Web Services API.
version_added: "2.8"
author: "Ansible by Red Hat (@rcarrillocruz)"
options:
name:
description:
- Name of the host object. If name is not provided, UID is required.
type: str
uid:
description:
- UID of the host object. If UID is not provided, name is required.
type: str
sK
- name: Get host object facts
checkpoint_host_facts:
name: attacker
sb
ansible_hosts:
description: The checkpoint host object facts.
returned: always.
type: list
( t
AnsibleModule( t
Connection( t HTTPErrorNc C` sh | j d } | j d } | r0 i | d 6} n | rF i | d 6} n | j d | � \ } } | | f S( Nt namet uids /web_api/show-host( t paramst send_request( t modulet
connectionR R t payloadt codet result( ( s] /usr/lib/python2.7/site-packages/ansible/modules/network/check_point/checkpoint_host_facts.pyt get_hostE s
c C` s� t d t d d � d t d d � � } d g } t d | d | � } t | j � } t | | � \ } } | d k r� | j d t d | � � n | j d
d j | | � � d S(
NR t typet strR t
argument_spect required_one_ofi� t
ansible_factst checkpoint_hostst msgs5 Checkpoint device returned error {0} with message {1}( R R ( t dictR R t _socket_pathR t exit_jsont fail_jsont format( R R R R R t response( ( s] /usr/lib/python2.7/site-packages/ansible/modules/network/check_point/checkpoint_host_facts.pyt mainS s t __main__( t
__future__R R R R t
__metaclass__t ANSIBLE_METADATAt
DOCUMENTATIONt EXAMPLESt RETURNt ansible.module_utils.basicR t ansible.module_utils.connectionR t+ ansible.module_utils.six.moves.urllib.errorR
t jsonR R"