Example #1
0
 def __init__(self,
              endpoint,
              transport='kerberos',
              username=None,
              password=None,
              realm=None,
              service=None,
              keytab=None,
              ca_trust_path=None):
     """
     @param string endpoint: the WinRM webservice endpoint
     @param string transport: transport type, one of 'kerberos' (default), 'ssl', 'plaintext'
     @param string username: username
     @param string password: password
     @param string realm: the Kerberos realm we are authenticating to
     @param string service: the service name, default is HTTP
     @param string keytab: the path to a keytab file if you are using one
     @param string ca_trust_path: Certification Authority trust path
     """
     self.endpoint = endpoint
     self.timeout = WinRMWebService.DEFAULT_TIMEOUT
     self.max_env_sz = WinRMWebService.DEFAULT_MAX_ENV_SIZE
     self.locale = WinRMWebService.DEFAULT_LOCALE
     if transport == 'plaintext':
         self.transport = HttpPlaintext(endpoint, username, password)
     elif transport == 'kerberos':
         self.transport = HttpKerberos(endpoint)
     else:
         raise NotImplementedError()
     self.username = username
     self.password = password
     self.service = service
     self.keytab = keytab
     self.ca_trust_path = ca_trust_path