Public APIs for the routing interfaces service.
This IDL defines the APIs for the routing interfaces service.
The APIs are used to receive routing interface events and query routing interfaces on a router.
Routing interface Address
Field | Type | Label | Description |
address | NetworkAddress | optional | IPv4 or v6 address of the interface [REQUIRED] |
prefix_length | uint32 | optional | Prefix length of the address [REQUIRED] |
is_primary | bool | optional | Indicates whether this is the primary IP address of the interface [REQUIRED] |
Routing interface entry
This entry contains the information of a routing interface. It is used by RoutingInterfaceNotificationResponse and RoutingInterfaceGetResponse.
In a RoutingInterfaceNotificationResponse notifying of a CHANGED or UP status, and in a RoutingInterfaceGetResponse, all attributes are applicable.
In a RoutingInterfaceNotificationResponse notifying of a DOWN or DELETED status, only the name and status attributes are applicable.
Field | Type | Label | Description |
name | string | optional | Name in the format of type-fpc/pic/port.logical [REQUIRED] |
index | uint32 | optional | Interface index [OPTIONAL] (defaults to 0) |
status | RoutingInterfaceStatus | optional | Status [REQUIRED] |
bandwidth | uint64 | optional | Bandwidth in bps [OPTIONAL] (defaults to 0) |
mtu | uint32 | optional | MTU [OPTIONAL] (defaults to 0) |
addresses | RoutingInterfaceAddress | repeated | Addresses There may be none, one or multiple addresses. [OPTIONAL] (defaults to none) |
Routing interface get request.
A client sends this request to query an individual interface.
Field | Type | Label | Description |
name | string | optional | Name |
index | uint32 | optional | Index |
address_format | AddressFormat | optional | The format of IP addresses to be used in response. [OPTIONAL] (defaults to string). |
Routing interface get response.
Field | Type | Label | Description |
code | StatusCode | optional | Top level return code [REQUIRED] |
sub_code | RoutingInterfaceGetResponse.RoutingInterfaceGetStatusCode | optional | Sub code [REQUIRED] |
entry | RoutingInterfaceEntry | optional | Interface entry [OPTIONAL]; Contains an empty entry in error conditions |
Routing interface service initialize request.
A client sends this request to initialize the service.
Field | Type | Label | Description |
Routing interface service initialize response.
Field | Type | Label | Description |
code | StatusCode | optional | Top level return code [REQUIRED] |
sub_code | RoutingInterfaceInitializeResponse.RoutingInterfaceInitializeStatusCode | optional | Sub code [REQUIRED] |
Routing interface notification refresh request.
A client sends this request to receive a full flash of all interfaces. RoutingInterfaceNotificationResponses carrying the information of all the interfaces will be streamed to the client.
Field | Type | Label | Description |
Routing interface notification refresh response.
Field | Type | Label | Description |
code | StatusCode | optional | Top level return code [REQUIRED] |
sub_code | RoutingInterfaceNotificationRefreshResponse.RoutingInterfaceNotificationRefreshStatusCode | optional | Sub code [REQUIRED] |
Routing interface notification register request.
A client sends this request to register for interface event notifications, which will be streamed to the client via RoutingInterfaceNotificationResponses.
Field | Type | Label | Description |
address_format | AddressFormat | optional | The format for IP addresses to be used in response. [OPTIONAL] (defaults to string). |
Routing interface notification response.
Field | Type | Label | Description |
code | StatusCode | optional | Top level return code [REQUIRED] |
sub_code | RoutingInterfaceNotificationResponse.RoutingInterfaceNotificationStatusCode | optional | Sub code [REQUIRED] |
entries | RoutingInterfaceEntry | repeated | Interface entries [OPTIONAL]; May contain 0, 1 or multiple entries |
Routing interface notification unregister request.
A client sends this request to unregister for interface event notifications.
Field | Type | Label | Description |
Routing interface notification unregister response.
Field | Type | Label | Description |
code | StatusCode | optional | Top level return code [REQUIRED] |
sub_code | RoutingInterfaceNotificationUnregisterResponse.RoutingInterfaceNotificationUnregisterStatusCode | optional | Sub code [REQUIRED] |
Response status
Name | Number | Description |
SUCCESS_COMPLETED | 0 | Request completed successfully |
INTERNAL_ERROR | 1 | Request failed due to an internal error |
NOT_INITIALIZED | 2 | Service is not initialized |
INVALID_INDEX_AND_NAME | 3 | Interface name and index are invalid |
NOT_FOUND | 4 | Interface was not found |
Response status
Name | Number | Description |
SUCCESS_COMPLETED | 0 | Request successfully completed |
SUCCESS_REBOUND | 1 | Request successfully completed, with a preexisting client of the same client identifier being rebound. |
INTERNAL_ERROR | 2 | Request failed due to an internal error |
ALREADY_INITIALIZED | 3 | Service is already initialized |
Notification refresh response status
Name | Number | Description |
SUCCESS_COMPLETED | 0 | Request successfully completed |
INTERNAL_ERROR | 1 | Request failed due to an internal error |
NOT_INITIALIZED | 2 | Service is not initialized |
NOTIFICATION_NOT_REGISTERED | 3 | Notification is not registered |
Response status
Name | Number | Description |
SUCCESS_COMPLETED | 0 | Request successfully completed |
INTERNAL_ERROR | 1 | Request failed due to an internal error |
NOT_INITIALIZED | 2 | Service is not initialized |
ALREADY_REGISTERED | 3 | Notification is already registered. |
Notification unregister response status
Name | Number | Description |
SUCCESS_COMPLETED | 0 | Request successfully completed |
INTERNAL_ERROR | 1 | Request failed due to an internal error |
NOT_INITIALIZED | 2 | Service is not initialized |
NOTIFICATION_NOT_REGISTERED | 3 | Notification is not registered |
Routing interface status
CHANGED, UP, DOWN, and DELETED are applicable to RoutingInterfaceNotificationResponse. UP and DOWN are applicable to RoutingInterfaceGetResponse,
Name | Number | Description |
RT_INTF_CHANGED | 0 | Attribute changed |
RT_INTF_UP | 1 | Up |
RT_INTF_DOWN | 2 | Down |
RT_INTF_DELETED | 3 | Deleted |
Routing interfaces service
Method Name | Request Type | Response Type | Description |
RoutingInterfaceInitialize | RoutingInterfaceInitializeRequest | RoutingInterfaceInitializeResponse | Service initialize A client must first use this RPC to initialize and connect to the service, before issuing other RPCs. |
RoutingInterfaceGet | RoutingInterfaceGetRequest | RoutingInterfaceGetResponse | Get a routing interface by name or index A client may use this RPC to query an individual routing interface at any time. The client should already know the name or index of the interface via notification or any other method. |
RoutingInterfaceNotificationRegister | RoutingInterfaceNotificationRegisterRequest | RoutingInterfaceNotificationResponse | Notification register Request to receive asynchronous notifications of of routing interface CHANGED, UP, DOWN and DELETED status events. After a RoutingInterfaceNotificationRegisterRequest, an initial RoutingInterfaceNotificationResponse is sent immediately to the client, as a confirmation for the request. This response may or may not carry an interface. Then, RoutingInterfaceNotificationResponses are sent to the client, as a full flash of all the interfaces. Subsequently, a RoutingInterfaceNotificationResponse will be sent to the client upon a CHANGED, UP, DOWN, or DELETED status event of an interface. Notification compression: When a status event of an interface is pending for a client to be notified of, a new status event happens. As a net result, a single notification representing the latest status and attributes of the interface is sent to the client. This should only happen when consecutive events happen with extremely small intervals. Examples: [1] When a CHANGED event is pending, an UP/DOWN event happens. Hence, an UP/DOWN notification is sent. [2] When a CHANGED/UP/DOWN event is pending, a DELETED event happens. Hence, a DELETED notification is sent. [3] When an UP/DOWN event if pending, a CHANGED event happens. Hence, only an UP/DOWN notification is sent. |
RoutingInterfaceNotificationUnregister | RoutingInterfaceNotificationUnregisterRequest | RoutingInterfaceNotificationUnregisterResponse | Notification unregister Request to stop receiving notifications (i.e. RoutingInterfaceNotificationResponses) of routing interface events. |
RoutingInterfaceNotificationRefresh | RoutingInterfaceNotificationRefreshRequest | RoutingInterfaceNotificationRefreshResponse | Notification refresh Request to receive a refresh of notifications (i.e. RoutingInterfaceNotificationResponses) of all routing interfaces, with their current status and attributes. |
.proto Type | Notes | C++ Type | Java Type | Python Type |
double | double | double | float | |
float | float | float | float | |
int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int |
int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long |
uint32 | Uses variable-length encoding. | uint32 | int | int/long |
uint64 | Uses variable-length encoding. | uint64 | long | int/long |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long |
sfixed32 | Always four bytes. | int32 | int | int |
sfixed64 | Always eight bytes. | int64 | long | int/long |
bool | bool | boolean | boolean | |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode |
bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str |