Update the Configuration on a Device

post

/rest/{versionId}/configuration/devices/{deviceId}/action

Use this (POST) method to push a device configuration stored on the OSDMC database to the device and ensure that it is properly activated and used as the running configuration for the device. Only SaveAndActivate action is supported.

Request

Path Parameters
Back to Top

Response

200 Response

Successful operation

400 Response

The user input is invalid.

401 Response

The user is unauthorized.

403 Response

The user does not have permission for the attempted action.

404 Response

The object (resource URI, device, and so on) of your input request cannot be found.

500 Response

An internal server error has occurred while processing the request.
Back to Top

Examples

Examples of Accessing the API

See Authenticate page to acquire a token.

The following example shows how to use curl to update the configuration on a device.

curl -X POST \
    -d @request.json \
    -H @auth_header.txt \
    "https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/devices/<deviceId>/action"

The following example shows how to use Python to update the configuration on a device.

import requests
import json
headers = {
	"Accept": "application/json",
	"Authorization": "Bearer <auth-token>"
}
with open("request.json") as f: data = json.load(f)
url  = "https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/devices/<deviceId>/action"
resp = requests.post(url, headers=headers, data=data)

Note:

Use the Get a List of Devices Associated with Config Manager API to find the deviceId parameter.

Example of the Request Body

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

{
  "type": "saveActivateConfig"
}

Example of the Response Body

The following example shows the contents of the response body.

{
  "action": "SaveActivateConfig",
  "isActivateConfigSuccess": "SUCCESS",
  "isCreateSuccess": "SUCCESS",
  "isDeviceFirmwareChangedFailure": "false",
  "isEraseCacheSuccess": "Not Applicable",
  "isIntegrityCheckSuccess": "SUCCESS",
  "isLockSuccess": "SUCCESS",
  "isRestoreConfigSuccess": "Not Applicable",
  "isSaveConfigSuccess": "SUCCESS",
  "isUnlockSuccess": "SUCCESS",
  "isValidationSuccess": "SUCCESS",
  "status": "SUCCESS",
  "taskId": "1"
}
Back to Top