Configuration Management API

/api/space/configuration-management/change-requests

The following operations are supported on this resource:

  • GET - Gets all change requests
  • POST - Creates a change request for a device. (This is a synchronous request.)
  • POST - Creates multiple change requests for one or more devices. (This is a synchronous request.)
  • POST - Creates schedulable multiple change requests for one or more devices. (This is an asynchronous request.)

GET /api/space/configuration-management/change-requests (v1)


This API retrieves all change requests present in the system.

Access Control

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


Example Usage

GET /api/space/configuration-management/change-requests

Content Types

  • Produces content types:
    application/vnd.net.juniper.space.configuration-management.change-requests+xml;version=1
    application/vnd.net.juniper.space.configuration-management.change-requests+json;version=1


  • Sample Output XML:
    <change-requests size="1" uri="/api/space/configuration-management/change-requests">
       <change-request key="790" uri="/configuration-management/change-requests/790">
         <deviceId>8</deviceId>
         <name>ChangeRequestName_1</name>
         <description>testDesc_1</description>
       </change-request>
       <change-request key="791" uri="/configuration-management/change-requests/791">
         <deviceId>80</deviceId>
         <name>ChangeRequestName_2</name>
         <description>testDesc_2</description>
       </change-request>
    </change-requests>


  • Sample Output JSON:
    {
      "change-requests": {
        "@size": "1",
        "@uri": "/api/space/configuration-management/change-requests",
        "change-request": [
          {
            "@key": "790",
            "@uri": "/configuration-management/change-requests/790",
            "deviceId": "8",
            "name": "ChangeRequestName_1",
            "description" : "testDesc_1"
          },
          {
          "@key": "791",
          "@uri": "/configuration-management/change-requests/791",
          "deviceId": "80",
          "name": "ChangeRequestName_2",
          "description": "testDesc_2"
          }
        ]
      }
    }



POST /api/space/configuration-management/change-requests (v2)


This API creates a change request for a particular device based on input parameters. This API is a synchronous API.

Note: If the client does not provide an accept header, this synchronous API is called by default.

To execute this API asynchronously, you need an Accept header similar to the following:

  Accept application/vnd.net.juniper.space.job-managemnt.task+xml;version=1.

Access Control

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


Example Usage

POST /api/space/configuration-management/change-requests

Content Types

  • Consumes content types:
    application/vnd.net.juniper.space.configuration-management.change-request+xml;version=2;charset=UTF-8
    application/vnd.net.juniper.space.configuration-management.change-request+json;version=2;charset=UTF-8


  • Produces content types:
    application/vnd.net.juniper.space.configuration-management.change-request+xml;version=2;q=.02
    application/vnd.net.juniper.space.configuration-management.change-request+json;version=2;q=.02


  • Sample Input XML:
    <change-request>

    <name>TEST_NAME</name>
    <description>TEST_DESC</description>
    <xmlData>
    <![CDATA[
    <configuration>
      <system>
       <host-name>host-srx_100_updated</host-name>
      </system>
    </configuration>
    ]]>
    </xmlData>
    <device href="/api/space/device-management/devices/229377"/>
      <syncAfterPush>true</syncAfterPush>
      </change-request>


  • Sample Output XML:
    <change-request uri="/api/space/configuration-management/change-requests/223344">
    <name>TEST_NAME</name>
    <description>TEST_DESC</description>
    <xmlData>
    <![CDATA[
    <configuration>
      <system>
       <host-name>host-srx_100_updated</host-name>
      </system>
    </configuration>

    ]]>
    </xmlData>
    <device href="/api/space/device-management/devices/229377"/>
     <syncAfterPush>true</syncAfterPush>
    <result>
    Status: Success, ResultMessage: updateEditConfig Results
    lock Success. edit-config Success. commit Success. unlock Success.
    rpc-reply:
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    </result>
    </change-request>


  • Sample Input JSON:
    {
     "change-request":
      {
       "name":"TEST_NAME",
       "description":"TEST_DESC",
       "xmlData":"<configuration><system><host-name>host-srx_100_updated</host-name></system></configuration>",
       "device":
        {
         "@href":"/api/space/device-management/devices/229377"
        },
       "syncAfterPush":"true"
      } }


  • Sample Output JSON:
    {
    "change-request":
    {
    "@uri":"/api/space/configuration-management/change-requests/223344",
    "name":"TEST_NAME",
    "description":"TEST_DESC",
    "xmlData":"host-srx_100_updated",
    "device":{"@href":"/api/space/device-management/devices/229377"},
    "syncAfterPush":true,
    "result":"Status: Success, ResultMessage: updateEditConfig Results
    lock Success.edit-config Success.commit Success.unlock Success.
    rpc-reply:
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>"
    }
    }



    For the deprecated versions of this API, refer to :
  • version 1

