jnx_routing_interface_service.proto

Service

Interfaces

JET RPC service providing interface services.

Method Name Request Type Response Type Description
InterfaceInitialize InterfaceInitializeRequest InterfaceInitializeResponse Service initialize.
InterfaceGet InterfaceGetRequest InterfaceGetResponse Get a routing interface by name or index.
InterfaceSubscribe InterfaceSubscribeRequest InterfaceSubscribeResponse Notification Subscribe.
InterfaceUnsubscribe InterfaceUnsubscribeRequest InterfaceUnsubscribeResponse Notification unsubscribe.
InterfaceRefresh InterfaceRefreshRequest InterfaceRefreshResponse Notification refresh.

RPC(s)

The following APIs are provided by this service:

InterfaceInitialize

A client must first use this RPC to initialize and connect to the service, before issuing other RPCs.

Input: InterfaceInitializeRequest

Output: InterfaceInitializeResponse

InterfaceGet

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.

Input: InterfaceGetRequest

Output: InterfaceGetResponse

InterfaceSubscribe

Request to receive asynchronous notifications of of routing interface CHANGED, UP, DOWN and DELETED status events. After a InterfaceSubscribeRequest, an initial InterfaceSubscribeResponse is sent immediately to the client, as a confirmation for the request. This response may or may not carry an interface. Then, InterfaceSubscribeResponses are sent to the client, as a full flash of all the interfaces. Subsequently, a InterfaceSubscribeResponse 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.

Input: InterfaceSubscribeRequest

Output: InterfaceSubscribeResponse

InterfaceUnsubscribe

Request to stop receiving notifications of routing interface events.

Input: InterfaceUnsubscribeRequest

Output: InterfaceUnsubscribeResponse

InterfaceRefresh

Request to receive a refresh of notifications of all routing interfaces, with their current status and attributes.

Input: InterfaceRefreshRequest

Output: InterfaceRefreshResponse

Message(s)

This IDL defines the following message type(s)

InterfaceInitializeRequest

A client sends this request to initialize the service.

Field Type Description

InterfaceInitializeResponse

Routing interface service initialize response.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode The API specific return sub-code for the request.

InterfaceGetRequest

A client sends this request to query an individual interface.

Field Type Description
name string Interface name.
index uint32 Interface index.
address_format AddressFormat The format of IP addresses to be used in response.

InterfaceGetResponse

Response message for get interface request.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode The API specific return sub-code for the request.
entry InterfaceEntry Interface entry.

InterfaceSubscribeRequest

A client sends this request to subscribe for interface event notifications, which will be streamed to the client via InterfaceSubscribeResponses.

Field Type Description
address_format AddressFormat The format for IP addresses to be used in response.

InterfaceSubscribeResponse

Routing interface subscribe response message.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode The API specific return sub-code for the request.
entries InterfaceEntry Interface entries.

InterfaceUnsubscribeRequest

A client sends this request to unsubscribe for interface event notifications.

Field Type Description

InterfaceUnsubscribeResponse

Routing interface notification unsubscribe response.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode The API specific return sub-code for the request.

InterfaceRefreshRequest

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 Description

InterfaceRefreshResponse

Response message for the interface refresh request.

Field Type Description
status RpcStatus Top level return code.
sub_code StatusCode The API specific return sub-code for the request.

InterfaceEntry

This entry contains the information of a routing interface. It is used by InterfaceSubscribeResponse and InterfaceGetResponse. In a InterfaceSubscribeResponse notifying of a CHANGED or UP status, and in a InterfaceGetResponse, all attributes are applicable. In a InterfaceSubscribeResponse notifying of a DOWN or DELETED status, only the name and status attributes are applicable.

Field Type Description
name string Name in the format of type-fpc/pic/port.logical.
index uint32 Interface index.
status InterfaceStatus interface status.
bandwidth uint64 Bandwidth in bps.
mtu uint32 Maximum transmission unit.
addresses InterfaceAddress Interface Addresses. There may be none, one or multiple addresses.

InterfaceAddress

The network address linked to the interface.

Field Type Description
address NetworkAddress IPv4 or IPv6 address of the interface.
prefix_length uint32 Prefix length of the address.
is_primary bool Indicates whether this is the primary IP adddress of the interface.

Enum(s)

StatusCode

Interface get Response status code.

Value Description
SUCCESS_COMPLETED Request completed successfully.
INTERNAL_ERROR Request failed due to an internal error.
NOT_INITIALIZED Service is not initialized.
INVALID_INDEX_AND_NAME Interface name and index are invalid.
NOT_FOUND Interface was not found.

InterfaceStatus

Routing interface status like CHANGED, UP, DOWN, and DELETED applicable to InterfaceSubscribeResponse. UP and DOWN are applicable to InterfaceGetResponse.

Value Description
RT_INTF_CHANGED Attribute changed.
RT_INTF_UP Interface Up.
RT_INTF_DOWN Interface Down.
RT_INTF_DELETED Interface Deleted.

StatusCode

Status code for the interface unsubscribe response.

Value Description
SUCCESS_COMPLETED Request successfully completed.
INTERNAL_ERROR Request failed due to an internal error.
NOT_INITIALIZED Service is not initialized.
NOTIFICATION_NOT_SUBSCRIBED Notification is not subscribed.

StatusCode

Response status code for interface initialization.

Value Description
SUCCESS_COMPLETED Request successfully completed.
SUCCESS_REBOUND Request successfully completed, with a preexisting client of the same client identifier being rebound.
INTERNAL_ERROR Request failed due to an internal error.
ALREADY_INITIALIZED Service is already initialized.

StatusCode

Response status code.

Value Description
SUCCESS_COMPLETED Request successfully completed.
INTERNAL_ERROR Request failed due to an internal error.
NOT_INITIALIZED Service is not initialized.
ALREADY_SUBSCRIBED Notification is already subscribed.

StatusCode

Status code for the interface refresh request.

Value Description
SUCCESS_COMPLETED Request successfully completed.
INTERNAL_ERROR Request failed due to an internal error.
NOT_INITIALIZED Service is not initialized.
NOTIFICATION_NOT_SUBSCRIBED Notification is not subscribed.