Hello,
i am trying to create an new interfaces on a device. The data-model is tr-181, so we have interfaces + ip-adresses that belong to the interface.
The data looks like this
Device.IP.Interface.1.Alias = customer
Device.IP.Interface.1.Enable = true
Device.IP.Interface.1.IPv4Address.1.IPAddress = some-ip
Device.IP.Interface.1.IPv4Address.2.IPAddress = another-ip
plus more attributes
I read the docs here
// Ensure that *all* other instances are deleted
declare("InternetGatewayDevice.X_BROADCOM_COM_IPAddrAccCtrl.X_BROADCOM_COM_IPAddrAccCtrlListCfg.[]", null, {path: 0});
// Add the two entries we care about
declare("InternetGatewayDevice.X_BROADCOM_COM_IPAddrAccCtrl.X_BROADCOM_COM_IPAddrAccCtrlListCfg.[SourceIPAddress:192.168.1.0,SourceNetMask:255.255.255.0]", {path: now}, {path: 1});
declare("InternetGatewayDevice.X_BROADCOM_COM_IPAddrAccCtrl.X_BROADCOM_COM_IPAddrAccCtrlListCfg.[SourceIPAddress:172.16.12.0,SourceNetMask:255.255.0.0]", {path: now}, {path: 1});
looked at some ideas from @akcoder here
And for a very basic test i did the following
let values = {
Enable: true,
Alias: "customer",
LowerLayers: "Device.Ethernet.Link.3"
};
let basePath = "Device.IP.Interface";
const path = basePath + '.[' + Object.keys(values).map(key => key + ':' + values[key]).join(',') + ']';
log(path);
declare(path, {path: 1}, {path: 1});
The provision executes, but fails
2021-11-30T11:26:20.752Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: Script: Device.IP.Interface.[Enable:true,Alias:customer,LowerLayers:Device.Ethernet.Link.3]
2021-11-30T11:26:20.754Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0100" acsRequestName="GetParameterNames"
2021-11-30T11:26:20.810Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0101" acsRequestName="AddObject"
2021-11-30T11:26:20.904Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0102" acsRequestName="GetParameterValues"
2021-11-30T11:26:21.088Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0103" acsRequestName="SetParameterValues"
2021-11-30T11:26:21.179Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0104" acsRequestName="GetParameterNames"
2021-11-30T11:26:21.232Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0105" acsRequestName="AddObject"
2021-11-30T11:26:21.325Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0106" acsRequestName="GetParameterValues"
2021-11-30T11:26:21.468Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0107" acsRequestName="SetParameterValues"
2021-11-30T11:26:21.566Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0108" acsRequestName="GetParameterNames"
2021-11-30T11:26:21.628Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0109" acsRequestName="AddObject"
2021-11-30T11:26:21.723Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f010a" acsRequestName="GetParameterValues"
2021-11-30T11:26:21.867Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f010b" acsRequestName="SetParameterValues"
2021-11-30T11:26:21.956Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f010c" acsRequestName="GetParameterNames"
2021-11-30T11:26:22.007Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f010d" acsRequestName="AddObject"
2021-11-30T11:26:22.098Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f010e" acsRequestName="GetParameterValues"
2021-11-30T11:26:22.252Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f010f" acsRequestName="SetParameterValues"
2021-11-30T11:26:22.342Z [INFO] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: ACS request; acsRequestId="17d70987a3f0110" acsRequestName="GetParameterNames"
that goes on a while and finally fails
2021-11-30T11:26:26.488Z [WARN] ::ffff:172.25.0.206 000F94-Panther-Y%2E0520360024: Channel has faulted; channel="default" retries=0 faultCode="too_many_commits" faultMessage="Too many commit iterations"
Here is the cwmp request
<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cwmp="urn:dslforum-org:cwmp-1-2"><soap-env:Header><cwmp:ID
soap-env:mustUnderstand="1">17d70987a3f0101</cwmp:ID></soap-env:Header><soap-env:Body><cwmp:AddObject><ObjectName>Device.IP.Interface.</ObjectName><ParameterKey></ParameterKey></cwmp:AddObject></soap-env:Body></soap-env:Envelope>
And the response
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap_env:Envelope
xmlns:soap_env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soap_enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cwmp="urn:dslforum-org:cwmp-1-2">
<soap_env:Header>
<cwmp:ID soap_env:mustUnderstand="1">17d70987a3f0101</cwmp:ID>
</soap_env:Header>
<soap_env:Body>
<cwmp:AddObjectResponse>
<InstanceNumber>3</InstanceNumber>
<Status>1</Status>
</cwmp:AddObjectResponse>
</soap_env:Body>
</soap_env:Envelope>
GenieACS goes on and tries to set the parameters
<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cwmp="urn:dslforum-org:cwmp-1-2"><soap-env:Header><cwmp:ID
soap-env:mustUnderstand="1">17d70987a3f0103</cwmp:ID></soap-env:Header><soap-env:Body><cwmp:SetParameterValues><ParameterList
soap-enc:arrayType="cwmp:ParameterValueStruct[3]"><ParameterValueStruct><Name>Device.IP.Interface.3.Alias</Name><Value
xsi:type="xsd:string">customer</Value></ParameterValueStruct><ParameterValueStruct><Name>Device.IP.Interface.3.Enable</Name><Value
xsi:type="xsd:boolean">true</Value></ParameterValueStruct><ParameterValueStruct><Name>Device.IP.Interface.3.LowerLayers</Name><Value
xsi:type="xsd:string">Device.Ethernet.Link.3</Value></ParameterValueStruct></ParameterList><ParameterKey></ParameterKey></cwmp:SetParameterValues></soap-env:Body></soap-env:Envelope>
The response is 1 - which means the device does somethin internally before contacting GenieACS again
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap_env:Envelope
xmlns:soap_env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soap_enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cwmp="urn:dslforum-org:cwmp-1-2">
<soap_env:Header>
<cwmp:ID soap_env:mustUnderstand="1">17d70987a3f0103</cwmp:ID>
</soap_env:Header>
<soap_env:Body>
<cwmp:SetParameterValuesResponse>
<Status>1</Status>
</cwmp:SetParameterValuesResponse>
</soap_env:Body>
</soap_env:Envelope>
We then have a GetParameterNames
<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cwmp="urn:dslforum-org:cwmp-1-2"><soap-env:Header><cwmp:ID
soap-env:mustUnderstand="1">17d70987a3f0104</cwmp:ID></soap-env:Header><soap-env:Body><cwmp:GetParameterNames><ParameterPath>Device.IP.Interface.</ParameterPath><NextLevel>1</NextLevel></cwmp:GetParameterNames></soap-env:Body></soap-env:Envelope>
With a reply
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap_env:Envelope
xmlns:soap_env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soap_enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cwmp="urn:dslforum-org:cwmp-1-2">
<soap_env:Header>
<cwmp:ID soap_env:mustUnderstand="1">17d70987a3f0104</cwmp:ID>
</soap_env:Header>
<soap_env:Body>
<cwmp:GetParameterNamesResponse>
<ParameterList xsi:type="soap_enc:Array"
soap_enc:arrayType="cwmp:ParameterInfoStruct[1]">
<ParameterInfoStruct>
<Name>Device.IP.Interface.2.</Name>
<Writable>1</Writable>
</ParameterInfoStruct>
</ParameterList>
</cwmp:GetParameterNamesResponse>
</soap_env:Body>
</soap_env:Envelope>
And then it starts all over
We are just starting with CWMP - any help/advice will be appreciated