Hello everyone,
I recently discovered Ericsson enmscripting library they provide to consume their API to connect to ENM-cli via python script
I read their docummentation and I was hoping to be able to connect to the ENMs i use on my daily activities and write some scripts to make my life and my teams easier, but when I try to log into the library, I get the error in the topic subject (I am using the same url I use when I connect to the ENM on the web browser:
Please make sure the URL [https://enm.url:8005/]
is a valid ENM URL
This is a small class I was writting to test the library which is the one giving me the error
class Enm_session:
def __init__(self,url,user,password):
self.url = url
self.user = user
self.password = password
def init_session(self):
self.session = enmscripting.open(self.url).with_credentials(enmscripting.UsernameAndPassword(self.user,self.password))
def close_session(self):
if self.session():
enmscripting.close(self.session)
def send_command(self,command):
if self.session():
cmd = self.session.command()
response = cmd.execute(command)
for element in response.get_output():
print(element.value())
def main():
url = r'https://enm.url:8005/'
user = "myuser"
pasword = "mypassword"
enm = Enm_session(url,user,pasword)
enm.init_session()
command = 'cmedit get MeContext=SampleNode'
enm.send_command(command)
enm.close_session()
main()
As for requirementes I installed :
Package Version
-------------------- --------
bcrypt 4.1.3
certifi 2024.2.2
cffi 1.16.0
charset-normalizer 3.3.2
cryptography 42.0.7
enm-client-scripting 1.22.2
idna 3.7
pip 24.0
pycparser 2.22
PyNaCl 1.5.0
requests 2.32.0
six 1.16.0
uplink 0.9.7
uritemplate 4.1.1
urllib3 2.2.1
and my Python version is 3.12.3
any insights? thanks
Admin note: this post was updated with image below.