Update a single configuration element instance

put

https://{managementIp}/rest/{version}/configuration/configElements

Updates the specified configuration element instance in the system configuration. The client making the PUT request must already possess the configuration lock or the request fails. If the specified element instance is a singleton - meaning only one instance can exist in the system configuration - it must first have been created using POST. When editing any non-singleton element, the PUT request body must include the key attribute(s) that uniquely identify the instance being edited, as well as any attributes or sub-elements that are being changed. However, the client is free to send all of the element's attributes/sub-elements in the PUT request. Any attribute/sub-element in the request that is identical to the system configuration will be left unmodified in the system configuration. If one or more attributes/sub-elements in the request is syntactically invalid in any way, the PUT request fails and the system configuration is left unmodified.

Request

Path Parameters
Header Parameters
  • 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/token request.
Supported Media Types
Request Body ()
When updating a singleton element type, the request body must contain the element type and only those attributes/sub-elements that are being modified. When updating a non-singleton element type, the request body must contain the element type, the key attribute(s) to uniquely identify the instance being updated, and the attribute(s)/sub-element(s) that are being modified. In either case, however (singleton or non-), the client may provide the entire set of element attributes/sub-elements, and the system will only update those that are different from the current system configuration (assuming all supplied values are valid).
Root Schema : schema
Type: object
Show Source
Nested Schema : attribute
Type: array
Show Source
Nested Schema : subElement
Type: array
Show Source
Nested Schema : NameValuePair
Type: object
Show Source
Nested Schema : items
Type: object
Back to Top

Response

Supported Media Types

200 Response

Successful update of the requested instance. The complete configuration data (all supported attributes and sub-elements) are returned in the response body.
Body ()
Root Schema : response
Type: object
Show Source
Nested Schema : data
Type: object
Show Source
Nested Schema : messages
Type: object
Nested Schema : configElement
Type: object
Show Source
Nested Schema : attribute
Type: array
Show Source
Nested Schema : subElement
Type: array
Show Source
Nested Schema : NameValuePair
Type: object
Show Source
Nested Schema : items
Type: object

400 Response

The request is missing required information and cannot be processed, or one or more attribute or sub-element names or values supplied by the client is not valid, or the request is malformed and cannot be processed.
Body ()
Root Schema : response
Type: object
Show Source
Nested Schema : data
Type: object
Nested Schema : messages
Type: array
Show Source
Nested Schema : items
Type: object
Show Source

401 Response

Unauthorized - Request lacks valid authentication credentials.
Body ()
Root Schema : response
Type: object
Show Source
Nested Schema : data
Type: object
Nested Schema : messages
Type: array
Show Source
Nested Schema : items
Type: object
Show Source

403 Response

This request requires the client credentials to have administrator privileges.
Body ()
Root Schema : response
Type: object
Show Source
Nested Schema : data
Type: object
Nested Schema : messages
Type: array
Show Source
Nested Schema : items
Type: object
Show Source

404 Response

Unsupported versionId in URI, or requested element type not supported, or element instance specified by key attribute(s) not found.
Body ()
Root Schema : response
Type: object
Show Source
Nested Schema : data
Type: object
Nested Schema : messages
Type: array
Show Source
Nested Schema : items
Type: object
Show Source

423 Response

The request requires the configuration lock and failed because the client does not currently own the lock. If another client or user currently owns the configuration lock, the error message is "Resource locked by another user". If no client or user owns the configuration lock, the error message is "User does not have the lock".
Body ()
Root Schema : response
Type: object
Show Source
Nested Schema : data
Type: object
Nested Schema : messages
Type: array
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top

Examples

Example of Accessing the API with cURL

The following example shows how to update a single configuration element instance by submitting a PUT request on the REST resource using cURL. For more information about cURL, see Use cURL.

curl -X PUT \
    -d@request.xml \
    --header "Accept: application/xml" \
    --header "Authorization: Bearer $TOKEN" \
    "https://10.0.0.2/rest/v1.1/configuration/configElements"

The following shows an example of the contents of the request.xml file sent as the request body.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configElement>
  <elementType>access-control</elementType>
  <attribute>
    <name>realm-id</name>
    <value>core</value>
  </attribute>
  <attribute>
    <name>source-address</name>
    <value>10.4.4.0/24</value>
  </attribute>
  <attribute>
    <name>application-protocol</name>
    <value>SIP</value>
  </attribute>
  <attribute>
    <name>transport-protocol</name>
    <value>TCP</value>
  </attribute>
  <attribute>
    <name>access</name>
    <value>deny</value>
  </attribute>
</configElement>

Note:

This updates the access rule from 'permit' to 'deny'.

Example of Accessing the API with Python

The following example shows how to update a single configuration element instance by submitting a PUT request on the REST resource using Python. This example assumes you have a valid token stored in the token variable. For an example of authenticating with Python, see Authenticate.

import requests
from lxml import etree
headers = { "Accept":"application/xml", "Authorization":"Bearer " + token }
data = etree.tostring(etree.parse("request.xml"))
url  = "https://10.0.0.2//rest/v1.1/configuration/configElements"
resp = requests.put(url, headers=headers, data=data)

Example of the Response Headers

The following shows an example of the response headers.

HTTP/1.1 200 OK
Date: Mon, 14 Jan 2019 13:22:04 GMT
Cache-Control: no-cache
Content-Length: 2122
Content-Type: application/xml
Connection: keep-alive
Keep-Alive: timeout=60, max=99
Last-Modified: Mon, 14 Jan 2019 13:22:04 GMT
X-Appweb-Seq: 105

Example of the Response Body

The following example shows the contents of the response body in XML format.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
  <data>
    <configElement>
      <elementType>access-control</elementType>
      <attribute>
        <name>realm-id</name>
        <value>core</value>
      </attribute>
      <attribute>
        <name>description</name>
        <value/>
      </attribute>
      <attribute>
        <name>source-address</name>
        <value>10.4.4.0/24</value>
      </attribute>
      <attribute>
        <name>destination-address</name>
        <value>0.0.0.0</value>
      </attribute>
      <attribute>
        <name>application-protocol</name>
        <value>SIP</value>
      </attribute>
      <attribute>
        <name>transport-protocol</name>
        <value>TCP</value>
      </attribute>
      <attribute>
        <name>access</name>
        <value>deny</value>
      </attribute>
      ...
      <attribute>
        <name>last-modified-date</name>
        <value>2019-01-14 13:22:04</value>
      </attribute>
    </configElement>
  </data>
  <messages/>
  <links/>
</response>
Back to Top