<?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: ydk.errors.YInvalidArgumentError:  Path is invalid: Cisco-IOS-XE-n in Tools</title>
    <link>https://community.cisco.com/t5/tools/ydk-errors-yinvalidargumenterror-path-is-invalid-cisco-ios-xe/m-p/5161354#M3578</link>
    <description>&lt;P&gt;I dont have a way to test this right now, try this&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from ydk.models.Cisco_IOS_XE_native import Cisco_IOS_XE_native as xe_native
from ydk.errors import YServiceProviderError

provider = NetconfServiceProvider(address='192.168.2.2',
                                    port=830,
                                    username='###',
                                    password='###',
                                    protocol='ssh')
crud = CRUDService()

native = xe_native.Native()  # create object

# Define the path to the Loopback interface configuration
loopback_path = "/native/interface/Loopback[name='0']"  # Replace '0' with your desired loopback number

# Create the Loopback object with desired configuration
loopback = xe_native.Loopback()
loopback.name = "0"  # Replace with your desired loopback number
loopback.description = "PRIMARY ROUTER LOOPBACK"
loopback.ip.address.primary.address = "172.16.255.1"
loopback.ip.address.primary.mask = "255.255.255.255"

# Update the Loopback configuration at the specified path
crud.create(provider, path=loopback_path, data=loopback)

exit()
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Aug 2024 12:16:07 GMT</pubDate>
    <dc:creator>bigevilbeard</dc:creator>
    <dc:date>2024-08-15T12:16:07Z</dc:date>
    <item>
      <title>ydk.errors.YInvalidArgumentError:  Path is invalid: Cisco-IOS-XE-nativ</title>
      <link>https://community.cisco.com/t5/tools/ydk-errors-yinvalidargumenterror-path-is-invalid-cisco-ios-xe/m-p/5161301#M3577</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying just to config a loop back interface by YDK in 9300 switch . I followed samples but got errors and don't know how to follow it and fix it . this my code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from ydk.models.Cisco_IOS_XE_native import Cisco_IOS_XE_native as xe_native
from ydk.errors import YServiceProviderError
provider = NetconfServiceProvider(address='192.168.2.2',
                                    port=830,
                                    username='###',
                                    password='###',
                                    protocol='ssh')
crud = CRUDService()

native = xe_native.Native()  # create object
loopback = native.interface.Loopback()
loopback.name = 0
loopback.description = "PRIMARY ROUTER LOOPBACK"
loopback.ip.address.primary.address = "172.16.255.1"
loopback.ip.address.primary.mask = "255.255.255.255"
native.interface.loopback.append(loopback)

# read data from NETCONF device
native = crud.create(provider, native)
 # process object data
