OpenIxia / IxNetwork

A central location for IxNetwork sample scripts and utilities. Please also visit http://openixia.com
MIT License
50 stars 59 forks source link

how to turns traffic item "State" from "unapplied" to "applied" #85

Closed sshuguan closed 4 years ago

sshuguan commented 4 years ago

My code is able to find all traffic items and enable them:

_testpl = TestPlatform(server, restport=restport) ixses = testpl.Sessions.find() # only one session exists in my case ixnet = ixses.Ixnetwork trfitems = ixnet.Traffic.TrafficItem.find() for t in trfitems: t.Enabled=True

But traffic items "State" are in "unapplied". How do I apply traffic item ? which api do I call ? In our legacy python codes, methods commit() and execute('apply', '/traffic') are used. I do not see corresponding methods in https://openixia.github.io/ixnetwork_restpy/#/reference Please help.

therkong commented 4 years ago

There is Apply() and Start() under Traffic. See code snip:

testplatform = TestPlatform('127.0.0.1') sessions = testplatform.Sessions.add(ApplicationType='ixnrest', Name=None) ixnetwork = sessions.Ixnetwork traffic = ixnetwork.Traffic traffic.Apply() and traffic.Start()

Regards, Theresa

From: sshanggu notifications@github.com Sent: Monday, December 9, 2019 1:40 PM To: OpenIxia/IxNetwork IxNetwork@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [OpenIxia/IxNetwork] how to turns traffic item "State" from "unapplied" to "applied" (#85)

[EXTERNAL]

My code is able to find all traffic items and enable them:

testpl = TestPlatform(server, rest_port=restport) ixses = testpl.Sessions.find() ixnet = ixses.Ixnetwork trfitems = ixnet.Traffic.TrafficItem.find() for t in trfitems: t.Enabled=True

But traffic items "State" are in "unapplied". How do I apply traffic item ? which api do I call ? In our legacy python codes, methods commit() and execute('apply', '/traffic') are used. I do not see corresponding methods in https://openixia.github.io/ixnetwork_restpy/#/referencehttps://urldefense.com/v3/__https:/openixia.github.io/ixnetwork_restpy/*/reference__;Iw!!I5pVk4LIGAfnvw!0r4IF8vXf5v0LxROCerGXRvra9LHTFq-doNm6lruGdTxEItZzW7JJ9np-2B6VY4cmKsc$ Please help.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/OpenIxia/IxNetwork/issues/85?email_source=notifications&email_token=AIRRUUK2MLZCEVX2YZX6MM3QX23JZA5CNFSM4JYSZ2OKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H7I3M4A__;!!I5pVk4LIGAfnvw!0r4IF8vXf5v0LxROCerGXRvra9LHTFq-doNm6lruGdTxEItZzW7JJ9np-2B6VfUKQ2xR$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AIRRUUKFIMABHJLXBEPMH63QX23JZANCNFSM4JYSZ2OA__;!!I5pVk4LIGAfnvw!0r4IF8vXf5v0LxROCerGXRvra9LHTFq-doNm6lruGdTxEItZzW7JJ9np-2B6VXF4Ya1Y$.

sshuguan commented 4 years ago

Got it. Thanks.