write_attributes.py
def main():
    """ Main method. Receive user input and call the write value methods """
    piwebapi_url = str(input('Enter the PI Web API url: '))
    af_server_name = str(input('Enter the Asset Server Name: '))
    piwebapi_user = str(input('Enter the user name: '))
    piwebapi_password = str(getpass.getpass('Enter the password: '))
    piwebapi_security_method = str(
        input('Enter the security method, Basic or Kerberos: '))
    piwebapi_security_method = piwebapi_security_method.lower()
    verify_ssl_string = str(input('Verify certificates? (Y/N): '))

    if (verify_ssl_string.upper() == "N"):
        print('Not verifying certificates poses a security risk and is not recommended')
        verify_ssl = False
    else:
        verify_ssl = True

    # Comment the method calls below when running unit tests
    write_data_set(piwebapi_url, af_server_name, piwebapi_user, piwebapi_password,
                   piwebapi_security_method, verify_ssl)
    write_single_value(piwebapi_url, af_server_name, piwebapi_user, piwebapi_password,
                       piwebapi_security_method, verify_ssl)
    update_attribute_value(piwebapi_url, af_server_name, piwebapi_user, piwebapi_password,
                           piwebapi_security_method, verify_ssl)
 Main method. Receive user input and call the write value methods 
Main method. Receive user input and call the write value methods
Main method . Receive user input and call the write value methods
def main():
    piwebapi_url = str(input('Enter the PI Web API url: '))
    af_server_name = str(input('Enter the Asset Server Name: '))
    piwebapi_user = str(input('Enter the user name: '))
    piwebapi_password = str(getpass.getpass('Enter the password: '))
    piwebapi_security_method = str(
        input('Enter the security method, Basic or Kerberos: '))
    piwebapi_security_method = piwebapi_security_method.lower()
    verify_ssl_string = str(input('Verify certificates? (Y/N): '))
    if (verify_ssl_string.upper() == "N"):
        print('Not verifying certificates poses a security risk and is not recommended')
        verify_ssl = False
    else:
        verify_ssl = True
    write_data_set(piwebapi_url, af_server_name, piwebapi_user, piwebapi_password,
                   piwebapi_security_method, verify_ssl)
    write_single_value(piwebapi_url, af_server_name, piwebapi_user, piwebapi_password,
                       piwebapi_security_method, verify_ssl)
    update_attribute_value(piwebapi_url, af_server_name, piwebapi_user, piwebapi_password,
                           piwebapi_security_method, verify_ssl)
def main ( ) : piwebapi_url = str ( input ( 'Enter the PI Web API url: ' ) ) af_server_name = str ( input ( 'Enter the Asset Server Name: ' ) ) piwebapi_user = str ( input ( 'Enter the user name: ' ) ) piwebapi_password = str ( getpass . getpass ( 'Enter the password: ' ) ) piwebapi_security_method = str ( input ( 'Enter the security method, Basic or Kerberos: ' ) ) piwebapi_security_method = piwebapi_security_method . lower ( ) verify_ssl_string = str ( input ( 'Verify certificates? (Y/N): ' ) ) if ( verify_ssl_string . upper ( ) == "N" ) : print ( 'Not verifying certificates poses a security risk and is not recommended' ) verify_ssl = False else : verify_ssl = True write_data_set ( piwebapi_url , af_server_name , piwebapi_user , piwebapi_password , piwebapi_security_method , verify_ssl ) write_single_value ( piwebapi_url , af_server_name , piwebapi_user , piwebapi_password , piwebapi_security_method , verify_ssl ) update_attribute_value ( piwebapi_url , af_server_name , piwebapi_user , piwebapi_password , piwebapi_security_method , verify_ssl )
Main method.
Main method .
""" Main method. Receive user input and call the write value methods """ # Comment the method calls below when running unit tests