ovirt-engine-sdk-ruby icon indicating copy to clipboard operation
ovirt-engine-sdk-ruby copied to clipboard

Fault reason is "Request syntactically incorrect"

Open siddushar opened this issue 1 year ago • 0 comments

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'
    }
  )
)

siddushar avatar Sep 18 '24 19:09 siddushar