Not sure where this post should go, but I'm trying to make a basic REST call to vROps and start with getting a token and can't.
Here's my code:
$mybody= @{
username ="admin"
password = "my password"
}
$json=$mybody|ConvertTo-Json
$response=Invoke- RestMethod-urihttps://192.168.1.60/api/auth/token/acquire-MethodPost-Body$json-ContentType'application/json'
I'm getting this response:
Invoke-RestMethod : The remote server returned an error: (404) Not Found.
At C:\powershell\vrops-rest.ps1:6 char:13
+ $response = Invoke-RestMethod -uri https://192.168.1.60/api/auth/token/acquire -
...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWeb
Request) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.C
ommands.InvokeRestMethodCommand
I can ping vROps fine at this IP and can view the rest API at https://192.168.1.60/suite-api/docs/rest/index.html just fine.
Any ideas?
Thanks!