[Contents] [Prev] [Next] [Index] [Report an Error]

# Requesting Operational Information

To request information about the current status of a C Series Controller, a client application emits the specific tag element from the SRC XML API that returns the desired information. For example, the <get-interfaces> tag element corresponds to the show interfaces command, and the <get-system-info> tag element requests the same information as the show system information command.

For complete information about the operational request tag elements available in the current SRC software release, see the chapters in the SRC XML API Operational Reference that are titled “ Mapping Between Operational Tag Elements and CLI Commands” and “ Summary of Operational Request Tag Elements.”

The application encloses the request tag element in an <rpc> tag element. The syntax depends on whether the corresponding CLI command has any options:

`

    <rpc>
       <!- - If the command does not have options - ->
          <operational-request/>

       <!- - If the command has options - ->
          <operational-request>
            <!- - tag elements representing the options - ->
          </operational-request>
    </rpc>
    ]]>]]>

`

The NETCONF server encloses its response in a specific tag element that matches the request tag element, enclosed in an <rpc-reply> tag element.

`

    <rpc-reply xmlns="URN" xmlns:sdx="URL”>
        <operational-response xmlns="URL-for-DTD">
            <!- -  SRC  XML tag elements for the requested information - ->
        </operational-response>
    </rpc-reply>
    ]]>]]>

`

The opening tag for each operational response includes the xmlns attribute to define the XML namespace for the enclosed tag elements that do not have a prefix (such as sdx:) in their names. The namespace indicates which XML document type definition (DTD) defines the set of tag elements in the response. The SRC XML API defines separate DTDs for operational responses from different software components. For instance, the DTD for software component information is called SdxComponentList.dtd. The division into separate DTDs and XML namespaces means that a tag element with the same name can have distinct functions depending on which DTD it is defined in.

The namespace is a URL of the following form:

`

http://xml.juniper.net/sdx/category

`

where category specifies the DTD for the top-level tag.

For example, http://xml.juniper.net/sdx/sdx-component-list would be the namespace for the SdxComponentList DTD.

The SRC XML API Operational Reference includes the text of the SRC XML DTDs for operational responses.

## Parsing the <output> Tag Element

If the SRC XML API does not define a response tag element for the type of output requested by a client application, the NETCONF server encloses its response in an <output> tag element. The tag element’s contents are usually one or more lines of formatted ASCII output like that displayed by the CLI on the computer screen.

| Note: The content and formatting of data within an <output> tag element are subject to change, so client applications must not depend on them. Future versions of the SRC XML API will define specific response tag elements (instead of <output> tag elements) for more commands. Client applications that rely on the content of <output> tag elements will not be able to interpret the output from future versions of the SRC XML API.

[Contents] [Prev] [Next] [Index] [Report an Error]