Bug 1585572
| Summary: | Document API for fetch disks extended information | ||
|---|---|---|---|
| Product: | [oVirt] ovirt-engine | Reporter: | Joey Ma <majunjiev> |
| Component: | RestAPI | Assignee: | shani <sleviim> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Radim Hrazdil <rhrazdil> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.3.0 | CC: | arshpreet218, bugs, lsvaty, omachace, tnisan, ylavi |
| Target Milestone: | ovirt-4.2.5 | Keywords: | Reopened |
| Target Release: | --- | Flags: | rule-engine:
ovirt-4.2+
rule-engine: ovirt-4.3+ |
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-07-31 15:25:02 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | Storage | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Joey Ma
2018-06-04 06:50:12 UTC
Hi Joey,
The VMs information is not displayed for the disks by default as it requires more queries to be executed that might pose a performance hit if run on a very big amount of disks.
You can have the info on VMs attached to a disk when GETing a disk via:
/ovirt-engine/api/disks/{disk-id}
And specifying the header name "All-Content" wit the value "true", this will populate the disk returned with the VMs it's attached to:
<disk>
...
<vms>
<vm href="/ovirt-engine/api/vms/{vm1-id}" id="{vm1-id}"/>
<vm href="/ovirt-engine/api/vms/{vm2-id}" id="{vm2-id}"/>
...
<vm href="/ovirt-engine/api/vms/{vmn-id}" id="{vmn-id}"/>
</vms>
...
</disk>
hi Tal, Thanks for your advice. It works. However, as indicated blow, the VMs information returned doesn't seem to contain the href field. <vms> <vm id="bbd4585b-1958-433b-88e3-6df9f4ee4598" /> </vms> Is this a bug or as expected? Since lack of the href field, we could not use `connection.FollowLink` to retrieve the VM instance. Thanks. Tal, can you please document this parameter in model documentation: https://github.com/oVirt/ovirt-engine-api-model/blob/master/src/main/java/services/DiskService.java#L298 Currently it isn't exposed to SDKs, as it's not there. Thanks. (In reply to Ondra Machacek from comment #3) > Tal, can you please document this parameter in model documentation: > > https://github.com/oVirt/ovirt-engine-api-model/blob/master/src/main/java/ > services/DiskService.java#L298 > > Currently it isn't exposed to SDKs, as it's not there. Thanks. This is not a parameter relevant to DiskService only, it's a general parameter relevant to all the services that can implement doPopulate, see BackendResource line #302 (In reply to Tal Nisan from comment #4) > This is not a parameter relevant to DiskService only, it's a general > parameter relevant to all the services that can implement doPopulate, see > BackendResource line #302 Then we need to document those which implement it. Some are already documented, VmService for example: https://github.com/oVirt/ovirt-engine-api-model/blob/master/src/main/java/services/VmService.java#L386 Hi, Tal, I just found that the IDs of DiskAttachment and relevant Disk are the same, in the mapping phrase by [1]. Is my view correct? If so, this equivalence is extremely helpful for connecting the disk and the disk-attachment, especially when updating a disk by its relevant disk-attachment instance. Nevertheless it's missing in the API document [2]. Thanks. [1]: https://github.com/oVirt/ovirt-engine/blob/68753f46f09419ddcdbb632453501273697d1a20/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskAttachmentMapper.java [2]: http://ovirt.github.io/ovirt-engine-api-model/4.3/#types/disk_attachment Moving back to post since referenced patch https://gerrit.ovirt.org/#/c/92595/ is not yet merged Verified that allContent parameter is documented. This bugzilla is included in oVirt 4.2.5 release, published on July 30th 2018. Since the problem described in this bug report should be resolved in oVirt 4.2.5 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report. *** Bug 1622359 has been marked as a duplicate of this bug. *** |