Protocol Documentation

Table of Contents

mgd_service.proto

Top

Public API for Junos OS Manageabiltiy RPC services.

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

ConfigCommit

FieldTypeLabelDescription
commit_type ConfigCommitType optional

This specifies the type of commit operation. The commit operation can be commit or commit-synchronize

comment string optional

Specify the comment for the commit log

EditEphemeralConfigRequest

FieldTypeLabelDescription
request_id uint64 optional

A 64-bit unsigned integer for the request ID

eph_config_operations EditEphemeralConfigRequest.ConfigOperationList repeated

List of configuration data items. Each data item consists of the data model path and corresponding data encoded requested format.

eph_instance_name string optional

EditEphemeralConfigRequest.ConfigOperationList

FieldTypeLabelDescription
operation_id string optional

A string value for the operation ID. Because any given configuration request can contain multiple operational commands, the operation-id is used to identify a specific configuration command. 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

Configuration in XML format

json_config string optional

Configuration in JSON format

EditEphemeralConfigResponse

FieldTypeLabelDescription
request_id uint64 optional

A 64-bit unsigned integer for the request ID

response EditEphemeralConfigResponse.ResponseList repeated

List of responses for each configuration request

EditEphemeralConfigResponse.ResponseList

FieldTypeLabelDescription
operation_id string optional

A string value for the operation ID. Because any given configuration request can contain multiple operational commands, the operation-id is used to identify a specific configuration command. 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

FieldTypeLabelDescription
operation_id string optional

Identifier for the request

path string optional

Data model path to retrieve

ExecuteCfgCommandRequest

FieldTypeLabelDescription
request_id uint64 optional

A 64-bit unsigned integer for the request ID

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

FieldTypeLabelDescription
request_id uint64 optional

A 64-bit unsigned integer for the request ID

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

Request structure for executing operational mode commands

FieldTypeLabelDescription
request_id uint64 optional

Unsigned 64-bit integer for the request ID

cli_command string optional

Command in CLI format

xml_command string optional

Command in XML format

json_command string optional

Command in JSON format

out_format OperationFormatType optional

Output format, default is JSON

ExecuteOpCommandResponse

Response structure for operational command execution requests

FieldTypeLabelDescription
request_id uint64 optional

A 64-bit unsigned integer for the request ID

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

FieldTypeLabelDescription
request_id uint64 optional

A 64-bit unsigned integer for the request ID

encoding JunosDataEncodingTypes optional

Identifier for the encoding scheme

eph_config_requests EphConfigRequestList repeated

EphConfigRequest contains the Path

eph_instance_name string optional

EphInstanceName Leave empty for the default ephemeral instance Enter the name of the ephemeral instance for dynamic instances

merge_view bool optional

MergeView : True, if merge view configuration needed

GetEphemeralConfigResponse

FieldTypeLabelDescription
request_id uint64 optional

A 64-bit unsigned integer for the request ID

response GetEphemeralConfigResponse.ResponseList repeated

List of responses for each configuration request

GetEphemeralConfigResponse.ResponseList

FieldTypeLabelDescription
operation_id string optional

A string value for the operation ID. Because any given configuration request can contain multiple operational commands, the operation-id is used to identify a specific configuration command. 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

This integer data type lists the available configuration commands.

NameNumberDescription
UPDATE_CONFIG 0

Update configuration

REPLACE_CONFIG 1

Replace configuration

DELETE_CONFIG 2

Delete configuration

ConfigCommitType

This integer data type lists the available commit types

NameNumberDescription
CONFIG_COMMIT_SYNCHRONIZE 0

Use commit synchronize

CONFIG_COMMIT 1

Use commit without options

ConfigLoadType

This integer data type lists the available load configuration commands.

NameNumberDescription
CONFIG_LOAD_REPLACE 0

Load the configuration as a replacement for the existing configuration

CONFIG_LOAD_MERGE 1

Load the configuration to merge with the existing configuraton

CONFIG_LOAD_OVERRIDE 2

Load the configuration to override the existing configuration

CONFIG_LOAD_UPDATE 3

Load the configuration as an update the existing configuration

CONFIG_LOAD_SET 4

Load the configuration as a set of commands to run on the existing configuration

JunosDataEncodingTypes

This integer data type represents the supported data encoding types.

NameNumberDescription
ENCODING_XML 0

XML encoding

ENCODING_JSON 1

JSON encoding

JunosRpcResponseTypes

This data type lists the available RPC response codes.

NameNumberDescription
SUCCESS 0

The RPC was successful

NOK 1

The RPC was not successful

UNSUPPORTED_PATH 2

The path contained in the RPC request is unsupported.

INVALID_PATH 3

The path contained in the RPC request is invalid.

INVALID_CONFIGURATION 4

The configuration contained in the RPC is invalid.

UNSUPPORTED_ENCODING 5

The RPC contains unsupported encoding.

OperationFormatType

This is used to set the data type for the operations performed.

NameNumberDescription
OPERATION_FORMAT_JSON 0

JSON format (DEFAULT)

OPERATION_FORMAT_XML 1

XML format

OPERATION_FORMAT_CLI 2

Text CLI format

ManagementRpcApi

Method NameRequest TypeResponse TypeDescription
ExecuteOpCommand ExecuteOpCommandRequest ExecuteOpCommandResponse

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

ExecuteCfgCommand ExecuteCfgCommandRequest ExecuteCfgCommandResponse

This RPC enables the user to load and commit configuration on a Junos OS device.

GetEphemeralConfig GetEphemeralConfigRequest GetEphemeralConfigResponse

This RPC returns the configuration in the ephemeral database for path specified in the request.

EditEphemeralConfig EditEphemeralConfigRequest EditEphemeralConfigResponse

This RPC perfoms load-configuration and commit in Junos OS in the 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