examples/collect_inventory.py
def main(args):
    """
    Handles various command line args and call collect_inv() function.
    """
    if args.pem is not None:
        if args.session:
            print("Simulating inventory collection with session-based API access...")
            spc1 = rest.Space(args.space_URL,
                              cert=(args.pem, args.key),
                              use_session=True,
                              profile_file='/tmp/api-responses-session.csv')
            collect_inv(spc1, args.threads)
            spc1.logout()
        else:
            print("Simulating inventory collection with non-session-based API access...")
            spc2 = rest.Space(args.space_URL,
                              cert=(args.pem, args.key),
                              use_session=False,
                              profile_file='/tmp/api-responses.csv')
            collect_inv(spc2, args.threads)
    else:
        if args.session:
            print("Simulating inventory collection with session-based API access...")
            spc1 = rest.Space(args.space_URL,
                              args.user, args.passwd,
                              use_session=True,
                              profile_file='/tmp/api-responses-session.csv')
            collect_inv(spc1, args.threads)
            spc1.logout()
        else:
            print("Simulating inventory collection with non-session-based API access...")
            spc2 = rest.Space(args.space_URL,
                              args.user, args.passwd,
                              use_session=False,
                              profile_file='/tmp/api-responses.csv')
            collect_inv(spc2, args.threads)

    Handles various command line args and call collect_inv() function.
    
Handles various command line args and call collect_inv() function.
Handles various command line args and call collect_inv () function .
def main(args):
    if args.pem is not None:
        if args.session:
            print("Simulating inventory collection with session-based API access...")
            spc1 = rest.Space(args.space_URL,
                              cert=(args.pem, args.key),
                              use_session=True,
                              profile_file='/tmp/api-responses-session.csv')
            collect_inv(spc1, args.threads)
            spc1.logout()
        else:
            print("Simulating inventory collection with non-session-based API access...")
            spc2 = rest.Space(args.space_URL,
                              cert=(args.pem, args.key),
                              use_session=False,
                              profile_file='/tmp/api-responses.csv')
            collect_inv(spc2, args.threads)
    else:
        if args.session:
            print("Simulating inventory collection with session-based API access...")
            spc1 = rest.Space(args.space_URL,
                              args.user, args.passwd,
                              use_session=True,
                              profile_file='/tmp/api-responses-session.csv')
            collect_inv(spc1, args.threads)
            spc1.logout()
        else:
            print("Simulating inventory collection with non-session-based API access...")
            spc2 = rest.Space(args.space_URL,
                              args.user, args.passwd,
                              use_session=False,
                              profile_file='/tmp/api-responses.csv')
            collect_inv(spc2, args.threads)
def main ( args ) : if args . pem is not None : if args . session : print ( "Simulating inventory collection with session-based API access..." ) spc1 = rest . Space ( args . space_URL , cert = ( args . pem , args . key ) , use_session = True , profile_file = '/tmp/api-responses-session.csv' ) collect_inv ( spc1 , args . threads ) spc1 . logout ( ) else : print ( "Simulating inventory collection with non-session-based API access..." ) spc2 = rest . Space ( args . space_URL , cert = ( args . pem , args . key ) , use_session = False , profile_file = '/tmp/api-responses.csv' ) collect_inv ( spc2 , args . threads ) else : if args . session : print ( "Simulating inventory collection with session-based API access..." ) spc1 = rest . Space ( args . space_URL , args . user , args . passwd , use_session = True , profile_file = '/tmp/api-responses-session.csv' ) collect_inv ( spc1 , args . threads ) spc1 . logout ( ) else : print ( "Simulating inventory collection with non-session-based API access..." ) spc2 = rest . Space ( args . space_URL , args . user , args . passwd , use_session = False , profile_file = '/tmp/api-responses.csv' ) collect_inv ( spc2 , args . threads )
Handles various command line args and call collect_inv() function.
Handles various command line args and call collect_inv () function .
"""
    Handles various command line args and call collect_inv() function.
    """
args