Closed dorado18 closed 6 years ago
The example of the proper way to augment using pyang requires listing the augmentor minimal.yang
after the augmentee minimal_base.yang
. Example below:
% ~/.local/bin/pyang --plugindir ./YANG-to-Redfish-Plugin -p ./ --format redfish ./minimal_base.yang ./minimal.yang
Since the augmented item is base_container, it will generate minimal_base.base_container_v1.xml
with the augmented property name, like so
...
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="minimal_base.base_container.v1_0_0">
<Annotation Term="Redfish.OwningEntity" String="DMTF"/>
<EntityType Name="base_container" BaseType="minimal_base.base_container.base_container">
<Annotation Term="RedfishYang.NodeTypes" EnumMember="RedfishYang.NodeTypes/container"/>
<Property Name="id" Type="RedfishYang.uint32">
<Annotation Term="RedfishYang.NodeTypes" EnumMember="RedfishYang.NodeTypes/leaf"/>
<Annotation Term="RedfishYang.YangType" String="uint32"/>
<Annotation Term="OData.Permissions" EnumMember="OData.Permission/Read"/>
</Property>
<Property Name="name" Type="Edm.String">
<Annotation Term="RedfishYang.NodeTypes" EnumMember="RedfishYang.NodeTypes/leaf"/>
<Annotation Term="RedfishYang.YangType" String="string"/>
<Annotation Term="OData.Permissions" EnumMember="OData.Permission/Read"/>
</Property>
</EntityType>
</Schema>
...
Notably, the file for minimal_v1.xml is largely empty since it does not actually contain any payload content itself. This is from what I understand. Seems that this might prove an issue, as there's not really any way to know if a generated xml had been augmented.
@dorado18 Is this a satisfactory explanation?
Yes, it is! Thank you very much! I will close the issue.
Hello,
I am having problems with the 'augment' statement. What I'm trying to do is to generate CSDL file based on OpenConfig models, but one of the blocks I'm facing is about augmenting modules. When I augment some container for example, I can't get the CSDL files to reflect this augmenting.
This is reproducible with a minimal crafted example. Take for example file minimal_base.yang file:
And file minimal.yang :
The generated minimal_v1.xml has no reference whatsoever to property 'id' from minimal_base and also does not have the property 'name' defined.
Am I doing something wrong? I expected to have a CSDL file where an entity 'minimal' with both propertied (id and name) in it, or that entity 'minimal' inherited 'id' from some other base entity.
Thanks, andré