Anyone mess w/ the VAMI api for vcenter 6.5U1 using powershell? Specifically looking for some direction on com.vmware.appliance.techpreview.networking.proxy (edited)
it is techpreview, so expected issues, but always getting errors w/ `get` and unclear formatting for `configlist`
error I get for `get` `A server error occurred: 'com.vmware.vapi.std.errors.unauthorized': Unable to authorize user (Server error id: 'vapi.security.authorization.invalid'). Check $Error[0].Exception.ServerError for more details.`
Even though I am authenticated via connect-cisserver. Doesn't even matter if I'm accessing non-techpreview spaces. Same error.
:smileyconfused:
To clarify, I have two issues:
$PodvCvAMI = Connect-CisServer $PodvCenterName -Credential $podvcenterRootCreds
$ProxyConfigAPI = Get-CisService -name "com.vmware.appliance.techpreview.networking.proxy"
$ProxyConfigSpec = $ProxyConfigAPI.help.set.config.CreateExample()
Message was edited by: Chris Nakagaki
I see where my issue is now. I was so focused on just changing the proxy config, that I assumed that I should be authenticating against the 'VAMI' REST API as the VCSA local root user. Which, by the way, authenticates just fine, but does not seem to grant any worthwhile access. I had to authenticate using my SSO admin account.
You need to authorise before making the call, see my VSphere Automation SDKs, PowerShell And You – Part 1 post.
I just added function Get-rProxyConfig and updated Sample1.
See Sample1 in my OpenSdk repo.
Sample output from my test system with no proxy configured.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD. Isn't the point of "connect-cisserver" to authorize my connection to the VAMI REST API? I was hoping to avoid making something custom, although if that's what I'm going to need to do so be it.
Thanks for the proxy output, seems I was on the right track, just needed to get past the authorization problem.
I see where my issue is now. I was so focused on just changing the proxy config, that I assumed that I should be authenticating against the 'VAMI' REST API as the VCSA local root user. Which, by the way, authenticates just fine, but does not seem to grant any worthwhile access. I had to authenticate using my SSO admin account.