OpenStack Compute (Nova)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

extended_server_attributes.py 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Copyright 2016 Cloudbase Solutions Srl
  2. # All Rights Reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  5. # not use this file except in compliance with the License. You may obtain
  6. # a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. # License for the specific language governing permissions and limitations
  14. # under the License.
  15. from oslo_policy import policy
  16. from nova.policies import base
  17. BASE_POLICY_NAME = 'os_compute_api:os-extended-server-attributes'
  18. extended_server_attributes_policies = [
  19. policy.DocumentedRuleDefault(
  20. BASE_POLICY_NAME,
  21. base.RULE_ADMIN_API,
  22. """Return extended attributes for server.
  23. This rule will control the visibility for a set of servers attributes:
  24. - ``OS-EXT-SRV-ATTR:host``
  25. - ``OS-EXT-SRV-ATTR:instance_name``
  26. - ``OS-EXT-SRV-ATTR:reservation_id`` (since microversion 2.3)
  27. - ``OS-EXT-SRV-ATTR:launch_index`` (since microversion 2.3)
  28. - ``OS-EXT-SRV-ATTR:hostname`` (since microversion 2.3)
  29. - ``OS-EXT-SRV-ATTR:kernel_id`` (since microversion 2.3)
  30. - ``OS-EXT-SRV-ATTR:ramdisk_id`` (since microversion 2.3)
  31. - ``OS-EXT-SRV-ATTR:root_device_name`` (since microversion 2.3)
  32. - ``OS-EXT-SRV-ATTR:user_data`` (since microversion 2.3)
  33. """,
  34. [
  35. {
  36. 'method': 'GET',
  37. 'path': '/servers/{id}'
  38. },
  39. {
  40. 'method': 'GET',
  41. 'path': '/servers/detail'
  42. }
  43. ]
  44. ),
  45. ]
  46. def list_rules():
  47. return extended_server_attributes_policies