def append_v3_routers(mapper, routers): trust_controller = controllers.TrustV3() mapper.connect('/OS-TRUST/trusts', controller=trust_controller, action='create_trust', conditions=dict(method=['POST'])) mapper.connect('/OS-TRUST/trusts', controller=trust_controller, action='list_trusts', conditions=dict(method=['GET'])) mapper.connect('/OS-TRUST/trusts/{trust_id}', controller=trust_controller, action='delete_trust', conditions=dict(method=['DELETE'])) mapper.connect('/OS-TRUST/trusts/{trust_id}', controller=trust_controller, action='get_trust', conditions=dict(method=['GET'])) mapper.connect('/OS-TRUST/trusts/{trust_id}/roles', controller=trust_controller, action='list_roles_for_trust', conditions=dict(method=['GET'])) mapper.connect('/OS-TRUST/trusts/{trust_id}/roles/{role_id}', controller=trust_controller, action='get_role_for_trust', conditions=dict(method=['GET', 'HEAD']))
def append_v3_routers(self, mapper, routers): trust_controller = controllers.TrustV3() self._add_resource( mapper, trust_controller, path='/OS-TRUST/trusts', get_action='list_trusts', post_action='create_trust', rel=_build_resource_relation(resource_name='trusts')) self._add_resource( mapper, trust_controller, path='/OS-TRUST/trusts_for_admin', post_action='create_trust_for_admin', rel=_build_resource_relation(resource_name='trusts')) self._add_resource(mapper, trust_controller, path='/OS-TRUST/trusts/{trust_id}', get_action='get_trust', delete_action='delete_trust', rel=_build_resource_relation(resource_name='trust'), path_vars={ 'trust_id': TRUST_ID_PARAMETER_RELATION, }) self._add_resource( mapper, trust_controller, path='/OS-TRUST/trusts/{trust_id}/roles', get_action='list_roles_for_trust', rel=_build_resource_relation(resource_name='trust_roles'), path_vars={ 'trust_id': TRUST_ID_PARAMETER_RELATION, }) self._add_resource( mapper, trust_controller, path='/OS-TRUST/trusts/{trust_id}/roles/{role_id}', get_head_action='get_role_for_trust', rel=_build_resource_relation(resource_name='trust_role'), path_vars={ 'trust_id': TRUST_ID_PARAMETER_RELATION, 'role_id': json_home.Parameters.ROLE_ID, })
def append_v3_routers(self, mapper, routers): trust_controller = controllers.TrustV3() self._add_resource(mapper, trust_controller, path='/OS-TRUST/trusts', get_action='list_trusts', post_action='create_trust') self._add_resource(mapper, trust_controller, path='/OS-TRUST/trusts/{trust_id}', get_action='get_trust', delete_action='delete_trust') self._add_resource(mapper, trust_controller, path='/OS-TRUST/trusts/{trust_id}/roles', get_action='list_roles_for_trust') self._add_resource(mapper, trust_controller, path='/OS-TRUST/trusts/{trust_id}/roles/{role_id}', get_head_action='get_role_for_trust')