jon_monts_46033
Feb 07, 2012Nimbostratus
Pycontrol 2 - issue disabling nodes
Created a script via python to disable nodes, and nodes are not being disabled. Script & log included. Any suggestions would be apperciated.
Script:
import sys
import pycontrol.pycontrol as pc
import time
import csv
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
b = pc.BIGIP(
hostname = 'xx.xx.xx.xx',
username = 'xxxxx',
password = 'xxxxx',
fromurl = True,
wsdls = ['LocalLB.NodeAddress'])
def enable_node():
enable_disable_node('STATE_ENABLED')
def disable_node():
enable_disable_node('STATE_DISABLED')
def enable_disable_node(target_state):
nodes = 'xx.xx.xx.xx'
states = []
states.append(target_state)
b.LocalLB.NodeAddress.set_session_enabled_state(node_addresses=nodes, states=states)
disable_node()
Respose:
DEBUG:suds.client:sending to (https://xx.xx.xx.xx/iControl/iControlPortal.cgi)
message:
xx.xx.xx.xx
STATE_DISABLED
DEBUG:suds.client:headers = {'SOAPAction': u'"urn:iControl:LocalLB/NodeAddress"', 'Content-Type': 'text/xml; charset=utf-8'}
DEBUG:suds.client:http succeeded:
DEBUG:suds.client:sending to ()
message:
http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="urn:iControl:LocalLB/NodeAddress" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
xx.xx.xx.xx
STATE_DISABLED
DEBUG:suds.client:headers = {'SOAPAction': u'"urn:iControl:LocalLB/NodeAddress"', 'Content-Type': 'text/xml; charset=utf-8'}
DEBUG:suds.client:http succeeded:
xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:s="http://www.w3.org/2001/XMLSchema-instance"
xmlns:y="http://www.w3.org/2001/XMLSchema"
xmlns:iControl="urn:iControl"
E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
xmlns:m="urn:iControl:LocalLB/NodeAddress">