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")
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")
def get(self, ws_id, parent_id, service_id): """Return a specific Service Returns the referenced service from the Project or catalogue""" if get_parent(request) is Category.project: service = servicesimpl.get_service(ws_id, parent_id, service_id) return prepare_response(service) if get_parent(request) is Category.catalogue: service = catalogue_servicesimpl.get_in_catalogue(ws_id, parent_id, service_id, False) return prepare_response(service) return prepare_response("not yet implemented")
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")
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")
def get(self, ws_id, parent_id, service_id): """Return a specific Service Returns the referenced service from the Project or catalogue""" if get_parent(request) is Category.project: service = servicesimpl.get_service(ws_id, parent_id, service_id) return prepare_response(service) if get_parent(request) is Category.catalogue: service = catalogue_servicesimpl.get_in_catalogue( ws_id, parent_id, service_id, False) return prepare_response(service) return prepare_response("not yet implemented")
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")
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")
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")
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")
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 get(self, ws_id, parent_id, vnf_id): """Get a specific function Gets a specific function information by its id""" if get_parent(request) is Category.project: functions = functionsimpl.get_function_project(ws_id, parent_id, vnf_id) return prepare_response(functions) # TODO implement for catalog and platform if get_parent(request) is Category.catalogue: functions = catalogue_servicesimpl.get_in_catalogue(ws_id, parent_id, vnf_id, True) return prepare_response(functions) # TODO implement for catalog and platform return prepare_response("not yet implemented")
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 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 get(self, ws_id, parent_id, vnf_id): """Get a specific function Gets a specific function information by its id""" if get_parent(request) is Category.project: functions = functionsimpl.get_function_project( ws_id, parent_id, vnf_id) return prepare_response(functions) # TODO implement for catalog and platform if get_parent(request) is Category.catalogue: functions = catalogue_servicesimpl.get_in_catalogue( ws_id, parent_id, vnf_id, True) return prepare_response(functions) # TODO implement for catalog and platform 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, 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 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 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")