Get Additional Element Metadata
post
/rest/{versionId}/configuration/device-configs/{deviceId}/element-types/element-metadata
Use this (POST) method to retrieve additional meta-data information about a targeted configuration element. OSDMC configuration support is model driven to allow a user to query any attribute supported by a release, and get additional information such as if it contains additional sub-element children, what are its inter-dependencies between other elements, and so on. A client can be configured to use this metadata for self-describing the characteristics of all elements supported by a given device release to develop an understanding of configuration element dependencies and the flow for which elements need to configured first, second, and so on.
Request
Path Parameters
Back to Top
Response
200 Response
Retrieved element metadata for device configuration with deviceId successfully.
400 Response
The user input is invalid.
401 Response
The user is unauthorized.
403 Response
The user doesn't have the required permission.
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.
Examples
Examples of Accessing the API
See Authenticate page to acquire a token.
The following example shows how to use curl to get Additional Element Metadata.
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/device-configs/<deviceId>/element-types/element-metadata"The following example shows how to use Python to get Additional Element Metadata.
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>/element-types/element-metadata"
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.
{
"elementTypePath": "dialingContext"
}
Example of the Response Body
The following example shows the contents of the response body.
{
"attributeMetadatas": [
{
"cliName": "outside-line-prefix",
"defaultValue": "",
"key": false,
"name": "outsideLinePrefix",
"required": false,
"valueType": "STRING"
},
{
"cliName": "parent",
"defaultValue": "",
"key": true,
"name": "parent",
"referredElementType": "dialingContext",
"referredValues": [
"test-dc-corp",
"corporate.test",
"test-dc-corp.child-corp",
"test-dc-corp.restapi",
"test-dc-corp.automationChildElement",
"test.restAutomation_Test"
],
"required": true,
"valueType": "REFERENCE_TO_ANOTHER_ELEMENT"
},
{
"cliName": "geographic-location",
"defaultValue": "",
"key": false,
"name": "geographicLocation",
"referredElementType": "dialingContext",
"referredValues": [
"test-dc-corp",
"corporate.test",
"test-dc-corp.child-corp",
"test-dc-corp.restapi",
"test-dc-corp.automationChildElement",
"test.restAutomation_Test"
],
"required": false,
"valueType": "REFERENCE_TO_ANOTHER_ELEMENT"
},
{
"cliName": "last-modified-date",
"defaultValue": "",
"key": false,
"name": "lastModifiedDate",
"required": false,
"valueType": "STRING"
},
{
"cliName": "data-version",
"defaultValue": "",
"key": false,
"name": "dataVersion",
"required": false,
"valueType": "STRING"
},
{
"cliName": "country-code",
"defaultValue": "",
"key": false,
"name": "countryCode",
"required": false,
"valueType": "STRING"
},
{
"cliName": "last-modified-by",
"defaultValue": "",
"key": false,
"name": "lastModifiedBy",
"required": false,
"valueType": "STRING"
},
{
"cliName": "name",
"defaultValue": "",
"key": true,
"name": "name",
"required": true,
"valueType": "STRING"
},
{
"cliName": "description",
"defaultValue": "",
"key": false,
"name": "description",
"required": false,
"valueType": "STRING"
}
],
"elementTypePath": "dialingContext",
"readOnly": false,
"singleInstance": false,
"subElements": [
{
"elementTypePath": "dialingContext/dialPattern",
"required": false
}
],
"type": "dialingContext"
}
Example 2 of Accessing this API
This example shows getting element metadata.
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/configuration/device-configs/<deviceId>/element-types/element-metadata"The following shows an example of the request body.
{
"elementTypePath": "policyConfig/nextHopCompareCondition"
}
The following shows an example response.
{
"attributeMetadatas": [
{
"cliName": "name",
"defaultValue": "",
"key": true,
"name": "name",
"required": true,
"valueType": "STRING"
},
{
"cliName": "next-hop-compare-mode",
"defaultValue": "previous-hop",
"enumeratedValues": [
"previous-hop",
"from-uri"
],
"key": false,
"name": "nextHopCompareMode",
"required": false,
"valueType": "ENUMERATED_VALUE"
}
],
"elementTypePath": "policyConfig/nextHopCompareCondition",
"readOnly": false,
"singleInstance": false,
"type": "nextHopCompareCondition"
}