Error "attr and val parameters are not proportionate" when updating attributes in DX NetOps Spectrum
search cancel

Error "attr and val parameters are not proportionate" when updating attributes in DX NetOps Spectrum

book

Article ID: 435332

calendar_today

Updated On:

Products

Network Observability Spectrum

Issue/Introduction

Error "attr and val parameters are not proportionate" when updating notes in DX NetOps Spectrum

Using curl commands to update Spectrum model attributes via REST.

We run the following command and see the following response from the CLI. In this instance we are trying to update the Notes attribute (attribute ID 0x11564).

[root@oneclick ~]# curl -k -H "Content-Type: application/xml" --header "Authorization: Basic <encrypted_string>" -X PUT https://oneclick:8443/spectrum/restful/model/0x1000076?attr=0x11564&val=NewValue
[1] 4731
[root@oneclick ~]# attr and val parameters are not proportionate
[1]+  Done                    curl -k -H "Content-Type: application/xml" --header "Authorization: Basic <encrypted_string>" -X PUT https://oneclick:8443/spectrum/restful/model/0x1000076?attr=0x11564

SYMPTOMS:

  • The REST API PUT command fails to execute

  • The device notes do not update in the web UI

  • The command line returns a background job ID followed by the error

CONTEXT: Executing a curl command to the Spectrum OneClick REST API to update a model attribute

IMPACT: Administrators cannot programmatically update device notes using the REST API

Environment

All supported Network Observability DX NetOps Spectrum releases

Cause

The URL is not enclosed in double quotes resulting in the curl command misinterpreting it causing the error.

The command line shell interprets the ampersand character in the unquoted URL as a background process operator, causing the URL to be read incorrectly․

Resolution

Ensure the URL in the command is enclosed in double quotes. When using double quotes we see the following successful command.

 

Step 1․ ENCLOSE THE URL IN DOUBLE QUOTES

Command: curl -k -H "Content-Type: application/xml" --header "Authorization: Basic [auth-token]" -X PUT "https://[hostname]:8443/spectrum/restful/model/[model-handle]?attr=0x11564&val=[value]"

EXPECTED: The shell correctly parses the entire URL string including the ampersand character

NOTE: Include the -k flag if the server uses a self-signed certificate

 

 

VERIFY SUCCESS:

  • The command returns a success response in XML format

  • The updated notes value appears correctly in the Spectrum OneClick web UI