Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/remote_management/cpm/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/remote_management/cpm/cpm_serial_port_info.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlm
Z
dd
lmZmZmZddlmZmZddlmZmZmZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	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(tto_texttto_bytest	to_native(t	HTTPErrortURLError(topen_urltConnectionErrortSSLValidationErrorc
C`s$tdtdddt�dtdddt�dtdddtdt�dtdd	d
dg�dtdd
d
t�dtdd
d
t�dtdd
d
t��}tdtdd�}td|dt�}ttjtdjt	|j
d�t	|j
d��dd���}|j
dtkr2d}nd}|j
d}t|t�rpdj
d�|D��}nd|t	|j
d�|f}yNt|ddddd|j
dd|j
ddid d!6d"|d#6�}Wntk
r'}td$d%j|t	|��dt�}	|j|	�n�tk
rm}td$d&j|t	|��dt�}	|j|	�n�tk
r�}td$d'j|t	|��dt�}	|j|	�nGtk
r�}td$d(j|t	|��dt�}	|j|	�nXtj|j��|d<|j|�dS()Ntcpm_urlttypetstrtrequiredtcpm_usernametcpm_passwordtno_logtporttlisttdefaultt*t	use_httpstbooltvalidate_certst	use_proxytchangedtdatatt
argument_spectsupports_check_modes{0}:{1}terrorstsurrogate_or_strictshttps://shttp://t,cs`s|]}t|�VqdS(N(R(t.0tx((s^/usr/lib/python2.7/site-packages/ansible/modules/remote_management/cpm/cpm_serial_port_info.pys	<genexpr>�ss'%s%s/api/v2/config/serialports?ports=%stmethodtGETtheaderssapplication/jsonsContent-TypesBasic %st
Authorizationtmsgs&GET: Received HTTP error for {0} : {1}s$GET: Failed lookup url for {0} : {1}s;GET: Error validating the servers certificate for {0} : {1}s"GET: Error connecting to {0} : {1}(tdicttTruetFalseRR	tbase64t	b64encodeR
tformatRtparamst
isinstanceRtjoinRtNoneRt	fail_jsonR
RRtjsontloadstreadt	exit_json(
tmodule_argstresulttmoduletauthtprotocoltportstfullurltresponseteR9((s^/usr/lib/python2.7/site-packages/ansible/modules/remote_management/cpm/cpm_serial_port_info.pyt
run_module�sL	8	
 /''''cC`st�dS(N(RG(((s^/usr/lib/python2.7/site-packages/ansible/modules/remote_management/cpm/cpm_serial_port_info.pytmain�st__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR2R:tansible.module_utils.basicRtansible.module_utils._textR	R
Rt+ansible.module_utils.six.moves.urllib.errorRR
tansible.module_utils.urlsRRRRGRHt__name__(((s^/usr/lib/python2.7/site-packages/ansible/modules/remote_management/cpm/cpm_serial_port_info.pyt<module>s$

3*	7	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]