Calix Community  
 
Reply
Senior Member
Posts: 14
Registered: ‎12-30-2015
0
Accepted Solution

API Consumer Connect - TR069

Hello,

 

I'm trying to set paramaters by TR-069 through Consumer Connect Plus Api.

 

I have no problem getting they, but not setting. I get error always.

 

*** Example getting -> Operation: GetParameterValues

 

curl -k -X POST --header "Content-Type: application/json" -u "api-user-XXXX:XXXXXX" https://gcs.calix.com:8444/api/device-op --data '{"operation": "GetParameterValues","cpeIdentifier": {"serialNumber": "CXNK0021AC0B"},"parameterNames": ["InternetGatewayDevice.LANDevice.1.WLANConfiguration.1."]}'                                            
{
  "InternetGatewayDevice" : {
    "LANDevice" : {
      "1" : {
        "WLANConfiguration" : {
          "1" : {
            "Enable" : "true",
            "Status" : "Up",
            "BSSID" : "EC:4F:82:22:25:CB",
            "MaxBitRate" : "Auto",
            "Channel" : "11",
            "AutoChannelEnable" : "false",
            "SSID" : "TVAlmansa2",
            "BeaconType" : "WPAand11i",
            "MACAddressControlEnabled" : "false",
            "Standard" : "bgn",
            "WEPKeyIndex" : "1",
            "X_000631_KeyPassphrase" : "",
            "WEPEncryptionLevel" : "",
            "BasicEncryptionModes" : "None",
            "BasicAuthenticationMode" : "None",
            "WPAEncryptionModes" : "AESEncryption",
            "WPAAuthenticationMode" : "PSKAuthentication",
            "IEEE11iEncryptionModes" : "AESEncryption",
            "IEEE11iAuthenticationMode" : "PSKAuthentication",
            "PossibleChannels" : "1,2,3,4,5,6,7,8,9,10,11",
            "BasicDataTransmitRates" : "",
            "SSIDAdvertisementEnabled" : "true",
            "RadioEnabled" : "true",
            "TransmitPowerSupported" : "",
            "TransmitPower" : "100",
            "RegulatoryDomain" : "US",
            "WMMEnable" : "true",
            "UAPSDEnable" : "false",
            "TotalBytesSent" : "2527450721",
            "TotalBytesReceived" : "2973664057",
            "TotalPacketsSent" : "13055692",
            "TotalPacketsReceived" : "6666721",
            "X_000631_Radio" : "InternetGatewayDevice.X_000631_Device.WiFi.Radio.1.",
            "X_000631_Usage" : "Primary",
            "X_000631_OperatingFrequencyBand" : "2.4GHz",
            "X_000631_OperatingChannelBandwidth" : "20MHz",
            "X_000631_AllowedMACAddresses" : "",
            "X_000631_DeniedMACAddresses" : "",
            "X_000631_SupportedStandards" : "",
            "X_000631_SupportedFrequencyBands" : "",
            "X_000631_EnableDfsChannels" : "true",
            "X_000631_ChannelUtilization" : "0",
            "X_000631_ChannelInterferenceTime" : "3",
            "X_000631_ChannelFreeTime" : "97",
            "X_000631_AirtimeFairness" : "true",
            "X_000631_FrameBurst" : "true",
            "X_000631_MulticastForwardEnable" : "true",
            "X_000631_IntraSsidIsolation" : "false",
            "X_000631_L2_Bridge_Enable" : "false",
            "X_000631_SubnetEnable" : "false",
            "X_000631_SubnetMinAddr" : "",
            "X_000631_SubnetMaxAddr" : "",
            "X_000631_SubnetMask" : "",
            "X_000631_SubnetGatewayAddr" : "",
            "X_000631_SubnetHostsRef" : "",
            "X_000631_IGMPStats" : {
              "V1ReportsReceived" : "0",
              "V2ReportsReceived" : "91",
              "V3ReportsReceived" : "7750",
              "V2LeavesReceived" : "0"
            },
            "WEPKey" : {
              "1" : {
                "WEPKey" : "",
                "X_000631_WEPKey" : "0987654321"
              },
              "2" : {
                "WEPKey" : "",
                "X_000631_WEPKey" : "0987654321"
              },
              "3" : {
                "WEPKey" : "",
                "X_000631_WEPKey" : "0987654321"
              },
              "4" : {
                "WEPKey" : "",
                "X_000631_WEPKey" : "0987654321"
              }
            },
            "PreSharedKey" : {
              "1" : {
                "PreSharedKey" : "",
                "X_000631_PreSharedKey" : "",
                "KeyPassphrase" : "",
                "X_000631_KeyPassphrase" : "",
                "AssociatedDeviceMACAddress" : ""
              }
            },
            "Stats" : {
              "ErrorsSent" : "2866",
              "ErrorsReceived" : "0",
              "UnicastPacketsSent" : "9868896",
              "UnicastPacketsReceived" : "6559257",
              "DiscardPacketsSent" : "0",
              "DiscardPacketsReceived" : "4",
              "MulticastPacketsSent" : "2827923",
              "MulticastPacketsReceived" : "37029",
              "BroadcastPacketsSent" : "358873",
              "BroadcastPacketsReceived" : "70435",
              "UnknownProtoPacketsReceived" : "0",
              "BytesSent" : "2527450721",
              "BytesReceived" : "2973664057"
            },
            "WPS" : {
              "Enable" : "true",
              "ConfigMethodsSupported" : "",
              "ConfigMethodsEnabled" : "PushButton",
              "X_000631_PushButton" : "false"
            }
          }
        }
      }
    }
  }
}

 

 

