<?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 Re: Trying to extract Line info with AXL and Python in Management</title>
    <link>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259496#M3553</link>
    <description>&lt;P&gt;Great thanks.&lt;/P&gt;&lt;P&gt;Im using zeep since that seemed to be what was most recently recommended.&lt;/P&gt;&lt;P&gt;Ive bookmarked the other two links. I had found the schema reference in the past and had lost it again - so Im glad to have that bookmarked now. I will hit the lab as soon as I can - it sounds like just what I need!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;k&lt;/P&gt;</description>
    <pubDate>Wed, 16 Dec 2020 17:20:13 GMT</pubDate>
    <dc:creator>Keith Abbott</dc:creator>
    <dc:date>2020-12-16T17:20:13Z</dc:date>
    <item>
      <title>Trying to extract Line info with AXL and Python</title>
      <link>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259152#M3548</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to extract line info from extensions&amp;nbsp; on call manager 11.5 using python and AXL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see the data with the following test code, but I cant get at the data to assign it to variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    resp2 = service.getPhone(name=mac)
    phone_get = resp2['return'].phone
    lineApp = phone_get.lines.line
    #testtesttest
    for test in lineApp:
        for test2 in test:
            print("test:",test2)&lt;/PRE&gt;&lt;P&gt;Ive tried various combinations of things like&lt;/P&gt;&lt;P&gt;print(test2[label])&lt;/P&gt;&lt;P&gt;print(test2.label)&lt;/P&gt;&lt;P&gt;print(test2.label.value)&lt;/P&gt;&lt;P&gt;et cetera ad nausium&lt;/P&gt;&lt;P&gt;but havent had any luck&lt;/P&gt;&lt;P&gt;the specific fields Im looking for (among others) are label, display, displayAscii, and e164mask&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clearly Im not understanding what data structures are returned for getphone.lines, and how to use them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone put me on the right path before I waste anymore time?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 05:58:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259152#M3548</guid>
      <dc:creator>Keith Abbott</dc:creator>
      <dc:date>2020-12-16T05:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to extract Line info with AXL and Python</title>
      <link>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259432#M3549</link>
      <description>&lt;P&gt;Here's a sample output of getPhone up to and including the lines.&amp;nbsp; Notice this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'line': [ {&lt;/P&gt;
