github.com/cloudwan/edgelq-sdk@v1.15.4/proxies/proto/v1/broker_custom.proto (about)

     1  syntax = "proto3";
     2  
     3  package ntt.proxies.v1;
     4  
     5  import "edgelq-sdk/proxies/proto/v1/project.proto";
     6  import "edgelq-sdk/proxies/proto/v1/project_change.proto";
     7  
     8  option go_package = "github.com/cloudwan/edgelq-sdk/proxies/client/v1/broker;broker_client";
     9  option java_multiple_files = false;
    10  option java_outer_classname = "BrokerCustomProto";
    11  option java_package = "com.ntt.proxies.pb.v1";
    12  
    13  // Request message for method [Connect][ntt.proxies.v1.Connect]
    14  message ConnectRequest {
    15    oneof message {
    16      // The initiation message to open a channel to a device.
    17      OpenRequest open_request = 1;
    18  
    19      // Attempt to resume stream of data
    20      ResumeRequest resume_request = 2;
    21  
    22      // ACK message
    23      Ack ack = 3;
    24  
    25      // Any data sent to the device through the endpoint.
    26      Data data = 4;
    27  
    28      Close close = 5;
    29  
    30      Error error = 6;
    31  
    32      Ping ping = 7;
    33    }
    34  
    35    message OpenRequest {
    36      string project = 1;
    37  
    38      // Region ID to connect to
    39      string region_id = 6;
    40  
    41      // Service domain (for example devices.edgelq.com) for this provider.
    42      string service_domain = 7;
    43  
    44      // name to connect to - must match to name value passed in ListenRequest
    45      string provider_name = 3;
    46  
    47      // Name of the connecting client
    48      string name = 2;
    49  
    50      // Service to connect
    51      string service = 4;
    52  
    53      // Initial argument (optional)
    54      bytes arg = 5;
    55  
    56      // If true, ConnectResponse will contain NotAvailableLocally in response
    57      // instead of NotFound/OutOfRange. This is used so far internally between
    58      // servers.
    59      // TODO: This is temporary flag, till we migrate all clients to shard-aware
    60      // ones: Client can probe what core endpoint owns given shard number for
    61      // provider_name. Then it can, and should connect directly there, without
    62      // setting this flag.
    63      bool return_not_available = 8;
    64    }
    65  
    66    message ResumeRequest {
    67      string project = 1;
    68  
    69      // Region ID to connect to
    70      string region_id = 7;
    71  
    72      // Service domain (for example devices.edgelq.com) for this provider.
    73      string service_domain = 8;
    74  
    75      // name to connect to - must match to name value passed in ListenRequest
    76      string provider_name = 3;
    77  
    78      // Name of the connecting client
    79      string name = 2;
    80  
    81      uint64 session_id = 4;
    82  
    83      uint64 channel_id = 5;
    84  
    85      uint64 last_message_id = 6;
    86  
    87      // If true, ConnectResponse will contain NotAvailableLocally in response
    88      // instead of NotFound/OutOfRange. This is used so far internally between
    89      // servers.
    90      // TODO: This is temporary flag, till we migrate all clients to shard-aware
    91      // ones: Client can probe what core endpoint owns given shard number for
    92      // provider_name. Then it can, and should connect directly there, without
    93      // setting this flag.
    94      bool return_not_available = 9;
    95    }
    96  }
    97  
    98  // Response message for method [Connect][ntt.proxies.v1.Connect]
    99  message ConnectResponse {
   100    oneof message {
   101      // Notification from the agent (endpoint) to the channel has been opened.
   102      OpenResponse open_response = 1;
   103  
   104      ResumeResponse resume_response = 2;
   105  
   106      ChannelOpenError channel_open_error = 3;
   107  
   108      // ACK message
   109      Ack ack = 4;
   110  
   111      // Any data from the device (endpoint) to the client.
   112      Data data = 5;
   113  
   114      Close close = 6;
   115  
   116      Error error = 7;
   117  
   118      Pong pong = 8;
   119  
   120      // Informs that provider is not available locally.
   121      // This is sent instead of open_response/resume_response
   122      // if
   123      NotAvailableLocally not_available_locally = 9;
   124    }
   125  
   126    message NotAvailableLocally {}
   127  
   128    message OpenResponse {
   129      uint64 session_id = 1;
   130  
   131      uint64 channel_id = 2;
   132    }
   133  
   134    message ResumeResponse {
   135      uint64 session_id = 1;
   136  
   137      uint64 channel_id = 2;
   138  
   139      uint64 last_message_id = 4;
   140    }
   141  
   142    message ChannelOpenError {
   143      // ID of the channel failed to open.
   144      uint64 channel_id = 1;
   145  
   146      // Error message.
   147      string message = 2;
   148    }
   149  }
   150  
   151  // Request message for method [Listen][ntt.proxies.v1.Listen]
   152  message ListenRequest {
   153    oneof message {
   154      // This is a hello message from the agent with its name.
   155      OpenRequest open_request = 1;
   156  
   157      ResumeRequest resume_request = 2;
   158  
   159      // When the agent failed to open a requested channel, this message will be
   160      // sent from the agent to the endpoint.
   161      ChannelOpenError channel_open_error = 3;
   162  
   163      Ping ping = 4;
   164    }
   165  
   166    message OpenRequest {
   167      string project = 1;
   168  
   169      string region_id = 3;
   170  
   171      // Service domain (for example devices.edgelq.com) for this provider.
   172      string service_domain = 4;
   173  
   174      // The self-declared device name, used for authentication/authorization.
   175      string name = 2;
   176    }
   177  
   178    message ResumeRequest {
   179      string project = 1;
   180  
   181      string region_id = 4;
   182  
   183      // Service domain (for example devices.edgelq.com) for this provider.
   184      string service_domain = 5;
   185  
   186      // The self-declared device name, used for authentication/authorization.
   187      string name = 2;
   188  
   189      uint64 session_id = 3;
   190    }
   191  
   192    message ChannelOpenError {
   193      // ID of the channel failed to open.
   194      uint64 channel_id = 1;
   195  
   196      // Error message.
   197      string message = 2;
   198    }
   199  }
   200  
   201  // Response message for method [Listen][ntt.proxies.v1.Listen]
   202  message ListenResponse {
   203    oneof message {
   204      Listening listening = 1;
   205  
   206      // Notifies a new channel has been requested by a client.
   207      OpenChannelResponse open_channel_response = 2;
   208  
   209      // Notifies a channel was asked to be resumed by a client
   210      ResumeChannelResponse resume_channel_response = 3;
   211  
   212      Pong pong = 4;
   213    }
   214  
   215    message Listening { uint64 session_id = 1; }
   216  
   217    message OpenChannelResponse {
   218      // Channel ID
   219      uint64 channel_id = 1;
   220  
   221      // Device service;
   222      string service = 2;
   223  
   224      // Initial argument (optional)
   225      bytes arg = 3;
   226    }
   227  
   228    message ResumeChannelResponse {
   229      // Channel ID
   230      uint64 channel_id = 1;
   231  
   232      // Device service;
   233      string service = 2;
   234  
   235      // Initial argument (optional)
   236      bytes arg = 3;
   237  
   238      uint64 last_message_id = 4;
   239    }
   240  }
   241  
   242  // Request message for method [Accept][ntt.proxies.v1.Accept]
   243  message AcceptRequest {
   244    oneof message {
   245      // Registers a new socket on the endpoint.
   246      OpenRequest open_request = 1;
   247  
   248      ResumeRequest resume_request = 2;
   249  
   250      // Data from the agent to the endpoint (client).
   251      Data data = 3;
   252  
   253      // ACK message
   254      Ack ack = 4;
   255  
   256      Close close = 5;
   257  
   258      Error error = 6;
   259  
   260      Ping ping = 7;
   261    }
   262  
   263    message OpenRequest {
   264      string project = 1;
   265  
   266      string region_id = 5;
   267  
   268      // Service domain (for example devices.edgelq.com) for this provider.
   269      string service_domain = 6;
   270  
   271      // Name, to be authenticated/authorized.
   272      string name = 2;
   273  
   274      uint64 session_id = 3;
   275  
   276      // Channel ID, requested by the endpoint in the ChannelRequested message.
   277      uint64 channel_id = 4;
   278    }
   279  
   280    message ResumeRequest {
   281      string project = 1;
   282  
   283      string region_id = 6;
   284  
   285      // Service domain (for example devices.edgelq.com) for this provider.
   286      string service_domain = 7;
   287  
   288      // Name, to be authenticated/authorized.
   289      string name = 2;
   290  
   291      uint64 session_id = 3;
   292  
   293      // Channel ID, requested by the endpoint in the ChannelRequested message.
   294      uint64 channel_id = 4;
   295  
   296      uint64 last_message_id = 5;
   297    }
   298  }
   299  
   300  // Response message for method [Accept][ntt.proxies.v1.Accept]
   301  message AcceptResponse {
   302    oneof message {
   303      // Data from the endpoint (client) to the agent.
   304      Data data = 1;
   305  
   306      // ACK message
   307      Ack ack = 2;
   308  
   309      Close close = 3;
   310  
   311      Error error = 4;
   312  
   313      Pong pong = 5;
   314    }
   315  }
   316  
   317  message Ping {}
   318  
   319  message Pong {}
   320  
   321  message Data {
   322    uint64 id = 1;
   323  
   324    bytes bytes = 2;
   325  
   326    bool ack_required = 3;
   327  }
   328  
   329  message Ack { uint64 id = 1; }
   330  
   331  message Close { uint64 id = 1; }
   332  
   333  message Error {
   334    uint64 id = 1;
   335  
   336    string message = 2;
   337  }