From fgavrilo at redhat.com Thu Sep 19 09:45:38 2019 Content-Type: multipart/mixed; boundary="===============7265231877159896588==" MIME-Version: 1.0 From: Fedor Gavrilov To: devel at ovirt.org Subject: [ovirt-devel] Re: [User is not authorized to perform this action.] Date: Thu, 19 Sep 2019 05:45:30 -0400 Message-ID: <1788940930.1358067.1568886330400.JavaMail.zimbra@redhat.com> In-Reply-To: 20190918133928.3514.4114@mail.ovirt.org --===============7265231877159896588== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hello, Maybe you can try calling GET on vms/74a1a99f-87d1-4444-b394-f90e4f29f51f/d= iskattachments for testing purpose? I suggest using REST client since it takes care of authentication when need= ed and to make sure the problem is not in the code. In dev environment ovir= t uses basic authentication and that is something you have to set up when c= alling this API. For example, for admin user username would be admin(a)inte= rnal and password is whatever you specified during setup. Fedor = ----- Original Message ----- From: smidhunraj(a)gmail.com To: devel(a)ovirt.org Sent: Wednesday, September 18, 2019 3:39:28 PM Subject: [ovirt-devel] [User is not authorized to perform this action.] I am getting error as User is not authorized to perform this action.I am us= ing oVirt api to manually attach a disk and snapshot to another virtual ma= chine.This the code i used.The API i followed is ' true false virtio My disk cow mydisk = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D The php code i have tried is ... public function attachSnapshotandActivateDisk( ) { $data =3D array(); $xmlStr =3D ' true false virtio My disk cow mydisk = '; $curlParam =3D array( "url" =3D> "vms/74a1a99f-87d1-4444-b394-f90e4f29f51f/diskattach= ments", "method" =3D> "POST", "data" =3D> $xmlStr ); // $text =3D print_r($curlParam, true); //echo ""; $data =3D $this->processCurlRequest($curlParam, "vm-create"); // if instance update failed if ($data['status'] !=3D 'success') { Common::ovirtLog(array( "requestParam" =3D> $curlParam, "responseParam" =3D> $data, )); } // show the output of print_r function as a string // $text =3D print_r($data, true); echo $data['message']; die; echo ""; //Detach the disk // $this->detachSnapshotDisk() ; = return $data; } Please help me. _______________________________________________ Devel mailing list -- devel(a)ovirt.org To unsubscribe send an email to devel-leave(a)ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guid= elines/ List Archives: https://lists.ovirt.org/archives/list/devel(a)ovirt.org/mess= age/42Z54W3JDZSTAN6PIOGWGGMVNZ5IDA47/ --===============7265231877159896588==--