• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python requestutil.prepare_response函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中son_editor.util.requestutil.prepare_response函数的典型用法代码示例。如果您正苦于以下问题:Python prepare_response函数的具体用法?Python prepare_response怎么用?Python prepare_response使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了prepare_response函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: get

 def get(self, ws_id, parent_id):
     """Get a list of all Services
     Returns a list of all services available in this resource"""
     if get_parent(request) is Category.project:
         service = servicesimpl.get_services(ws_id, parent_id)
         return prepare_response(service)
     if get_parent(request) is Category.catalogue:
         service = catalogue_servicesimpl.get_all_in_catalogue(ws_id, parent_id, False)
         return prepare_response(service)
     return prepare_response("not yet implemented")
开发者ID:Jmanuel4SandMan,项目名称:upb-son-editor-backend,代码行数:10,代码来源:servicesapi.py


示例2: delete

    def delete(self, ws_id, parent_id, service_id):
        """Delete the Service

        Deletes the service from the Project or Catalogue"""
        if get_parent(request) is Category.project:
            service = servicesimpl.delete_service(parent_id, service_id)
            return prepare_response(service)
        if get_parent(request) is Category.catalogue:
            service = catalogue_servicesimpl.delete_service_catalogue(ws_id, parent_id, service_id, False)
            return prepare_response(service)
        return prepare_response("not yet implemented")
开发者ID:Jmanuel4SandMan,项目名称:upb-son-editor-backend,代码行数:11,代码来源:servicesapi.py


示例3: get

    def get(self, ws_id, parent_id):
        """List all functions

        Lists all available functions in the given project or catalogue."""
        if get_parent(request) is Category.project:
            functions = functionsimpl.get_functions(ws_id, parent_id)
            return prepare_response(functions)
        if get_parent(request) is Category.catalogue:
            functions = catalogue_servicesimpl.get_all_in_catalogue(ws_id, parent_id, True)
            return prepare_response(functions)
        return prepare_response("not yet implemented")
开发者ID:Jmanuel4SandMan,项目名称:upb-son-editor-backend,代码行数:11,代码来源:functionsapi.py


示例4: delete

    def delete(self, ws_id, parent_id, vnf_id):
        """Deletes a  function

        Deletes a function in the project or catalogue by its id"""
        if get_parent(request) is Category.project:
            deleted = functionsimpl.delete_function(ws_id, parent_id, vnf_id)
            return prepare_response(deleted)
        if get_parent(request) is Category.catalogue:
            deleted = catalogue_servicesimpl.delete_service_catalogue(ws_id, parent_id, vnf_id, True)
            return prepare_response(deleted)
        # TODO implement for catalog and platform
        return prepare_response("not yet implemented")
开发者ID:Jmanuel4SandMan,项目名称:upb-son-editor-backend,代码行数:12,代码来源:functionsapi.py


示例5: put

    def put(self, ws_id, parent_id, vnf_id):
        """Updates a function

        Updates a function in the project or catalogue by its id"""
        if get_parent(request) is Category.project:
            vnf_data = get_json(request)
            vnf_data = functionsimpl.update_function(ws_id, parent_id, vnf_id, vnf_data)
            return prepare_response(vnf_data)
        if get_parent(request) is Category.catalogue:
            vnf_data = get_json(request)
            vnf_data = catalogue_servicesimpl.update_service_catalogue(ws_id, parent_id, vnf_id, vnf_data, True)
            return prepare_response(vnf_data)
        return prepare_response("update vnf in project with id " + parent_id)
开发者ID:Jmanuel4SandMan,项目名称:upb-son-editor-backend,代码行数:13,代码来源:functionsapi.py


示例6: post

    def post(self, ws_id, parent_id):
        """Creates a new function

        Creates a new function in the project or catalogue"""
        if get_parent(request) is Category.project:
            vnf_data = get_json(request)
            vnf_data = functionsimpl.create_function(ws_id, parent_id, vnf_data)
            return prepare_response(vnf_data, 201)
        if get_parent(request) is Category.catalogue:
            vnf_data = get_json(request)
            vnf_data = catalogue_servicesimpl.create_in_catalogue(parent_id, vnf_data['id'],
                                                                  True)
            return prepare_response(vnf_data, 201)
        # TODO implement for catalog and platform
        return prepare_response("not implemented yet")
开发者ID:Jmanuel4SandMan,项目名称:upb-son-editor-backend,代码行数:15,代码来源:functionsapi.py


示例7: get

    def get(self, ws_id):
        """
        List private Catalogue services

        Lists all services in the Private workspace wide catalogue
        """
        return prepare_response(get_private_nsfs_list(ws_id, False))
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:7,代码来源:workspacesapi.py


示例8: get

    def get(self, ws_id, catalogue_id):
        """List all functions

        Lists all available functions in the given project or catalogue."""

        functions = catalogue_servicesimpl.get_all_in_catalogue(ws_id, catalogue_id, True)
        return prepare_response(functions)
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:7,代码来源:catalogue_functionsapi.py


