def is_connection_to_a_vcenter(service_instance):
 try:
  api_type = service_instance.content.about.apiType
 except vim.fault.VimFault as exc:
  raise salt.exceptions.VMwareApiError(exc.msg)
 except vmodl.RuntimeFault as exc:
  raise salt.exceptions.VMwareRuntimeError(exc.msg)
 log.trace('api_type = {0}'.format(api_type))
 if (api_type == 'VirtualCenter'):
  return True
 elif (api_type == 'HostAgent'):
  return False
 else:
  raise salt.exceptions.VMwareApiError("Unexpected api type '{0}' . Supported types: 'VirtualCenter/HostAgent'".format(api_type))

def is_connection_to_a_vcenter ( service_instance ) : try : api_type = service_instance . content . about . apiType except vim . fault . VimFault as exc : raise salt . exceptions . VMwareApiError ( exc . msg ) except vmodl . RuntimeFault as exc : raise salt . exceptions . VMwareRuntimeError ( exc . msg ) log . trace ( 'api_type = {0}' . format ( api_type ) ) if ( api_type == 'VirtualCenter' ) : return True elif ( api_type == 'HostAgent' ) : return False else : raise salt . exceptions . VMwareApiError ( "Unexpected api type '{0}' . Supported types: 'VirtualCenter/HostAgent'" . format ( api_type ) )
function that returns true if the connection is made to a vcenter server and false if the connection is made to an esxi host service_instance the service instance from which to obtain managed object references .