Bug 1406064
| Summary: | The elements of list disk.storage_domains don't have links | ||
|---|---|---|---|
| Product: | [oVirt] ovirt-engine | Reporter: | Juan Hernández <juan.hernandez> |
| Component: | RestAPI | Assignee: | Juan Hernández <juan.hernandez> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Aleksei Slaikovskii <aslaikov> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.0.6.3 | CC: | bodnopoz, bugs, gklein, juan.hernandez, mgoldboi, mperina |
| Target Milestone: | ovirt-4.1.0-rc | Flags: | rule-engine:
ovirt-4.1+
mgoldboi: planning_ack+ juan.hernandez: devel_ack+ pstehlik: testing_ack+ |
| Target Release: | 4.1.0 | ||
| 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: | 2017-02-01 14:50:22 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | Infra | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
4.0.6 has been the last oVirt 4.0 release, please re-target this bug. Verified on ovirt-engine-sdk-python (4.1.0) >>> connection = ... >>> disk = ... >>> sd = connection.follow_link(disk.storage_domains[0]) <ovirtsdk4.types.StorageDomain object at 0x7f96b3ac8748> >>> sd.name 'nfs_0' |
When the representation of a disk is retrieved using the API the following XML document is returned: <disk href="/ovirt-engine/api/disks/123" id="123"> ... <storage_domains> <storage_domain id="456"/> </storage_domains> </disk> In that XML document the 'href' attribute of the storage domain is missing. This means that the user of the API as to calculate the 'href' itself in order to retrieve the details of the storage domain. This is specially problematic for developers using the 'follow_link' method of the SDKs, as they won't be able to use it. For example, when the 'href' attribute is populated correctly, the code to retrieve the storage domain with the Ruby SDI is as simple as this: # Retrieve the disk: disk = ... # Retrieve the details of the storage domain: sd = connection.follow_link(disk.storage_domains.first) But if the 'href' isn't populated then the code needs to be like this: # Retrieve the disk: disk = ... # Find the service that manages the storage domain: sd = disk.storage_domains.first sd_service = connection.system_service.storage_domains_service.storage_domain_service(sd.id) # Retrieve the storage domain: sd = sd_service.get() The server should be fixed so that the 'href' attribute is populated correctly.