def _send_request(payload=None, session=None):
 stub = session
 host_port = stub.host
 url = 'https://{0}/sdk'.format(host_port)
 logging.debug('Sending {0} to {1}'.format(payload, url))
 res = requests.post(url=url, data=payload, headers={'Cookie': stub.cookie, 'SOAPAction': 'urn:vim25', 'Content-Type': 'application/xml'}, verify=False)
 if (res.status_code != 200):
  logging.debug('Failed to reset alarm. HTTP Status: {0}'.format(res.status_code))
  return False
 return True

def _send_request ( payload = None , session = None ) : stub = session host_port = stub . host url = 'https://{0}/sdk' . format ( host_port ) logging . debug ( 'Sending {0} to {1}' . format ( payload , url ) ) res = requests . post ( url = url , data = payload , headers = { 'Cookie' : stub . cookie , 'SOAPAction' : 'urn:vim25' , 'Content-Type' : 'application/xml' } , verify = False ) if ( res . status_code != 200 ) : logging . debug ( 'Failed to reset alarm. HTTP Status: {0}' . format ( res . status_code ) ) return False return True
using requests we send a soap envelope directly to the vcenter api to reset an alarm to the green state .