&lt;P&gt;The [ tells you that what follows is a list. I think if you treat it like a list, you'll get the kind of output you're looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{
   'return': {
       'phone': {
           'name': 'SEP151515151515',
           'description': 'SEP151515151515',
           'product': 'Cisco 8821',
           'model': 'Cisco 8821',
           'class': 'Phone',
           'protocol': 'SIP',
           'protocolSide': 'User',
           'callingSearchSpaceName': {
               '_value_1': None,
               'uuid': None
           },
           'devicePoolName': {
               '_value_1': 'Default',
               'uuid': '{1B1B9EB6-7803-11D3-BDF0-00108302EAD1}'
           },
           'commonDeviceConfigName': {
               '_value_1': None,
               'uuid': None
           },
           'commonPhoneConfigName': {
               '_value_1': 'Standard Common Phone Profile',
               'uuid': '{AC243D17-98B4-4118-8FEB-5FF2E1B781AC}'
           },
           'networkLocation': 'Use System Default',
           'locationName': {
               '_value_1': 'Hub_None',
               'uuid': '{29C5C1C4-8871-4D1E-8394-0B9181E8C54D}'
           },
           'mediaResourceListName': {
               '_value_1': None,
               'uuid': None
           },
           'networkHoldMohAudioSourceId': None,
           'userHoldMohAudioSourceId': None,
           'automatedAlternateRoutingCssName': {
               '_value_1': None,
               'uuid': None
           },
           'aarNeighborhoodName': {
               '_value_1': None,
               'uuid': None
           },
           'loadInformation': {
               '_value_1': 'sip8821.11-0-4-14',
               'special': 'false'
           },
           'vendorConfig': None,
           'versionStamp': '{1548087040-BA9ED5FB-CE94-4DFE-87FB-674F451AC688}',
           'traceFlag': 'false',
           'mlppDomainId': None,
           'mlppIndicationStatus': 'Default',
           'preemption': 'Default',
           'useTrustedRelayPoint': 'Default',
           'retryVideoCallAsAudio': 'true',
           'securityProfileName': {
               '_value_1': 'Cisco 8821 - Standard SIP Non-Secure Profile',
               'uuid': '{2E1DF068-6CDD-42C9-98E2-AD96983BDB16}'
           },
           'sipProfileName': {
               '_value_1': 'Standard SIP Profile',
               'uuid': '{FCBC7581-4D8D-48F3-917E-00B09FB39213}'
           },
           'cgpnTransformationCssName': {
               '_value_1': None,
               'uuid': None
           },
           'useDevicePoolCgpnTransformCss': 'true',
           'geoLocationName': {
               '_value_1': None,
               'uuid': None
           },
           'geoLocationFilterName': {
               '_value_1': None,
               'uuid': None
           },
           'sendGeoLocation': 'false',
           'lines': {
               'line': [
                   {
                       'index': 1,
                       'label': None,
                       'display': None,
                       'dirn': {
                           'pattern': '1111',
                           'routePartitionName': {
                               '_value_1': None,
                               'uuid': None
                           },
                           'uuid': '{BE4AED9D-18C7-2710-C93A-804B9B635B1C}'
                       },
                       'ringSetting': 'Use System Default',
                       'consecutiveRingSetting': 'Use System Default',
                       'ringSettingIdlePickupAlert': 'Use System Default',
                       'ringSettingActivePickupAlert': 'Use System Default',
                       'displayAscii': None,
                       'e164Mask': None,
                       'dialPlanWizardId': None,
                       'mwlPolicy': 'Use System Policy',
                       'maxNumCalls': 4,
                       'busyTrigger': 2,
                       'callInfoDisplay': {
                           'callerName': 'true',
                           'callerNumber': 'false',
                           'redirectedNumber': 'false',
                           'dialedNumber': 'true'
                       },
                       'recordingProfileName': {
                           '_value_1': None,
                           'uuid': None
                       },
                       'monitoringCssName': {
                           '_value_1': None,
                           'uuid': None
                       },
                       'recordingFlag': 'Call Recording Disabled',
                       'audibleMwi': 'Default',
                       'speedDial': None,
                       'partitionUsage': 'General',
                       'associatedEndusers': {
                           'enduser': [
                               {
                                   'userId': 'johnq'
                               }
                           ]
                       },
                       'missedCallLogging': 'true',
                       'recordingMediaSource': 'Gateway Preferred',
                       'ctiid': None,
                       'uuid': '{ED53A607-6688-B093-3615-B5E0D1C352BA}'
                   }
               ],
               'lineIdentifier': None
           },
&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Dec 2020 15:20:27 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259432#M3549</guid>
      <dc:creator>npetrele</dc:creator>
      <dc:date>2020-12-16T15:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to extract Line info with AXL and Python</title>
      <link>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259459#M3550</link>
      <description>&lt;P&gt;AWESOME!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks! Thats just the nudge I needed!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For those slow of mind like me, the test code to access individual fields within a cisco phone line was:&lt;/P&gt;&lt;PRE&gt;try:
#    resp2 = service.getPhone(uuid=Tuuid)
    resp2 = service.getPhone(name=mac)
    phone_get = resp2['return'].phone
    lineApp = phone_get.lines.line
    print("L1 Label is:",lineApp[0]['label'])
    print("L2 Label is:",lineApp[1]['label'])&lt;/PRE&gt;&lt;P&gt;and the result looked like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;L1 Label is: Jonas Grumby 22041 L1 LTL&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;L2 Label is: Jonas Grumby L2 LTL&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again - I had been beating my head against that for some time, and with your info I got it in about 20 mins of fooling around to get the syntax right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you happen to know a good reference site for getting more familiar with the AXL data structures - and python syntax for addressing them? Im pretty much a newb with both and am still not sure about&lt;/P&gt;&lt;P&gt;when to use a &amp;nbsp; &lt;EM&gt;this.that&amp;nbsp;&amp;nbsp; &lt;/EM&gt;versus a &amp;nbsp; &lt;EM&gt;this[that]&amp;nbsp;&amp;nbsp; .&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I see now that &lt;EM&gt;this[that]&amp;nbsp; &lt;/EM&gt;is for an item in a list:&amp;nbsp; with &lt;EM&gt;this.that&amp;nbsp; , &lt;/EM&gt;is&amp;nbsp; &lt;EM&gt;that&lt;/EM&gt; a defined property of &lt;EM&gt;this&lt;/EM&gt; ?&lt;/P&gt;&lt;P&gt;If so, where can I find a reference that will reveal all of those properties for AXL structures?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 16:12:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259459#M3550</guid>
      <dc:creator>Keith Abbott</dc:creator>
      <dc:date>2020-12-16T16:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to extract Line info with AXL and Python</title>
      <link>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259485#M3551</link>
      <description>&lt;P&gt;The AXL schema reference is of course the reference for all of the fine detaisl about data structures and fields: &lt;A href="https://developer.cisco.com/docs/axl-schema-reference/" target="_blank"&gt;https://developer.cisco.com/docs/axl-schema-reference/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;How those map to/from Python data structures is a bit of an art, and certainly depends on the mechanism/libraries you are using for interacting with AXL.&amp;nbsp; Zeep is pretty commonly used and is the basis for a lot of sample code: &lt;A href="https://docs.python-zeep.org/en/master/" target="_blank"&gt;https://docs.python-zeep.org/en/master/&lt;/A&gt;&lt;BR /&gt;This repo has several AXL/Zeep samples that can be informative - many address specific issues/foibles with AXL: &lt;A href="https://github.com/CiscoDevNet/axl-python-zeep-samples" target="_blank"&gt;CiscoDevNet/axl-python-zeep-samples&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 16:58:00 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259485#M3551</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2020-12-16T16:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to extract Line info with AXL and Python</title>
      <link>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259489#M3552</link>
      <description>&lt;P&gt;I don't now of any AXL/Python/JSON dictionary, but I wrote this learning lab that might be helpful for you:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.cisco.com/learning/lab/python-zeep-axl-lab/step/1" target="_blank" rel="noopener"&gt;https://developer.cisco.com/learning/lab/python-zeep-axl-lab/step/1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 9 has a tip on how I learned how to format data for AXL requests and responses.&amp;nbsp; I hope that helps.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 17:05:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259489#M3552</guid>
      <dc:creator>npetrele</dc:creator>
      <dc:date>2020-12-16T17:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to extract Line info with AXL and Python</title>
      <link>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259496#M3553</link>
      <description>&lt;P&gt;Great thanks.&lt;/P&gt;&lt;P&gt;Im using zeep since that seemed to be what was most recently recommended.&lt;/P&gt;&lt;P&gt;Ive bookmarked the other two links. I had found the schema reference in the past and had lost it again - so Im glad to have that bookmarked now. I will hit the lab as soon as I can - it sounds like just what I need!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;k&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 17:20:13 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/trying-to-extract-line-info-with-axl-and-python/m-p/4259496#M3553</guid>
      <dc:creator>Keith Abbott</dc:creator>
      <dc:date>2020-12-16T17:20:13Z</dc:date>
    </item>
  </channel>
</rss>

