Script Management API

/api/space/script-management/scripts/{script-id}/view-associated-devices

The following operations are supported on this resource:

GET /api/space/script-management/scripts/{script-id}/view-associated-devices (v2)


This API finds all available devices associated with a script and returns a list of them.

Access Control

The following capabilities are required to access this API:
"ViewAssociatedDevicesCap"


Example Usage

GET /api/space/script-management/scripts/{script-id}/view-associated-devices


Parameters

NameTypeURI TypeDescriptionRequired
script-idintPathThe script ID used to get devices associated with the script Y

Content Types

  • Produces content types:
    application/vnd.net.juniper.space.script-management.view-associated-devices+xml;version=2
    application/vnd.net.juniper.space.script-management.view-associated-devices+json;version=2


  • Sample Output XML:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <script-device-associations size="2" uri="/api/space/script-management/scripts//163856/view-associated-devices">
       <script-device-association>
         <device href= "/api/space/device-management/devices/327690">
          <device-id>327690</device-id>
          <device-name>EX4200-20</device-name>
          <ip-address>192.168.27.20</ip-address>
         </device >
          <script-name>show-interfaces.slax</script-name>
          <deployed-version>1.0</deployed-version>
          <script-status>ENABLED</script-status>
       </script-device-association>
       <script-device-association>
         <device href= "/api/space/device-management/devices/327694">
          <device-id>327694</device-id>
          <device-name>EX4200-200</device-name>
          <ip-address>192.168.27.200</ip-address>
         </device >
          <script-name>show-interfaces.slax</script-name>
          <deployed-version>1.0</deployed-version>
          <script-status>ENABLED</script-status>
       </script-device-association>
    </script-device-associations>


  • Sample Output JSON:
    script-device-associations:
    {
    @size: 2
    @uri: /api/space/script-management/scripts/163856/view-associated-devices
    script-device-association:
    [
     {
     device:
     {
       @href: /api/space/device-management/devices/327690
       device-id:327690
       device-name:EX4200-20
       ip-address:192.168.27.20
       },
       script-name:show-interfaces.slax
       deployed-version:1.0
       script-status:ENABLED
       },
     device:
     {
       @href: /api/space/device-management/devices/327694
       device-id:327694
       device-name:EX4200-200
       ip-address:192.168.27.200
       },
       script-name:show-interfaces.slax
       deployed-version:1.0
       script-status:ENABLED
       }
    ]
    }



    For other non-deprecated versions of this API, refer to :
  • version 1