cloudflared-mirror/tunnelrpc/tunnelrpc.capnp

62 lines
1.7 KiB
Cap'n Proto
Raw Normal View History

2017-10-16 11:44:03 +00:00
using Go = import "go.capnp";
@0xdb8274f9144abc7e;
$Go.package("tunnelrpc");
2018-03-22 15:24:52 +00:00
$Go.import("github.com/cloudflare/cloudflared/tunnelrpc");
2017-10-16 11:44:03 +00:00
struct Authentication {
key @0 :Text;
email @1 :Text;
originCAKey @2 :Text;
}
struct TunnelRegistration {
err @0 :Text;
2017-11-07 15:17:19 +00:00
# the url to access the tunnel
url @1 :Text;
2017-10-16 11:44:03 +00:00
# Used to inform the client of actions taken.
logLines @2 :List(Text);
# In case of error, whether the client should attempt to reconnect.
permanentFailure @3 :Bool;
}
struct RegistrationOptions {
# The tunnel client's unique identifier, used to verify a reconnection.
clientId @0 :Text;
# Information about the running binary.
version @1 :Text;
os @2 :Text;
# What to do with existing tunnels for the given hostname.
existingTunnelPolicy @3 :ExistingTunnelPolicy;
# If using the balancing policy, identifies the LB pool to use.
2018-02-20 21:13:56 +00:00
poolName @4 :Text;
2017-10-16 11:44:03 +00:00
# Client-defined tags to associate with the tunnel
2017-11-07 15:17:19 +00:00
tags @5 :List(Tag);
2017-11-28 13:41:29 +00:00
# A unique identifier for a high-availability connection made by a single client.
connectionId @6 :UInt8;
# origin LAN IP
originLocalIp @7 :Text;
2018-03-22 15:24:52 +00:00
# whether Argo Tunnel client has been autoupdated
2018-02-20 21:13:56 +00:00
isAutoupdated @8 :Bool;
2017-10-16 11:44:03 +00:00
}
struct Tag {
name @0 :Text;
value @1 :Text;
}
enum ExistingTunnelPolicy {
ignore @0;
disconnect @1;
balance @2;
}
struct ServerInfo {
locationName @0 :Text;
}
interface TunnelServer {
2017-11-07 15:17:19 +00:00
registerTunnel @0 (originCert :Data, hostname :Text, options :RegistrationOptions) -> (result :TunnelRegistration);
2017-10-16 11:44:03 +00:00
getServerInfo @1 () -> (result :ServerInfo);
2018-04-04 15:47:36 +00:00
unregisterTunnel @2 (gracePeriodNanoSec :Int64) -> ();
2017-10-16 11:44:03 +00:00
}