<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:299071578;
        mso-list-template-ids:-488080206;}
@list l1
        {mso-list-id:1636906725;
        mso-list-template-ids:996548060;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l2
        {mso-list-id:2079397122;
        mso-list-template-ids:1533316302;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222">We need a way to let Horizon know about the presence of cinder-backup service so that it can enable the volume backup operations in the UI (</span><a href="https://bugs.launchpad.net/cinder/+bug/1334856" target="_blank"><span style="color:#1155CC;background:white">https://bugs.launchpad.net/cinder/+bug/1334856</span></a><span style="color:#222222">).<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222">The backup action does not have any restrictions on who can perform it as evidenced by the following policy in<span class="apple-converted-space"> </span><a href="https://github.com/openstack/cinder/blob/master/etc/cinder/policy.json" target="_blank"><span style="color:#1155CC">etc/cinder/policy.json</span></a>:<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#183691">"backup:create"</span><span style="color:#333333"> :
</span><span style="color:#183691">""</span><span style="color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222">However, the only API that can tell Horizon about the existence of this service, namely the "</span><span style="color:#222222">os-services"</span><span class="apple-converted-space"><span style="color:#222222"> </span></span><span style="color:#222222">API
 extension (that corresponds to the "</span><span style="color:#222222">cinder service-list"</span><span class="apple-converted-space"><span style="color:#222222"> </span></span><span style="color:#222222">client command) is admin-only:<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#183691">"volume_extension:services:index"</span><span style="color:#333333">:
</span><span style="color:#183691">"rule:admin_api"</span><span style="color:#222222"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222">Today, Horizon<span class="apple-converted-space"> </span><a href="http://docs.openstack.org/developer/horizon/topics/settings.html" target="_blank"><span style="color:#1155CC">uses</span></a><span class="apple-converted-space"> </span>a
 config setting<span class="apple-converted-space"> </span></span><span style="color:#222222">"enable_backup"</span><span style="color:#222222">, that needs to be manually set in order to enable backup functionality in Horizon. We need a way for Horizon to
 figure this out itself, programmatically.<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222">I can think of two ways:<o:p></o:p></span></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoNormal" style="color:#222222;mso-list:l2 level1 lfo1">Modify the services:index action to take a details=true/false parameter (http://{cinder-endpoint}/v2/{tenant-id}/os-services<b>?details=false</b>). And define different policies for detail=true(admin_api)
 and detail=false ("" i.e. unrestricted).<o:p></o:p></li></ol>
<ol style="margin-top:0in" start="1" type="1">
<ul style="margin-top:0in" type="disc">
<li class="MsoNormal" style="color:#222222;mso-list:l1 level2 lfo3"><span style="color:#183691">"volume_extension:services:index_with_details"</span><span style="color:#333333">:
</span><span style="color:#183691">"rule:admin_api"</span><o:p></o:p></li><li class="MsoNormal" style="color:#222222;mso-list:l1 level2 lfo3"><span style="color:#183691">"volume_extension:services:index_without_details"</span><span style="color:#333333">:
</span><span style="color:#183691">"”</span><o:p></o:p></li></ul>
<li class="MsoNormal" style="color:#222222;mso-list:l1 level1 lfo3">Raise the abstraction level by creating a Cinder API extension that returns the list of "service capabilities". That is, the list of functionality that the cinder service supports. This will
 return only "volume backup" for now but can be augmented as new capabilities are added to Cinder.<o:p></o:p></li></ol>
<p class="MsoNormal" style="margin-left:.5in"><span style="color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222">I don't know if #1 can be implemented in a backward compatible way and also whether there is precedence for splitting the policy of a single API call based on parameters.<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222">#2 seems the traditional way to do it, but I am afraid that "service capabilities" terminology clashes with existing "volume capabilities"<span class="apple-converted-space"> </span><a href="https://github.com/openstack/cinder/blob/master/cinder/api/contrib/capabilities.py" target="_blank"><span style="color:#1155CC">extension</span></a>,
 which has a different purpose.<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222">I would appreciate any input on this.<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="color:#222222">Deepti<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>