Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
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:

    1. Configure a normal service, but set the service type to script. See Adding a Normal Service (SRC CLI) .
    2. 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
    3. 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)
    4. 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
    5. 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
    6. 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
    7. (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; 

    Modified: 2010-01-07