Child pages
  • Как запускать команды в микросервисной ветке

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
linenumberstrue
from noc.sa.models.managedobjectselector import ManagedObjectSelector
from noc.sa.models import ManagedObject

MOS='Huawei.VRP'

command="display link-aggregation verbose"

params={"commands":[command],"ignore_cli_errors":True}
o=ManagedObjectSelector.objects.get(name=MOS)

result=[]

for i in o.managed_objects:
    print i
    resp=i.scripts["commands"](**params)
    print resp []
    result.append({
        'result': resp,
        'name': i.name
    })

...