Junos OS management IDL - Protocol Documentation

Table of Contents

mgd_service.proto

Top

Public API for the Manageabiltiy RPC services.

This IDL defines the APIs for the Junos specific management services.

ConfigCommit

Request configuration commit message structure

FieldTypeLabelDescription
commit_type ConfigCommitType optional

This will specify the type of commit operation commit operation can be commit or commit-synchronize

comment string optional

Specify the comment for the commit log

EditEphemeralConfigRequest

Message structure for edit ephemeral configuration requests

FieldTypeLabelDescription
request_id uint64 optional

The request id corresponding to the request

eph_config_operations EditEphemeralConfigRequest.ConfigOperationList repeated

List of configuration data items, each consisting of the data model path and corresponding data encoded based on the requested format

eph_instance_name string optional

EphInstanceName:

Empty for the default ephemeral instance or the name of the ephemeral instance for dynamic instance

EditEphemeralConfigRequest.ConfigOperationList

List of configuration operations to be performed

FieldTypeLabelDescription
operation_id string optional

The operation id is used to identify a specific configuration command when the RPC contains multiple commands.

The response for each command can be identified based on the operation-id returned by the target device

operation ConfigCommands optional

The type of configuration modification requested for the corresponding path.Note that some commands, such as 'delete' do not specify any associated data with the path

path string optional

Specifies a path in the data model path corresponding to the data in the message

xml_config string optional

Config in XML format

json_config string optional

Config in JSON format

EditEphemeralConfigResponse

Message structure for responses from edit ephemeral configuration requests

FieldTypeLabelDescription
request_id uint64 optional

The request id corresponding to the request

response EditEphemeralConfigResponse.ResponseList repeated

List of responses for each configuration request

EditEphemeralConfigResponse.ResponseList

List of responses

FieldTypeLabelDescription
operation_id string optional

The operation id is used to identify a specific configuration command when the RPC contains multiple commands.

The response for each command can be identified based on the operation-id returned by the target device

status JunosRpcResponseTypes optional

Response code indicating the result of the command

message string optional

Error or information text associated with the return-code value

EphConfigRequestList

Message structure for ephemeral database configuration request lists

FieldTypeLabelDescription
operation_id string optional

Identifier for the request

path string optional

Data model path to retrieve

ExecuteCfgCommandRequest

Request Configuration Command Execution

FieldTypeLabelDescription
request_id uint64 optional

The request id corresponding to the request

xml_config string optional

Configuration data in XML format

json_config string optional

Configuration data in JSON format

text_config string optional

Configuration data in text format

load_type ConfigLoadType optional

Specify the type of load operation

commit ConfigCommit optional

Specify the type of commit operation

ExecuteCfgCommandResponse

Configuration command response

FieldTypeLabelDescription
request_id uint64 optional

The request id corresponding to the request

status JunosRpcResponseTypes optional

Response code indicating the result of the command

message string optional

Error or information text associated with the return-code value

ExecuteOpCommandRequest

Message structure for executing operational mode commands

FieldTypeLabelDescription
request_id uint64 optional

The request id corresponding to the request

cli_command string optional

Command formatted in cli (set) format

xml_command string optional

Command formatted in XML format

json_command string optional

Command formatted in json format

out_format OperationFormatType optional

Output format, default is JSON

ExecuteOpCommandResponse

Message structure for responses returned from executing operational commands

FieldTypeLabelDescription
request_id uint64 optional

The request id corresponding to the request

data string optional

Command Data

status JunosRpcResponseTypes optional

Response code indicating the result of the command

message string optional

Error or information text associated with the return-code value

GetEphemeralConfigRequest

Message structure for get ephemeral configuration requests

FieldTypeLabelDescription
request_id uint64 optional

The request id corresponding to the request

encoding JunosDataEncodingTypes optional

Identifier for the encoding scheme

eph_config_requests EphConfigRequestList repeated

List of configuration requests

EphConfigRequest will contain the Path

eph_instance_name string optional

EphInstanceName:

Empty for default ephemeral instance or the name of the ephemeral instance for dynamic instance

merge_view bool optional

MergeView:

Set to true if merge view configuration needed

GetEphemeralConfigResponse

Message structure for responses from get ephemeral configuration requests

FieldTypeLabelDescription
request_id uint64 optional

The request id corresponding to the request

response GetEphemeralConfigResponse.ResponseList repeated

List of responses for each configuration request

GetEphemeralConfigResponse.ResponseList

List of responses

FieldTypeLabelDescription
operation_id string optional

The operation id is used to identify a specific configuration command when the RPC contains multiple commands.

The response for each command can be identified based on the operation-id returned by the target device.

path string optional

Specifies a path in the data model path corresponding to the data in the message

value string optional

Data encoded using the encoding specified in set-data-encoding, or encoding specified in the request. This data may be populated by the management system.

status JunosRpcResponseTypes optional

Response code indicating the result of the command

message string optional

Error or information text associated with the return-code value

ConfigCommands

List of configuration commands

NameNumberDescription
UPDATE_CONFIG 0

Update configuration

REPLACE_CONFIG 1

Replace configuration

DELETE_CONFIG 2

Delete configuration

ConfigCommitType

List of available configuration commit types

NameNumberDescription
CONFIG_COMMIT_SYNCHRONIZE 0

Commit synchronize

CONFIG_COMMIT 1

Commit

ConfigLoadType

List of configuration load options

NameNumberDescription
CONFIG_LOAD_REPLACE 0

Config load replace - Load configuration statements from client as replacement for existing configuration

CONFIG_LOAD_MERGE 1

Config load merge - Load configuration statements from client so as to merge with existing configuration

CONFIG_LOAD_OVERRIDE 2

Config load override - Load configuration statements from client as an override to existing configuration

CONFIG_LOAD_UPDATE 3

Config load update - Load configuration statements from client as an update to existing configuration

CONFIG_LOAD_SET 4

Config load set - Load configuration from commands sent from client in set form.

JunosDataEncodingTypes

List of supported data encoding types

NameNumberDescription
ENCODING_XML 0

XML encoding

ENCODING_JSON 1

JSON encoding

JunosRpcResponseTypes

List of possible RPC responses

NameNumberDescription
SUCCESS 0

Success

NOK 1

Error

UNSUPPORTED_PATH 2

Unsupported path

INVALID_PATH 3

Invalid path

INVALID_CONFIGURATION 4

Invalid configuration

UNSUPPORTED_ENCODING 5

Unsupported encoding

OperationFormatType

NameNumberDescription
OPERATION_FORMAT_JSON 0

JSON format (Default)

OPERATION_FORMAT_XML 1

OPERATION_FORMAT_CLI 2

ManagementRpcApi

MGD Service Definitions

Method NameRequest TypeResponse TypeDescription
ExecuteOpCommand ExecuteOpCommandRequest ExecuteOpCommandResponse

It executes the operational command specified in ExecuteOpCommandRequest. This is a streaming API

ExecuteCfgCommand ExecuteCfgCommandRequest ExecuteCfgCommandResponse

The RPC will enable user to load and commit configuration on a Junos OS device

GetEphemeralConfig GetEphemeralConfigRequest GetEphemeralConfigResponse

This RPC will return the configuration in the ephemeral database for Path specified in the request

EditEphemeralConfig EditEphemeralConfigRequest EditEphemeralConfigResponse

This RPC will perform load-configuration and commit in JUNOS in ephemeral database

Scalar Value Types

.proto TypeNotesC++ TypeJava TypePython 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