github.com/google/fleetspeak@v0.1.15-0.20240426164851-4f31f62c1aea/fleetspeak/src/server/proto/fleetspeak_server/admin.proto (about)

     1  syntax = "proto3";
     2  
     3  package fleetspeak.server;
     4  
     5  import "fleetspeak/src/common/proto/fleetspeak/common.proto";
     6  import "fleetspeak/src/server/proto/fleetspeak_server/broadcasts.proto";
     7  import "fleetspeak/src/server/proto/fleetspeak_server/resource.proto";
     8  import "google/protobuf/timestamp.proto";
     9  
    10  option go_package = "github.com/google/fleetspeak/fleetspeak/src/server/proto/fleetspeak_server";
    11  
    12  message CreateBroadcastRequest {
    13    Broadcast broadcast = 1;
    14    uint64 limit = 2;
    15  }
    16  
    17  message ListActiveBroadcastsRequest {
    18    // If set, only return broadcasts with the given service_name.
    19    string service_name = 1;
    20  }
    21  
    22  message ListActiveBroadcastsResponse {
    23    repeated Broadcast broadcasts = 1;
    24  }
    25  
    26  message ListClientsRequest {
    27    // If non-empty, restricts results to the listed client_ids. If empty, all
    28    // clients known to the system will be listed.
    29    repeated bytes client_ids = 1;
    30  }
    31  
    32  message ListClientsResponse {
    33    repeated Client clients = 1;
    34  }
    35  
    36  message StreamClientIdsRequest {
    37    bool include_blacklisted = 1;
    38    google.protobuf.Timestamp last_contact_after = 2;
    39  }
    40  
    41  message StreamClientIdsResponse {
    42    bytes client_id = 1;
    43  }
    44  
    45  message Client {
    46    // Next unused tag: 8
    47  
    48    bytes client_id = 1;
    49    repeated Label labels = 2;
    50    google.protobuf.Timestamp last_contact_time = 3;
    51    string last_contact_address = 4;
    52    string last_contact_streaming_to = 7;
    53    google.protobuf.Timestamp last_clock = 5;
    54    bool blacklisted = 6;
    55  }
    56  
    57  message GetMessageStatusRequest {
    58    bytes message_id = 1;
    59  }
    60  
    61  message DeletePendingMessagesRequest {
    62    repeated bytes client_ids = 1;
    63  }
    64  
    65  message GetPendingMessagesRequest {
    66    repeated bytes client_ids = 1;
    67    uint64 offset = 2;
    68    uint64 limit = 3;
    69    bool want_data = 4;
    70  }
    71  
    72  message GetPendingMessagesResponse {
    73    repeated fleetspeak.Message messages = 1;
    74  }
    75  
    76  message GetPendingMessageCountRequest {
    77    repeated bytes client_ids = 1;
    78  }
    79  
    80  message GetPendingMessageCountResponse {
    81    uint64 count = 1;
    82  }
    83  
    84  message GetMessageStatusResponse {
    85    google.protobuf.Timestamp creation_time = 1;
    86    MessageResult result = 2;
    87  }
    88  
    89  message StoreFileRequest {
    90    string service_name = 1;
    91    string file_name = 2;
    92    bytes data = 3;
    93  }
    94  
    95  message ListClientContactsRequest {
    96    bytes client_id = 1;
    97  }
    98  
    99  message ListClientContactsResponse {
   100    repeated ClientContact contacts = 1;
   101  }
   102  
   103  message StreamClientContactsRequest {
   104    bytes client_id = 1;
   105  }
   106  
   107  message StreamClientContactsResponse {
   108    ClientContact contact = 1;
   109  }
   110  
   111  message ClientContact {
   112    fixed64 sent_nonce = 1;
   113    fixed64 received_nonce = 2;
   114    string observed_address = 3;
   115    google.protobuf.Timestamp timestamp = 4;
   116  }
   117  
   118  message BlacklistClientRequest {
   119    bytes client_id = 1;
   120  }
   121  
   122  message FetchClientResourceUsageRecordsRequest {
   123    bytes client_id = 1;
   124    google.protobuf.Timestamp start_timestamp = 3;
   125    google.protobuf.Timestamp end_timestamp = 4;
   126  }
   127  
   128  message FetchClientResourceUsageRecordsResponse {
   129    repeated ClientResourceUsageRecord records = 1;
   130  }
   131  
   132  service Admin {
   133    // CreateBroadcast creates a FS broadcast, potentially sending a message to
   134    // many machines in the fleet.
   135    rpc CreateBroadcast(CreateBroadcastRequest)
   136        returns (fleetspeak.EmptyMessage) {}
   137  
   138    // ListActiveBroadcasts lists the currently active FS broadcasts.
   139    rpc ListActiveBroadcasts(ListActiveBroadcastsRequest)
   140        returns (ListActiveBroadcastsResponse) {}
   141  
   142    // ListClients lists the currently active FS clients.
   143    rpc ListClients(ListClientsRequest) returns (ListClientsResponse) {}
   144  
   145    // StreamClientIds lists the currently active FS clients as a stream.
   146    rpc StreamClientIds(StreamClientIdsRequest)
   147        returns (stream StreamClientIdsResponse) {}
   148  
   149    // ListClientContacts lists the contact history for a client.
   150    rpc ListClientContacts(ListClientContactsRequest)
   151        returns (ListClientContactsResponse) {}
   152  
   153    // StreamClientContacts lists the contact history for a client as a stream.
   154    rpc StreamClientContacts(StreamClientContactsRequest)
   155        returns (stream StreamClientContactsResponse) {}
   156  
   157    // GetMessageStatus retrieves the current status of a message.
   158    rpc GetMessageStatus(GetMessageStatusRequest)
   159        returns (GetMessageStatusResponse) {}
   160  
   161    // InsertMessage inserts a message into the Fleetspeak system to be processed
   162    // by the server or delivered to a client.
   163    // TODO: Have this method return the message that is written to the
   164    // datastore (or at least the id).
   165    rpc InsertMessage(fleetspeak.Message) returns (fleetspeak.EmptyMessage) {}
   166  
   167    // DeletePendingMessages clears message queues for given clients.
   168    rpc DeletePendingMessages(DeletePendingMessagesRequest)
   169        returns (fleetspeak.EmptyMessage) {}
   170  
   171    // Returns the pending messages for given clients.
   172    rpc GetPendingMessages(GetPendingMessagesRequest)
   173        returns (GetPendingMessagesResponse) {}
   174  
   175    // Returns the number of pending messages for the given clients.
   176    rpc GetPendingMessageCount(GetPendingMessageCountRequest)
   177        returns (GetPendingMessageCountResponse) {}
   178  
   179    // StoreFile inserts a file into the Fleetspeak system.
   180    rpc StoreFile(StoreFileRequest) returns (fleetspeak.EmptyMessage) {}
   181  
   182    // KeepAlive does as little as possible.
   183    rpc KeepAlive(fleetspeak.EmptyMessage) returns (fleetspeak.EmptyMessage) {}
   184  
   185    // BlacklistClient marks a client_id as invalid, forcing all Fleetspeak
   186    // clients using it to rekey.
   187    rpc BlacklistClient(BlacklistClientRequest)
   188        returns (fleetspeak.EmptyMessage) {}
   189  
   190    // FetchClientResourceUsageRecords returns all resource usage records for a
   191    // single client with a given limit on the number of records.
   192    rpc FetchClientResourceUsageRecords(FetchClientResourceUsageRecordsRequest)
   193        returns (FetchClientResourceUsageRecordsResponse) {}
   194  }