importloggingimportosimportsmiafromsmia.agents.extensible_smia_agentimportExtensibleSMIAAgentfromsmia.utilities.general_utilsimportDockerUtilsfromsmia_ism.behaviours.acl_openapi_handling_behaviourimportACLOpenAPIHandlingBehaviourfromsmia_ism.utilitiesimportgeneral_utils_logger=logging.getLogger(__name__)# This is the starter file to launch the SMIA Infrastructure Services Manager software
[docs]defmain():# First, the initial configuration must be executedsmia.initial_self_configuration()_logger.info("Initializing SMIA ISM (Infrastructure Services Manager)...")# The main banner of SMIA will be replaced for the SMIA ISM bannersmia.utilities.general_utils.GeneralUtils.print_smia_banner=general_utils.print_smia_ism_banner# The AAS model is obtained from the environmental variablesaas_model_path=DockerUtils.get_aas_model_from_env_var()# When the AAS model path has been obtained, it is added to SMIAsmia.load_aas_model(aas_model_path)# The jid and password can also be set as environmental variables. In case they are not set, the values are obtained# from the initialization properties filesmia_jid=os.environ.get('AGENT_ID')smia_psswd=os.environ.get('AGENT_PASSWD')# # TODO BORRAR (para pruebas)# smia_jid = "gcis1@xmpp.jp"# smia_psswd = "gcis1234"# smia.load_aas_model('../smia_archive/config/aas/SMIA_InfrastructureServicesManager.aasx')# Create the agent objectsmia_extensible_agent=ExtensibleSMIAAgent(smia_jid,smia_psswd)operator_behaviour=ACLOpenAPIHandlingBehaviour(smia_extensible_agent)smia_extensible_agent.add_new_agent_capability(operator_behaviour)smia.run(smia_extensible_agent)
if__name__=='__main__':# Run main program with SMIAmain()