Update the Configuration on a Device
/rest/{versionId}/configuration/devices/{deviceId}/action
Request
- application/xml
- application/json
Response
- application/xml
- application/json
200 Response
object
-
action(optional):
string
-
errorMessage(optional):
string
-
isActivateConfigSuccess(optional):
string
-
isCreateSuccess(optional):
string
-
isDeviceFirmwareChangedFailure(optional):
string
-
isEraseCacheSuccess(optional):
string
-
isIntegrityCheckSuccess(optional):
string
-
isLockSuccess(optional):
string
-
isRestoreConfigSuccess(optional):
string
-
isSaveConfigSuccess(optional):
string
-
isUnlockSuccess(optional):
string
-
isValidationSuccess(optional):
string
-
status(optional):
string
-
taskId(optional):
string
-
validationErrorMessage(optional):
string
400 Response
401 Response
404 Response
Examples
Example of Accessing the API with cURL
The following example shows how to update the configuration on a device by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.
curl -X POST -b sessionid.txt \
-d@request.xml \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
"https://example.com:8443/rest/v1.3/configuration/devices/ID9/action"
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"?>
<deviceAction>
<type>SaveActivateConfig</type>
</deviceAction>
Example of Accessing the API with Python
The following example shows how to update the configuration on a device by submitting a POST request on the REST resource using Python. This example assumes the cookie
variable contains a valid authentication cookie. For an example of authenticating with Python, see Authenticate.
import requests
from lxml import etree
url = "https://example.com:8443/rest/v1.3/configuration/devices/ID9/action"
headers = { "Accept":"application/xml", "Content-Type":"application/xml", "Cookie":cookie }
data = etree.tostring(etree.parse("request.xml"))
resp = requests.post(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: Tue, 12 Sep 2017 20:38:30 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Content-Length: 742
Vary: Accept-Encoding
Content-Type: application/xml
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"?>
<saveActivateResult>
<action>SaveActivateConfig</action>
<isActivateConfigSuccess>SUCCESS</isActivateConfigSuccess>
<isCreateSuccess>SUCCESS</isCreateSuccess>
<isDeviceFirmwareChangedFailure>false</isDeviceFirmwareChangedFailure>
<isEraseCacheSuccess>Not Applicable</isEraseCacheSuccess>
<isIntegrityCheckSuccess>SUCCESS</isIntegrityCheckSuccess>
<isLockSuccess>SUCCESS</isLockSuccess>
<isRestoreConfigSuccess>Not Applicable</isRestoreConfigSuccess>
<isSaveConfigSuccess>SUCCESS</isSaveConfigSuccess>
<isUnlockSuccess>SUCCESS</isUnlockSuccess>
<isValidationSuccess>SUCCESS</isValidationSuccess>
<status>SUCCESS</status>
<taskId>admin-2017-09-12-20-38-30-897-10.196.0.194</taskId>
</saveActivateResult>