Ask Your Question
0

How to config the request body for tags when creating networks in Pike

asked 2019-09-03 16:54:43 -0500

MrQ gravatar image

updated 2019-09-03 17:01:05 -0500

How to assemble the request body when creating networks and setting up the "Tags" in OpenStack Pike?

I used to do like this: network = {'name': network_name, 'admin_state_up': True, 'shared': 'true', 'tenant_id': tenant_id, 'provider:network_type': 'vlan', 'provider:physical_network': 'some_network'} followed by something like this in python: neutronclient.v2_0.client.create_network(network)

But now we're using the "Tags" field in openstack network, and I was wondering shall I put a key: value pair where key being "tags" and value being a list of string tags, e.g. ["tag1", "tag2"], or value being a comma-separated string, e.g. "tag1,tag2"?

I might end up trying both and see which one works but hope to get some suggestion or comment before doing the blind trials. Any comments/suggestions/pointers would be appreciated and helpful. Thanks.

edit retag flag offensive close merge delete

Comments

I don't know about the neutronclient, but the API documentation says: "tags": ["tag1,tag2"].

Bernd Bausch gravatar imageBernd Bausch ( 2019-09-03 22:24:37 -0500 )edit

This doesn't make sense to me, though. I would expect a list of strings, one string per tag, not a single string containing tags.

Another strange detail in the API documentation: Tags are listed in the response parameters, but not in the request parameters. I suppose you have to experiment a bit.

Bernd Bausch gravatar imageBernd Bausch ( 2019-09-03 22:28:31 -0500 )edit

Thank you Bernd for the info! I just found another resource here: https://docs.openstack.org/neutron/pike/contributor/internals/tag.html (https://docs.openstack.org/neutron/pi...) which makes more sense as we need to provide a list of strings as you mentioned.

MrQ gravatar imageMrQ ( 2019-09-04 12:25:54 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-09-04 12:28:22 -0500

MrQ gravatar image

https://docs.openstack.org/neutron/pike/contributor/internals/tag.html (https://docs.openstack.org/neutron/pi...)

Just found a page stating the answer to my question. Thanks everyone!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-09-03 16:54:43 -0500

Seen: 8 times

Last updated: Sep 04