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)
Exemplo n.º 2
0
    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)
    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")
Exemplo n.º 4
0
    def put(self, ws_id, catalogue_id):
        """Updates a specific catalogue

        Updates a specific catalogue by its id"""
        return prepare_response(
            cataloguesimpl.update_catalogue(ws_id, catalogue_id,
                                            get_json(request)))
    def put(self, ws_id, project_id, service_id):
        """Update the service

        Updates the referenced service in the project or in the catalogue or platform"""
        service = servicesimpl.update_service(ws_id, project_id, service_id,
                                              get_json(request))
        return prepare_response(service)
 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)
    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)
Exemplo n.º 8
0
    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")
    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)
    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)
    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)
    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")
    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)
    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)
 def put(self, ws_id, platform_id):
     """Update platform
     
     Updates a service platform by its id"""
     return prepare_response(
         platformsimpl.update_platform(ws_id, platform_id,
                                       get_json(request)))
Exemplo n.º 16
0
 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)
Exemplo n.º 17
0
    def post(self, ws_id, catalogue_id):
        """Create a new Service

        Publishes a new Service in the catalogue"""

        vnf_data = get_json(request)
        service = catalogue_servicesimpl.create_in_catalogue(catalogue_id, vnf_data['id'], False)
        return prepare_response(service)
    def put(self, ws_id, parent_id, service_id):
        """Update the service

        Updates the referenced service in the project or in the catalogue or platform"""
        if get_parent(request) is Category.project:
            service = servicesimpl.update_service(ws_id, parent_id, service_id, get_json(request))
            return prepare_response(service)
        elif get_parent(request) is Category.catalogue:
            function_data = get_json(request)
            service = catalogue_servicesimpl.update_service_catalogue(ws_id, parent_id, service_id, function_data,
                                                                      False)
            return prepare_response(service)
        elif get_parent(request) is Category.platform:
            # platform only has one upload method
            result = platform_connector.create_service_on_platform(ws_id, parent_id, get_json(request))
            return prepare_response(result)
        return prepare_response("not yet implemented")
    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)
    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)
 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)
    def post(self, ws_id, catalogue_id):
        """Creates a new function

        Creates a new function in the project or catalogue"""

        vnf_data = get_json(request)
        vnf_data = catalogue_servicesimpl.create_in_catalogue(catalogue_id, vnf_data['id'],
                                                              True)
        return prepare_response(vnf_data, 201)
Exemplo n.º 23
0
    def post(self, ws_id, catalogue_id):
        """Creates a new function

        Creates a new function in the project or catalogue"""

        vnf_data = get_json(request)
        vnf_data = catalogue_servicesimpl.create_in_catalogue(
            catalogue_id, vnf_data['id'], True)
        return prepare_response(vnf_data, 201)
Exemplo n.º 24
0
    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)
Exemplo n.º 25
0
    def put(self, ws_id, catalogue_id, service_id):
        """Update the service

        Updates the referenced service in the catalogue"""

        function_data = get_json(request)
        service = catalogue_servicesimpl.update_service_catalogue(ws_id, catalogue_id, service_id, function_data,
                                                                  False)
        return prepare_response(service)
    def put(self, ws_id, parent_id, service_id):
        """Update the service

        Updates the referenced service in the project or in the catalogue or platform"""
        if get_parent(request) is Category.project:
            service = servicesimpl.update_service(ws_id, parent_id, service_id,
                                                  get_json(request))
            return prepare_response(service)
        elif get_parent(request) is Category.catalogue:
            function_data = get_json(request)
            service = catalogue_servicesimpl.update_service_catalogue(
                ws_id, parent_id, service_id, function_data, False)
            return prepare_response(service)
        elif get_parent(request) is Category.platform:
            # platform only has one upload method
            result = platform_connector.create_service_on_platform(
                ws_id, parent_id, get_json(request))
            return prepare_response(result)
        return prepare_response("not yet implemented")
    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")
    def post(self, ws_id):
        """Creates a new service catalogue

        Creates a new service catalogue in the specific workspace"""
        return prepare_response(cataloguesimpl.create_catalogue(ws_id, get_json(request)), 201)
