netmod-wg / yang-next

Feature requests for future versions of YANG
6 stars 0 forks source link

Support media-type specific schema that can be used to model error-info and other mount-points #7

Open abierman opened 8 years ago

abierman commented 8 years ago

The element included in NETCONF and RESTCONF is very useful but there is no way to specify YANG schema to match expected data-model specific content.

The ietf-restconf module defines the restconf-media-type extension that uses groupings to define this sort of data so they do not appear to be data nodes.

Extensions and groupings cannot be augmented to this approach is limited.

This is related to YANG mount, but this is for defining protocol message content, not datastore content.

The YANG mechanism needs to specify what message and the root node for the schema data.

abierman commented 8 years ago

The following solution proposal could be done with an extension or real statement

 rpc do-something {
    input {   ... }
    output {   ... }
    error-info {
        leaf X { ... }
        container Y { ... }
    }
  }

The error conditions would have to be defined in the description-stmt

Possible machine-readable statement, like if-feature

  error-info {
      leaf X {
          if-error-tag  resource-denied;
          ...
      }
      container Y {
          if-error-tag invalid-value;
           ...
     }
 }
schoenw commented 6 years ago

I support YANG statements that allow to define error information for rpcs and actions. I consider the lack of it an omission bug.

mbj4668 commented 6 years ago

I also support a way to define possible errors in rpc and action.

lllyfeng commented 1 year ago

Furthermore, I suggest add error-info to must statement, if the must expression is broken, the error-info will be reported. Must xxxxx { error-app-tag xxx; error-message xxxxx; error-info { leaf X { ... } container Y { ... } } }

abierman commented 3 months ago

still strong support but server is not forced to return requested error-info. should not be mandatory like error-tag and error-app-tag

kwatsen commented 3 months ago

This is different than other modeling tools be cautious going into uncharted territory

BalazsLengyel commented 2 weeks ago

Strongly support

abierman commented 2 weeks ago

Common feature request: improve the ability for error customization and ability to specify error-info, not just error-tag and error-app-tag. Also requests for more places that error statements can be used.

There are several error handling related netconf-next issues 53, 36, 33, 31, 25