-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question: can we parse and print edit-config or edit-data before pushing into the sysrepo database. #3281
Comments
It is not possible to avoid the standard YANG validation, you can only add your own.
The direct approach is to write standard sysrepo module change callbacks when you have the option to validate and refuse the configuration changes on the |
Hi Michal,
Can I achieve to revert back the configuration in case of validation failes?
Can I get any examples for this? Do in need to pass this in the function sr_module_change_subscribe
Thanks
Samba
From: Michal Vasko ***@***.***>
Sent: Monday, April 29, 2024 12:38 PM
To: sysrepo/sysrepo ***@***.***>
Cc: Samba Siva Reddy ***@***.***>; Author ***@***.***>
Subject: Re: [sysrepo/sysrepo] question: can we parse and print edit-config or edit-data before pushing into the sysrepo database. (Issue #3281)
[CAUTION: This email originated from outside of Tejas. Do not click links or open attachments unless you recognize the sender and know the content is safe]
validate without using the default or range values
It is not possible to avoid the standard YANG validation, you can only add your own.
is it possible to write my validations check function ?
The direct approach is to write standard sysrepo module change callbacks when you have the option to validate and refuse the configuration changes on the SR_EV_CHANGE event.
—
Reply to this email directly, view it on GitHub<#3281 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BFY5QEHOYEKN7FP2DJVJLUDY7XWTXAVCNFSM6AAAAABG5XWNXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBSGAZDGMZRHA>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Yes, the configuration is fully refused (not reverted because it is not applied yet), see the docs. There are no specific examples of this because there is nothing to it. Just call |
How to send a delete operation for humidity operation using following yang module
yang
module example {
namespace "urn:example";
prefix ex;
container exam {
leaf humidity {
type uint8 {
range "0..100";
}
description "Relative humidity percentage";
}
leaf pressure {
type uint16 {
range "800..1200";
}
description "Atmospheric pressure in millibars";
}
leaf temperature {
type uint16;
description "termprature";
}
leaf day {
type string;
description "temperature of the day";
}
}
}
Thanks
Samba
From: Michal Vasko ***@***.***>
Sent: Monday, April 29, 2024 12:38 PM
To: sysrepo/sysrepo ***@***.***>
Cc: Samba Siva Reddy ***@***.***>; Author ***@***.***>
Subject: Re: [sysrepo/sysrepo] question: can we parse and print edit-config or edit-data before pushing into the sysrepo database. (Issue #3281)
[CAUTION: This email originated from outside of Tejas. Do not click links or open attachments unless you recognize the sender and know the content is safe]
validate without using the default or range values
It is not possible to avoid the standard YANG validation, you can only add your own.
is it possible to write my validations check function ?
The direct approach is to write standard sysrepo module change callbacks when you have the option to validate and refuse the configuration changes on the SR_EV_CHANGE event.
—
Reply to this email directly, view it on GitHub<#3281 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BFY5QEHOYEKN7FP2DJVJLUDY7XWTXAVCNFSM6AAAAABG5XWNXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBSGAZDGMZRHA>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
I am not here to explain NETCONF or YANG, please read the specs. |
Hi Michal,
User authentication is failing when I try to connect from Netconf cli. I am able to connect through root user and password . Do we need to enable anything for user authentications in the code?
Thanks,
Samba
From: Michal Vasko ***@***.***>
Sent: Thursday, May 9, 2024 1:29 PM
To: sysrepo/sysrepo ***@***.***>
Cc: Samba Siva Reddy ***@***.***>; Author ***@***.***>
Subject: Re: [sysrepo/sysrepo] question: can we parse and print edit-config or edit-data before pushing into the sysrepo database. (Issue #3281)
[CAUTION: This email originated from outside of Tejas. Do not click links or open attachments unless you recognize the sender and know the content is safe]
I am not here to explain NETCONF or YANG, please read the specs<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdatatracker.ietf.org%2fdoc%2fhtml%2frfc6241%23section-7.2&c=E,1,juhMN1dfFb3FrhJHWd_EENXLzORvhP1AFnrV0nheWiql7-_hQZEdRzdzmlEZ2Gy7KIYmk5Fb9JyYpmFwjPNp_A2VN2WC5raVXKUx24QV&typo=1>.
—
Reply to this email directly, view it on GitHub<#3281 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BFY5QEFB65T45MSNTRKWOTLZBMUCRAVCNFSM6AAAAABG5XWNXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBSGE2TEMRUGA>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
If you are asking about connecting and authenticating to netopeer2-server they yes, you need to configure the authentication mechanisms in its YANG configuration stored in sysrepo. You can manually edit the configuration using |
Yes Michal. Thank you
Here can we use only one authentication or can we use multiple?
<users>
<user>
<name>root</name>
<keyboard-interactive xmlns="urn:cesnet:libnetconf2-netconf-se
<use-system-auth/>
</keyboard-interactive>
</user>
</users>
Thanks,
Samba
From: Michal Vasko ***@***.***>
Sent: Monday, May 13, 2024 12:24 PM
To: sysrepo/sysrepo ***@***.***>
Cc: Samba Siva Reddy ***@***.***>; Author ***@***.***>
Subject: Re: [sysrepo/sysrepo] question: can we parse and print edit-config or edit-data before pushing into the sysrepo database. (Issue #3281)
[CAUTION: This email originated from outside of Tejas. Do not click links or open attachments unless you recognize the sender and know the content is safe]
If you are asking about connecting and authenticating to netopeer2-server they yes, you need to configure the authentication mechanisms in its YANG configuration stored in sysrepo. You can manually edit the configuration using sysrepocfg -E vim -m ietf-netconf-server, for example. You can find example segments of the supported configuration in netopeer2/example_configuration/ssh_listen.xml.
—
Reply to this email directly, view it on GitHub<#3281 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BFY5QEETFQXTL34L3KL3AWTZCBPQLAVCNFSM6AAAAABG5XWNXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWG44DKNJRGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
In the current SSH server YANG module a specific single authentication method must be configured for each user. Meaning you need to select only one method for a user but each user can have a different authentication method. |
I am not able to delete the list inside container. Could you please check and let me is anything error in my xml file.
Getting the success message but in server showing the following message
[INF]: SR: No "running" datastore changes to apply.
[INF]: SR: EV LISTEN: "/ietf-netconf:edit-config" "rpc" ID 6 priority 0 success (remaining 0 subscribers).
[INF]: SR: EV ORIGIN: "/ietf-netconf:edit-config" "rpc" ID 6 priority 0 succeeded.
Here is the yang and xml file:
module TEJASFPTEMPLATE-MIB {
namespace "urn:TEJASFPTEMPLATE-MIB";
prefix "tejasfptemplate-mib";
import ietf-inet-types {
prefix "inet";
}
import ietf-yang-types {
prefix "yang";
}
typedef Fixed2 {
type int32;
description
"Represents a fixed decimal as an integer that is one
hundred times the float value.";
}
typedef String16 {
type binary {
length "16";
}
description
"Represents an Octet String consisting of 16 octets.";
}
container tejasFPTemplateTable {
list tejasFPTemplateEntry {
key "cI sI sN fPTemplateID";
description
"An entry in the FPTemplate Table.";
leaf cI {
type int32;
description
"Chassis Index";
}
leaf sI {
type int32;
description
"Slot Index";
}
leaf sN {
type int32;
description
"Parent SN";
}
leaf fPTemplateID {
type int32;
description
"The identifier for this FP template.";
}
leaf description {
type string;
description
"The name associated with this FP template.";
}
}
}
}
<tejasFPTemplateTable xmlns="urn:TEJASFPTEMPLATE-MIB" xc:operation="delete">
<tejasFPTemplateEntry >
<cI>100</cI>
<sI>40</sI>
<sN>50</sN>
<fPTemplateID>60</fPTemplateID>
<description>tejas</description>
</tejasFPTemplateEntry>
</tejasFPTemplateTable>
Thanks,
Samba
From: Michal Vasko ***@***.***>
Sent: Monday, May 13, 2024 12:39 PM
To: sysrepo/sysrepo ***@***.***>
Cc: Samba Siva Reddy ***@***.***>; Author ***@***.***>
Subject: Re: [sysrepo/sysrepo] question: can we parse and print edit-config or edit-data before pushing into the sysrepo database. (Issue #3281)
[CAUTION: This email originated from outside of Tejas. Do not click links or open attachments unless you recognize the sender and know the content is safe]
In the current SSH server YANG module<https://github.com/CESNET/libnetconf2/blob/master/modules/ietf-ssh-server%402023-12-28.yang#L232> a specific single authentication method must be configured for each user. Meaning you need to select only one method for a user but each user can have a different authentication method.
—
Reply to this email directly, view it on GitHub<#3281 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BFY5QECAHZWADO3M7PPBXADZCBRG7AVCNFSM6AAAAABG5XWNXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWHAYTANJYGM>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Hi,
I tried both xc: and without xc operation
<tejasFPTemplateTable xmlns="urn:TEJASFPTEMPLATE-MIB" operation="delete">
<tejasFPTemplateEntry >
<cI>100</cI>
<sI>40</sI>
<sN>50</sN>
<fPTemplateID>60</fPTemplateID>
<description>tejas</description>
</tejasFPTemplateEntry>
</tejasFPTemplateTable>
Following message seeing in the server side
[INF]: SR: No "running" datastore changes to apply.
[INF]: SR: EV LISTEN: "/ietf-netconf:edit-config" "rpc" ID 6 priority 0 success (remaining 0 subscribers).
[INF]: SR: EV ORIGIN: "/ietf-netconf:edit-config" "rpc" ID 6 priority 0 succeeded.
Thanks,
Samba
From: Samba Siva Reddy
Sent: Thursday, May 23, 2024 3:21 PM
To: 'sysrepo/sysrepo' ***@***.***>; sysrepo/sysrepo ***@***.***>
Cc: Author ***@***.***>
Subject: RE: [sysrepo/sysrepo] question: can we parse and print edit-config or edit-data before pushing into the sysrepo database. (Issue #3281)
I am not able to delete the list inside container. Could you please check and let me is anything error in my xml file.
Getting the success message but in server showing the following message
[INF]: SR: No "running" datastore changes to apply.
[INF]: SR: EV LISTEN: "/ietf-netconf:edit-config" "rpc" ID 6 priority 0 success (remaining 0 subscribers).
[INF]: SR: EV ORIGIN: "/ietf-netconf:edit-config" "rpc" ID 6 priority 0 succeeded.
Here is the yang and xml file:
module TEJASFPTEMPLATE-MIB {
namespace "urn:TEJASFPTEMPLATE-MIB";
prefix "tejasfptemplate-mib";
import ietf-inet-types {
prefix "inet";
}
import ietf-yang-types {
prefix "yang";
}
typedef Fixed2 {
type int32;
description
"Represents a fixed decimal as an integer that is one
hundred times the float value.";
}
typedef String16 {
type binary {
length "16";
}
description
"Represents an Octet String consisting of 16 octets.";
}
container tejasFPTemplateTable {
list tejasFPTemplateEntry {
key "cI sI sN fPTemplateID";
description
"An entry in the FPTemplate Table.";
leaf cI {
type int32;
description
"Chassis Index";
}
leaf sI {
type int32;
description
"Slot Index";
}
leaf sN {
type int32;
description
"Parent SN";
}
leaf fPTemplateID {
type int32;
description
"The identifier for this FP template.";
}
leaf description {
type string;
description
"The name associated with this FP template.";
}
}
}
}
<tejasFPTemplateTable xmlns="urn:TEJASFPTEMPLATE-MIB" xc:operation="delete">
<tejasFPTemplateEntry >
<cI>100</cI>
<sI>40</sI>
<sN>50</sN>
<fPTemplateID>60</fPTemplateID>
<description>tejas</description>
</tejasFPTemplateEntry>
</tejasFPTemplateTable>
Thanks,
Samba
From: Michal Vasko ***@***.******@***.***>>
Sent: Monday, May 13, 2024 12:39 PM
To: sysrepo/sysrepo ***@***.******@***.***>>
Cc: Samba Siva Reddy ***@***.******@***.***>>; Author ***@***.******@***.***>>
Subject: Re: [sysrepo/sysrepo] question: can we parse and print edit-config or edit-data before pushing into the sysrepo database. (Issue #3281)
[CAUTION: This email originated from outside of Tejas. Do not click links or open attachments unless you recognize the sender and know the content is safe]
In the current SSH server YANG module<https://github.com/CESNET/libnetconf2/blob/master/modules/ietf-ssh-server%402023-12-28.yang#L232> a specific single authentication method must be configured for each user. Meaning you need to select only one method for a user but each user can have a different authentication method.
—
Reply to this email directly, view it on GitHub<#3281 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BFY5QECAHZWADO3M7PPBXADZCBRG7AVCNFSM6AAAAABG5XWNXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWHAYTANJYGM>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
You need to send a valid XML. The prefix is needed but it must also be defined. I am sorry but you really must know how XML works, look at a tutorial. |
Hi All,
I was tried with lock option to lock the running database. I was able to edit the running database even after the “lock” . is that expected behavior?
Lock –target running
Ok
Thanks,
Samba
From: Michal Vasko ***@***.***>
Sent: Thursday, May 23, 2024 3:36 PM
To: sysrepo/sysrepo ***@***.***>
Cc: Samba Siva Reddy ***@***.***>; Author ***@***.***>
Subject: Re: [sysrepo/sysrepo] question: can we parse and print edit-config or edit-data before pushing into the sysrepo database. (Issue #3281)
[CAUTION: This email originated from outside of Tejas. Do not click links or open attachments unless you recognize the sender and know the content is safe]
You need to send a valid XML. The prefix is needed but it must also be defined. I am sorry but you really must know how XML works, look at a tutorial<https://www.w3schools.com/xml/xml_namespaces.asp>.
—
Reply to this email directly, view it on GitHub<#3281 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BFY5QEB6EQIKEFUKOD5ONPTZDW5O3AVCNFSM6AAAAABG5XWNXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRWG4ZDAMJVG4>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Yes, that is expected and works as specified. Please learn all these basics before asking anything. |
Hi All,
Getting the following issue while executing the merge_config.sh script. It was working earlier.
I followed the following steps
./setup.sh
./merge_hostkey.sh
./merge_config.sh
[ERR] Invalid leafref value "genkey" - no target instance "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key/ks:name" with the same value. (Data location "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='default-ssh']/ssh/ssh-server-parameters/server-identity/host-key[name='default-key']/public-key/central-keystore-reference".)
[ERR] Validation failed.
sysrepocfg error: Failed to merge edit data (Validation failed)
I am not able to understand why this issue is coming.
Thanks
Samba
|
Me neither, this is exactly the executed sequence of scripts during the installation. And it works fine there so I am not able to help. |
Hi,
is it possible to write my validations check function ? if yes please let me know where can i write my own validate function for each module to validate without using the default or range values.
Thanks
Samba
The text was updated successfully, but these errors were encountered: