tacker.api.v1.resource_helper module¶
- tacker.api.v1.resource_helper.build_plural_mappings(special_mappings, resource_map)¶
Create plural to singular mapping for all resources.
Allows for special mappings to be provided, like policies -> policy. Otherwise, will strip off the last character for normal mappings, like routers -> router.
- tacker.api.v1.resource_helper.build_resource_info(plural_mappings, resource_map, which_service, action_map=None, translate_name=False, allow_bulk=False)¶
Build resources for advanced services.
Takes the resource information, and singular/plural mappings, and creates API resource objects for advanced services extensions. Will optionally translate underscores to dashes in resource names, register the resource, and accept action information for resources.
- Parameters:
plural_mappings – mappings between singular and plural forms
resource_map – attribute map for the WSGI resources to create
which_service – The name of the service for which the WSGI resources are being created. This name will be used to pass the appropriate plugin to the WSGI resource. It can be set to None or “CORE”to create WSGI resources for the core plugin
action_map – custom resource actions
translate_name – replaces underscores with dashes
allow_bulk – True if bulk create are allowed