Exemplo n.º 29
0
 def post(self, ws_id):
     """ Clones projects into the workspace """
     json_data = get_json(request)
     result = clone(ws_id, shlex.quote(json_data['url']))
     return prepare_response(result, 200)
    def put(self, ws_id, catalogue_id):
        """Updates a specific catalogue

        Updates a specific catalogue by its id"""
        return prepare_response(cataloguesimpl.update_catalogue(ws_id, catalogue_id, get_json(request)))
 def post(self, ws_id):
     """ Commits and pushes changes """
     json_data = get_json(request)
     result = commit_and_push(ws_id, int(json_data['project_id']), shlex.quote(json_data['commit_message']))
     return prepare_response(result, 200)
Exemplo n.º 32
0
 def post(self, ws_id):
     """ Pulls updates from a project """
     json_data = get_json(request)
     result = pull(ws_id, json_data['project_id'])
     return prepare_response(result, 200)
    def post(self, ws_id):
        """Create a new service platform

        Creates a new service platform in the given workspace"""
        return prepare_response(
            platformsimpl.create_platform(ws_id, get_json(request)), 201)
Exemplo n.º 34
0
    def post(self, ws_id):
        """Creates a new service catalogue

        Creates a new service catalogue in the specific workspace"""
        return prepare_response(
            cataloguesimpl.create_catalogue(ws_id, get_json(request)), 201)
Exemplo n.º 35
0
 def delete(self, ws_id):
     """ Deletes a remote repository"""
     json_data = get_json(request)
     result = delete(ws_id, int(json_data['project_id']),
                     shlex.quote(json_data['repo_name']))
     return prepare_response(result, 200)
Exemplo n.º 36
0
 def post(self, ws_id):
     """ Retrieves the current status of the project directory"""
     json_data = get_json(request)
     result = status(ws_id, int(json_data['project_id']))
     return prepare_response(result, 200)
 def delete(self, ws_id):
     """ Deletes a remote repository"""
     json_data = get_json(request)
     result = delete(ws_id, int(json_data['project_id']), shlex.quote(json_data['repo_name']))
     return prepare_response(result, 200)
 def post(self, ws_id):
     """ Retrieves the current status of the project directory"""
     json_data = get_json(request)
     result = status(ws_id, int(json_data['project_id']))
     return prepare_response(result, 200)
 def post(self, ws_id):
     """ Clones projects into the workspace """
     json_data = get_json(request)
     result = clone(ws_id, shlex.quote(json_data['url']))
     return prepare_response(result, 200)
 def post(self, ws_id):
     """ Pulls updates from a project """
     json_data = get_json(request)
     result = pull(ws_id, json_data['project_id'])
     return prepare_response(result, 200)
 def post(self, ws_id):
     """ Creates a remote repository and pushes a project for it"""
     json_data = get_json(request)
     result = create_commit_and_push(ws_id, int(json_data['project_id']),
                                     shlex.quote(json_data['repo_name']))
     return prepare_response(result)
Exemplo n.º 42
0
 def post(self):
     update_config(get_json(request))
Exemplo n.º 43
0
 def post(self, ws_id):
     """ Initializes a repository in the given project"""
     json_data = get_json(request)
     result = init(ws_id, int(json_data['project_id']))
     return prepare_response(result, 200)
    def put(self, ws_id, project_id, service_id):
        """Update the service

        Updates the referenced service in the project or in the catalogue or platform"""
        service = servicesimpl.update_service(ws_id, project_id, service_id, get_json(request))
        return prepare_response(service)
Exemplo n.º 45
0
 def post(self, ws_id):
     """ Commits and pushes changes """
     json_data = get_json(request)
     result = commit_and_push(ws_id, int(json_data['project_id']),
                              shlex.quote(json_data['commit_message']))
     return prepare_response(result, 200)
    def put(self, ws_id, project_id):
        """Updates a project

        Updates the project by its id"""
        project_data = get_json(request)
        return prepare_response(projectsimpl.update_project(project_data, project_id))
Exemplo n.º 47
0
 def post(self, ws_id):
     """ Creates a remote repository and pushes a project for it"""
     json_data = get_json(request)
     result = create_commit_and_push(ws_id, int(json_data['project_id']),
                                     shlex.quote(json_data['repo_name']))
     return prepare_response(result)
Exemplo n.º 48
0
 def post(self):
     """ Update Configuration
     Update the server configuration (requires authentication via Basic Auth)
     """
     return prepare_response(update_config(get_json(request)))
 def post(self, ws_id):
     """ Initializes a repository in the given project"""
     json_data = get_json(request)
     result = init(ws_id, int(json_data['project_id']))
     return prepare_response(result, 200)