DeleteObject api call not working

I am trying to work with the object instances in genieACS. When following the documentation I found the following calls:

AddObject: API Reference — GenieACS Documentation 1.2.9 documentation
DeleteObject: API Reference — GenieACS Documentation 1.2.9 documentation

While the call for addObject works. The call for deleting that new object doesn’t. I don’t get a fault, it simply does not work.

The object I am trying to delete is “InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.3”

With the post body being:
{“name”: “deleteObject”, “objectName”: “InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.3”}

Any one have an idea what I might be doing wrong?

If you are on a development/testing instance of GenieACS, then go into the UI and create a new config entry for cwmp.debug = true (Admin → Config → New Config). Repeat your testing. What is shown in the logs? That will help to narrow down where the issue is.

Why are you managing object instances directly? I’ve found it much easier to use provision scripts to manage the number of instances needed. If you are trying to test out switching a CPE from routed to bridge mode, unless your CPE throws faults, I’ve found it easier to disable the wan ppp instance and enable the bridge mode instance.

Here is a short provision which will switch a CPE from routed to bridge mode.

const now = Date.now();

disableRoutedInterfaces();

//Ensure we have a WANIPConnection instances
addBridgedInterface(1, 1, 'Bridged-ATM');
addBridgedInterface(2, 2, 'Bridged-PTM', {
    NATEnabled: false
});

log('Rebooting, because the CPE is dumb');
declare('Reboot', null, {value: Date.now()});

return;

function disableRoutedInterfaces() {
    declare('InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.[ConnectionType:IP_Routed].Enable', {path: now, value: now}, {value: false});
}

function addBridgedInterface(wanDeviceInstance, connectionInstance, name, params) {
    let basePath = 'InternetGatewayDevice.WANDevice.' + wanDeviceInstance + '.WANConnectionDevice.' + connectionInstance + '.WANIPConnection';

    let defaults = {
        ConnectionType: 'IP_Bridged',
        Enable: true,
        Name: name
    };

    const vals = Object.assign({}, defaults, params);

    /*
     * Gets rid of all exising Bridged instances. If there are no actual changes at the end of this, then the instance
     * won't actually be deleted. This insures we don't have multiple IP_Bridged instances per
     * WANDevice/WANConnectionDevice.
     */
    declare(basePath + '.[ConnectionType:IP_Bridged]', null, {path: 0});

    log('Creating WANIPConnection instance ' + wanDeviceInstance + ' (if necessary)');

    const path = basePath + '.[' + Object.keys(vals).map((key) => { return key + ':' + vals[key]; }).join(',') + ']';
    log(`\r\n\r\nUpdating - ${path}`);

    declare(path, {value: now}, {path: 1}); //Ensures we have only 1 bridged connection
}

Thank you for the quick reply.

I will add the config, and I will take a look at the logs. I hope that will show why I can’t delete objects.
Instead of enabling/disabling I simply wanted to remove any unneeded instances. Seeing as it is described in the documentation I figured that it would work.