Creating the CoA Script Service with the SRC CLI

To create the script service:

  1. From configuration mode, enter the service configuration. In this sample procedure, the service is configured in the global service scope, and CoAservice is the name of the service.
    user@host# edit services global service CoAservice
  2. Configure the type of service.
    [edit services global service CoAservice]
    user@host# set type script
  3. (Optional) Specify whether the service is visible only to administrators who have permission to see secret information.
    [edit services global service CoAservice]
    user@host# set secret
  4. Configure URL as the type of script that the sample CoA script service uses.
    [edit services global service CoAservice]
    user@host# set script script-type url
  5. Configure net.juniper.smgt.sae.coa.CoaService as the name of the class that implements the script service.
    [edit services global service CoAservice]
    user@host# set script class-name net.juniper.smgt.sae.coa.CoaService
  6. Configure the URL of the script service or the path and filename of the service. Copy the /lib/coa.jar file used by the script service to a location that is accessible by a URL (such as an FTP or HTTP server). In this sample procedure, the coa.jar file was copied to the /opt/UMC/sae/var/run directory.
    [edit services global service CoAservice]
    user@host# set file file:///opt/UMC/sae/var/run/coa.jar
  7. (Optional) Verify your configuration.
    [edit services global service CoAservice]
    user@host# show 
    type script;
    status active;
    available;
    script { 
      script-type url;
      class-name net.juniper.smgt.sae.coa.CoaService;
      file file:///opt/UMC/sae/var/run/coa.jar;
    }
    
    

After you create the script service, you need to configure parameters for the script service. For more information about configuring script services and parameters, see Overview of SRC Script Services.