view rpc.proto @ 0:ed6ea43af3f4

Initial commit
author Lewin Bormann <lbo@spheniscida.de>
date Fri, 23 Sep 2016 16:23:46 +0200
parents
children
line wrap: on
line source

package proto;

message TraceInfo {
    required int64 received_time = 1;
    required int64 replied_time = 2;
    optional string machine_name = 3;
    optional string endpoint_name = 4;
    optional string error_message = 5;
    optional string redirect = 6;
    repeated TraceInfo child_calls = 7;
}

message RPCRequest {
    // A unique-ish ID for this RPC
    optional string rpc_id = 1;
    required string srvc = 2;
    required string procedure = 3;
    required bytes data = 4;
    optional int64 deadline = 5; // UNIX µs timestamp after which we don't want to have an answer anymore
                                 // (i.e. the server doesn't need to bother sending one)
    optional string caller_id = 6;
    optional bool want_trace = 7;
}

message RPCResponse {
    optional string rpc_id = 1;
    optional bytes response_data = 2;

    enum Status {
        // Default value
        STATUS_UNKNOWN = 0;
        // a.k.a. 200
        STATUS_OK = 1;
        // service/endpoint not found (a.k.a. 404)
        STATUS_NOT_FOUND = 2;
        // The handler returned an error; see the error_message for a description (500). response_data may have content
        STATUS_NOT_OK = 4;
        // An error happened in the clusterrpc implementation (500)
        STATUS_SERVER_ERROR = 5;
        // The requested timeout has been expired
        STATUS_TIMEOUT = 6;
        // The server is overloaded (503)
        STATUS_OVERLOADED_RETRY = 7;
        // We couldn't even send the request (PB serialization error, ...)
        STATUS_CLIENT_REQUEST_ERROR = 9;
        // We couldn't send the request because of network/socket issues.
        STATUS_CLIENT_NETWORK_ERROR = 10;
        // Client function called in a wrong way (e.g. different lengt of raddrs
        // and rports slices to NewClientRR())
        STATUS_CLIENT_CALLED_WRONG = 11;
        // Timeout somewhere in the call stack
        STATUS_MISSED_DEADLINE = 12;
        // Loadshedding mode, not accepting requests right now
        STATUS_LOADSHED = 13;
        // Health check failed
        STATUS_UNHEALTHY = 14;
    }

    required Status response_status = 3;
    optional string error_message = 4;
    optional TraceInfo traceinfo = 5;
}