|
| 1 | +### Description |
| 2 | + |
| 3 | +The Modify Command runs a [gRIBI Modify RPC](https://github.com/openconfig/gribi/blob/master/v1/proto/service/gribi.proto#L31) as a client, sending a stream of [ModifyRequest(s)](https://github.com/openconfig/gribi/blob/master/v1/proto/service/gribi.proto#L52) to a gRIBI server. |
| 4 | +The Server returns a stream of [ModifyResponse(s)](https://github.com/openconfig/gribi/blob/master/v1/proto/service/gribi.proto#L213). |
| 5 | + |
| 6 | +The ModifyRequest is used to set the current session parameters (redundancy, persistence, and ack mode) as well as issuing AFT operation to the server. |
| 7 | + |
| 8 | +The AFT operation can be an ADD, REPLACE or DELETE and references a single AFT entry of type IPV4, IPv6, Next Hop, Next Hop Group, MPLS, MAC or Policy Forwarding. |
| 9 | + |
| 10 | +A single modifyRequest can carry multiple AFT operations. |
| 11 | + |
| 12 | +A Modify RPC start with the client sending a ModifyRequest indicating the [session parameters](https://github.com/openconfig/gribi/blob/master/v1/proto/service/gribi.proto#L342) it wants to apply to the current session, the parameters are: |
| 13 | + |
| 14 | +- Redundancy: specifies the client redundancy mode, either `ALL_PRIMARY` or `SINGLE_PRIMARY` |
| 15 | + - `ALL_PRIMARY`: is the default and indicates that the server should accept AFT operations from all clients. |
| 16 | + |
| 17 | + When it comes to ADD operations, the server should add an entry when it first receives it from any client. |
| 18 | + While it should wait for the last delete to remove it from its RIB. |
| 19 | + |
| 20 | + In other words, the server should keep track of the number of clients it received a specific entry from. |
| 21 | + |
| 22 | + - `SINGLE_PRIMARY`: implies that the clients went through an election process and a single one came out as primary, it has the highest election ID which it sends to the server in the initial ModifyRequest as well as with each AFT Operation. |
| 23 | + |
| 24 | + The server accepts AFT Operations only from the client with the highest election ID. |
| 25 | + |
| 26 | +- Persistence: Specifies desired server behavior when the client disconnects. |
| 27 | + - `DELETE`: is the default, it means that all AFTs received from the client shall be deleted when it disconnects. |
| 28 | + - `PRESERVE`: the server should keep the RIB and FIB entries set by the client when it disconnects. |
| 29 | + |
| 30 | +- Ack Mode: Specifies the Ack type expected by the client |
| 31 | + - `RIB_ACK`: the server must respond with `RIB_PROGRAMMED` |
| 32 | + - `RIB_AND_FIB_ACK`: the server must respond with `RIB_PROGRAMMED`, if the AFT entry is also programmed in the NE FIB, the server must response with `FIB_PROGRAMMED` instead. |
| 33 | + |
| 34 | +### Usage |
| 35 | + |
| 36 | +`gribic [global-flags] modify [local-flags]` |
| 37 | + |
| 38 | +Alias: `mod`, `m` |
| 39 | + |
| 40 | +### Flags |
| 41 | + |
| 42 | +#### single-primary |
| 43 | + |
| 44 | +The `--single-primary` flag set the session parameters redundancy to `SINGLE_PRIMARY` |
| 45 | + |
| 46 | +#### preserve |
| 47 | + |
| 48 | +The `--preserve` flag set the session parameters persistence to `PRESERVE` |
| 49 | + |
| 50 | +#### fib |
| 51 | + |
| 52 | +The `--fib` flag set the session parameters Ack mode to `RIB_AND_FIB_ACK` |
| 53 | + |
| 54 | +#### input-file |
| 55 | + |
| 56 | +The `--input-file` flag points to a modify input file |
| 57 | + |
| 58 | +See [here](https://github.com/karimra/gribic/examples) for some input file examples |
| 59 | + |
| 60 | +### Examples |
| 61 | + |
| 62 | +Run all operations defined in the input-file in `single-primary` redundancy mode, with persistence `preserve` and ack mode `RIB_FIB` |
| 63 | + |
| 64 | +```bash |
| 65 | +gribic -a router1 -u admin -p admin --skip-verify modify \ |
| 66 | + --single-primary \ |
| 67 | + --preserve \ |
| 68 | + --fib \ |
| 69 | + --election-id 1:2 \ |
| 70 | + --input-file <path/to/modify/operations> |
| 71 | +``` |
0 commit comments