�
�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
Z
d d l Z d d l m
Z
d d
l m Z m Z m Z d d l m Z m Z d d l m Z m Z m 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 communityt supported_bys
---
module: cpm_serial_port_info
version_added: "2.9"
author: "Western Telematic Inc. (@wtinetworkgear)"
short_description: Get Serial port parameters in WTI OOB and PDU devices
description:
- "Get Serial port parameters from WTI OOB and PDU devices"
options:
cpm_url:
description:
- This is the URL of the WTI device to send the module.
required: true
cpm_username:
description:
- This is the Username of the WTI device to send the module.
required: true
cpm_password:
description:
- This is the Password of the WTI device to send the module.
required: true
use_https:
description:
- Designates to use an https connection or http connection.
required: false
type: bool
default: true
validate_certs:
description:
- If false, SSL certificates will not be validated. This should only be used
- on personally controlled sites using self-signed certificates.
required: false
type: bool
default: true
use_proxy:
description: Flag to control if the lookup will observe HTTP proxy environment variables when present.
required: false
type: bool
default: false
port:
description:
- This is the serial port number that is getting retrieved. It can include a single port
number, multiple port numbers separated by commas, a list of port numbers, or an '*' character for all ports.
required: true
type: list
default: ['*']
notes:
- Use C(groups/cpm) in C(module_defaults) to set common options used between CPM modules.)
s�
- name: Get the Serial Port Parameters for port 2 of a WTI device
cpm_serial_port_info:
cpm_url: "nonexist.wti.com"
cpm_username: "super"
cpm_password: "super"
use_https: true
validate_certs: false
port: 2
- name: Get the Serial Port Parameters for ports 2 and 4 of a WTI device
cpm_serial_port_info:
cpm_url: "nonexist.wti.com"
cpm_username: "super"
cpm_password: "super"
use_https: true
validate_certs: false
port: 2,4
- name: Get the Serial Port Parameters for all ports of a WTI device
cpm_serial_port_info:
cpm_url: "nonexist.wti.com"
cpm_username: "super"
cpm_password: "super"
use_https: true
validate_certs: false
port: "*"
s-
data:
description: The output JSON returned from the commands sent
returned: always
type: complex
contains:
serialports:
description: List of data for each serial port
returned: success
type: list
sample:
- baud: 4
break: 1
cmd: 1
connstatus: Free
echo: 1
handshake: 2
logoff: '^X'
mode: 1
parity: 3
port: 2
portname: switch
seq: 2
stopbits: 1
tout: 0
- baud: 3
break: 1
cmd: 1
connstatus: Free
echo: 1
handshake: 2
logoff: '^X'
mode: 1
parity: 1
port: 4
portname: router
seq: 2
stopbits: 1
tout: 1
N( t
AnsibleModule( t to_textt to_bytest to_native( t HTTPErrort URLError( t open_urlt ConnectionErrort SSLValidationErrorc
C` s$ t d t d d d t � d t d d d t � d t d d d t d t � d t d d d
d g � d t d d
d
t � d t d d
d
t � d t d d
d
t � � } t d t d d � } t d | d t � } t t j t d j t | j
d � t | j
d � � d d �� � } | j
d t k r2d } n d } | j
d } t | t � rpd j
d � | D� � } n d | t | j
d � | f } yN t | d d d d d | j
d d | j
d d i d d! 6d"