The post body needs to be a json array containing the arguments for the verb. AddNodeToNCM takes one integer argument. Try this line:
CURLOPT_POSTFIELDS => "",
I tried that also, same problem.
I get the same error when running it from php also.
I noticed another issue: the URL needs fixing. It should be this:
(with a slash between Cirrus.Nodes and AddNodeToNCM, not a period)
I'm not familiar with PHP, but I glanced at the docs for the curl API. Do you also need this line?
CURLOPT_POST => 1,
Is CURLOPT_POST the same thing as this: CURLOPT_CUSTOMREQUEST => "POST",
I changed it to a slash and I get the following:
"Message": "Verb Cirrus.Nodes.AddNodeToNCM requires 1 parameters not 0",
"FullException": "SolarWinds.InformationService.Verb.VerbExecutorException: Verb Cirrus.Nodes.AddNodeToNCM requires 1 parameters not 0\r\n at SolarWinds.InformationService.Verb.VerbExecutorContext.CreateParameters(Func`2 getParameterAt, Int32 parametersCount, Stream stream)\r\n at SolarWinds.InformationService.Verb.VerbExecutorContext.UnpackageParameters(JArray parameters)\r\n at SolarWinds.InformationService.Core.InformationService.Invoke[T](String entity, String verb, Action`1 setupParameters, Func`2 extractReturnValue)"
I think we can ignore CURLOPT_POST vs. CURLOPT_CUSTOMREQUEST now. The error you are getting indicates that the HTTP method, content-type, and URL are all correct. The remaining problem is the request body.
SWIS is behaving like it is receiving this: [ ]
We need it to receive this: [ 11985 ]
I don't really know PHP, so I'm not sure what's going on here. Maybe change the double-quoted string to single-quoted? Maybe try out the request in Postman or a similar REST API testing tool to verify that it works outside of PHP?
As mentioned in the original post I have tried using the Insomnia REST client.
I also tried Postman which returns the same error message.
I have also tried the SWQL studio:
I get the following result:
<Fault xmlns="http://www.w3.org/2003/05/soap-envelope">- <Code><Value>Sender</Value>
</Code>- <Reason><Text xml:lang="en-US">Cirrus.Nodes.AddNodeToNCM failed, check fault information. Could not load file or assembly 'SolarWinds.Cirrus.BusinessLayer, Version=220.127.116.114, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.</Text>
</Reason>- <Detail>- <InformationServiceFaultContract xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.solarwinds.com/2007/08/informationservice"><Message>Could not load file or assembly 'SolarWinds.Cirrus.BusinessLayer, Version=18.104.22.1684, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.</Message>
In SWQL Studio, are you connected to the "Orion (v3)" endpoint?
Yes, I am using the Orion (v3) endpoint.
Are you connecting to the main Orion server? These NCM verbs are not supported when connecting to Additional Websites.