Merge "Add description to policies in aggregates.py"

This commit is contained in:
Jenkins 2017-03-28 11:19:48 +00:00 committed by Gerrit Code Review
commit c549866308

View File

@ -22,33 +22,89 @@ POLICY_ROOT = 'os_compute_api:os-aggregates:%s'
aggregates_policies = [ aggregates_policies = [
policy.RuleDefault( base.create_rule_default(
name=POLICY_ROOT % 'set_metadata', POLICY_ROOT % 'set_metadata',
check_str=base.RULE_ADMIN_API), base.RULE_ADMIN_API,
policy.RuleDefault( "Create or replace metadata for an aggregate",
name=POLICY_ROOT % 'add_host', [
check_str=base.RULE_ADMIN_API), {
'path': '/os-aggregates/{aggregate_id}/action (set_metadata)',
'method': 'POST'
}
]),
base.create_rule_default(
POLICY_ROOT % 'add_host',
base.RULE_ADMIN_API,
"Add a host to an aggregate.",
[
{
'path': '/os-aggregates/{aggregate_id}/action (add_host)',
'method': 'POST'
}
]),
policy.RuleDefault( policy.RuleDefault(
name=POLICY_ROOT % 'discoverable', name=POLICY_ROOT % 'discoverable',
check_str=base.RULE_ANY), check_str=base.RULE_ANY),
policy.RuleDefault( base.create_rule_default(
name=POLICY_ROOT % 'create', POLICY_ROOT % 'create',
check_str=base.RULE_ADMIN_API), base.RULE_ADMIN_API,
policy.RuleDefault( "Create an aggregate",
name=POLICY_ROOT % 'remove_host', [
check_str=base.RULE_ADMIN_API), {
policy.RuleDefault( 'path': '/os-aggregates',
name=POLICY_ROOT % 'update', 'method': 'POST'
check_str=base.RULE_ADMIN_API), }
policy.RuleDefault( ]),
name=POLICY_ROOT % 'index', base.create_rule_default(
check_str=base.RULE_ADMIN_API), POLICY_ROOT % 'remove_host',
policy.RuleDefault( base.RULE_ADMIN_API,
name=POLICY_ROOT % 'delete', "Remove a host from an aggregate",
check_str=base.RULE_ADMIN_API), [
policy.RuleDefault( {
name=POLICY_ROOT % 'show', 'path': '/os-aggregates/{aggregate_id}/action (remove_host)',
check_str=base.RULE_ADMIN_API), 'method': 'POST'
}
]),
base.create_rule_default(
POLICY_ROOT % 'update',
base.RULE_ADMIN_API,
"Update name and/or availability zone for an aggregate",
[
{
'path': '/os-aggregates/{aggregate_id}',
'method': 'PUT'
}
]),
base.create_rule_default(
POLICY_ROOT % 'index',
base.RULE_ADMIN_API,
"List all aggregates",
[
{
'path': '/os-aggregates',
'method': 'GET'
}
]),
base.create_rule_default(
POLICY_ROOT % 'delete',
base.RULE_ADMIN_API,
"Delete an aggregate",
[
{
'path': '/os-aggregates/{aggregate_id}',
'method': 'DELETE'
}
]),
base.create_rule_default(
POLICY_ROOT % 'show',
base.RULE_ADMIN_API,
"Show details for an aggregate.",
[
{
'path': '/os-aggregates/{aggregate_id}',
'method': 'GET'
}
]),
] ]