[ovirt-users] Re: OVirt rest api 4.3. How do you get the job id started by the async parameter
Sorry, my example URL is messed up, the correct example is: https://engine/ovirt-engine/api/jobs?search=correlation_id%3Dmycorrelationid On Wed, Feb 10, 2021 at 2:38 PM Pascal DeMilly wrote: > > Thank you. This is very helpful. I'll give it a try. > > On Wed, Feb 10, 2021, 2:18 AM Benny Zlotnik wrote: >> >> You could do this by setting a custom correlation_id with a query >> param when invoking the operation, then filter the jobs using the same >> correlation id: >> https://engine/ovirt-engine/api/jobs?search%3Dmycorrelationid (it's >> not a reported field) >> >> We do this in our system tests[1] >> >> [1] >> https://github.com/oVirt/ovirt-system-tests/blob/b4e156f1ee23c8b7d4338c937fa0a1b708a154f3/basic-suite-master/test-scenarios/test_004_basic_sanity.py#L767 >> >> On Tue, Jan 26, 2021 at 3:54 PM Pascal DeMilly >> wrote: >> > >> > Hello >> > >> > Any ideas how to retrieve the job Id of an async job at the time of >> > creation or from a job to know which entities (VM, disk, template) Id it >> > was created from >> > >> > Thanks >> > >> > On Sat, Jan 23, 2021, 10:04 AM Martin Perina wrote: >> >> >> >> Hi Ori, >> >> >> >> could you please take a look? >> >> >> >> Thanks, >> >> Martin >> >> >> >> On Thu, Jan 21, 2021 at 9:52 PM wrote: >> >>> >> >>> I am using the rest api to create a VM, because the VM is cloned from >> >>> the template and it takes a long time, I am also passing the async >> >>> parameters hoping to receive back a job id, which I could then query >> >>> >> >>> https://x/ovirt-engine/api/vms?async=true=true >> >>> >> >>> however I get the new VM record which is fine but then I have no way of >> >>> knowing the job id I should query to know when it is finished. And >> >>> looking at all jobs there is no reference back to the VM execept for the >> >>> description >> >>> >> >>> >> >>> > >>> id="d17125c7-6668-4b6c-ad22-95121cb66a31"> >> >>> >> >>> > >>> href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/clear" >> >>> rel="clear"/> >> >>> > >>> href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/end" >> >>> rel="end"/> >> >>> >> >>> Creating VM DEMO-PCC-4 from Template >> >>> MASTER-W10-20H2-CDrive in Cluster d1-c2 >> >>> > >>> href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/steps" >> >>> rel="steps"/> >> >>> true >> >>> false >> >>> 2021-01-21T12:49:06.700-08:00 >> >>> 2021-01-21T12:48:59.453-08:00 >> >>> started >> >>> > >>> href="/ovirt-engine/api/users/0f2291fa-872a-11e9-b13c-00163e449339" >> >>> id="0f2291fa-872a-11e9-b13c-00163e449339"/> >> >>> >> >>> ___ >> >>> Users mailing list -- users@ovirt.org >> >>> To unsubscribe send an email to users-le...@ovirt.org >> >>> Privacy Statement: https://www.ovirt.org/privacy-policy.html >> >>> oVirt Code of Conduct: >> >>> https://www.ovirt.org/community/about/community-guidelines/ >> >>> List Archives: >> >>> https://lists.ovirt.org/archives/list/users@ovirt.org/message/TGZQLI55EFZOSEBNEU5CCBDZ2EDXMINQ/ >> >> >> >> >> >> >> >> -- >> >> Martin Perina >> >> Manager, Software Engineering >> >> Red Hat Czech s.r.o. >> >> ___ >> >> Users mailing list -- users@ovirt.org >> >> To unsubscribe send an email to users-le...@ovirt.org >> >> Privacy Statement: https://www.ovirt.org/privacy-policy.html >> >> oVirt Code of Conduct: >> >> https://www.ovirt.org/community/about/community-guidelines/ >> >> List Archives: >> >> https://lists.ovirt.org/archives/list/users@ovirt.org/message/SETMGF2ZNYGU6OJKJAY7WRPKTWUQGF7F/ >> > >> > ___ >> > Users mailing list -- users@ovirt.org >> > To unsubscribe send an email to users-le...@ovirt.org >> > Privacy Statement: https://www.ovirt.org/privacy-policy.html >> > oVirt Code of Conduct: >> > https://www.ovirt.org/community/about/community-guidelines/ >> > List Archives: >> > https://lists.ovirt.org/archives/list/users@ovirt.org/message/UVKF5KCOP27VR6UXHXECEQJGWGZSHTWP/ >> ___ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-le...@ovirt.org Privacy Statement: https://www.ovirt.org/privacy-policy.html oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/E5SBLTT2W7C777QYNZS6R4VJDAHTCTOP/
[ovirt-users] Re: OVirt rest api 4.3. How do you get the job id started by the async parameter
Thank you. This is very helpful. I'll give it a try. On Wed, Feb 10, 2021, 2:18 AM Benny Zlotnik wrote: > You could do this by setting a custom correlation_id with a query > param when invoking the operation, then filter the jobs using the same > correlation id: > https://engine/ovirt-engine/api/jobs?search%3Dmycorrelationid (it's > not a reported field) > > We do this in our system tests[1] > > [1] > https://github.com/oVirt/ovirt-system-tests/blob/b4e156f1ee23c8b7d4338c937fa0a1b708a154f3/basic-suite-master/test-scenarios/test_004_basic_sanity.py#L767 > > On Tue, Jan 26, 2021 at 3:54 PM Pascal DeMilly > wrote: > > > > Hello > > > > Any ideas how to retrieve the job Id of an async job at the time of > creation or from a job to know which entities (VM, disk, template) Id it > was created from > > > > Thanks > > > > On Sat, Jan 23, 2021, 10:04 AM Martin Perina wrote: > >> > >> Hi Ori, > >> > >> could you please take a look? > >> > >> Thanks, > >> Martin > >> > >> On Thu, Jan 21, 2021 at 9:52 PM wrote: > >>> > >>> I am using the rest api to create a VM, because the VM is cloned from > the template and it takes a long time, I am also passing the async > parameters hoping to receive back a job id, which I could then query > >>> > >>> https://x/ovirt-engine/api/vms?async=true=true > >>> > >>> however I get the new VM record which is fine but then I have no way > of knowing the job id I should query to know when it is finished. And > looking at all jobs there is no reference back to the VM execept for the > description > >>> > >>> > >>> href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31" > id="d17125c7-6668-4b6c-ad22-95121cb66a31"> > >>> > >>>href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/clear" > rel="clear"/> > >>>href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/end" > rel="end"/> > >>> > >>> Creating VM DEMO-PCC-4 from Template > MASTER-W10-20H2-CDrive in Cluster d1-c2 > >>> href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/steps" > rel="steps"/> > >>> true > >>> false > >>> 2021-01-21T12:49:06.700-08:00 > >>> 2021-01-21T12:48:59.453-08:00 > >>> started > >>> href="/ovirt-engine/api/users/0f2291fa-872a-11e9-b13c-00163e449339" > id="0f2291fa-872a-11e9-b13c-00163e449339"/> > >>> > >>> ___ > >>> Users mailing list -- users@ovirt.org > >>> To unsubscribe send an email to users-le...@ovirt.org > >>> Privacy Statement: https://www.ovirt.org/privacy-policy.html > >>> oVirt Code of Conduct: > https://www.ovirt.org/community/about/community-guidelines/ > >>> List Archives: > https://lists.ovirt.org/archives/list/users@ovirt.org/message/TGZQLI55EFZOSEBNEU5CCBDZ2EDXMINQ/ > >> > >> > >> > >> -- > >> Martin Perina > >> Manager, Software Engineering > >> Red Hat Czech s.r.o. > >> ___ > >> Users mailing list -- users@ovirt.org > >> To unsubscribe send an email to users-le...@ovirt.org > >> Privacy Statement: https://www.ovirt.org/privacy-policy.html > >> oVirt Code of Conduct: > https://www.ovirt.org/community/about/community-guidelines/ > >> List Archives: > https://lists.ovirt.org/archives/list/users@ovirt.org/message/SETMGF2ZNYGU6OJKJAY7WRPKTWUQGF7F/ > > > > ___ > > Users mailing list -- users@ovirt.org > > To unsubscribe send an email to users-le...@ovirt.org > > Privacy Statement: https://www.ovirt.org/privacy-policy.html > > oVirt Code of Conduct: > https://www.ovirt.org/community/about/community-guidelines/ > > List Archives: > https://lists.ovirt.org/archives/list/users@ovirt.org/message/UVKF5KCOP27VR6UXHXECEQJGWGZSHTWP/ > > ___ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-le...@ovirt.org Privacy Statement: https://www.ovirt.org/privacy-policy.html oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/UDUN3WMJ23KTZ5XX6MRJSY4RMXP7U4T7/
[ovirt-users] Re: OVirt rest api 4.3. How do you get the job id started by the async parameter
You could do this by setting a custom correlation_id with a query param when invoking the operation, then filter the jobs using the same correlation id: https://engine/ovirt-engine/api/jobs?search%3Dmycorrelationid (it's not a reported field) We do this in our system tests[1] [1] https://github.com/oVirt/ovirt-system-tests/blob/b4e156f1ee23c8b7d4338c937fa0a1b708a154f3/basic-suite-master/test-scenarios/test_004_basic_sanity.py#L767 On Tue, Jan 26, 2021 at 3:54 PM Pascal DeMilly wrote: > > Hello > > Any ideas how to retrieve the job Id of an async job at the time of creation > or from a job to know which entities (VM, disk, template) Id it was created > from > > Thanks > > On Sat, Jan 23, 2021, 10:04 AM Martin Perina wrote: >> >> Hi Ori, >> >> could you please take a look? >> >> Thanks, >> Martin >> >> On Thu, Jan 21, 2021 at 9:52 PM wrote: >>> >>> I am using the rest api to create a VM, because the VM is cloned from the >>> template and it takes a long time, I am also passing the async parameters >>> hoping to receive back a job id, which I could then query >>> >>> https://x/ovirt-engine/api/vms?async=true=true >>> >>> however I get the new VM record which is fine but then I have no way of >>> knowing the job id I should query to know when it is finished. And looking >>> at all jobs there is no reference back to the VM execept for the description >>> >>> >>> >> id="d17125c7-6668-4b6c-ad22-95121cb66a31"> >>> >>> >> href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/clear" >>> rel="clear"/> >>> >> href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/end" >>> rel="end"/> >>> >>> Creating VM DEMO-PCC-4 from Template >>> MASTER-W10-20H2-CDrive in Cluster d1-c2 >>> >> href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/steps" >>> rel="steps"/> >>> true >>> false >>> 2021-01-21T12:49:06.700-08:00 >>> 2021-01-21T12:48:59.453-08:00 >>> started >>> >> href="/ovirt-engine/api/users/0f2291fa-872a-11e9-b13c-00163e449339" >>> id="0f2291fa-872a-11e9-b13c-00163e449339"/> >>> >>> ___ >>> Users mailing list -- users@ovirt.org >>> To unsubscribe send an email to users-le...@ovirt.org >>> Privacy Statement: https://www.ovirt.org/privacy-policy.html >>> oVirt Code of Conduct: >>> https://www.ovirt.org/community/about/community-guidelines/ >>> List Archives: >>> https://lists.ovirt.org/archives/list/users@ovirt.org/message/TGZQLI55EFZOSEBNEU5CCBDZ2EDXMINQ/ >> >> >> >> -- >> Martin Perina >> Manager, Software Engineering >> Red Hat Czech s.r.o. >> ___ >> Users mailing list -- users@ovirt.org >> To unsubscribe send an email to users-le...@ovirt.org >> Privacy Statement: https://www.ovirt.org/privacy-policy.html >> oVirt Code of Conduct: >> https://www.ovirt.org/community/about/community-guidelines/ >> List Archives: >> https://lists.ovirt.org/archives/list/users@ovirt.org/message/SETMGF2ZNYGU6OJKJAY7WRPKTWUQGF7F/ > > ___ > Users mailing list -- users@ovirt.org > To unsubscribe send an email to users-le...@ovirt.org > Privacy Statement: https://www.ovirt.org/privacy-policy.html > oVirt Code of Conduct: > https://www.ovirt.org/community/about/community-guidelines/ > List Archives: > https://lists.ovirt.org/archives/list/users@ovirt.org/message/UVKF5KCOP27VR6UXHXECEQJGWGZSHTWP/ ___ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-le...@ovirt.org Privacy Statement: https://www.ovirt.org/privacy-policy.html oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/MQL23WFIC6Q2OET7KZ2QUEHZES3HKRYN/
[ovirt-users] Re: OVirt rest api 4.3. How do you get the job id started by the async parameter
Hello Any ideas how to retrieve the job Id of an async job at the time of creation or from a job to know which entities (VM, disk, template) Id it was created from Thanks On Sat, Jan 23, 2021, 10:04 AM Martin Perina wrote: > Hi Ori, > > could you please take a look? > > Thanks, > Martin > > On Thu, Jan 21, 2021 at 9:52 PM wrote: > >> I am using the rest api to create a VM, because the VM is cloned from the >> template and it takes a long time, I am also passing the async parameters >> hoping to receive back a job id, which I could then query >> >> https://x/ovirt-engine/api/vms?async=true=true >> >> however I get the new VM record which is fine but then I have no way of >> knowing the job id I should query to know when it is finished. And looking >> at all jobs there is no reference back to the VM execept for the description >> >> >> > id="d17125c7-6668-4b6c-ad22-95121cb66a31"> >> >> > href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/clear" >> rel="clear"/> >> > href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/end" >> rel="end"/> >> >> Creating VM DEMO-PCC-4 from Template >> MASTER-W10-20H2-CDrive in Cluster d1-c2 >> > href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/steps" >> rel="steps"/> >> true >> false >> 2021-01-21T12:49:06.700-08:00 >> 2021-01-21T12:48:59.453-08:00 >> started >> > href="/ovirt-engine/api/users/0f2291fa-872a-11e9-b13c-00163e449339" >> id="0f2291fa-872a-11e9-b13c-00163e449339"/> >> >> ___ >> Users mailing list -- users@ovirt.org >> To unsubscribe send an email to users-le...@ovirt.org >> Privacy Statement: https://www.ovirt.org/privacy-policy.html >> oVirt Code of Conduct: >> https://www.ovirt.org/community/about/community-guidelines/ >> List Archives: >> https://lists.ovirt.org/archives/list/users@ovirt.org/message/TGZQLI55EFZOSEBNEU5CCBDZ2EDXMINQ/ >> > > > -- > Martin Perina > Manager, Software Engineering > Red Hat Czech s.r.o. > ___ > Users mailing list -- users@ovirt.org > To unsubscribe send an email to users-le...@ovirt.org > Privacy Statement: https://www.ovirt.org/privacy-policy.html > oVirt Code of Conduct: > https://www.ovirt.org/community/about/community-guidelines/ > List Archives: > https://lists.ovirt.org/archives/list/users@ovirt.org/message/SETMGF2ZNYGU6OJKJAY7WRPKTWUQGF7F/ > ___ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-le...@ovirt.org Privacy Statement: https://www.ovirt.org/privacy-policy.html oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/UVKF5KCOP27VR6UXHXECEQJGWGZSHTWP/
[ovirt-users] Re: OVirt rest api 4.3. How do you get the job id started by the async parameter
Hi Ori, could you please take a look? Thanks, Martin On Thu, Jan 21, 2021 at 9:52 PM wrote: > I am using the rest api to create a VM, because the VM is cloned from the > template and it takes a long time, I am also passing the async parameters > hoping to receive back a job id, which I could then query > > https://x/ovirt-engine/api/vms?async=true=true > > however I get the new VM record which is fine but then I have no way of > knowing the job id I should query to know when it is finished. And looking > at all jobs there is no reference back to the VM execept for the description > > > id="d17125c7-6668-4b6c-ad22-95121cb66a31"> > >href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/clear" > rel="clear"/> >href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/end" > rel="end"/> > > Creating VM DEMO-PCC-4 from Template > MASTER-W10-20H2-CDrive in Cluster d1-c2 > href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/steps" > rel="steps"/> > true > false > 2021-01-21T12:49:06.700-08:00 > 2021-01-21T12:48:59.453-08:00 > started > href="/ovirt-engine/api/users/0f2291fa-872a-11e9-b13c-00163e449339" > id="0f2291fa-872a-11e9-b13c-00163e449339"/> > > ___ > Users mailing list -- users@ovirt.org > To unsubscribe send an email to users-le...@ovirt.org > Privacy Statement: https://www.ovirt.org/privacy-policy.html > oVirt Code of Conduct: > https://www.ovirt.org/community/about/community-guidelines/ > List Archives: > https://lists.ovirt.org/archives/list/users@ovirt.org/message/TGZQLI55EFZOSEBNEU5CCBDZ2EDXMINQ/ > -- Martin Perina Manager, Software Engineering Red Hat Czech s.r.o. ___ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-le...@ovirt.org Privacy Statement: https://www.ovirt.org/privacy-policy.html oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/SETMGF2ZNYGU6OJKJAY7WRPKTWUQGF7F/