Esempio n. 1
0
class RunCommand(Command):
    arguments = (
        ("world", Unicode()),
        ("command", Unicode()),
        ("parameters", ListOf(Unicode())),
    )
    response = (("output", ListOf(Unicode())), )
    errors = {
        KeyError: "KEY_ERROR",
        ValueError: "VALUE_ERROR",
    }
Esempio n. 2
0
class SeekGet(Command):
    """
    Grab starting at a hash and moving backwards, with an offset and object count
    Grab starting at a hash and moving forward on the list, with an offset and object count
    Grab from the latest of the list, with an offset and object count
    """
    """
    type : hash : [list]
    foos : bar : [ abc, def, ghi, jkl, mno, pqr, stu, vwx, yz ]

    GET PAST foo stu OFFSET 1 COUNT 3
    GET FUTURE foo ghi OFFSET 2 COUNT 2
    GET CURRENT foo bar OFFSET 5 COUNT 2

    """
    arguments = [
        (b'type', String()),
        (b'direction', String()),  # Forward || reverse
        (b'hash', String()),  # hash || "latest"
        (b'offset', Integer()),
        (b'count', Integer())
    ]
    response = [(b'hashes', String())]  # list of strings...
    arguments = [(b'keyspace', ObjHash()), (b'count', Integer()),
                 (b'forward', Boolean())]
    # should be providing auths
    Responses = [(b'hashes', ListOf(ObjHash()))]
    """
Esempio n. 3
0
class PrivateWhitelistView(Command):
    arguments = [(b'enc_req_nonce', EncBlob()), (b'enc_hash', EncHash()),
                 (b'enc_sig', EncSig()), (b'sesh_key', PrivAES()),
                 (b'sesh_hash', ObjHash()), (b'sesh_sig', ObjSig())]
    response = [(b'enc_blacklist', ListOf(EncAddress())),
                (b'sesh_hash', ObjHash()), (b'sesh_sig', ObjSig())]
    """
Esempio n. 4
0
class AddError(Command):
    """
    Add an error.
    """
    arguments = [(b'testName', String()), (b'error', String()),
                 (b'errorClass', String()), (b'frames', ListOf(String()))]
    response = [(b'success', Boolean())]
Esempio n. 5
0
class AddFailure(Command):
    """
    Add a failure.
    """
    arguments = [(b'testName', String()), (b'fail', String()),
                 (b'failClass', String()), (b'frames', ListOf(String()))]
    response = [(b'success', Boolean())]
Esempio n. 6
0
class NodeStateCommand(Command):
    """
    Used by a convergence agent to update the control service about the
    status of a particular node.
    """
    arguments = [('state_changes',
                  ListOf(SerializableArgument(NodeState,
                                              NonManifestDatasets))),
                 ('eliot_context', _EliotActionArgument())]
    response = []
class AddError(Command):
    """
    Add an error.
    """

    arguments = [
        (b"testName", NativeString()),
        (b"error", NativeString()),
        (b"errorClass", NativeString()),
        (b"frames", ListOf(NativeString())),
    ]
    response = [(b"success", Boolean())]
class AddFailure(Command):
    """
    Add a failure.
    """

    arguments = [
        (b"testName", NativeString()),
        (b"fail", NativeString()),
        (b"failClass", NativeString()),
        (b"frames", ListOf(NativeString())),
    ]
    response = [(b"success", Boolean())]
Esempio n. 9
0
class SyncCourierDirectoryAsk(Command):
    arguments = [(b'dir_pubkey', ListOf(ObjPubKey())),
                 (b'dir_addrs', ListOf(ObjAddress())),
                 (b'dir_ports', ListOf(Integer()))]
    response = [(b'dir_pubkey', ListOf(ObjPubKey())),
                (b'dir_addrs', ListOf(ObjAddress())),
                (b'dir_ports', ListOf(Integer()))]
    """
Esempio n. 10
0
class MakeChunk(Command):
    arguments = [
        ("x", Integer()),
        ("z", Integer()),
        ("seed", Integer()),
        ("generators", ListOf(String())),
    ]
    response = [
        ("blocks", String()),
        ("metadata", String()),
        ("skylight", String()),
        ("blocklight", String()),
        ("heightmap", String()),
    ]
    errors = {
        Exception: "Exception",
    }
Esempio n. 11
0
class SyncPeerDirectoryAsk(Command):
    # would have prefered dict capability.
    # these may need encoding...
    arguments = [(b'dir_pubkey', ListOf(ObjPubKey())),
                 (b'dir_addrs', ListOf(ObjAddress())),
                 (b'dir_ports', ListOf(Integer()))]
    response = [(b'dir_pubkey', ListOf(ObjPubKey())),
                (b'dir_addrs', ListOf(ObjAddress())),
                (b'dir_ports', ListOf(Integer()))]

    def __init__(self, commandType, *a, **kw):
        print('Command Created')
        super(SyncPeerDirectoryAsk).__init__(commandType, *a, **kw)

    """
Esempio n. 12
0
class Listen(Command):
    """
    A simple command for registering interest with an active Q2Q connection
    to hear from a server when others come calling.  An occurrence of this
    command might have this appearance on the wire::

        C: -Command: Listen
        C: -Ask: 1
        C: From: [email protected]
        C: Protocols: q2q-example, q2q-example2
        C: Description: some simple protocols
        C:
        S: -Answer: 1
        S:

    This puts some state on the server side that will affect any Connect
    commands with q2q-example or q2q-example2 in the Protocol: header.
    """

    commandName = 'listen'
    arguments = [('From', Q2QAddressArgument()),
                 ('protocols', ListOf(String())), ('description', Unicode())]

    result = []
Esempio n. 13
0
class SyncHavesWantsAsk(Command):
    arguments = [(b'have', ListOf(ObjHash)), (b'want', ListOf(ObjHash))]
    # should be providing auths
    Responses = [(b'have', ListOf(ObjHash)), (b'want', ListOf(ObjHash))]
    """
Esempio n. 14
0
 class CommandWithBigListArgument(Command):
     arguments = [
         ("big", Big(ListOf(Integer()))),
     ]
Esempio n. 15
0
class CommandWithSmallResponse(Command):
    response = [
        ("small", ListOf(Integer())),
    ]
Esempio n. 16
0
class SyncStorageAsk(Command):
    arguments = [(b'blobs', ListOf(ObjBlob))]
    # should be providing auths
    Responses = [(b'blobs', ListOf(ObjBlob))]
    """
Esempio n. 17
0
class CommandWithBigResponse(Command):
    response = [
        ("big", ListOf(Integer())),
    ]
Esempio n. 18
0
class Benchmark(Command):
    arguments = [
        (b'foo', String()),
        (b'bar', Integer()),
        (b'baz', ListOf(Float())),
    ]
Esempio n. 19
0
class JMTXSigs(JMCommand):
    """Send signatures on the bitcoin transaction
    sent by TAKER
    """
    arguments = [(b'nick', Unicode()), (b'sigs', ListOf(Unicode()))]
Esempio n. 20
0
class JMMakeTx(JMCommand):
    """Send a hex encoded raw bitcoin transaction
    to a set of counterparties
    """
    arguments = [(b'nick_list', ListOf(Unicode())), (b'tx', String())]
Esempio n. 21
0
class Commands(Command):
    arguments = tuple()
    response = (("commands", ListOf(Unicode())), )