lb: vip and as dump/detail api's
[vpp.git] / src / plugins / lb / lb.api
1 option version = "1.0.0";
2 import "plugins/lb/lb_types.api";
3
4 /** \brief Configure Load-Balancer global parameters (unlike the CLI, both ip4_src_address and ip6_src_address need to be specified.
5     @param client_index - opaque cookie to identify the sender
6     @param context - sender context, to match reply w/ request
7     @param ip4_src_address - IPv4 address to be used as source for IPv4 traffic(applicable in GRE4/GRE6/NAT4/NAT6 mode only).
8     @param ip6_src_address - IPv6 address to be used as source for IPv6 traffic(applicable in GRE4/GRE6/NAT4/NAT6 mode only).
9     @param sticky_buckets_per_core - Number of buckets *per worker thread* in the
10            established flow table (must be power of 2).
11     @param flow_timeout - Time in seconds after which, if no packet is received
12            for a given flow, the flow is removed from the established flow table.
13 */
14 autoreply manual_print define lb_conf
15 {
16   u32 client_index;
17   u32 context;
18   vl_api_ip4_address_t ip4_src_address;
19   vl_api_ip6_address_t ip6_src_address;
20   u32 sticky_buckets_per_core;
21   u32 flow_timeout;
22 };
23
24 /** \brief Add a virtual address (or prefix)
25     @param client_index - opaque cookie to identify the sender
26     @param context - sender context, to match reply w/ request
27     @param pfx - ip prefix and length
28     @param protocol - tcp or udp.
29     @param port - destination port. (0) means 'all-port VIP'
30     @param encap - Encap is ip4 GRE(0) or ip6 GRE(1) or L3DSR(2) or NAT4(3) or NAT6(4).
31     @param dscp - DSCP bit corresponding to VIP(applicable in L3DSR mode only).
32     @param type - service type(applicable in NAT4/NAT6 mode only).
33     @param target_port - Pod's port corresponding to specific service(applicable in NAT4/NAT6 mode only).
34     @param node_port - Node's port(applicable in NAT4/NAT6 mode only).
35     @param new_flows_table_length - Size of the new connections flow table used
36            for this VIP (must be power of 2).
37     @param is_del - The VIP should be removed.
38 */
39 autoreply manual_print define lb_add_del_vip {
40   u32 client_index;
41   u32 context;
42   vl_api_prefix_t pfx;
43   u8 protocol [default=255];
44   u16 port;
45   vl_api_lb_encap_type_t encap;
46   u8 dscp;
47   vl_api_lb_srv_type_t type ; /* LB_API_SRV_TYPE_CLUSTERIP */
48   u16 target_port;
49   u16 node_port;
50   u32 new_flows_table_length [default=1024];
51   bool is_del;
52 };
53
54 /** \brief Add an application server for a given VIP
55     @param client_index - opaque cookie to identify the sender
56     @param context - sender context, to match reply w/ request
57     @param pfx - ip prefix and length
58     @param protocol - tcp or udp.
59     @param port - destination port.
60     @param as_address - The application server address (IPv4 in lower order 32 bits).
61     @param is_del - The AS should be removed.
62     @param is_flush - The sessions related to this AS should be flushed.
63 */
64 autoreply manual_print define lb_add_del_as {
65   u32 client_index;
66   u32 context;
67   vl_api_prefix_t pfx;
68   u8 protocol [default=255];
69   u16 port;
70   vl_api_address_t as_address;
71   bool is_del;
72   bool is_flush;
73 };
74
75 /** \brief Flush a given vip
76     @param client_index - opaque cookie to identify the sender
77     @param context - sender context, to match reply w/ request
78     @param pfx - ip prefix and length
79     @param protocol - tcp or udp.
80     @param port - destination port.
81 */
82 autoreply manual_print define lb_flush_vip {
83   u32 client_index;
84   u32 context;
85   vl_api_prefix_t pfx;
86   u8 protocol;
87   u16 port;
88 };
89
90 /** \brief Dump all vips
91     @param client_index - opaque cookie to identify the sender
92     @param context - sender context, to match reply w/ request
93 */
94 define lb_vip_dump{
95   u32 client_index;
96   u32 context;
97   vl_api_prefix_t pfx;
98   vl_api_prefix_matcher_t pfx_matcher;
99   u8 protocol [default=255];
100   u16 port;
101
102 };
103
104 /** \brief Reply all configured vip
105     @param context - sender context, to match reply w/ request
106     @param vip - all vip addrs.
107 */
108 define lb_vip_details {
109   u32 context;
110   vl_api_lb_vip_t vip;
111   vl_api_lb_encap_type_t encap;
112   vl_api_ip_dscp_t dscp;
113   vl_api_lb_srv_type_t srv_type;
114   u16 target_port;
115   u16 flow_table_length;
116 };
117
118 /** \brief dump AS list per VIP or all ASs for all VIPs
119     @param client_index - opaque cookie to identify the sender
120     @param context - sender context, to match reply w/ request
121     @param pfx - ip prefix and length.
122     @param protocol - tcp or udp.
123     @param port - destination port.
124 */
125 define lb_as_dump{
126   u32 client_index;
127   u32 context;
128   /* vip */
129   vl_api_prefix_t pfx;
130   u8 protocol;
131   u16 port;
132 };
133
134 /** \brief lb_as_details
135     @param context - sender context, to match reply w/ request
136     @param as - AS detail record
137 */
138 define lb_as_details {
139   u32 context;
140   vl_api_lb_vip_t vip;
141   vl_api_address_t app_srv;
142   u8 flags;
143   u32 in_use_since;
144 };
145