Delete a Configuration Element
/rest/{versionId}/configuration/device-configs/{deviceId}/config-elements/delete
Request
Response
204 Response
400 Response
401 Response
403 Response
404 Response
409 Response
500 Response
Examples
Examples of Accessing the API
See Authenticate page to acquire a token.
The following example shows how to use curl to delete a configuration element.
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/device-configs/<deviceId>/config-elements/delete"The following example shows how to use Python to delete a configuration element.
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/device-configs/<deviceId>/config-elements/delete"
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.
{
"attributes": [
{
"name": "parent",
"value": "corporate"
},
{
"name": "name",
"value": "TestDialingContext"
}
],
"elementTypePath": "dialingContext"
}
Example of the Response Body
This endpoint does not return a response body.
Example 2 of Accessing this API
This example shows deleting the security-config element.
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/device-configs/<deviceId>/config-elements/delete"The following shows an example of the request body.
{
"elementTypePath": "securityConfig"
}
The following shows an example response.
Example 3 of Accessing this API
This example shows deleting the realm-config element whose id attribute is "realmTest".
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/device-configs/<deviceId>/config-elements/delete"The following shows an example of the request body.
{
"elementTypePath": "realmConfig",
"attributes": [
{
"name": "id",
"value": "realmTest"
}
]
}
The following shows an example response.
Example 4 of Accessing this API
This example shows deleting a network-interface element.
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/device-configs/<deviceId>/config-elements/delete"The following shows an example of the request body.
{
"attributes": [
{
"name": "name",
"value": "testNm"
},
{
"name": "ipAddress",
"value": "192.0.2.10"
},
{
"name": "secondUtilityAddress",
"value": "192.0.2.10"
},
{
"name": "utilityAddress",
"value": "192.0.2.10"
},
{
"name": "subPortId",
"value": 0
},
{
"name": "family",
"value": "4"
}
],
"elementTypePath": "networkInterface"
}
The following shows an example response.
Example 5 of Accessing this API
This example shows deleting a local-policy configuration element.
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/device-configs/<deviceId>/config-elements/delete"The following shows an example of the request body.
{
"elementTypePath": "localPolicy",
"childrenElements": [
{
"elementTypePath": "localPolicy/sourceRealm",
"attributes": [
{
"name": "name",
"value": "realmConfig4"
}
]
},
{
"elementTypePath": "localPolicy/from",
"attributes": [
{
"name": "addr",
"value": "192.0.2.10"
}
]
},
{
"elementTypePath": "localPolicy/to",
"attributes": [
{
"name": "addr",
"value": "192.0.2.10"
}
]
}
]
}
The following shows an example response.
Example 6 of Accessing this API
This example shows deleting the codec-policy/order-codecs sub-element from a codec-policy parent element.
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/device-configs/<deviceId>/config-elements/delete"The following shows an example of the request body.
{
"parentElement": {
"elementTypePath": "codecPolicy",
"attributes": [
{
"name": "name",
"value": "test"
}
]
},
"elementTypePath": "codecPolicy/order",
"attributes": [
{
"name": "name",
"value": "PCMU"
}
]
}
The following shows an example response.
Example 7 of Accessing this API
This example shows deleting a media-attributes element inside tos-setting inside media-policy element.
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/device-configs/<deviceId>/config-elements/delete"The following shows an example of the request body.
{
"parentElement": {
"elementTypePath": "mediaPolicy",
"attributes": [
{
"name": "name",
"value": "testMePolicy"
}
],
"childrenElements": [
{
"elementTypePath": "mediaPolicy/tosSetting",
"attributes": [
{
"name": "mediaType",
"value": "testSetting"
},
{
"name": "mediaSubType",
"value": "testSubTesting"
}
]
}
]
},
"elementTypePath": "mediaPolicy/tosSetting/mediaAttribute",
"attributes": [
{
"name": "value",
"value": "testMediaAttr2"
}
]
}
The following shows an example response.