api_user = Users(looker_client) logger.info("Found looker.ini file in the directory.") # use environment variable instead else: try: LOOKERSDK_API_VERSION = 4.0 # enforcing API 4.0 to access new endpoints when released LOOKERSDK_BASE_URL = os.environ.get('LOOKERSDK_BASE_URL') LOOKERSDK_CLIENT_ID = os.environ.get('LOOKERSDK_CLIENT_ID') LOOKERSDK_CLIENT_SECRET = os.environ.get('LOOKERSDK_CLIENT_SECRET') looker_client = setup.configure_sdk() api_user = Users(looker_client) logger.info("Found Looker ENV VAR in the system.") except Exception as e: logger.error('Missing Environment Variables {}'.format(e)) if not api_user.validate_api_creds(): logger.error('Ensure API credentials have Admin role.') exit(0) looker_version = get_looker_version(looker_client) looker_url = get_looker_instance() logger.info('Checking instance: {}'.format(looker_url)) # USERS all_users = api_user.count_all_users() user_issue_details = api_user.get_users_issue() logger.info('Checked: {}'.format(Users.__repr__(api_user))) #################################################################### # PROJECTS my_project = Projects(looker_client)