Question

Create new custom device attribute using Python (not API)

  • 27 November 2023
  • 0 replies
  • 40 views

Userlevel 1

Good Day,


Netbrain Version 10.0

 

How can I create a custom device Attribute using Python, NOT using the API method?

 

Documentation shows how to do it using APIs, but not using the “non-API” method.

 

I know the following Python methods/functions exist:

SetDeviceProperty and GetProperty:

 

Example:

SetDeviceProperty("is_external_router", $_device.GetProperty("name"), "Yes, External Router")

AddMessage($_device.GetProperty("is_external_router"))

 

Of course, it’s not going to work (prints “None”) without first creating the new Attribute.

 

As stated, I need to know what the function/method name is to create a custom attribute.

 

Thanks in advance for your help.

 

Dave


0 replies

Be the first to reply!

Reply


Community |  Ideas

Facebook |  Instagram |  Youtube |  Twitter |  LinkedIn
Privacy & Security Statement  |  Terms & Conditions |  Impressum  |  UK Modern Slavery Statement