POST /api/space/configuration-management/change-requests (v2)


This API can create multiple change requests for one or more devices based on input parameters. This is a synchronous API.

Note: If the client does not provide an accept header, this synchronous API is called by default.

Access Control

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


Example Usage

POST /api/space/configuration-management/change-requests

Content Types

  • Consumes content types:
    application/vnd.net.juniper.space.configuration-management.change-requests+xml;version=2;charset=UTF-8
    application/vnd.net.juniper.space.configuration-management.change-requests+json;version=2;charset=UTF-8


  • Produces content types:
    application/vnd.net.juniper.space.configuration-management.change-requests+xml;version=2;q=.02
    application/vnd.net.juniper.space.configuration-management.change-requests+json;version=2;q=.02


  • Sample Input XML:
    <change-requests>
    <change-request>
    <name>TEST_NAME</name>
    <description>TEST_DESC</description>
    <xmlData>
    <![CDATA[
    <configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>
    ]]>
    </xmlData>
    <device href="/api/space/device-management/devices/229377"/>
      <syncAfterPush>true</syncAfterPush>
      </change-request>
    <change-request>
    <name>TEST_NAME</name>
    <description>TEST_DESC</description>
    <xmlData>
    <![CDATA[
    <configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>
    ]]>
    </xmlData>
    <device href="/api/space/device-management/devices/229378"/>
      <syncAfterPush>true</syncAfterPush>
      </change-request>
      </change-requests>


  • Sample Output XML:
    <change-requests uri="/api/space/configuration-management/change-requests">
    <change-request href="/api/space/configuration-management/change-requests/950274">
    <name>TEST_NAME</name>
    <description>TEST_DESC</description>
    <xmlData>
    <configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>
    </xmlData>
    <device href="/api/space/device-management/devices/229377"/>
      <syncAfterPush>true</syncAfterPush>
    <result>
    <status>Success</status>
    <message>updateEditConfig Results lock Success. edit-config Success. commit Success. unlock Success.</message>
    <rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    </rpc-reply>
    </result>
      </change-request>
    <change-request href="/api/space/configuration-management/change-requests/950275">
    <name>TEST_NAME</name>
    <description>TEST_DESC</description>
    <xmlData>
    <configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>
    </xmlData>
    <device href="/api/space/device-management/devices/229378"/>
      <syncAfterPush>true</syncAfterPush>
    <result>
    <status>Success</status>
    <message>updateEditConfig Results lock Success. edit-config Success. commit Success. unlock Success.</message>
    <rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    </rpc-reply>
    </result>
      </change-request>
      </change-requests>


  • Sample Input JSON:
    {
     "change-requests":
    {
     "change-request":[
      {
       "name":"TEST_NAME",
       "description":"TEST_DESC",
       "xmlData":"<configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>",
       "device":
        {
         "@href":"/api/space/device-management/devices/229377"
        },
       "syncAfterPush":"true"
      },
      {
       "name":"TEST_NAME",
       "description":"TEST_DESC",
       "xmlData":"<configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>",
       "device":
        {
         "@href":"/api/space/device-management/devices/229378"
        },
       "syncAfterPush":"true"
      }
      ]
      } }


  • Sample Output JSON:
    {
     "change-requests":
    {
    "@uri": "/api/space/configuration-management/change-requests",
     "change-request":[
      {
    "@href": "/api/space/configuration-management/change-requests/950274",
       "name":"TEST_NAME",
       "description":"TEST_DESC",
       "xmlData":"<configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>",
       "device":
        {
         "@href":"/api/space/device-management/devices/229377"
        },
       "syncAfterPush":"true",
    "result":
    {
    "status": "Success",
    "message": updateEditConfig Results, lock Success.edit-config Success.commit Success.unlock Success.
    "rpc-reply":
    "<rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>"
    }
      },
      {
    "@href": "/api/space/configuration-management/change-requests/950275",
       "name":"TEST_NAME",
       "description":"TEST_DESC",
       "xmlData":"<configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>",
       "device":
        {
         "@href":"/api/space/device-management/devices/229377"
        },
       "syncAfterPush":"true",
    "result":
    {
    "status": "Success",
    "message": updateEditConfig Results, lock Success.edit-config Success.commit Success.unlock Success.
    "rpc-reply":
    "<rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>
    <rpc-reply><rpc-reply><ok xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/11.2R1/junos" /></rpc-reply></rpc-reply>"
    }
      }
      ]
      } }



