On 02/25/2019 08:36 AM, Akihiro Motoki wrote:
Hi API-SIG, neutron and tagging-related folks,
This email ask opinions on tagging when creating a resource.
We received a feature request to support tagging when creating a resource [1]. Neutron supports bulk creation of resources but the current tagging API recommended by the API-SIG does not define tagging when creating a resource. As a result, if we want to create 100 ports with specific tags, we need 1 (bulk creation) +100 (taggins per resource) API calls.
It sounds nice to me to support tagging when creating a resource to address the above problem. What in my mind is to specify 'tags' attribute in a body of POST request like:
{'port': {'name': 'foo', 'network_id': <network-id>, 'tags': ['red', 'blue'] } }
I don't know the reason why the current API-SIG recommended tagging API does not support this model. The current tagging API defines "tags" as a subresource.
I think you're asking why the API working group's guidelines on tags don't have an example of setting one or more tags for some resource at the same time as the resource's creation? Probably just a simple oversight, frankly. The Compute API @ version 2.52 allows setting tags on a server instance (the main HTTP resource) on creation using exactly the same format that you describe above: https://developer.openstack.org/api-ref/compute/?expanded=create-server-deta... Best, -jay