示例9: post

    def post(self, ws_id, project_id):
        """Create a new Service

        Creates a new Service in this project or
        publishes it in the catalogue or platform"""
        service = servicesimpl.create_service(ws_id, project_id, get_json(request))
        return prepare_response(service, 201)
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:7,代码来源:project_servicesapi.py


示例10: put

    def put(self, ws_id, project_id, vnf_id):
        """Updates a function

        Updates a function in the project or catalogue by its id"""
        vnf_data = get_json(request)
        vnf_data = functionsimpl.update_function(ws_id, project_id, vnf_id, vnf_data)
        return prepare_response(vnf_data)
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:7,代码来源:project_functionsapi.py


示例11: post

    def post(self, ws_id):
        """Creates a new project

        Creates a new project in the given workspace"""
        projectData = get_json(request)
        pj = projectsimpl.create_project(ws_id, projectData)
        return prepare_response(pj, 201)
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:7,代码来源:projectsapi.py


示例12: put

 def put(self, ws_id):
     """Update workspace
     
     Updates a specific workspace by its id"""
     workspace_data = get_json(request)
     workspace = workspaceimpl.update_workspace(workspace_data, ws_id)
     return prepare_response(workspace)
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:7,代码来源:workspacesapi.py


示例13: get

 def get(self, ws_id):
     """
     Returns a list of all schemas configured for this server
     :param ws_id:
     :return:
     """
     return prepare_response(descriptorutil.get_schemas())
开发者ID:Jmanuel4SandMan,项目名称:upb-son-editor-backend,代码行数:7,代码来源:schemaapi.py


示例14: post

    def post(self, ws_id, project_id):
        """Creates a new function

        Creates a new function in the project or catalogue"""
        vnf_data = get_json(request)
        vnf_data = functionsimpl.create_function(ws_id, project_id, vnf_data)
        return prepare_response(vnf_data, 201)
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:7,代码来源:project_functionsapi.py


示例15: delete

    def delete(self, ws_id, catalogue_id, vnf_id):
        """Deletes a  function

        Deletes a function in the project or catalogue by its id"""

        deleted = catalogue_servicesimpl.delete_service_catalogue(ws_id, catalogue_id, vnf_id, True)
        return prepare_response(deleted)
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:7,代码来源:catalogue_functionsapi.py


示例16: post

    def post(self):
        """Create workspace

        Creates a new workspace"""
        workspace_data = get_json(request)
        workspace = workspaceimpl.create_workspace(session['user_data']['login'], workspace_data)
        return prepare_response(workspace, 201)
开发者ID:Jmanuel4SandMan,项目名称:upb-son-editor-backend,代码行数:7,代码来源:workspacesapi.py


示例17: handle_unauthorized

def handle_unauthorized(msg: str):
    args = {"scope": "user:email repo delete_repo",
            "client_id": get_config()['authentication']['ClientID']}
    session["requested_endpoint"] = request.endpoint
    return prepare_response({
        'authorizationUrl': 'https://github.com/login/oauth/authorize/?{}'.format(urllib.parse.urlencode(args)),
        "message": msg}, 401)
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:7,代码来源:__main__.py


示例18: post

    def post(self, ws_id, parent_id):
        """Create a new Service

        Creates a new Service in this project or
        publishes it in the catalogue or platform"""
        if get_parent(request) is Category.project:
            service = servicesimpl.create_service(ws_id, parent_id, get_json(request))
            return prepare_response(service, 201)
        elif get_parent(request) is Category.platform:
            result = platform_connector.create_service_on_platform(ws_id, parent_id, get_json(request))
            return prepare_response(result, 201)
        if get_parent(request) is Category.catalogue:
            vnf_data = get_json(request)
            service = catalogue_servicesimpl.create_in_catalogue(parent_id, vnf_data['id'], False)
            return prepare_response(service)
        return prepare_response("not yet implemented")
开发者ID:Jmanuel4SandMan,项目名称:upb-son-editor-backend,代码行数:16,代码来源:servicesapi.py


示例19: post

 def post(self, ws_id, platform_id):
     """
     Upload a service package
     
     Packages and uploads a network service to the platform
     """
     result = platform_connector.create_service_on_platform(ws_id, platform_id, get_json(request))
     return prepare_response(result, 201)
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:8,代码来源:platformsapi.py


示例20: put

    def put(self, ws_id, catalogue_id, vnf_id):
        """Updates a function

        Updates a function in the project or catalogue by its id"""

        vnf_data = get_json(request)
        vnf_data = catalogue_servicesimpl.update_service_catalogue(ws_id, catalogue_id, vnf_id, vnf_data, True)
        return prepare_response(vnf_data)
开发者ID:CN-UPB,项目名称:upb-son-editor-backend,代码行数:8,代码来源:catalogue_functionsapi.py



注:本文中的son_editor.util.requestutil.prepare_response函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python song.Song类代码示例发布时间:2022-05-27
下一篇:
Python database.db_session函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap