So i know very little about the api side of the house and trying to learn more. Any resources to learn how to do this better would be greatly appreciated.
I can get the current configuration of SSH. but I don't know how to format the put statement to turn off the settings.
Invoke-restmethod -Uri "https://$($NSXMgr)/api/v1/node/services/ssh" -Method GET -Credential $mycreds -SkipCertificateCheck:$skipcertcheck -Authentication:$AuthMethod
_schema _self service_name service_properties
------- ----- ------------ ------------------
NodeSshServiceProperties @{href=/node/services/ssh; rel=self} ssh @{root_login=True; start_on_boot=True}
Failed PUT
Invoke-restmethod -Uri "https://$($NSXMgr)/api/v1/node/services/ssh" -Method put -Credential $mycreds -SkipCertificateCheck:$skipcertcheck -Authentication:$AuthMethod -ContentType 'application/json' -body ('{"root_login":"False"')
Invoke-RestMethod:
{
"error_code": 255,
"error_message": "Request body not valid - Badly formatted body",
"module_name": "common-services"
}