-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read content of Multivalue #66
Comments
Hi @alexandreseitz , So we would be exposing another property in Multivalue class named PatternType @property
def PatternType(self):
# type: () -> str
"""
Returns
-------
- str: a string containing information about the type for this Multivalue
possible returns (Alternate, Custom, Decrement, Distributed, Increment, Random, RandomRange, RandomMask,
Single, String, ValueList)
""" To see a simple test scenario from ixnetwork_restpy import SessionAssistant
session_assistant = SessionAssistant(
IpAddress="127.0.0.1",
UserName="admin",
Password="admin",
LogLevel=SessionAssistant.LOGLEVEL_INFO,
ClearConfig=True,
)
# adding ipv4 stack
ipv4 = (
session_assistant.Ixnetwork.Topology.add()
.DeviceGroup.add()
.Ethernet.add()
.Ipv4.add()
)
# fetching ipv4 address multivalue object
address = ipv4.Address
# modifying multivalue base on pattern type
if address.PatternType == "Increment":
address.Increment(start_value="1.1.1.1", step_value="1.0.0.0")
elif address.PatternType == "Decrement":
address.Decrement(start_value="100.1.1.1", step_value="1.0.0.0") Please let us know if this will help you in achieving your use-case |
Hello Yes it could be a solution to expose a property like @PatternType. |
Hi @alexandreseitz , Just so that we are in the same page . Note: as you have mentioned nest in your previous comment we use @steps property to get and modify nest patterns from a multivalue instance |
Hello @Vibaswan Yes we are on the same page. @PatternType should return a string. And based on its value, I will be able to discover the configuration of the Multivalue instance by accessing subclasses with code similar to:
|
Hi I am testing the lastest release 1.1.6 with mutlivalue PatternType. It seems to work well, but now I am facing an issue |
Hi, |
Hello
I need to read content of Multivalue.
Typically in my program when I connect to Ixnetwork controler with some configuration already
deployed (or a config uploaded via ixncfg file) and I discover the config by parsing the complete topology.
For the Multivalue object I need to detect which type of mutlivalue it is:
There are some @Property defined in Multivalue like Pattern, but there is a complex mecanism to hide the real type of Multivalue
I would expect to get the real pattern value (
MV._properties['pattern']
), but instead it returns a string:So I try to access data in the private property
mv._properties[]
but sometime data is not there..so it raise a KeyErrorSo for now, I have no other solution than doing some kind of reverse engineering from the string returned by the @Property Pattern
The text was updated successfully, but these errors were encountered: