ovirt-engine-sdk-ruby
ovirt-engine-sdk-ruby copied to clipboard
Fault reason is "Request syntactically incorrect"
Due to some SSO issue, i'm not able to authenticate to ovirt sdk using OvirtSDK4::Connection object. mac version: 14.6.0 Sonoma
As a work-around solution , i tried to generate token and pass the token to the OvirtSDK4::Connection object. something like
connection = OvirtSDK4::Connection.new(
url: host,
username: @user,
password: @pass,
debug: true,
ca_file: '/Users/sh077503/Downloads/ca.crt',
token: 'token here',
log: Logger.new('example.log')
)
It worked for get calls but not working for post api calls.
I tried to create a vm and getting an error Fault reason is "Request syntactically incorrect." Fault detail is "For correct usage, see: https://engine-host/ovirt-engine/apidoc#services/vms/methods/add". HTTP response code is 400. (OvirtSDK4::Error)
Following code is not working.
vms_service = connection.system_service.vms_service
vms_service.add(
OvirtSDK4::Vm.new(
name: 'testvm',
cluster: {
name: 'LS1KVMGP02'
},
template: {
name: 'Blank'
}
)
)