POST /api/space/configuration-management/change-requests (v2)


This API can create schedulable multiple change requests for one or more devices based on input parameters. This is an asynchronous API.

Note: If the client does not provide an accept header, this synchronous API is called by default.

Access Control

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


Example Usage

Since this API makes an asynchronous method call, the user must specify a queue parameter with this API.

POST /api/space/configuration-management/change-requests?queue-url=<queue-url>&schedule-time=<schedule-time>

Note: It is assumed that the queue denoted by <queue-url> has, already, been created.



Parameters

NameTypeURI TypeDescriptionRequired
queue-urlURLQueryA fully qualified queue URL, where job progress notifications will be sent (See Asynchronous API Usage)Y
schedule-timecron-like-expressionQuerySchedule this API in the future, by specifying a cron-like-expression (See Job Scheduling)N

Content Types

  • Consumes content types:
    application/vnd.net.juniper.space.configuration-management.change-requests+xml;version=2;charset=UTF-8
    application/vnd.net.juniper.space.configuration-management.change-requests+json;version=2;charset=UTF-8


  • Produces content types:
    application/vnd.net.juniper.space.job-management.task+xml;version=1;q=.01
    application/vnd.net.juniper.space.job-management.task+json;version=1;q=.01


  • Sample Input XML:
    <change-requests>
    <change-request>
    <name>TEST_NAME</name>
    <description>TEST_DESC</description>
    <xmlData>
    <![CDATA[
    <configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>
    ]]>
    </xmlData>
    <device href="/api/space/device-management/devices/229377"/>
      <syncAfterPush>true</syncAfterPush>
      </change-request>
    <change-request>
    <name>TEST_NAME</name>
    <description>TEST_DESC</description>
    <xmlData>
    <![CDATA[
    <configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>
    ]]>
    </xmlData>
    <device href="/api/space/device-management/devices/229378"/>
      <syncAfterPush>true</syncAfterPush>
      </change-request>
      </change-requests>


  • Sample Output XML:
    <task href="/api/space/job-management/jobs/688132">
       <id>917507</id>
    </task>


  • Sample Input JSON:
    {
     "change-requests":
    {
     "change-request":[
      {
       "name":"TEST_NAME",
       "description":"TEST_DESC",
       "xmlData":"<configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>",
       "device":
        {
         "@href":"/api/space/device-management/devices/229377"
        },
       "syncAfterPush":"true"
      },
      {
       "name":"TEST_NAME",
       "description":"TEST_DESC",
       "xmlData":"<configuration><system><syslog><file><name>messages</name><contents><name>authorization</name><info/></contents></file></syslog></system></configuration>",
       "device":
        {
         "@href":"/api/space/device-management/devices/229378"
        },
       "syncAfterPush":"true"
      }
      ]
      } }


  • Sample Output JSON:
    {"task":{"@href":"/api/space/job-management/jobs/688132","id":917507}}