*** Examples setting -> Operation: SetParameterValues

 

curl -k -X POST --header "Content-Type: application/json" -u "api-user-xxxxx:xxxxxxxxx" https://gcs.calix.com:8444/api/device-op --data '{"operation": "SetParameterValues","cpeIdentifier": {"serialNumber": "CXNK0021AC0B"},"parameterNames": ["InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.WPS.Enable":"false"]}'

{ "error" : "Invalid JSON Payload!" }
curl -k -X POST --header "Content-Type: application/json" -u "api-user-xxxxx:xxxxxxxx" https://gcs.calix.com:8444/api/device-op --data '{"operation":"SetParameterValues","cpeIdentifier":{"serialNumber":"CXNK0021AC0B"},"InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.WPS.Enable":["false"]}'

{
  "error" : "Invalid Device Op! Caught exception Unknown Field InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.WPS.Enable!"
}
curl -k -X POST --header "Content-Type: application/json" -u "api-user-xxxx:xxxxxxxxxxxxxx" https://gcs.calix.com:8444/api/device-op --data '{"operation": "SetParameterValues","cpeIdentifier": {"serialNumber": "CXNK0021AC0B"},"parameterNames": {"InternetGatewayDevice":{"LANDevice":{"1":{"WPS":{"Enable":"false"}}}}}}'       
{
  "error" : "Invalid Device Op! Caught exception Field Type Mismatch! Filed name: \"parameterNames\": expect JsonArray, actual type is JsonObject!"
}
curl -k -X POST --header "Content-Type: application/json" -u "api-user-xxxx:xxxxxxxxxxxxxxxx" https://gcs.calix.com:8444/api/device-op --data '{"operation":"SetParameterValues","cpeIdentifier":{"serialNumber":"CXNK0021AC0B"},["InternetGatewayDevice":["LANDevice":["1":["WLANConfiguration":["1":["WPS":["Enable":"false"]]]]]]]}'
{
  "error" : "Invalid JSON Payload!"
}
curl -k -X POST --header "Content-Type: application/json" -u "api-user-xxxxxx:xxxxxxxxxx" https://gcs.calix.com:8444/api/device-op --data '{"operation": "SetParameterValues","cpeIdentifier": {"serialNumber": "CXNK0021AC0B"},"parameterNames": ["InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.WPS.Enable":{"false"}]}'
{
  "error" : "Invalid JSON Payload!"
}
curl -k -X POST --header "Content-Type: application/json" -u "api-user-xxxx:xxxxxxxxxxxxx" https://gcs.calix.com:8444/api/device-op --data '{"operation": "SetParameterValues","cpeIdentifier": {"serialNumber": "CXNK0021AC0B"},["InternetGatewayDevice" : {"LANDevice" : {"1" : {"WLANConfiguration" : {"1" : {"WPS" : {"Enable" : "true"}}}}}]}'  
{
  "error" : "Invalid JSON Payload!"
}
curl -k -X POST --header "Content-Type: application/json" -u "api-user-xxxxx:xxxxxxxxxxxxxx" https://gcs.calix.com:8444/api/device-op --data '{"operation": "SetParameterValues","cpeIdentifier": {"serialNumber": "CXNK0021AC0B"},{"InternetGatewayDevice" : {"LANDevice" : {"1" : {"WLANConfiguration" : {"1" : {"WPS" : {"Enable" : "true"}}}}}}}'
{
  "error" : "Invalid JSON Payload!"
}

and more other combinations... 

 

What is the correct syntax for SetParameterValues?

 

 

Best regards

Francisco Gomez

Senior Member
Posts: 14
Registered: ‎12-30-2015
0

Re: API Consumer Connect - TR069

I have already can set parameters, this is the right syntax:

 

curl -k -X POST --header "Content-Type: application/json" -u "api-user-xxxxx:xxxxxxxxxx" https://gcs.calix.com:8444/api/device-op --data '{"operation": "SetParameterValues","cpeIdentifier": {"serialNumber": "CXNK0021AC0B"},"parameterValues": {"InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.WPS.Enable":"false"}}'

 

Thanks!