/api/space/script-management/scripts/{script-id}/contents

The following operation is supported on this resource:

  • GET - Get Script details and basic data by ID
GET /scripts/{script-id}/contentsVersion 1

This API finds and returns script details along with basic script data available on Junos Space.

Sample Usage

GET /scripts/{script-id}/contents


  • Parameters:
    NameTypeURI TypeDescriptionRequired
    script-idIntegerPathThe ID of the script to get from Junos Space Y
  • Sample Output XML:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <script uri="/api/space/script-management/scripts/1245800/contents">
          <id>1114117</id>
          <scriptName>cpu-usage-60.slax</scriptName>
          <category>sample</category>
          <domain-name>Global</domain-name>
          <domain-id>65537</domain-id>
          <type>TYPE_EVENT</type>
          <format>FORMAT_SLAX</format>
          <lastestRevision>1.1</lastestRevision>
          <comments>Script is imported for the first time</comments>
          <scriptSize>7520</scriptSize>
          <scriptContents>ns junos .....</scriptContents>
          <domain href= "/api/space/domain-management/domains/65537" />
          <collection href="/api/space/script-management/scripts/1114117/results"/>
          <contents href= "/api/space/script-management/scripts/1015808/contents" />
          <parameters href= "/api/space/script-management/scripts/1015808/parameters" />
          <view-associated-devices href= "/api/space/script-management/scripts/1015808/view-associated-devices" />
    </script>

  • Sample Output JSON:
    {
       "script": {
          "@uri": "/api/space/script-management/scripts/1245800/contents",
          "id": 1114117,
          "scriptName": "cpu-usage-60.slax",
          "category": "sample",
          "domain-name": "Global",
          "domain-id": 65537,
          "type": "TYPE_EVENT",
          "format": "FORMAT_SLAX",
          "lastestRevision": "1.1",
          "comments": "Script is imported for the first time",
          "scriptSize": 7520,
          "scriptContents": "ns junos ..... ",
          "collection": {
          "@href":"/api/space/script-management/scripts/1114117/results"
          },
          "domain": {
            "@href": "/api/space/domain-management/domains/65537"
          },
          "contents": {
            "@href": "/api/space/script-management/scripts/1015808/contents"
          },
          "parameters": {
            "@href": "/api/space/script-management/scripts/1015808/parameters"
          },
          "view-associated-devices": {
            "@href": "/api/space/script-management/scripts/1015808/view-associated-devices"
          }
      }
    }

  • Access Control

    The following capabilities are required to access this API: ViewScriptsCap