Access Configuration Management API with cURL
The following examples show how to add/update/delete a single configuration element by submitting a request on the REST resource using cURL.
To retrieve a single configuration element, submit a GET request:
curl --request GET 'https://CNSBCIP/config/<version>/<topic>/<configElement>/<configElementKey>'
Note:
ElementKey uniquely identifies the configuration element.Consider the following in the above URL.
CNSBCIP is the Cloud Native Session Border Controller service IP address or service FQDN or Console Core Ingress External IP.
<version> is the version of the REST API. The current version is v1.
<topic> is a path prefix in the resource path. Following are some of the examples.
- sd - Path prefix used for URLs that configure the Cloud Native Session Border Controller.
- license - Path prefix used for URLs that manage the license keys for the Cloud Native Session Border Controller.
- logging - Path prefix used for URLs that manage the Cloud Native Session Border Controller logs.
The resource path for managing active configurations and file management do not include the path prefix <topic>.
To add a new configuration element, submit a POST request:
curl --request POST 'https://CNSBCIP/config/<version>/<topic>/<configElement>' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ -d@request.json
The following shows an example of the contents of the request.json file sent as the request body.
{ "identifier": "core", "service-networks": [ "core-network1" ] }
The following shows an example of the contents of the response body in JSON format.
{
"identifier": "core",
"service-networks": [
"core-network1"
],
"mm-in-realm": false,
"mm-in-network": true,
"mm-same-ip": true,
"mm-in-system": true,
"bw-cac-non-mm": false,
"msm-release": false,
"qos-enable": false,
"max-bandwidth": 0,
"fallback-bandwidth": 0,
"max-priority-bandwidth": 0,
"rtcp-mux": false,
"srtp-msm-passthrough": false,
"access-control-trust-level": "none",
"invalid-signal-threshold": 0,
"maximum-signal-threshold": 0,
"untrusted-signal-threshold": 0,
"nat-trust-threshold": 0,
"max-endpoints-per-nat": 0,
"nat-invalid-message-threshold": 0,
"wait-time-for-invalid-register": 0,
"deny-period": 30,
"session-max-life-limit": 86400,
"symmetric-latching": "disabled",
"pai-strip": false,
"restricted-latching": "none",
"restriction-mask": 32,
"icmp-detect-multiplier": 0,
"icmp-advertisement-interval": 0,
"monthly-minutes": 0,
"accounting-enable": true,
"delay-media-update": false,
"refer-call-transfer": "disabled",
"hold-refer-reinvite": false,
"refer-notify-provisional": "none",
"dyn-refer-term": false,
"codec-manip-in-realm": false,
"codec-manip-in-network": true,
"xnq-state": "xnq-unknown",
"hairpin-id": 0,
"flow-time-limit": 86400,
"initial-guard-timer": 300,
"subsq-guard-timer": 300,
"tcp-flow-time-limit": 86400,
"tcp-initial-guard-timer": 300,
"tcp-subsq-guard-timer": 300,
"block-rtcp": false,
"hide-egress-media-update": false,
"pref-addr-type": "none",
"merge-early-dialogs": false,
"_elementKey": "core"
}
To update an existing configuration element, submit a PUT request:
curl --request PUT 'https://CNSBCIP/config/<version>/<topic>/<ConfigElement>/<ElementKey>' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ -d@request.json
The following shows an example of the contents of the request.json file sent as the request body.
{ "identifier": "core", "service-networks": [ "core-network1" ] }
Note:
This updates the service-networks from core-network1 to core-network2.The following shows an example of the contents of the response body in JSON format.
{
"identifier": "core",
"service-networks": [
"core-network2"
],
"mm-in-realm": false,
"mm-in-network": true,
"mm-same-ip": true,
"mm-in-system": true,
"bw-cac-non-mm": false,
"msm-release": false,
"qos-enable": false,
"max-bandwidth": 0,
"fallback-bandwidth": 0,
"max-priority-bandwidth": 0,
"rtcp-mux": false,
"srtp-msm-passthrough": false,
"access-control-trust-level": "none",
"invalid-signal-threshold": 0,
"maximum-signal-threshold": 0,
"untrusted-signal-threshold": 0,
"nat-trust-threshold": 0,
"max-endpoints-per-nat": 0,
"nat-invalid-message-threshold": 0,
"wait-time-for-invalid-register": 0,
"deny-period": 30,
"session-max-life-limit": 86400,
"symmetric-latching": "disabled",
"pai-strip": false,
"restricted-latching": "none",
"restriction-mask": 32,
"icmp-detect-multiplier": 0,
"icmp-advertisement-interval": 0,
"monthly-minutes": 0,
"accounting-enable": true,
"delay-media-update": false,
"refer-call-transfer": "disabled",
"hold-refer-reinvite": false,
"refer-notify-provisional": "none",
"dyn-refer-term": false,
"codec-manip-in-realm": false,
"codec-manip-in-network": true,
"xnq-state": "xnq-unknown",
"hairpin-id": 0,
"flow-time-limit": 86400,
"initial-guard-timer": 300,
"subsq-guard-timer": 300,
"tcp-flow-time-limit": 86400,
"tcp-initial-guard-timer": 300,
"tcp-subsq-guard-timer": 300,
"block-rtcp": false,
"hide-egress-media-update": false,
"pref-addr-type": "none",
"merge-early-dialogs": false,
"_elementKey": "core"
}
To delete a configuration element, submit a DELETE request:
curl --request DELETE 'https://CNSBCIP/config/<version>/<topic>/<ConfigElement>/<ElementKey>' \ --header 'Accept: application/json'
Upon successful deletion, the server responds with a 200 OK and there is no response for a successful delete.
After performing a POST,PUT and DELETE, submit request to the activate the configuration.
To activate a configuration, submit a POST request.
curl --request POST 'https://CNSBCIP/config/<version>/activate'
Upon successful activation, the server responds with the updated configuration in the JSON response body.