<html><body><p><font size="2">yes, I didn't go to that detail and missed the delete flag , that's exactly what I am looking for, which is a little bit confusing...</font><br><font size="2">Thanks for the info for know this...</font><br><br><font size="2">Best Regards! <br><br>Kevin (Chen) Ji ¼Í ³¿<br><br>Engineer, zVM Development, CSTL<br>Notes: Chen CH Ji/China/IBM@IBMCN   Internet: jichenjc@cn.ibm.com<br>Phone: +86-10-82451493<br>Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian District, Beijing 100193, PRC </font><br><br><img width="16" height="16" src="cid:1__=8FBB0B31DF8DD9E88f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for Matt Riedemann ---09/20/2017 09:15:15 PM---On 9/20/2017 12:48 AM, Chen CH Ji wrote: > in analyzing ot"><font size="2" color="#424282">Matt Riedemann ---09/20/2017 09:15:15 PM---On 9/20/2017 12:48 AM, Chen CH Ji wrote: > in analyzing other code, found seems we don't need PUT</font><br><br><font size="2" color="#5F5F5F">From:        </font><font size="2">Matt Riedemann <mriedemos@gmail.com></font><br><font size="2" color="#5F5F5F">To:        </font><font size="2">openstack-dev@lists.openstack.org</font><br><font size="2" color="#5F5F5F">Date:        </font><font size="2">09/20/2017 09:15 PM</font><br><font size="2" color="#5F5F5F">Subject:        </font><font size="2">Re: [openstack-dev] [nova][api] why need PUT /servers/{server_id}/metadata/{key} ?</font><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><tt><font size="2">On 9/20/2017 12:48 AM, Chen CH Ji wrote:<br>> in analyzing other code, found seems we don't need PUT <br>> /servers/{server_id}/metadata/{key} ?<br>> <br>> as the id is only used for check whether it's in the body and we will <br>> honor the whole body (body['meta'] in the code)<br>> </font></tt><tt><font size="2"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openstack_nova_blob_master_nova_api_openstack_compute_server-5Fmetadata.py-23L80&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=8sI5aZT88Uetyy_XsOddbPjIiLSGM-sFnua3lLy2Xr0&m=DSFbFb2bqll3hC8yrttkW6teiZtFod4XBQIC8jauVlE&s=1S1y1O0K2KOZgQd1wmx5_P8IhzNqf-i6d4IThx0yLrI&e=">https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openstack_nova_blob_master_nova_api_openstack_compute_server-5Fmetadata.py-23L80&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=8sI5aZT88Uetyy_XsOddbPjIiLSGM-sFnua3lLy2Xr0&m=DSFbFb2bqll3hC8yrttkW6teiZtFod4XBQIC8jauVlE&s=1S1y1O0K2KOZgQd1wmx5_P8IhzNqf-i6d4IThx0yLrI&e=</a></font></tt><tt><font size="2"> <br>> <br>> looks like it's identical to<br>> PUT /servers/{server_id}/metadata<br>> <br>> why we need this API or it should be something like<br>> <br>> PUT /servers/{server_id}/metadata/{key}but we only accept a value to <br>> modify the meta given by {key} in the API side?<br>> <br>> Best Regards!<br>> <br>> Kevin (Chen) Ji ¼Í ³¿<br>> <br>> Engineer, zVM Development, CSTL<br>> Notes: Chen CH Ji/China/IBM@IBMCN Internet: jichenjc@cn.ibm.com<br>> Phone: +86-10-82451493<br>> Address: 3/F Ring Building, ZhongGuanCun Software Park, Haidian <br>> District, Beijing 100193, PRC<br>> <br>> <br>> __________________________________________________________________________<br>> OpenStack Development Mailing List (not for usage questions)<br>> Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe<br>> </font></tt><tt><font size="2"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openstack.org_cgi-2Dbin_mailman_listinfo_openstack-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=8sI5aZT88Uetyy_XsOddbPjIiLSGM-sFnua3lLy2Xr0&m=DSFbFb2bqll3hC8yrttkW6teiZtFod4XBQIC8jauVlE&s=EMTJozBhxl7wXNyB7emtzxXMkegVXKWV6Ko8E2uhsPs&e=">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openstack.org_cgi-2Dbin_mailman_listinfo_openstack-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=8sI5aZT88Uetyy_XsOddbPjIiLSGM-sFnua3lLy2Xr0&m=DSFbFb2bqll3hC8yrttkW6teiZtFod4XBQIC8jauVlE&s=EMTJozBhxl7wXNyB7emtzxXMkegVXKWV6Ko8E2uhsPs&e=</a></font></tt><tt><font size="2"> <br>> <br><br>This API is a bit confusing, and the code is too since it all goes down <br>to some common code, and I think you're missing the 'delete' flag:<br><br></font></tt><tt><font size="2"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openstack_nova_blob_5bf1bb47c7e17c26592a699d07c2faa59d98bfb8_nova_compute_api.py-23L3830&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=8sI5aZT88Uetyy_XsOddbPjIiLSGM-sFnua3lLy2Xr0&m=DSFbFb2bqll3hC8yrttkW6teiZtFod4XBQIC8jauVlE&s=AMY4S8Ux0G78V_Nu2H17kNivICkiKErqDzPj0eFsUgg&e=">https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openstack_nova_blob_5bf1bb47c7e17c26592a699d07c2faa59d98bfb8_nova_compute_api.py-23L3830&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=8sI5aZT88Uetyy_XsOddbPjIiLSGM-sFnua3lLy2Xr0&m=DSFbFb2bqll3hC8yrttkW6teiZtFod4XBQIC8jauVlE&s=AMY4S8Ux0G78V_Nu2H17kNivICkiKErqDzPj0eFsUgg&e=</a></font></tt><tt><font size="2"> <br><br>If delete=False, as it is in this case, we only add/update the existing <br>metadata with the new metadata from the request body. If delete=True, <br>then we overwrite the instance metadata with whatever is in the request.<br><br>Does that answer your question?<br><br>This API is problematic and we have bugs against it since it's not <br>atomic, i.e. two concurrent requests will overwrite one of them. We <br>should really have a generation ID or etag on this data to be sure it's <br>atomically updated.<br><br>-- <br><br>Thanks,<br><br>Matt<br><br>__________________________________________________________________________<br>OpenStack Development Mailing List (not for usage questions)<br>Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe<br></font></tt><tt><font size="2"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openstack.org_cgi-2Dbin_mailman_listinfo_openstack-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=8sI5aZT88Uetyy_XsOddbPjIiLSGM-sFnua3lLy2Xr0&m=DSFbFb2bqll3hC8yrttkW6teiZtFod4XBQIC8jauVlE&s=EMTJozBhxl7wXNyB7emtzxXMkegVXKWV6Ko8E2uhsPs&e=">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openstack.org_cgi-2Dbin_mailman_listinfo_openstack-2Ddev&d=DwIGaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=8sI5aZT88Uetyy_XsOddbPjIiLSGM-sFnua3lLy2Xr0&m=DSFbFb2bqll3hC8yrttkW6teiZtFod4XBQIC8jauVlE&s=EMTJozBhxl7wXNyB7emtzxXMkegVXKWV6Ko8E2uhsPs&e=</a></font></tt><tt><font size="2"> <br><br></font></tt><br><br><BR>
</body></html>