github.com/microsoft/moc@v0.17.1/rpc/lbagent/agent/moc_lbagent_agent.proto (about)

     1  // Copyright (c) Microsoft Corporation.
     2  // Licensed under the Apache v2.0 license.
     3  
     4  syntax = "proto3";
     5  option go_package = "github.com/microsoft/moc/rpc/lbagent";
     6  package moc.lbagent;
     7  
     8  import "google/protobuf/wrappers.proto";
     9  import "google/protobuf/empty.proto";
    10  import "moc_common_common.proto";
    11  import "moc_common_networkcommon.proto";
    12  import "moc_common_notification.proto";
    13  
    14  message LoadBalancerRequest {
    15  	repeated LoadBalancer LoadBalancers = 1;
    16  	Operation OperationType = 2;
    17  }
    18  
    19  message LoadBalancerResponse {
    20  	repeated LoadBalancer LoadBalancers = 1;
    21  	google.protobuf.BoolValue Result = 2;
    22  	string  Error = 3;
    23  }
    24  
    25  message LoadBalancingRule {
    26  	uint32 frontendPort = 1;
    27  	uint32 backendPort = 2;
    28  	Protocol protocol = 3;
    29  }
    30  
    31  message LoadBalancer {
    32  	string name = 1;
    33  	string id = 2;
    34  	repeated string backendips = 3;
    35  	string frontendip = 4;
    36  	repeated LoadBalancingRule loadbalancingrules = 5;
    37  	Status status = 8;
    38  }
    39  
    40  enum LoadBalancerType {
    41  	Haproxy = 0;
    42  	Keepalived = 1;
    43  	Nginx = 2;
    44  }
    45  
    46  message LoadBalancerConfigRequest {
    47  	LoadBalancerType loadbalancertype = 1;
    48  }
    49  
    50  message LoadBalancerConfigResponse {
    51  	string config = 1;
    52  }
    53  
    54  message LoadBalancerPeerRequest {
    55  	repeated string peers = 1;
    56  }
    57  
    58  message LoadBalancerPeerResponse {
    59  	repeated string peers = 1;
    60  	google.protobuf.BoolValue Result = 2;
    61  	string  Error = 3;
    62  }
    63  
    64  message LoadBalancerResyncRequest {
    65  	repeated LoadBalancer LoadBalancers = 1;
    66  	repeated string peers = 2;
    67  }
    68  
    69  message LoadBalancerResyncResponse {
    70  	repeated LoadBalancer LoadBalancers = 1;
    71  	repeated string peers = 2;
    72  	google.protobuf.BoolValue Result = 3;
    73  	string  Error = 4;
    74  }
    75  
    76  service LoadBalancerAgent {
    77  	rpc Create(LoadBalancerRequest) returns (LoadBalancerResponse) {}
    78  	rpc Delete(LoadBalancerRequest) returns (LoadBalancerResponse) {}
    79  	rpc Get(LoadBalancerRequest) returns (LoadBalancerResponse) {}
    80  	//GetConfig is for debugging/testing
    81  	rpc GetConfig(LoadBalancerConfigRequest) returns (LoadBalancerConfigResponse) {}
    82  	rpc CheckNotification(google.protobuf.Empty) returns (NotificationResponse) {}
    83  	rpc AddPeer(LoadBalancerPeerRequest) returns (LoadBalancerPeerResponse) {}
    84  	rpc RemovePeer(LoadBalancerPeerRequest) returns (LoadBalancerPeerResponse) {}
    85  	rpc Resync(LoadBalancerResyncRequest) returns (LoadBalancerResyncResponse) {}
    86  }
    87