Navigation
Table of Contents
Guide That Contains This Content
[+] Expand All
[-] Collapse All
Configuring Script Services (SRC CLI)
Before you configure a script service, make sure that you know the location of the script file that the service will reference.
Use the following configuration statements to configure a script service in the global service scope:
services global service name script {script-type (url | python | java-class | java-archive); class-name class-name; file file ; filename filename; }
Use the following configuration statements to configure a script service in a service scope:
services scope name service name script {script-type (url | python | java-class | java-archive); class-name class-name; file file ; filename filename; }
To configure a script service:
- Configure a normal service, but set the service type to script. See Adding a Normal Service (SRC CLI) .
- From configuration mode, enter the service script configuration.
In this sample procedure, the service called scriptService is configured
in the scope configuration. user@host# edit services scope script service scriptService script
- Configure the type of script that the script service uses. [edit services scope script service scriptService script]user@host# set script-type (url | python | java-class | java-archive)
- For Java class and Python script services, configure the
name of the class that implements the script service.[edit services scope script service scriptService script]user@host# set class-name class-name
- Script services of the url script type are written in
Java and provided as a Java archive (.jar) file. Configure the URL
that specifies the location of the .jar file
containing the script service implementation. For other script types,
you must load the script service implementation.[edit services scope script service scriptService script]user@host# set file file
- For Java class, and Java archive, and Python script services,
load the script service implementation by specifying the filename
of the local file containing the script service implementation. This
file is the uncompiled Python source code or the compiled result of
the Java script service (binary .class or .jar file). [edit services scope script service scriptService script]user@host# set filename filename
- (Optional) Verify your configuration.
[edit services scope script service scriptService script] user@host# show script-type url; class-name net.juniper.smgt.script.Service; file http://some-server/some-path/script-service.jar;