How to use the spyne.decorator.rpc function in spyne

To help you get started, we’ve selected a few spyne examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Linutronix / elbe / elbepack / daemons / soap / esoap.py View on Github external
    @rpc(String, Integer, String, Boolean)
    @authenticated_uid
    @soap_faults
    # pylint: disable=too-many-arguments
    def finish_pdebuild(self, uid, builddir, cpuset, profile, cross):
        self.app.pm.open_project(uid, builddir)
        self.app.pm.build_current_pdebuild(uid, cpuset, profile, cross)
github Linutronix / elbe / elbepack / daemons / soap / esoap.py View on Github external
    @rpc(String)
    @authenticated_uid
    @soap_faults
    def reset_project(self, uid, builddir):
        self.app.pm.open_project(uid, builddir)
        self.app.pm.db.reset_project(builddir, True)
github arskom / spyne / examples / template / template / entity / user.py View on Github external
    @rpc(_returns=Iterable(User))
    def get_all_user(ctx):
        return ctx.udc.session.query(User)
github Linutronix / elbe / elbepack / daemons / soap / esoap.py View on Github external
    @rpc(String)
    @authenticated_uid
    @soap_faults
    def del_project(self, uid, builddir):
        self.app.pm.del_project(uid, builddir)
github magma / magma / lte / gateway / python / magma / enodebd / tr069 / rpc_methods.py View on Github external
    @rpc(
        models.Inform,
        _returns=models.InformResponse,
        _body_style="bare",
        _operation_name="Inform",
        _out_message_name="InformResponse",
    )
    def inform(ctx, request):
        """ Inform response generated locally """
        fill_response_header(ctx)
        resp = AutoConfigServer._handle_tr069_message(ctx, request)
        resp.MaxEnvelopes = AutoConfigServer._max_envelopes
        return resp
github arskom / spyne / examples / file_manager / soap_server.py View on Github external
    @rpc(Mandatory.Unicode, _returns=ByteArray(encoding='hex'))
    def get(ctx, file_name):
        path = os.path.join(os.path.abspath('./files'), file_name)
        if not path.startswith(os.path.abspath('./files')):
            raise ValidationError(file_name)

        try:
            f = open(path, 'r')
        except IOError:
            raise ResourceNotFoundError(file_name)

        ctx.transport.resp_headers['Content-Disposition'] = (
                                         'attachment; filename=%s;' % file_name)

        data = f.read(BLOCK_SIZE)
        while len(data) > 0:
            yield data
github arskom / spyne / examples / authentication / server_soap.py View on Github external
    @rpc(Mandatory.String, _throws=PublicKeyError, _returns=Preferences)
    def get_preferences(ctx, user_name):
        if user_name == 'smith':
            raise AuthorizationError()

        retval = preferences_db[user_name]

        return retval
github Linutronix / elbe / elbepack / daemons / soap / esoap.py View on Github external
    @rpc(String)
    @authenticated_uid
    @soap_faults
    def build_sysroot(self, uid, builddir):
        self.app.pm.open_project(uid, builddir)
        self.app.pm.build_sysroot(uid)
github arskom / spyne / examples / user_manager / server_sqlalchemy.py View on Github external
    @rpc(Mandatory.UnsignedInteger32, _returns=User)
    def get_user(ctx, user_id):
        return ctx.udc.session.query(User).filter_by(id=user_id).one()
github Linutronix / elbe / elbepack / daemons / soap / esoap.py View on Github external
    @rpc(String, String)
    @authenticated_uid
    @soap_faults
    def include_package(self, uid, builddir, filename):
        self.app.pm.open_project(uid, builddir)
        self.app.pm.add_deb_package(uid, filename)