??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó
à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 m 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 d l m Z e ƒ Z d e f d „ ƒ YZ d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bysÇ
lookup: cpm_metering
author: "Western Telematic Inc. (@wtinetworkgear)"
version_added: "2.7"
short_description: Get Power and Current data from WTI OOB/Combo and PDU devices
description:
- "Get Power and Current data from WTI OOB/Combo and PDU devices"
options:
_terms:
description:
- This is the Action to send the module.
required: true
choices: [ "getpower", "getcurrent" ]
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.
cpm_password:
description:
- This is the Password of the WTI device to send the module.
use_https:
description:
- Designates to use an https connection or http connection.
required: false
default: True
choices: [ True, False ]
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.
type: boolean
default: True
startdate:
description:
- Start date of the range to look for power data
required: false
enddate:
description:
- End date of the range to look for power data
required: false
s„
# Get Power data
- name: Get Power data for a given WTI device
- debug:
var: lookup('cpm_metering',
'getpower',
validate_certs=true,
use_https=true,
cpm_url='rest.wti.com',
cpm_username='restpower',
cpm_password='restfulpowerpass12')
# Get Current data
- name: Get Current data for a given WTI device
- debug:
var: lookup('cpm_metering',
'getcurrent',
validate_certs=true,
use_https=true,
cpm_url='rest.wti.com',
cpm_username='restpower',
cpm_password='restfulpowerpass12')
# Get Power data for a date range
- name: Get Power data for a given WTI device given a certain date range
- debug:
var: lookup('cpm_metering',
'getpower',
validate_certs=true,
use_https=true,
cpm_url='rest.wti.com',
cpm_username='restpower',
cpm_password='restfulpowerpass12',
startdate='08-12-2018'
enddate='08-14-2018')
sn
_list:
description: The output JSON returned from the commands sent
returned: always
type: str
N( t AnsibleError( t
LookupBase( t to_textt to_bytest to_native( t HTTPErrort URLError( t open_urlt ConnectionErrort SSLValidationError( t Displayt LookupModulec B` s e Z d d „ Z RS( c
K` sÉ | j d | ƒ g } x¬| D]¤} t t j t d j | j d ƒ | j d ƒ ƒ d d ƒƒ ƒ } d } | j d ƒ d k rò t | j d ƒ ƒ d k rò | j d
ƒ d k rò t | j d
ƒ ƒ d k rò d | j d ƒ d | j d
ƒ } qò n | j d
ƒ t k rd } n d } | d k r>d | | j d ƒ f } n8 | d k rfd | | j d ƒ f } n t
d | ƒ ‚ t | ƒ d k r•| | 7} n t j d | ƒ yF t
| d | j d ƒ d | j d ƒ d i d d 6d | d 6ƒ}
Wn¹ t k
r} t
d | t | ƒ f ƒ ‚ n‹ t k
rK} t
d | t | ƒ f ƒ ‚ n] t k
ry} t
d | t | ƒ f ƒ ‚ n/ t k
r§} t
d! | t | ƒ f ƒ ‚ n X| j t |
j ƒ ƒ ƒ q W| S(" Nt directs {0}:{1}t cpm_usernamet cpm_passwordt errorst surrogate_or_strictt t startdatei t enddates ?startdate=s &enddate=t use_httpss https://s http://t getpowers %s%s/api/v2/config/powert cpm_urlt
getcurrents %s%s/api/v2/config/currents Power command not recognized %s s cpm_metering connecting to %st validate_certst use_proxyt headerss application/jsons Content-Types Basic %st
Authorizations Received HTTP error for %s : %ss Failed lookup url for %s : %ss4 Error validating the server's certificate for %s: %ss Error connecting to %s: %s( t set_optionsR
t base64t b64encodeR t formatt
get_optiont Nonet lent TrueR t displayt vvvvR R
R R R R t appendt read( t selft termst variablest kwargst rett termt autht
additionalt protocolt fullurlt responset e( ( sG /usr/lib/python2.7/site-packages/ansible/plugins/lookup/cpm_metering.pyt runy sB
000*
' N( t __name__t
__module__R) R<