Related Documentation
- ACX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- EX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- M Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- MX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- PTX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- SRX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
invoke() Function (jcs Namespace)
Namespaces
SLAX Syntax
XSLT Syntax
Release Information
Function introduced in Junos OS Release 7.6.
Description
Invoke a remote procedure call (RPC) on the local device. The function is called with one argument, either a string containing a Junos XML API RPC, or a tree containing an RPC. The result contains the contents of the <rpc-reply> element, not including the <rpc-reply> tag. An RPC allows you to perform functions equivalent to Junos OS operational mode commands.
Parameters
rpc | — | String containing a Junos XML API RPC or a tree containing an RPC. |
Return Value
result | — | Results of the executed RPC, which include the contents of the <rpc-reply> element, but not the <rpc-reply> tag itself. By default, the results are in XML format equivalent to the output produced with the | display xml option in the CLI. |
Usage Examples
The following example tests to see if the interface argument is included on the command line when the script is executed. If the argument is provided, the output of the show interfaces terse operational mode command is narrowed to include only information about the specified interface.
<xsl:param name="interface"/>
<xsl:variable name="rpc">
<get-interface-information>
<terse/>
<xsl:if test="$interface">
<interface-name>
<xsl:value-of select="$interface"/>
</interface-name>
</xsl:if>
</get-interface-information>
</xsl:variable>
<xsl:variable name="out" select="jcs:invoke($rpc)"/>
In this example, the jcs:invoke() function calls the Junos XML API RPC get-software-information, and stores the unmodified output in the variable sw:
<xsl:variable name="sw" select="jcs:invoke('get-software-information')"/>Related Documentation
- ACX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- EX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- M Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- MX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- PTX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- SRX Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)
- T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
- execute() Function (jcs Namespace)
- hostname() Function (jcs Namespace)
- sleep() Function (jcs and slax Namespaces)