Re: [controller-dev] [mdsal-dev] Cohort or Restconf- How to alter input data?

2017-05-23 Thread Robert Varga
On 23/05/17 16:50, Vishweshwar Hegde wrote:
> Thanks Robert for the information.
> 
> Please refer below scenario:
> public static final QName QNAME = QName.create(XYZ.QNAME, "abc").intern();
> public static final YangInstanceIdentifier.NodeIdentifier NODEID = new 
> YangInstanceIdentifier.NodeIdentifier(QNAME);
> 
> In our cohort flow for "abc" input value from NBI is "123"  cohort validation 
> should change to "999".
> 
> Any pointers for this scenario?

At Tom already mentioned, validation is dealing with immutable data and
cannot change it, as that would render any model-defined validation
useless (i.e. what if the new value does not conform to the model?).

The API is limited strictly to implementing semantic checks which are
not expressible in YANG.

Any transformation needs to happen elsewhere -- but details on where and
how depend very much on the use case and expectations of the complete
solution.

Regards,
Robert



signature.asc
Description: OpenPGP digital signature
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev


Re: [controller-dev] [mdsal-dev] Cohort or Restconf- How to alter input data?

2017-05-23 Thread Tom Pantelis
On Tue, May 23, 2017 at 10:50 AM, Vishweshwar Hegde 
wrote:

> Thanks Robert for the information.
>
> Please refer below scenario:
> public static final QName QNAME = QName.create(XYZ.QNAME, "abc").intern();
> public static final YangInstanceIdentifier.NodeIdentifier NODEID = new
> YangInstanceIdentifier.NodeIdentifier(QNAME);
>
> In our cohort flow for "abc" input value from NBI is "123"  cohort
> validation should change to "999".
>
> Any pointers for this scenario?
>

The cohort API is for validating input, not changing it.  Not sure I
understand the use case whereby user input should be automatically changed
by the system - I'd think you'd want to report an error and let the user
pass the correct input.

But if you really need to alter user inout data then you can do it via DTCL
although that's after the fact. Perhaps you could add your own layer on top
of restconf that does such validation and updating prior to sending to
restconf.


>
> Regards,
> -Vishwa
>
>
> -Original Message-
> From: Robert Varga [mailto:n...@hq.sk]
> Sent: Tuesday, May 23, 2017 7:03 PM
> To: Vishweshwar Hegde ;
> mdsal-...@lists.opendaylight.org; controller-dev@lists.opendaylight.org
> Subject: Re: [mdsal-dev] Cohort or Restconf- How to alter input data?
>
>
>
> On 23/05/17 12:44, Vishweshwar Hegde wrote:
> > Hello,
> >
> >
> >
> > Is there any way can we alter or put condition to change restconf
> > input data?
> >
> >
> >
> > We are using cohort to validate restconf input data.
> >
> >
> >
> > Problem with DTCL is to getting into internal looping.
> >
> >
> >
> > Please provide your suggestions or alternative options to solve this
> > problem.
> >
>
> Depends on the use case and requirements, but the place to implement this
> is definitely not in the data store itself.
>
> Bye,
> Robert
>
> ___
> controller-dev mailing list
> controller-dev@lists.opendaylight.org
> https://lists.opendaylight.org/mailman/listinfo/controller-dev
>
___
controller-dev mailing list
controller-dev@lists.opendaylight.org
https://lists.opendaylight.org/mailman/listinfo/controller-dev