CiscoDevNet / ydk-gen

Generate model-driven APIs from YANG models
http://ciscodevnet.github.io/ydk-gen/
Apache License 2.0
137 stars 74 forks source link

OC-Model statsd: RPC generation is inconsistency #547

Closed vinogovi closed 7 years ago

vinogovi commented 7 years ago

Description: OC-Model statsd: RPC generation is inconsistency ,while configuring the node "ServiceAccounting" under component statsd. PRC generation is inconsistency.

  1. First time while configuring Service accounting polling_period , RPC generated and the configuration was successful.
  2. was able to do create, read and update configuration 3. Now the same node , failed to generate the RPC.

Note: verified in Fretta --> Version : 6.4.1.11I and skywarp platform --> Version : 6.3.2.07I

stats_trace.txt

ghost commented 7 years ago

I don't understand the issue. Please clarify the above as it is hard to make out what the problem is

vinogovi commented 7 years ago

Hi Abhi,

I trying to create crud service and able to generate RPC , But not able to find the any attribute value in the RPC send payload. Also got RPC reply as OK, when checked show running config nothing was configured.

RPC payload:

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:b6c2fb27-2c11-4bf5-896f-4f7aba19d68b">
  <edit-config>
    <target>
      <candidate/>
    </target>
    <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
      <statistics xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-infra-statsd-cfg"/>
    </config>
  </edit-config>
</rpc>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:b6c2fb27-2c11-4bf5-896f-4f7aba19d68b">
  <ok/>
</rpc-reply>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <commit/>
</rpc>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:b6c2fb27-2c11-4bf5-896f-4f7aba19d68b">
  <ok/>
</rpc-reply>

CREATE operation completed

Code snip :

from ydk.models.cisco_ios_xr import Cisco_IOS_XR_infra_statsd_cfg

 def Service_Accounting_config(self):
       ab = Cisco_IOS_XR_infra_statsd_cfg.Statistics()
       pdb.set_trace()
       ob = ab.Period.ServiceAccounting()
       ob.polling_period = 90
       self.crudservice.create(self.provider, ab)
vinogovi commented 7 years ago

Hi Abhi,

· While configuring the container “ServiceAccounting” in the component “Cisco_IOS_XR_infra_statsd_cfg” RPC is getting generated without any leaf values passed. But getting RPC reply as OK. CREATE operation initiated

CREATE operation completed Code snip : from ydk.models.cisco_ios_xr import Cisco_IOS_XR_infra_statsd_cfg def Service_Accounting_config(self): ab = Cisco_IOS_XR_infra_statsd_cfg.Statistics() pdb.set_trace() ob = ab.Period.ServiceAccounting() ob.polling_period = 90 self.crudservice.create(self.provider, ab)

Regards, Vinoth G.

From: Abhi Keshav [mailto:notifications@github.com] Sent: Tuesday, September 12, 2017 9:24 PM To: CiscoDevNet/ydk-gen ydk-gen@noreply.github.com Cc: Vinoth Govindan -X (vinogovi - MINDTREE LIMITED at Cisco) vinogovi@cisco.com; Author author@noreply.github.com Subject: Re: [CiscoDevNet/ydk-gen] OC-Model statsd: RPC generation is inconsistency (#547)

I don't understand the issue. Please clarify the above as it is hard to make out what the problem is

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/CiscoDevNet/ydk-gen/issues/547#issuecomment-328893085, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeaJ7Pnzw7dZpO2L1wTZcUlJsx3HhNrTks5shqhngaJpZM4PUbwj.

ghost commented 7 years ago

Thanks. Formatted your post a bit

ghost commented 7 years ago

Try the below. It is working for me:

from ydk.models.cisco_ios_xr import Cisco_IOS_XR_infra_statsd_cfg
def Service_Accounting_config(self):
       ab = Cisco_IOS_XR_infra_statsd_cfg.Statistics()
       ab.period.service_accounting.polling_period = 90
       self.crudservice.create(self.provider, ab)
vinogovi commented 7 years ago

Hi Abhi,

Thank you . Now able to generate the RPC Payload.

Regards, Vinoth G.

ghost commented 7 years ago

Glad it worked