[api][neutron] tagging support when creating a resource

Akihiro Motoki amotoki at gmail.com
Fri Mar 1 13:56:50 UTC 2019


On Tue, Feb 26, 2019 at 2:25 AM Ed Leafe <ed at leafe.com> wrote:

> On Feb 25, 2019, at 7:36 AM, Akihiro Motoki <amotoki at gmail.com> wrote:
> >
> > 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.
> > Is there any reason this model was adopted?
>
> Tags are strings attached to resources, so there really should be no
> difference when creating a resource with tags than when creating a resource
> with a name. The part of the guideline for modifying tags assumes that the
> resource already exists.
>
> We could certainly add additional wording that clarifies that resources
> can be created with tags; there certainly isn’t anything in the current
> guideline that says they can’t.
>

Thanks Ed and Jay.
As Miguel mentioned, we the neutron team would like to align the
community-wide guideline.
I agree that we can add some additional notes in the API-SIG docs.

In addition, we can also use the similar syntax in PUT/PATCH operation to
update existing tags of a resource.
This would simplify the implementation of SDKs (from my experience of
implementing the tag support in OpenStackSDK).

{'port': {'tags': ['red', 'blue'] } }

Best Regards,
Akihiro Motoki



>
>
> -- Ed Leafe
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20190301/41506c73/attachment-0001.html>


More information about the openstack-discuss mailing list