Skip to content
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

Volume snapshot object's getName() method error,return with null. but the API actually returned the name value. #1019

Closed
zhoutiekui opened this issue May 10, 2017 · 4 comments
Labels

Comments

@zhoutiekui
Copy link

OS4J Version:
3.0.4-snapshot

Test Code:
VolumeSnapshot snapshotForce = os.blockStorage().snapshots().create(Builders.volumeSnapshot()
.name(snapshotName)
.volume(volume.getId())
.force(true)
.build());
System.out.println("snapshot id:\t" + snapshotForce.getId());
System.out.println("snapshot name:\t" + snapshotForce.getName());
System.out.println(os.blockStorage().snapshots().get(snapshotForce.getId()).getId());
assertEquals(snapshotName, os.blockStorage().snapshots().get(snapshotForce.getId()).getName());

Output:
snapshot id: 6980f66a-110d-4bcb-a7f9-eb8752395799
snapshot name: null

Analyze:
the package org.openstack4j.openstack.storage.block.domain has following codes:
@JsonProperty("display_name")
private String name;
@JsonProperty("display_description")
private String description;
While the API definition the name "name" not the desplay_name.
The same error with the description attribute.

@auhlig
Copy link
Member

auhlig commented May 17, 2017

Thanks for investigating @zhoutiekui. Feel encouraged to contribute a fix for that :)

@cbirajdar
Copy link
Contributor

Hi @auhlig! I have also noticed this as an issue with CinderVolume - getName() and getDescription(). For block storage API V1, field names were display_name and display_description. Since V2, it's name and description.

@JsonRootName("volume")
public class CinderVolume implements Volume {
	@JsonProperty("display_name")
	private String name;
	@JsonProperty("display_description")
        private String description;

Is version 1 still supported for managing cinder volumes? I can simply rename these properties in CinderVolume and update V1/V2 related unit tests which would otherwise fail.

Thank you!

@auhlig
Copy link
Member

auhlig commented Jun 14, 2017

This was fixed by now, wasn't it? Could you try the latest snapshot?

@cbirajdar
Copy link
Contributor

cbirajdar commented Jun 14, 2017

For block storage API V2, it was fixed for CinderVolumeSnapshot but still an issue with CinderVolume. I will submit a PR to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants