Hello,
I try to create IP Addresses with the following Curl command:
curl -sSk -v -H "Content-Type: application/json" -H "Accept: application/json" -u "username:pwd -d '{"SubnetId":111,"IpAddress":"12.12.12.2"}' mysolarwinds:17778/.../IPAM.IPNode
But I keep getting the following error:
< HTTP/2 400
< content-length: 2635
< content-type: application/json
< server: Microsoft-HTTPAPI/2.0
< strict-transport-security: max-age=31536000,includeSubDomains
< date: Mon, 03 Apr 2023 21:39:32 GMT
<
{"Message":"Exception has been thrown by the target of an invocation.","ExceptionType":"System.Reflection.TargetInvocationException","FullException":"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Specified cast is not valid.\r\n at SolarWinds.Data.Providers.Orion.IPAM.V3.CrudHandlers.Validators.IpNodeValidator.ValidateIPOrdinal(IEntityValidationContext context)\r\n --- End of inner exception stack trace ---\r\n at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at SolarWinds.Data.Providers.Orion.IPAM.V3.CrudHandlers.Validators.IpamEntityValidatorBuilder.<>c__DisplayClass0_1.<BuildEntityValidator>b__2(IEntityValidationContext context)\r\n at SolarWinds.Data.Providers.Orion.IPAM.V3.CrudHandlers.Validators.IpamEntityValidator.Validate(IEntityValidationContext context)\r\n at SolarWinds.Data.Providers.Orion.IPAM.V3.CrudHandlers.IPAMCrudHandlerBase.Validate(IDictionary`2 columns, IIpamEntityValidator validator, Boolean isCreate, IDictionary`2 columnsToUpdate, String entityName)\r\n at SolarWinds.Data.Providers.Orion.IPAM.V3.CrudHandlers.IPAMCrudHandlerBase.ValidateCreate[T](IDictionary`2 columns, String entityName)\r\n at SolarWinds.Data.Providers.Orion.IPAM.V3.CrudHandlers.IPNodeCrudHandler.Create(IDictionary`2 columns, Func`2 baseCall)\r\n at SolarWinds.Data.Providers.Orion.OrionDataProvider.Create(IStorageElement storage, IDictionary`2 columns)\r\n at SolarWinds.InformationService.Addons.DataProvider.<Create>d__62.MoveNext()\r\n at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)\r\n at SolarWinds.InformationService.Core.CrudProcessor.<Creat* Connection #0 to host ipplan.at-work.local left intact
eLocal>d__22.MoveNext()\r\n at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n at SolarWinds.InformationService.Core.CrudProcessor.<CreateInternal>d__19.MoveNext()\r\n at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)\r\n at SolarWinds.InformationService.Core.CrudProcessor.Create(String entityType, IDictionary`2 properties, IQueryExecutionContext context)\r\n at SolarWinds.InformationService.Core.InformationService.Create(String entityType, IDictionary`2 properties)"}[
Obviously, there is something wrong with the subnet ID.
I already tried to write the value of the subnet Id with quotation marks, but somehow it doesn't work.
Update: The subnet ID was totally fine.
Thanks in advance