HPE OneView

Gen 10 ilo. create a new entry vfor SNMP i pythonilorest library in an ILO not oneview

 
mzkhann
Occasional Contributor

Gen 10 ilo. create a new entry vfor SNMP i pythonilorest library in an ILO not oneview

I am trying to create a new entry for SNMP, not edit (PATCH) but rather post/PUT using redfish

 

Which command None of below work

#curl -i --insecure -X POST -H "Content-Type: application/json" -d "{\"Action\": \"HpeSNMPAlertDestination.v2_0_0.HpeSNMPAlertDestination\",\"AlertsEnabled\":\"true\" ,\"Location\":\"14.14.14.14\"}" -u hp:abcd1234 -L https://IP/redfish/v1/Managers/1/SnmpService

#curl -i --insecure -X PATCH -H "Content-Type: application/json" -d "{\"Action\": \"HpeSNMPAlertDestination.v2_0_0.HpeSNMPAlertDestination\",\"AlertsEnabled\":\"true\" ,\"Location\":\"14.14.14.14\"}" -u hp:abcd1234 -L https://IP/redfish/v1/Managers/1/SnmpService

curl -i --insecure -X PATCH -H "Content-Type: application/json" -d "{\"Action\": \"HpeSNMPAlertDestination.v2_0_0.HpeSNMPAlertDestination\",\"AlertsEnabled\":\"true\" ,\"Location\":\"14.14.14.14\"}" -u hp:abcd1234 -L https://IP/redfish/v1/Managers/1/SnmpService/SNMPAlertDestinations/1

#curl -i --insecure -X PATCH -H "Content-Type: application/json" -d "{\"Action\": \"HpeSNMPAlertDestination.v2_0_0.HpeSNMPAlertDestination\",\"AlertsEnabled\":\"true\" ,\"Location\":\"14.14.14.14\"}" -u hp:abcd1234 -L https://IP/redfish/v1/Managers/1/SnmpService

1 REPLY 1
AmRa
HPE Pro

Re: Gen 10 ilo. create a new entry vfor SNMP i pythonilorest library in an ILO not oneview

Hi

The below is the working syntax

.\curl.exe -i --insecure -X PATCH -H "Content-Type: application/json" -d "{\"Location\":\"New location\"}" -u user:pswd -L https://{IP}/redfish/v1/Managers/1/SnmpService/

For more information please refer below community forums thread in which same issue was dicussed. 

https://community.hpe.com/t5/server-management-remote-server/rest-api-ilo5-curl-post-always-returns-bad-request/m-p/7058588#M8468

 

I am an HPE Employee

Accept or Kudo