Merge "Add policy description for os-host"

This commit is contained in:
Jenkins 2017-05-24 17:02:31 +00:00 committed by Gerrit Code Review
commit f4791a864a
1 changed files with 32 additions and 5 deletions

View File

@ -13,8 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_policy import policy
from nova.policies import base
@ -22,9 +20,38 @@ BASE_POLICY_NAME = 'os_compute_api:os-hosts'
hosts_policies = [
policy.RuleDefault(
name=BASE_POLICY_NAME,
check_str=base.RULE_ADMIN_API),
base.create_rule_default(
BASE_POLICY_NAME,
base.RULE_ADMIN_API,
"""List, Show and Manage physical hosts.
These APIs are all deprecated in favor of os-hypervisors and os-services.""",
[
{
'method': 'GET',
'path': '/os-hosts'
},
{
'method': 'GET',
'path': '/os-hosts/{host_name}'
},
{
'method': 'PUT',
'path': '/os-hosts/{host_name}'
},
{
'method': 'GET',
'path': '/os-hosts/{host_name}/reboot'
},
{
'method': 'GET',
'path': '/os-hosts/{host_name}/shutdown'
},
{
'method': 'GET',
'path': '/os-hosts/{host_name}/startup'
}
]),
]