I am attempting to create an element via the API and am getting the following response:
{
"Message": "Invalid port configuration: expected SNMPV2/SNMPV3-Serial but received SNMPV2.",
"StackTrace": "",
"ExceptionType": "Skyline.DataMiner.Web.Common.WebApiException"
}
This is the POST request, which matches the syntax outlined here https://docs.dataminer.services/develop/webservices/WS_v1/WS_About_v1/WS_v1_examples.html#createelement-request-1
POST https://dataminer-agent1/API/v1/Json.asmx/CreateElement
Content-Type: application/json
{
"connection": "xxxxxxxxxxxxxxxxxx",
"dmaID": 127911,
"viewIDs": [72],
"configuration": {
"Name": "test device",
"ProtocolName": "Linux Platform",
"ProtocolVersion": "Production",
"Ports": [
{ "__type": "Skyline.DataMiner.Web.Common.v1.DMAElementSNMPPortInfo", "IPAddress": "xxx.xx.xxx.xxx", "GetCommunity": "public", "SetCommunity": "private", "PortNumber": 161 }
]
}
}
Hi Oscar,
Can you try the following request:
{
"connection": "YourConnectionId",
"dmaID": 127911,
"viewIDs": [
72
],
"configuration": {
"Name": "TEST_ELEMENT",
"ProtocolName": "Linux Platform",
"ProtocolVersion": "Production",
"Ports": [
{
"__type": "Skyline.DataMiner.Web.Common.v1.DMAElementSNMPPortInfo",
"SNMPVersion": 2,
"DeviceAddress": "",
"GetCommunity": "public",
"IPAddress": "127.0.0.1",
"Network": "0",
"PortNumber": 161,
"SetCommunity": "private",
"ElementTimeoutTime": 30000,
"TimeoutTime": 1500,
"Retries": 3
},
{
"__type": "Skyline.DataMiner.Web.Common.v1.DMAElementSerialPortInfo",
"Baudrate": 0,
"BusAddress": "",
"Databits": 0,
"FlowControl": "No",
"IPAddress": "127.0.0.1",
"IPPort": 22,
"LocalIPPort": 0,
"Network": "0",
"Parity": "No",
"SerialPort": "0",
"Stopbits": 0,
"Type": "TCP",
"ElementTimeoutTime": 30000,
"TimeoutTime": 1500,
"Retries": 3
}
] }
}
Don't forget to change the IP addresses, port and the community strings.
Hope it helps.
Thanks Miguel, can confirm that this works.