Zhiteng,<div><br></div><div>Sorry for the late reply. To me, I think it (API) should provide some message indicating user is querying against public flavor type. There's two reasons for doing this, as I mentioned before, mainly to differentiate private flavor with no associated projects.</div>
<div><br></div><div>In the latest patchset, I chose 'ALL TENANTS' string to deliver this message. Since this message is replied under 'tenant_id' section in the following format, and should be self-explanatory as well. I think 'ALL TENANTS' should be a reasonable choice. </div>
<div><br></div><div>>> {'flavor_access': [{'flavor_id': '1', 'tenant_id': 'ALL TENANTS'}]}</div><div><br></div><div>Long sentence, as you suggested, could make it more self-explanatory, but in the other way it could be harmful to the semantics of 'tenant_id' section.</div>
<div><br></div><div>So far, I'd like to keep the way it is, if no other better choice.</div><div><br></div><div>Best Regards,<br clear="all">--<br>Qiu Yu</div><div><a href="http://www.unicell.info/" target="_blank">http://www.unicell.info</a> <br>
<br><div class="gmail_quote">On Sat, Aug 25, 2012 at 3:59 PM, Huang Zhiteng <span dir="ltr"><<a href="mailto:winston.d@gmail.com" target="_blank">winston.d@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Sat, Aug 25, 2012 at 11:53 AM, unicell <<a href="mailto:unicell@gmail.com">unicell@gmail.com</a>> wrote:<br>
> Hi Folks,<br>
><br>
> In the review comments of my project-specific-flavor blueprint patch,<br>
> <a href="https://review.openstack.org/#/c/11270/" target="_blank">https://review.openstack.org/#/c/11270/</a><br>
> Kevin raised a question about response value for public flavor access list.<br>
> And I'd like to posted here for discussion.<br>
><br>
> Sorry for the following long description area, just to illustrate the<br>
> background here.<br>
> Please scroll down and you'll see the question at the end of this email.<br>
><br>
> Quick Background<br>
> --<br>
> Project specific flavor is meant to give a flavor management choice that,<br>
> some flavor (non-public) types are only accessible for some projects,<br>
> instead of globally visible. And this flavor access list is manageable<br>
> through this API and corresponding nova client bindings.<br>
><br>
> Quick Demo<br>
> --<br>
> # Adding a new private flavor, and it is not accessible by default<br>
> stack@precise64:~$ nova flavor-create --is_public false m1.special 801 512 0<br>
> 1<br>
> stack@precise64:~$ nova flavor-list<br>
> +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+<br>
> | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor<br>
> | Is_Public |<br>
> +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+<br>
> | 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0<br>
> | True |<br>
> | 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0<br>
> | True |<br>
> | 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0<br>
> | True |<br>
> | 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0<br>
> | True |<br>
> | 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0<br>
> | True |<br>
> +----+-----------+-----------+------+-----------+------+-------+-------------+-----------+<br>
><br>
> # Adding the current project to flavor 801's access list<br>
> stack@precise64:~$ nova flavor-access-add 801<br>
> 55ea56479a6a48d699acb7afe22f00f7<br>
> +-----------+----------------------------------+<br>
> | Flavor_ID | Tenant_ID |<br>
> +-----------+----------------------------------+<br>
> | 801 | 55ea56479a6a48d699acb7afe22f00f7 |<br>
> +-----------+----------------------------------+<br>
><br>
> # Then this flavor (801) is accessible from this project.<br>
> stack@precise64:~$ nova flavor-list<br>
> +-----+------------+-----------+------+-----------+------+-------+-------------+-----------+<br>
> | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs |<br>
> RXTX_Factor | Is_Public |<br>
> +-----+------------+-----------+------+-----------+------+-------+-------------+-----------+<br>
> | 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0<br>
> | True |<br>
> | 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0<br>
> | True |<br>
> | 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0<br>
> | True |<br>
> | 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0<br>
> | True |<br>
> | 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0<br>
> | True |<br>
> | 801 | m1.special | 512 | 0 | 0 | | 1 | 1.0<br>
> | False |<br>
> +-----+------------+-----------+------+-----------+------+-------+-------------+-----------+<br>
><br>
> # Retrieve flavor 801 access information<br>
> stack@precise64:~$ nova flavor-access-list --flavor 801<br>
> +-----------+----------------------------------+<br>
> | Flavor_ID | Tenant_ID |<br>
> +-----------+----------------------------------+<br>
> | 801 | 55ea56479a6a48d699acb7afe22f00f7 |<br>
> +-----------+----------------------------------+<br>
><br>
> # Retrieve public flavor access information<br>
> stack@precise64:~$ nova flavor-access-list --flavor 1<br>
> +-----------+-------------+<br>
> | Flavor_ID | Tenant_ID |<br>
> +-----------+-------------+<br>
> | 1 | ALL TENANTS |<br>
> +-----------+-------------+<br>
><br>
> Question<br>
> --<br>
> For the default public flavor types, is this "ALL TENANTS" an acceptable<br>
> solution? It was intended to provide a human readable message for public<br>
> flaovrs. And, to differentiate from a non-public flavor with no project<br>
> access configured.<br>
><br>
> Any better way to approach? Or, just leave it as it is?<br>
</div></div>Well, to me, 'ALL TENANTS' is somewhat better than 'ALL' in your early<br>
patchset. I once tried to make a non-public flavor public by<br>
'add-flavor-access' to an that flavor to the fake tenant 'ALL',<br>
because I though the name 'ALL' has some magic. How about a long<br>
sentence to state that target is a public tenant?<br>
<div class="im">><br>
> Best Regards,<br>
> --<br>
> Qiu Yu<br>
> <a href="http://www.unicell.info" target="_blank">http://www.unicell.info</a><br>
><br>
</div>> _______________________________________________<br>
> OpenStack-dev mailing list<br>
> <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Regards<br>
Huang Zhiteng<br>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</font></span></blockquote></div><br></div>