Description of problem: Not able to set user's public key via rest api call. Version-Release number of selected component (if applicable): 4.2.0-0.0.master.20170927183005.git49790b2.el7.centos How reproducible: 100% Steps to Reproduce: 1. Compose and send a api request: Method: POST URL: https://engine-fqdn/ovirt-engine/api/users/{user_uuid}/sshpublickeys Headers: Content-Type: application/xml Body: <ssh_public_key> <content>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC04CrBCpZ5ZQfGncgsr61TV727loTHQWx9KlAyNLgxKsnOnsDFQFhStg8vTZm8t4e2NyIkjjBQ/iiOBOH/9NdBrOToOF0brmMHFq3gq55nziM3hlgo8eJm0Ia9cs8yaWBllaTbtYM7rLIy56ih9tfSeKtkyAU97im24gTzOqcLaswVWD7qjeXZkLpYJDKDLWDgwygqVMN+9j/3OcHzWxScfscnjfmbBtxTS/F37ISgpjGEVu6VtmXsB1Z4qTAQ4YrDsvFQCq5mnuvVDT3GVAM3UrSDFJt02HWYd5Mzdvi0XeJaSwOlSNljXEg5PYOCkA1pUdp8yZhsYUUc9kv6OHYp root@rh-test-serv </content> </ssh_public_key> Actual results: Response headers: Status Code: 400 Bad Request Connection: close Content-Encoding: gzip Content-Length: 179 Content-Type: application/xml;charset=UTF-8 Correlation-Id: 25f32521-5cc5-4ab5-8aa6-c7be8dc4bbf9 Date: Mon, 02 Oct 2017 09:57:33 GMT Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips Response body: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <fault> <detail>Parameters 'key.id' or 'key.name' are mandatory but both were not provided.</detail> <reason>Input validation failed.</reason> </fault> Expected results: Request should return 200 response and set users key. Additional info:
well, it complains that it is missing the key.id or key.name. So, when you set it, it will work. Please feel free to reopen if it does not help.
I am moving back to POST because the engine still needs to be modified to use the version of the model where this is fixed.
ok, ovirt-engine-restapi-4.2.0-0.0.master.20171029154613.git19686f3.el7.centos.noarch curl \ --insecure \ --user 'admin@internal:xxxxxx' \ -X POST \ -H 'Version: 4' \ -H 'Content-Type: application/xml' \ -H 'Accept: application/xml' \ --data ' <ssh_public_key> <content>ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA17cG03EgF+NVbmhHzZmeqWQOEs6icbrVvnkIGLlSmHSbUQn2PV61UnZrv/yZpgEZWE1sNWpQFJhiACr4qQbQyFmlNj+vkkas0xaJqc7TuHI+kgA34YbLzXn6X+pBKqTp1KyTBDtSZ5Lm013G4FYy0x1XapFFnhprVPF3bHlB8bnnYjjRACfgzqvLpRGorL7+wdyj59bD4R47ZZuieovKQEVfccABxbb2/2M4kXxdBR+yqhcKjOl2hpou8Yt0sp+P0SyTPZOO45oAZ50tV6jcKZ5JBtRfBzNjEaqMukcpu0pisdR6UFwfKnPWc7n1qMFrtYd1P7AyJJXXr0mXI+SaJQ==</content> </ssh_public_key> ' \ https://www.example.com/ovirt-engine/api/users/59e0bb6a-03fa-0217-03c9-000000000118/sshpublickeys <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <action> <status>complete</status> </action>
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017. Since the problem described in this bug report should be resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.