|
RFC7950:
7.15. The "action" Statement
The "action" statement is used to define an operation connected to a
specific container or list data node. It takes one argument, which
is an identifier, followed by a block of substatements that holds
detailed action information. The argument is the name of the action.
The "action" statement defines an action node in the schema tree.
Under the action node, a schema node with the name "input" and a
schema node with the name "output" are also defined. The nodes
"input" and "output" are defined in the module’s namespace.
An action MUST NOT be defined within an rpc, another action, or a
notification, i.e., an action node MUST NOT have an rpc, action, or a
notification node as one of its ancestors in the schema tree. For
example, this means that it is an error if a grouping that contains
an action somewhere in its node hierarchy is used in a notification
definition.
An action MUST NOT have any ancestor node that is a list node without
a "key" statement.
Since an action cannot be defined at the top level of a module or in
a "case" statement, it is an error if a grouping that contains an
action at the top of its node hierarchy is used at the top level of a
module or in a case definition.
The difference between an action and an rpc is that an action is tied
to a node in the datastore, whereas an rpc is not. When an action is
invoked, the node in the datastore is specified along with the name
of the action and the input parameters.
|