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

Fix #734: add extra field on project #729

Merged

Conversation

junoyoon
Copy link
Contributor

@junoyoon junoyoon commented Jun 27, 2016

This includes the fix for #734 "add extra field on project

To support extra field, I have modified org.openstack4j.openstack.identity.v3.domain.KeystoneProject like followings.

  • Put private Map<String, String> extra = new HashMap<String, String>(); in the KeystoneProject
  • Create getExtra / setExtra with @JsonAnyGetter and @JsonAnySetter which are called when there are no explicitly mapped field.
  • Ignore is_domain field in setExtra which is automatically calculated field from keystone. Currently openstack4j just ignores this field. However with this patch if we don't ignore this in setExtra, it will be re-sent to the keystone during project update call and keystone will keep this in DB's extra fields.
  • Put @JsonIgnore on getLinks(), because if it's re-sent to keystone while project update, it will be interpreted as extra field just like is_domain.
  • Put @JsonIgnoreProperties(value = "extra" , ignoreUnknown = true) on KeystoneProject class. If we don't provide this on KeystoneProject class, private Map<String, String> extra = new HashMap<String, String>(); will be translated to "extra": { .... }. This is not working in IdentityV3. Puting @JsonIgnore on private Map<String, String> extra = new HashMap<String, String>(); doesn't not working for @JsonAnyGetter and @JsonAnySetter as well. I found that this is the only way not to send extra field to keystone.

You can not find the exact blueprint for this in keystone but I can find relevant the blueprint in horizon.

Because it's only visible when the additional field is input, there is not much examples in OpenStack IdentityV3 spec.

You can fine the some evidence in the following. is_domain field.
http://developer.openstack.org/api-ref-identity-v3.html#updateProject

@junoyoon junoyoon changed the title add extra field on project Fix #784: add extra field on project Jun 30, 2016
@junoyoon junoyoon changed the title Fix #784: add extra field on project Fix #734: add extra field on project Jun 30, 2016
@auhlig
Copy link
Member

auhlig commented Jun 30, 2016

Hi @junoyoon,
Could you paste a link to the documentation of the feature above in the idv3 api?

@junoyoon
Copy link
Contributor Author

@auhlig Added.

@auhlig
Copy link
Member

auhlig commented Jun 30, 2016

@junoyoon Thanks. I initially was aware of the is_domain but not of the extra field.

LGTM

@vinodborole
Copy link
Contributor

LGTM

1 similar comment
@gondor
Copy link
Member

gondor commented Jul 2, 2016

LGTM

@gondor gondor merged commit 5926e2e into ContainX:master Jul 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants