go.ligato.io/vpp-agent/v3@v3.5.0/proto/ligato/generic/manager.proto (about)

     1  syntax = "proto3";
     2  
     3  package ligato.generic;
     4  
     5  option go_package = "go.ligato.io/vpp-agent/v3/proto/ligato/generic";
     6  
     7  import "google/protobuf/any.proto";
     8  
     9  // Item represents single instance described by the Model.
    10  message Item {
    11      // ID represents identifier for distinguishing items.
    12      message ID {
    13          string model = 1;
    14          string name = 2;
    15      }
    16  
    17      ID id = 1;
    18      Data data = 2;
    19  }
    20  
    21  // Data represents encoded data for an item.
    22  message Data {
    23      oneof union {
    24          google.protobuf.Any any = 1;
    25      }
    26  }
    27  
    28  // Item status describes status of an item.
    29  message ItemStatus {
    30      string status = 1;
    31      string message = 2;
    32  }
    33  
    34  message SetConfigRequest {
    35      repeated UpdateItem updates = 1;
    36      // The overwrite_all can be set to true to overwrite all other configuration
    37      // (this is also known as Full Resync)
    38      bool overwrite_all = 2;
    39  }
    40  message SetConfigResponse {
    41      repeated UpdateResult results = 1;
    42  }
    43  
    44  message UpdateItem {
    45      // The item describes item to be updated.
    46      // For a delete operation set fields item.Data to nil.
    47      Item item = 1;
    48      // The labels can be used to define user-defined labels for item.
    49      // Label is string key-value pair associated with configuration item.
    50      // Label key format guidelines: label key should be a lower-case alphanumeric
    51      // string which may contain periods and hyphens (but it should not contain
    52      // consecutive periods/hyphens and it should not start with period/hyphen).
    53      // Labels for configuration items should be prefixed with the reverse DNS
    54      // notation of a domain they originate from (with domain owner's permission)
    55      // for example: com.example.foo-bar-label.
    56      // The io.ligato.* and ligato.* prefixes are reserved by vpp-agent for internal use.
    57      map<string, string> labels = 2;
    58  }
    59  
    60  message UpdateResult {
    61      enum Operation {
    62          UNSPECIFIED = 0;
    63          CREATE = 1;
    64          UPDATE = 2;
    65          DELETE = 3;
    66      }
    67      Item.ID id = 4;
    68      string key = 1;
    69      Operation op = 2;
    70      ItemStatus status = 3;
    71  }
    72  
    73  
    74  message GetConfigRequest {
    75      repeated Item.ID ids = 1;
    76      map<string, string> labels = 2;
    77  }
    78  message GetConfigResponse {
    79      repeated ConfigItem items = 1;
    80  }
    81  
    82  message ConfigItem {
    83      Item item = 1;
    84      ItemStatus status = 2;
    85      map<string, string> labels = 3;
    86  }
    87  
    88  
    89  message DumpStateRequest {
    90      repeated Item.ID ids = 1;
    91  }
    92  message DumpStateResponse {
    93      repeated StateItem items = 1;
    94  }
    95  
    96  message StateItem {
    97      Item item = 1;
    98      map<string, string> metadata = 2;
    99  }
   100  
   101  
   102  message SubscribeRequest {
   103      repeated Subscription subscriptions = 1;
   104  }
   105  message SubscribeResponse {
   106      repeated Notification notifications = 1;
   107  }
   108  
   109  message Subscription {
   110      Item.ID id = 1;
   111  }
   112  
   113  message Notification {
   114      Item item = 1;
   115      ItemStatus status = 2;
   116  }
   117  
   118  
   119  // ManagerService defines the RPC methods for managing config
   120  // using generic model, allowing extending with custom models.
   121  service ManagerService {
   122      // SetConfig is used to update desired configuration.
   123      rpc SetConfig (SetConfigRequest) returns (SetConfigResponse);
   124  
   125      // GetConfig is used to read the desired configuration.
   126      rpc GetConfig (GetConfigRequest) returns (GetConfigResponse);
   127  
   128      // DumpState is used to retrieve the actual running state.
   129      rpc DumpState (DumpStateRequest) returns (DumpStateResponse);
   130  
   131      // Subscribe is used for subscribing to events.
   132      // Notifications are returned by streaming updates.
   133      rpc Subscribe (SubscribeRequest) returns (stream SubscribeResponse);
   134  }