edgexfoundry / device-onvif-camera

Owner: Device WG
Apache License 2.0
29 stars 37 forks source link

Bosch camera- Create Rules - Adding same rule if same create comamnd executes multiple times with same parameter. #35

Open surajitx-pal opened 2 years ago

surajitx-pal commented 2 years ago

Summary of the problem: 'Create Rules' API adding multiple times same rule.

Issue reproducible on below camera models:

Bosch DINION 6000HD

Reproduce steps:

Command to create rule

curl -X PUT http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/CreateRules \ --header 'Content-Type: application/json' \ --data-raw '

{
"CreateRules": {
    "ConfigurationToken": "1",
    "Rule": [
        {
            "Name": "Test1",
            "Type": "tt:ObjectInField",
            "Parameters": {
                "SimpleItem": [
                    {
                        "Name": "Armed",
                        "Value": "true"
                    }
                ]
            }
        }
    ]
}

}'

Then verify with GetRules command- curl -x GET GET http://localhost:59882/api/v2/device/name/Bosch-DINION-IP-starlight-6000-HD-00075fd8-7c31-317c-d85f-0700075fd85f/Rules

Actual result - Adding multiple times same rule. Executed - Should be create one for same rule.

vyshali-chitikeshi commented 1 year ago

Issue still exists with V3 code