def _build_session(username, password, trans_label=None):
 bigip = requests.session()
 bigip.auth = (username, password)
 bigip.verify = False
 bigip.headers.update({'Content-Type': 'application/json'})
 if trans_label:
  trans_id = __salt__['grains.get']('bigip_f5_trans:{label}'.format(label=trans_label))
  if trans_id:
   bigip.headers.update({'X-F5-REST-Coordination-Id': trans_id})
  else:
   bigip.headers.update({'X-F5-REST-Coordination-Id': None})
 return bigip

def _build_session ( username , password , trans_label = None ) : bigip = requests . session ( ) bigip . auth = ( username , password ) bigip . verify = False bigip . headers . update ( { 'Content-Type' : 'application/json' } ) if trans_label : trans_id = __salt__ [ 'grains.get' ] ( 'bigip_f5_trans:{label}' . format ( label = trans_label ) ) if trans_id : bigip . headers . update ( { 'X-F5-REST-Coordination-Id' : trans_id } ) else : bigip . headers . update ( { 'X-F5-REST-Coordination-Id' : None } ) return bigip
create a session to be used when connecting to icontrol rest .