-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
restapi: incorrect href for parent href #549
Conversation
.../jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotsResource.java
Show resolved
Hide resolved
.../jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotsResource.java
Outdated
Show resolved
Hide resolved
Have you checked this scenario? |
As I see, similar change is already done by b1579af |
right, that was for a particular snapshot and this one is for a collection of snapshots |
ad8ffff
to
a21f89a
Compare
.../jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotsResource.java
Outdated
Show resolved
Hide resolved
a21f89a
to
344ab71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note, that the href of the <disk_snapshot> element is also incorrect. It's not described in the bug, but maybe makes sense to fix that as well.
...stapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/utils/DiskResourceUtils.java
Outdated
Show resolved
Hide resolved
344ab71
to
3faeb4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit more readable, but I still think you should do the mapper.map(disk, null) thing once for each Disk entity, and then work with a list of DiskSnapshots
.../jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotsResource.java
Outdated
Show resolved
Hide resolved
3faeb4c
to
ed965e7
Compare
...i/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotResource.java
Outdated
Show resolved
Hide resolved
...stapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/utils/DiskResourceUtils.java
Outdated
Show resolved
Hide resolved
ed965e7
to
3ef23c7
Compare
.../jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotsResource.java
Outdated
Show resolved
Hide resolved
.../jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotsResource.java
Outdated
Show resolved
Hide resolved
3ef23c7
to
e2ace4f
Compare
.../jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotsResource.java
Outdated
Show resolved
Hide resolved
.../jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotsResource.java
Outdated
Show resolved
Hide resolved
643d418
to
38c254b
Compare
I think that this link is intended to fetch a specific disksnapshot. Thus returning it when include_template is not set makes even more sense - we don't have the parent image here in the returned array of disksnapshots, but here's a correct link that you can fetch it with. Also don't think that there would be any backward compatibility issues, since this href was never correct anyway. |
38c254b
to
8d13837
Compare
@mkemel so previously when include-template was not set we set an incorrect href for the parent of the top-level volume? wasn't it empty? |
No, it wasn't empty. The parent ID is always there, it's just that the URL is built incorrectly. |
ack, in this case, it's really a bug fix more than an enhancement that users can complain about, ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another minor comment, besides that lgm
...modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/storage/Disk.java
Outdated
Show resolved
Hide resolved
8d13837
to
eecf01f
Compare
/ost |
1 similar comment
/ost |
...les/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/GetDiskSnapshotByImageIdQuery.java
Show resolved
Hide resolved
.../jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotsResource.java
Show resolved
Hide resolved
...i/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDiskSnapshotResource.java
Show resolved
Hide resolved
If User send REST API request for ovirt-engine/api/disks/{diskid}/disksnapshots?include_active&include_template he will get this incorrect href back <parent href="/ovirt-engine/api/disks/{diskid}" id="{parentid}"/>. Now it will get correct output that will look like this <parent href="/ovirt-engine/api/disks/{diskid}/disksnapshots/{parentid}" id="{parentid}"/>. Bug-Url: https://bugzilla.redhat.com/2013697 Signed-off-by: Artiom Divak <adivak@redhat.com>
f9958e5
to
80af2c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ArtiomDivak I changed the code in GetDiskSnapshotByImageIdQuery to be a bit more null-safe, can you please check to see it still works so we'll get it in?
c3f83f6
to
80af2c8
Compare
If User send REST API request for ovirt-engine/api/disks/{diskid}/disksnapshots?include_active&include_template he will get this incorrect href back <parent href="/ovirt-engine/api/disks/{diskid}" id="{parentid}"/>.
Now it will get correct output that will look like this <parent href="/ovirt-engine/api/disks/{parentdiskid}/disksnapshots/{parentid}" id="{parentid}"/>.
Bug-Url: https://bugzilla.redhat.com/2013697
Signed-off-by: Artiom Divak adivak@redhat.com