metadata support for vcloud organization
To help us process your pull request efficiently, please include:
-
Ability to inject metadata for Organization
-
I was referencing to VCD metadata set/get/remove and tested based on real vcloud environment but sadly I am not good enough to write test for it now. I believe it can boost process of this functionality be available in core library.
@chitashvili you can run tox -e flake8 in your local development environment to check the lint issues before you push the code to remote.
If you can rebase and stash the additional commit it would be nice so that changes are merged to master as single commit.
Rebase interactively
git rebase -i master
Change the commits to squash Update the commit message Push to origin branch forcefully
Hello @cdivitotawela and thank you very much for information and guidance. Did I do all correct?
Since I do not have automatic tests I wanted to add some functions with outputs what I was testing with vCloud Organization metadata
Add metadata to vCloud Organizations:
dict = {
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
def vcd_set_org_metadata(org_name, dict):
client = vcd_connect()
org_record = client.get_org_by_name(org_name)
org = Org(client, href=org_record.get('href'))
org.set_multiple_metadata(dict)
client.logout()
Remove metadata to vCloud Organizations:
def vcd_remove_org_metadata(org_name, key):
client = vcd_connect()
org_record = client.get_org_by_name(org_name)
org = Org(client, href=org_record.get('href'))
org.remove_metadata(key)
client.logout()
Fetchs list of metadata from vCloud Organizations:
def vcd_get_org_metadata(org_name):
client = vcd_connect()
org_record = client.get_org_by_name(org_name)
org = Org(client, href=org_record.get('href'))
meta = metadata_to_dict(org.get_all_metadata())
client.logout()
return meta
Output:
{"Demo": {"metas": {"key1": "value1", "key2": "value2"}}}
@chitashvili looks good now. Only one commit so when it is merged it will have one commit on the master.
Hello,
Can I get some guidance how we can this PR get merged, if it is something needed to be done for that?
Thank you
Hello @pandeys and thank you for information. I will try to do it asap.
Does anyone have spare cycles to get this PR completed? The ability to pull metadata at this level would be very helpful.