Get a template instance for a configuration element or sub-element type
/rest/{version}/configuration/elementTypes/template
There are three ways to request a template:
- Top-level element and mandatory sub-elements only: if the query string only includes the elementType parameter, and the elementType value specifies a top-level configuration element, then the returned template includes all of that top-level element type's attributes plus any mandatory sub-elements - but no optional sub-elements.
 - Optional sub-element only: if the query string only includes the elementType parameter, and the elementType value is a path to a sub-element (for example, 
sip-manipulation/header-rules- a forward slash-delimited list of the top-level element type and sub-element type(s)), then the returned template includes only the requested sub-element, plus any of its own sub-elements which are mandatory. - Full template structure: if the query string includes the elementType parameter, whose value is a top-level element type, plus one or more instances of the subElement parameter, then the returned template includes all of the top-level element type's attributes, any mandatory sub-elements, and each optional sub-element named in a subElement parameter.
 
Request
- 
                    version(required): 
                    
                    REST API version string.
Available values: v1.2 
- 
                        elementType(required): 
                        
                        Specifies the configuration element type for which a template instance is requested. When requesting templates for top-level configuration element types (with or without optional sub-elements), the value for this query parameter is just the top-level configuration element type identifier (e.g., "phy-interface"). For optional sub-elements, the value is the hierarchical path to the desired sub-element, beginning with the top-level element itself (e.g., "network-interface/bfd-config/bfd-session").
 - 
                        subElement: 
                        
                        When requesting the full template structure for a top-level element type that has optional sub-elements, there should be one subElement parameter for each optional sub-element the client wants included in the returned template. The value for each subElement parameter is the hierarchical path to the desired sub-element, _not_ including the top-level element itself, which is named in the elementType parameter (e.g., "bfd-config/bfd-session", under network-interface). The subElement parameter is included only when requesting a template for a top-level element plus one or more of its optional sub-elements.
 
- 
                        Authorization(required): 
                        
                        The value in the Authorization header must be the string "
Bearer {access token}", where{access token}is a valid, unexpired token received in response to a prior/rest/{version}/auth/tokenrequest. 
Response
200 Response
400 Response
401 Response
404 Response
Examples
Examples of Accessing the API
See Authenticate for how to acquire a token.
The following example shows how to get a template instance for a configuration element or sub-element type using curl.
curl -X GET \
    --header "Accept: application/xml" \
    --header "Authorization: Bearer $TOKEN" \
    "https://${SBCIP}/rest/v1.1/configuration/elementTypes/template?elementType=access-control"The following example shows how to get a template instance for a configuration element or sub-element type using Python.
import requests
headers = { "Accept":"application/xml", "Authorization":"Bearer " + token }
url  = "https://" + sbcip + "/rest/v1.1/configuration/elementTypes/template?elementType=access-control"
resp = requests.get(url, headers=headers)Example of the Response Body
The following example shows the contents of the response body in XML.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
  <data>
    <configElement>
      <elementType>access-control</elementType>
      <attribute>
        <name>realm-id</name>
        <value/>
      </attribute>
      <attribute>
        <name>description</name>
        <value/>
      </attribute>
      <attribute>
        <name>source-address</name>
        <value>0.0.0.0</value>
      </attribute>
      ...
      <attribute>
        <name>untrust-cac-failure-threshold</name>
        <value>0</value>
      </attribute>
    </configElement>
  </data>
  <messages/>
  <links/>
</response>
                  Example 2 of Accessing API
This example shows retrieving a subelement using the 
syntax ?elementType=<element>/<subelement>.
                  
curl -H "Accept: application/xml" -H "Authorization: Bearer $TOKEN" \
    "https://${SBCIP}/rest/v1.1/configuration/elementTypes/template?elementType=system-config/collect"The following shows an example response.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
  <data>
    <configElement>
      <path>system-config/collect</path>
      <subElement>
        <subElementType>collect</subElementType>
        <attribute>
          <name>sample-interval</name>
          <value>5</value>
        </attribute>
        <attribute>
          <name>push-interval</name>
          <value>15</value>
        </attribute>
        <attribute>
          <name>boot-state</name>
          <value>disabled</value>
        </attribute>
        <attribute>
          <name>start-time</name>
          <value>now</value>
        </attribute>
        <attribute>
          <name>end-time</name>
          <value>never</value>
        </attribute>
        <attribute>
          <name>red-collect-state</name>
          <value>disabled</value>
        </attribute>
        <attribute>
          <name>red-max-trans</name>
          <value>1000</value>
        </attribute>
        <attribute>
          <name>red-sync-start-time</name>
          <value>5000</value>
        </attribute>
        <attribute>
          <name>red-sync-comp-time</name>
          <value>1000</value>
        </attribute>
        <attribute>
          <name>push-success-trap-state</name>
          <value>disabled</value>
        </attribute>
      </subElement>
    </configElement>
  </data>
  <messages/>
  <links/>
</response>
Example 3 of Accessing API
This example shows retrieving a subelement using the 
syntax ?elementType=<element>&subElement=<subelement>.
                  
curl -H "Accept: application/xml" -H "Authorization: Bearer $TOKEN" \
    "https://${SBCIP}/rest/v1.1/configuration/elementTypes/template?elementType=system-config&subElement=collect"The following shows an example response.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
  <data>
    <configElement>
      <elementType>system-config</elementType>
      <attribute>
        <name>hostname</name>
        <value/>
      </attribute>
      <attribute>
        <name>description</name>
        <value/>
      </attribute>
      <attribute>
        <name>location</name>
        <value/>
      </attribute>
      <attribute>
        <name>mib-system-contact</name>
        <value/>
      </attribute>
      <attribute>
        <name>mib-system-name</name>
        <value/>
      </attribute>
      <attribute>
        <name>mib-system-location</name>
        <value/>
      </attribute>
      <attribute>
        <name>acp-tls-profile</name>
        <value/>
      </attribute>
      <attribute>
        <name>snmp-enabled</name>
        <value>enabled</value>
      </attribute>
      <attribute>
        <name>enable-snmp-auth-traps</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>enable-snmp-syslog-notify</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>enable-snmp-monitor-traps</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>enable-snmp-tls-srtp-traps</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>enable-env-monitor-traps</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>enable-mblk_tracking</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>enable-l2-miss-report</name>
        <value>enabled</value>
      </attribute>
      <attribute>
        <name>snmp-syslog-his-table-length</name>
        <value>1</value>
      </attribute>
      <attribute>
        <name>snmp-syslog-level</name>
        <value>WARNING</value>
      </attribute>
      <attribute>
        <name>system-log-level</name>
        <value>WARNING</value>
      </attribute>
      <attribute>
        <name>process-log-level</name>
        <value>NOTICE</value>
      </attribute>
      <attribute>
        <name>process-log-ip-address</name>
        <value>0.0.0.0</value>
      </attribute>
      <attribute>
        <name>process-log-port</name>
        <value>0</value>
      </attribute>
      <subElement>
        <subElementType>collect</subElementType>
        <attribute>
          <name>sample-interval</name>
          <value>5</value>
        </attribute>
        <attribute>
          <name>push-interval</name>
          <value>15</value>
        </attribute>
        <attribute>
          <name>boot-state</name>
          <value>disabled</value>
        </attribute>
        <attribute>
          <name>start-time</name>
          <value>now</value>
        </attribute>
        <attribute>
          <name>end-time</name>
          <value>never</value>
        </attribute>
        <attribute>
          <name>red-collect-state</name>
          <value>disabled</value>
        </attribute>
        <attribute>
          <name>red-max-trans</name>
          <value>1000</value>
        </attribute>
        <attribute>
          <name>red-sync-start-time</name>
          <value>5000</value>
        </attribute>
        <attribute>
          <name>red-sync-comp-time</name>
          <value>1000</value>
        </attribute>
        <attribute>
          <name>push-success-trap-state</name>
          <value>disabled</value>
        </attribute>
      </subElement>
      <attribute>
        <name>call-trace</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>internal-trace</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>log-filter</name>
        <value>all</value>
      </attribute>
      <attribute>
        <name>default-gateway</name>
        <value>0.0.0.0</value>
      </attribute>
      <attribute>
        <name>restart</name>
        <value>enabled</value>
      </attribute>
      <attribute>
        <name>exceptions</name>
        <value/>
      </attribute>
      <attribute>
        <name>telnet-timeout</name>
        <value>0</value>
      </attribute>
      <attribute>
        <name>console-timeout</name>
        <value>0</value>
      </attribute>
      <attribute>
        <name>http-timeout</name>
        <value>5</value>
      </attribute>
      <attribute>
        <name>reserved-nsep-session-capacity</name>
        <value>0</value>
      </attribute>
      <attribute>
        <name>remote-control</name>
        <value>enabled</value>
      </attribute>
      <attribute>
        <name>cli-audit-trail</name>
        <value>enabled</value>
      </attribute>
      <attribute>
        <name>source-routing</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>cli-more</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>terminal-height</name>
        <value>24</value>
      </attribute>
      <attribute>
        <name>debug-timeout</name>
        <value>0</value>
      </attribute>
      <attribute>
        <name>trap-event-lifetime</name>
        <value>0</value>
      </attribute>
      <attribute>
        <name>ids-syslog-facility</name>
        <value>-1</value>
      </attribute>
      <attribute>
        <name>ecc-chk-pkt</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>pko-rake-pkt</name>
        <value>0</value>
      </attribute>
      <attribute>
        <name>pko-rake-burst</name>
        <value>0</value>
      </attribute>
      <attribute>
        <name>options</name>
        <value/>
      </attribute>
      <attribute>
        <name>default-v6-gateway</name>
        <value>::</value>
      </attribute>
      <attribute>
        <name>ipv6-signaling-mtu</name>
        <value>1500</value>
      </attribute>
      <attribute>
        <name>ipv4-signaling-mtu</name>
        <value>1500</value>
      </attribute>
      <attribute>
        <name>cleanup-time-of-day</name>
        <value>00:00</value>
      </attribute>
      <attribute>
        <name>snmp-engine-id-suffix</name>
        <value/>
      </attribute>
      <attribute>
        <name>snmp-agent-mode</name>
        <value>v3</value>
      </attribute>
      <attribute>
        <name>snmp-rate-limit</name>
        <value>0</value>
      </attribute>
      <attribute>
        <name>forwarding-cores</name>
        <value>1</value>
      </attribute>
      <attribute>
        <name>dos-cores</name>
        <value>0</value>
      </attribute>
      <attribute>
        <name>transcoding-cores</name>
        <value>0</value>
      </attribute>
      <attribute>
        <name>use-sibling-core-datapath</name>
        <value>disabled</value>
      </attribute>
      <attribute>
        <name>httpclient-max-total-conn</name>
        <value>500</value>
      </attribute>
      <attribute>
        <name>httpclient-max-cpu-load</name>
        <value>70</value>
      </attribute>
    </configElement>
  </data>
  <messages/>
  <links/>
</response>