exit()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after running the code I get bellow error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; line 68, in &amp;lt;module&amp;gt;
    native = crud.create(provider, native)
  File "/usr/local/lib/python3.10/dist-packages/ydk/errors/error_handler.py", line 103, in helper
    return func(self, provider, entity, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/ydk/services/crud_service.py", line 49, in create
    return _crud_update(provider, entity, self._crud.create)
  File "/usr/local/lib/python3.10/dist-packages/ydk/services/crud_service.py", line 69, in _crud_update
    with _handle_error():
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.10/dist-packages/ydk/errors/error_handler.py", line 73, in handle_runtime_error
    raise _exc
ydk.errors.YInvalidArgumentError:  Path is invalid: Cisco-IOS-XE-native:native&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the library generated by ydk-gen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 10:16:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/ydk-errors-yinvalidargumenterror-path-is-invalid-cisco-ios-xe/m-p/5161301#M3577</guid>
      <dc:creator>Hamed Fazel</dc:creator>
      <dc:date>2024-08-15T10:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: ydk.errors.YInvalidArgumentError:  Path is invalid: Cisco-IOS-XE-n</title>
      <link>https://community.cisco.com/t5/tools/ydk-errors-yinvalidargumenterror-path-is-invalid-cisco-ios-xe/m-p/5161354#M3578</link>
      <description>&lt;P&gt;I dont have a way to test this right now, try this&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from ydk.models.Cisco_IOS_XE_native import Cisco_IOS_XE_native as xe_native
from ydk.errors import YServiceProviderError

provider = NetconfServiceProvider(address='192.168.2.2',
                                    port=830,
                                    username='###',
                                    password='###',
                                    protocol='ssh')
crud = CRUDService()

native = xe_native.Native()  # create object

# Define the path to the Loopback interface configuration
loopback_path = "/native/interface/Loopback[name='0']"  # Replace '0' with your desired loopback number

# Create the Loopback object with desired configuration
loopback = xe_native.Loopback()
loopback.name = "0"  # Replace with your desired loopback number
loopback.description = "PRIMARY ROUTER LOOPBACK"
loopback.ip.address.primary.address = "172.16.255.1"
loopback.ip.address.primary.mask = "255.255.255.255"

# Update the Loopback configuration at the specified path
crud.create(provider, path=loopback_path, data=loopback)

exit()
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 12:16:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/ydk-errors-yinvalidargumenterror-path-is-invalid-cisco-ios-xe/m-p/5161354#M3578</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-08-15T12:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: ydk.errors.YInvalidArgumentError:  Path is invalid: Cisco-IOS-XE-n</title>
      <link>https://community.cisco.com/t5/tools/ydk-errors-yinvalidargumenterror-path-is-invalid-cisco-ios-xe/m-p/5165011#M3584</link>
      <description>&lt;P&gt;thank you for your reply.&lt;/P&gt;&lt;P&gt;I tried that.&lt;/P&gt;&lt;P&gt;crud.create() just get two arguments so it generates error again.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 12:57:22 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/ydk-errors-yinvalidargumenterror-path-is-invalid-cisco-ios-xe/m-p/5165011#M3584</guid>
      <dc:creator>Hamed Fazel</dc:creator>
      <dc:date>2024-08-23T12:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: ydk.errors.YInvalidArgumentError:  Path is invalid: Cisco-IOS-XE-n</title>
      <link>https://community.cisco.com/t5/tools/ydk-errors-yinvalidargumenterror-path-is-invalid-cisco-ios-xe/m-p/5165080#M3585</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1761847"&gt;@Hamed Fazel&lt;/a&gt;&amp;nbsp;got it thanks, my mistake. Try this, this&amp;nbsp;&lt;SPAN&gt;passes the&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;native.interface&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;to the&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;crud.create()&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;method instead of&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;native&lt;/CODE&gt;&lt;SPAN&gt;. Please check this i am not able to run this locally right now.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from ydk.models.Cisco_IOS_XE_native import Cisco_IOS_XE_native as xe_native
from ydk.providers import NetconfServiceProvider
from ydk.services import CRUDService

# create a netconf provider
provider = NetconfServiceProvider(address='192.168.2.2',
                                    port=830,
                                    username='###',
                                    password='###',
                                    protocol='ssh')

# create a crud service
crud = CRUDService()

# create a native object
native = xe_native.Native()

# create a loopback interface
loopback = xe_native.Interface.Loopback()
loopback.name = 'Loopback0'  # note: name should be a string
loopback.description = "PRIMARY ROUTER LOOPBACK"

# create an ip address
ip_address = xe_native.Interface.Loopback.Ip.Address()
ip_address.primary.address = '172.16.255.1'
ip_address.primary.mask = '255.255.255.255'

# add the ip address to the loopback interface
loopback.ip.address.append(ip_address)

# add the loopback interface to the native object
native.interface.loopback.append(loopback)

# create the configuration on the device
crud.create(provider, native.interface)

# close the provider
provider.close()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 14:56:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/ydk-errors-yinvalidargumenterror-path-is-invalid-cisco-ios-xe/m-p/5165080#M3585</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2024-08-23T14:56:41Z</dc:date>
    </item>
  </channel>
</rss>

