Complete these tasks to set the hostname of the Session Border Controller (SBC).
This example assumes you have exported the access token to the variable $TOKEN
.
- Retrieve the system-config template.
The template of a configuration element is a data structure containing all
required sub-elements and supported attributes with their default values,
along with any specified optional sub-elements.
curl -X GET -o response.xml \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.1/configuration/elementTypes/template?elementType=system-config"
The response is saved to the file response.xml
.
- Copy the content between the opening and closing <configElement> tags to a new file
called
system-config.xml
.
If you are on a Linux system with xmllint
installed, you may optionally
format the XML before writing it to the file system.
sed -n '/<configElement>/,/<\/configElement>/p' response.xml | xmllint --format - > system-config.xml
- Open the file and set the value of the hostname attribute to its desired value.
For example, if the hostname is example-sbc
:
<?xml version="1.0"?>
<configElement>
<elementType>system-config</elementType>
<attribute>
<name>hostname</name>
<value>example-sbc</value>
</attribute>
...
</configElement>
- Acquire the configuration lock.
curl -X POST \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.1/configuration/lock"
- Add the system-config configuration element.
curl -X POST \
-d@system-config.xml \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.1/configuration/configElements"
- If done editing the configuration, save, verify, and activate the configuration.
- Release the configuration lock.
curl -X POST \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.1/configuration/unlock"