<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Cant get 'up-ports' to print in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Cant-get-up-ports-to-print/m-p/135940#M2501</link>
    <description>&lt;P&gt;Writig this in Python 2. Im trying to print the up ports to print, but they show up as None. It should print out 4 ports.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ontap 9.1, API 110&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2 For loops&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;out = server.invoke("net-port-ifgrp-get","ifgrp-name","a0a","node","tsccfs05n01a")
test = out.child_get("attributes")
test_list = test.children_get()
for mlag in test_list:
	port = mlag.child_get('ports').children_get()
	for status in port:
		up = port.child_get_string('lif-bindable')
		print "UP: " , up&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ouput:&lt;/P&gt;&lt;P&gt;UP: None&lt;BR /&gt;UP: None&lt;BR /&gt;UP: None&lt;BR /&gt;UP: None&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When i try to do it with only one for loop:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;out = server.invoke("net-port-ifgrp-get","ifgrp-name","a0a","node","tsccfs05n01a  )
test = out.child_get("attributes")
test_list = test.children_get()
for mlag in out.child_get("attributes").children_get():
	port = mlag.child_get('up-ports').child_get_string('lif-bindable')
	print "Port: " + port&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;Port: e0e&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 14:22:37 GMT</pubDate>
    <dc:creator>mason_als</dc:creator>
    <dc:date>2025-06-04T14:22:37Z</dc:date>
    <item>
      <title>Cant get 'up-ports' to print</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Cant-get-up-ports-to-print/m-p/135940#M2501</link>
      <description>&lt;P&gt;Writig this in Python 2. Im trying to print the up ports to print, but they show up as None. It should print out 4 ports.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ontap 9.1, API 110&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2 For loops&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;out = server.invoke("net-port-ifgrp-get","ifgrp-name","a0a","node","tsccfs05n01a")
test = out.child_get("attributes")
test_list = test.children_get()
for mlag in test_list:
	port = mlag.child_get('ports').children_get()
	for status in port:
		up = port.child_get_string('lif-bindable')
		print "UP: " , up&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ouput:&lt;/P&gt;&lt;P&gt;UP: None&lt;BR /&gt;UP: None&lt;BR /&gt;UP: None&lt;BR /&gt;UP: None&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When i try to do it with only one for loop:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;out = server.invoke("net-port-ifgrp-get","ifgrp-name","a0a","node","tsccfs05n01a  )
test = out.child_get("attributes")
test_list = test.children_get()
for mlag in out.child_get("attributes").children_get():
	port = mlag.child_get('up-ports').child_get_string('lif-bindable')
	print "Port: " + port&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;Port: e0e&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 14:22:37 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Cant-get-up-ports-to-print/m-p/135940#M2501</guid>
      <dc:creator>mason_als</dc:creator>
      <dc:date>2025-06-04T14:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Cant get 'up-ports' to print</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Cant-get-up-ports-to-print/m-p/135955#M2502</link>
      <description>&lt;P&gt;As there are no child under array, you cannot access value with standard child_get&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this one works,&lt;/P&gt;&lt;PRE&gt;test = out.child_get(&lt;SPAN&gt;"attributes"&lt;/SPAN&gt;)&lt;BR /&gt;test_list = test.children_get()&lt;BR /&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;mlag &lt;SPAN&gt;in &lt;/SPAN&gt;test_list:&lt;BR /&gt;    ports = mlag.child_get(&lt;SPAN&gt;'ports'&lt;/SPAN&gt;).children_get()&lt;BR /&gt;    ifgrp = mlag.child_get_string(&lt;SPAN&gt;'ifgrp-name'&lt;/SPAN&gt;)&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;port &lt;SPAN&gt;in &lt;/SPAN&gt;ports:&lt;BR /&gt;        &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"UP: "&lt;/SPAN&gt;, port.element[&lt;SPAN&gt;'content'&lt;/SPAN&gt;])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 10:23:48 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Cant-get-up-ports-to-print/m-p/135955#M2502</guid>
      <dc:creator>francoisbnc</dc:creator>
      <dc:date>2017-11-13T10:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cant get 'up-ports' to print</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Cant-get-up-ports-to-print/m-p/135964#M2503</link>
      <description>&lt;P&gt;Thank you, that seems to have worked. Appreicate it. I do have a quick question, is the port&lt;STRONG&gt;.element['content']&lt;/STRONG&gt; a netapp api function or python function. I did not see that in the Netapp Api documentation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 16:48:47 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Cant-get-up-ports-to-print/m-p/135964#M2503</guid>
      <dc:creator>mason_als</dc:creator>
      <dc:date>2017-11-13T16:48:47Z</dc:date>
    </item>
  </channel>
</rss>

