Complete these tasks to add a new LST XML file.
This example assumes you have exported the access token to the variable $TOKEN
.
- Retrieve the LST 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://10.0.0.2/rest/v1.1/configuration/lst/lstfile"
The response is saved to the file
response.xml
.
- Copy the content between the opening and closing <LSTFile> tags to a new file called
lst-file.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 '/<LSTFile>/,/<\/LSTFile>/p' response.xml | xmllint --format - > lst-file.xml
- Set the filename, realm, encryption, and secret parameters to their desired values.
The following shows an example of the contents of lst-file.xml
:
<?xml version="1.0"?>
<LSTFile>
<filename/>
<realm/>
<encryption/>
<secret/>
</LSTFile>
- Acquire the configuration lock.
curl -X POST \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://10.0.0.2/rest/v1.1/configuration/lock"
- Add the LST XML file to the ECB.
curl -X POST \
-d@lst-file.xml \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://10.0.0.2/rest/v1.1/configuration/lst/lstfile"
- Release the configuration lock.
curl -X POST \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://10.0.0.2/rest/v1.1/configuration/unlock"