#!/usr/bin/env python
from __future__ import print_function
import sys

from  eTraveler.clientAPI.connection import Connection

#myConn = Connection('jrb', 'Raw', prodServer=False)
myConn = Connection('jrb', 'Raw', prodServer=False, debug=True)
newId = ''
try: 
    newId = myConn.registerHardware(htype='ITL-CCD', site='test',
                                    manufacturer='ITL',
                                    location='Cabinet',
                                    remarks='try out protected write',
                                    experimentSN='ITL-CCD-677')
    print('New hardware registered.  Returned id is ', newId)
except Exception as msg:
    print('Hardware registration failed with exception ',msg)


