Method Name | Request / Response Type | Description |
---|---|---|
Capabilities | CapabilityRequest
CapabilityResponse |
Capabilities allows the client to retrieve the set of capabilities that |
Get | GetRequest
GetResponse |
Retrieve a snapshot of data from the target. A Get RPC requests that the |
Set | SetRequest
SetResponse |
Set allows the client to modify the state of data on the target. The |
Subscribe | SubscribeRequest
stream SubscribeResponse stream |
Subscribe allows a client to request the target to send it values |
CapabilityRequest is sent by the client in the Capabilities RPC to request
that the target reports its capabilities.
Reference: gNMI Specification Section 3.2.1
Field | Type | Description |
---|---|---|
extension (repeated) | gnmi_ext.Extension |
Extension messages associated with the CapabilityRequest. See the |
CapabilityResponse is used by the target to report its capabilities to the
client within the Capabilities RPC.
Reference: gNMI Specification Section 3.2.2
Field | Type | Description |
---|---|---|
supported_models (repeated) | ModelData | Supported schema models. |
supported_encodings (repeated) | Encoding | Supported encodings. |
gNMI_version | string | Supported gNMI version. |
extension (repeated) | gnmi_ext.Extension |
Extension messages associated with the CapabilityResponse. See the |
Decimal64 is used to encode a fixed precision decimal number. The value
is expressed as a set of digits with the precision specifying the
number of digits following the decimal point in the digit set.
This message is deprecated in favor of encoding all floating point types
as double precision.
Field | Type | Description |
---|---|---|
digits | int64 | Set of digits. |
precision | uint32 | Number of digits following the decimal point. |
Error message previously utilised to return errors to the client. Deprecated
in favour of using the google.golang.org/genproto/googleapis/rpc/status
message in the RPC response.
Reference: gNMI Specification Section 2.5
Field | Type | Description |
---|---|---|
code | uint32 | Canonical gRPC error code. |
message | string | Human readable error. |
data | google.protobuf.Any | Optional additional information. |
GetRequest is sent when a client initiates a Get RPC. It is used to specify
the set of data elements for which the target should return a snapshot of
data. The use_models field specifies the set of schema modules that are to
be used by the target - where use_models is not specified then the target
must use all schema models that it has.
Reference: gNMI Specification Section 3.3.1
Field | Type | Description |
---|---|---|
prefix | Path | Prefix used for paths. |
path (repeated) | Path | Paths requested by the client. |
type | GetRequest.DataType | The type of data being requested. |
encoding | Encoding | Encoding to be used. |
use_models (repeated) | ModelData | The schema models to be used. |
extension (repeated) | gnmi_ext.Extension |
Extension messages associated with the GetRequest. See the |
GetResponse is used by the target to respond to a GetRequest from a client.
The set of Notifications corresponds to the data values that are requested
by the client in the GetRequest.
Reference: gNMI Specification Section 3.3.2
Field | Type | Description |
---|---|---|
notification (repeated) | Notification | Data values. |
error | Error | Errors that occurred in the Get. |
extension (repeated) | gnmi_ext.Extension |
Extension messages associated with the GetResponse. See the |
ModelData is used to describe a set of schema modules. It can be used in a
CapabilityResponse where a target reports the set of modules that it
supports, and within the SubscribeRequest and GetRequest messages to specify
the set of models from which data tree elements should be reported.
Reference: gNMI Specification Section 3.2.3
Field | Type | Description |
---|---|---|
name | string | Name of the model. |
organization | string | Organization publishing the model. |
version | string | Semantic version of the model. |
Notification is a re-usable message that is used to encode data from the
target to the client. A Notification carries two types of changes to the data
tree:
- Deleted values (delete) - a set of paths that have been removed from the
data tree.
- Updated values (update) - a set of path-value pairs indicating the path
whose value has changed in the data tree.
Reference: gNMI Specification Section 2.1
Field | Type | Description |
---|---|---|
timestamp | int64 | Timestamp in nanoseconds since Epoch. |
prefix | Path | Prefix used for paths in the message. |
update (repeated) | Update | Data elements that have changed values. |
delete (repeated) | Path | Data elements that have been deleted. |
atomic | bool |
This notification contains a set of paths that are always updated together |
Path encodes a data tree path as a series of repeated strings, with
each element of the path representing a data tree node name and the
associated attributes.
Reference: gNMI Specification Section 2.2.2.
Field | Type | Description |
---|---|---|
element (repeated) | string |
Elements of the path are no longer encoded as a string, but rather within |
origin | string | Label to disambiguate path. |
elem (repeated) | PathElem | Elements of the path. |
target | string | The name of the target |
PathElem encodes an element of a gNMI path, along with any attributes (keys)
that may be associated with it.
Reference: gNMI Specification Section 2.2.2.
Field | Type | Description |
---|---|---|
name | string | The name of the element in the path. |
key (repeated) | PathElem.KeyEntry | Map of key (attribute) name to value. |
Poll is sent within a SubscribeRequest to trigger the device to
send telemetry updates for the paths that are associated with the
subscription.
Reference: gNMI Specification Section Section 3.5.1.4
QOSMarking specifies the DSCP value to be set on transmitted telemetry
updates from the target.
Reference: gNMI Specification Section 3.5.1.2
Field | Type | Description |
---|---|---|
marking | uint32 |
|
ScalarArray is used to encode a mixed-type array of values.
Field | Type | Description |
---|---|---|
element (repeated) | TypedValue |
The set of elements within the array. Each TypedValue message should |
SetRequest is sent from a client to the target to update values in the data
tree. Paths are either deleted by the client, or modified by means of being
updated, or replaced. Where a replace is used, unspecified values are
considered to be replaced, whereas when update is used the changes are
considered to be incremental. The set of changes that are specified within
a single SetRequest are considered to be a transaction.
Reference: gNMI Specification Section 3.4.1
Field | Type | Description |
---|---|---|
prefix | Path | Prefix used for paths in the message. |
delete (repeated) | Path | Paths to be deleted from the data tree. |
replace (repeated) | Update | Updates specifying elements to be replaced. |
update (repeated) | Update | Updates specifying elements to updated. |
extension (repeated) | gnmi_ext.Extension |
Extension messages associated with the SetRequest. See the |
SetResponse is the response to a SetRequest, sent from the target to the
client. It reports the result of the modifications to the data tree that were
specified by the client. Errors for this RPC should be reported using the
https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto
message in the RPC return. The gnmi.Error message can be used to add
additional details where required. Reference: gNMI Specification
Section 3.4.2
Field | Type | Description |
---|---|---|
prefix | Path | Prefix used for paths. |
response (repeated) | UpdateResult |
A set of responses specifying the result of the operations specified in |
message | Error | The overall status of the transaction. |
timestamp | int64 | Timestamp of transaction (ns since epoch). |
extension (repeated) | gnmi_ext.Extension |
Extension messages associated with the SetResponse. See the |
SubscribeRequest is the message sent by the client to the target when
initiating a subscription to a set of paths within the data tree. The
request field must be populated and the initial message must specify a
SubscriptionList to initiate a subscription.
Reference: gNMI Specification Section 3.5.1.1
Field | Type | Description |
---|---|---|
request (one of) | ||
subscribe | SubscriptionList | Specify the paths within a subscription. |
poll | Poll | Trigger a polled update. |
extension (repeated) | gnmi_ext.Extension |
Extension messages associated with the SubscribeRequest. See the |
SubscribeResponse is the message used by the target within a Subscribe RPC.
The target includes a Notification message which is used to transmit values
of the path(s) that are associated with the subscription. The same message
is to indicate that the target has sent all data values once (is
synchronized).
Reference: gNMI Specification Section 3.5.1.4
Field | Type | Description |
---|---|---|
response (one of) | ||
update | Notification | Changed or sampled value for a path. |
sync_response | bool |
Indicate target has sent all values associated with the subscription |
error | Error | Deprecated in favour of google.golang.org/genproto/googleapis/rpc/status |
extension (repeated) | gnmi_ext.Extension |
Extension messages associated with the SubscribeResponse. See the |
Subscription is a single request within a SubscriptionList. The path
specified is interpreted (along with the prefix) as the elements of the data
tree that the client is subscribing to. The mode determines how the target
should trigger updates to be sent.
Reference: gNMI Specification Section 3.5.1.3
Field | Type | Description |
---|---|---|
path | Path | The data tree path. |
mode | SubscriptionMode | Subscription mode to be used. |
sample_interval | uint64 | ns between samples in SAMPLE mode. |
suppress_redundant | bool |
Indicates whether values that have not changed should be sent in a SAMPLE |
heartbeat_interval | uint64 |
Specifies the maximum allowable silent period in nanoseconds when |
SubscriptionList is used within a Subscribe message to specify the list of
paths that the client wishes to subscribe to. The message consists of a
list of (possibly prefixed) paths, and options that relate to the
subscription.
Reference: gNMI Specification Section 3.5.1.2
Field | Type | Description |
---|---|---|
prefix | Path | Prefix used for paths. |
subscription (repeated) | Subscription | Set of subscriptions to create. |
qos | QOSMarking | DSCP marking to be used. |
mode | SubscriptionList.Mode |
|
allow_aggregation | bool |
Whether elements of the schema that are marked as eligible for aggregation |
use_models (repeated) | ModelData |
The set of schemas that define the elements of the data tree that should |
encoding | Encoding |
The encoding that the target should use within the Notifications generated |
updates_only | bool |
An optional field to specify that only updates to current state should be |
TypedValue is used to encode a value being sent between the client and
target (originated by either entity).
Field | Type | Description |
---|---|---|
value (one of) | ||
string_val | string | String value. |
int_val | int64 | Integer value. |
uint_val | uint64 | Unsigned integer value. |
bool_val | bool | Bool value. |
bytes_val | bytes | Arbitrary byte sequence value. |
float_val | float | Deprecated - use double_val. |
double_val | double | Floating point value. |
decimal_val | Decimal64 | Deprecated - use double_val. |
leaflist_val | ScalarArray | Mixed type scalar array value. |
any_val | google.protobuf.Any | protobuf.Any encoded bytes. |
json_val | bytes | JSON-encoded text. |
json_ietf_val | bytes | JSON-encoded text per RFC7951. |
ascii_val | string | Arbitrary ASCII text. |
proto_bytes | bytes |
Protobuf binary encoded bytes. The message type is not included. |
Update is a re-usable message that is used to store a particular Path,
Value pair.
Reference: gNMI Specification Section 2.1
Field | Type | Description |
---|---|---|
path | Path | The path (key) for the update. |
value | Value | The value (value) for the update. |
val | TypedValue | The explicitly typed update value. |
duplicates | uint32 | Number of coalesced duplicates. |
UpdateResult is used within the SetResponse message to communicate the
result of an operation specified within a SetRequest message.
Reference: gNMI Specification Section 3.4.2
Field | Type | Description |
---|---|---|
timestamp | int64 |
Deprecated timestamp for the UpdateResult, this field has been |
path | Path | Path associated with the update. |
message | Error | Status of the update operation. |
op | UpdateResult.Operation | Update operation type. |
Value encodes a data tree node's value - along with the way in which
the value is encoded. This message is deprecated by gNMI 0.3.0.
Reference: gNMI Specification Section 2.2.3.
Encoding defines the value encoding formats that are supported by the gNMI
protocol. These encodings are used by both the client (when sending Set
messages to modify the state of the target) and the target when serializing
data to be returned to the client (in both Subscribe and Get RPCs).
Reference: gNMI Specification Section 2.3
Name | Number | Description |
---|---|---|
JSON | 0 | JSON encoded text. |
BYTES | 1 | Arbitrarily encoded bytes. |
PROTO | 2 | Encoded according to scalar values of TypedValue. |
ASCII | 3 | ASCII text of an out-of-band agreed format. |
JSON_IETF | 4 | JSON encoded text as per RFC7951. |
Type of elements within the data tree.
Name | Number | Description |
---|---|---|
ALL | 0 | All data elements. |
CONFIG | 1 | Config (rw) only elements. |
STATE | 2 | State (ro) only elements. |
OPERATIONAL | 3 | Data elements marked in the schema as operational. This refers to data |
Mode of the subscription.
Name | Number | Description |
---|---|---|
STREAM | 0 | Values streamed by the target (Sec. 3.5.1.5.2). |
ONCE | 1 | Values sent once-off by the target (Sec. 3.5.1.5.1). |
POLL | 2 | Values sent in response to a poll request (Sec. 3.5.1.5.3). |
SubscriptionMode is the mode of the subscription, specifying how the
target must return values in a subscription.
Reference: gNMI Specification Section 3.5.1.3
Name | Number | Description |
---|---|---|
TARGET_DEFINED | 0 | The target selects the relevant mode for each element. |
ON_CHANGE | 1 | The target sends an update on element value change. |
SAMPLE | 2 | The target samples values according to the interval. |
The operation that was associated with the Path specified.
Name | Number | Description |
---|---|---|
INVALID | 0 | |
DELETE | 1 | The result relates to a delete of Path. |
REPLACE | 2 | The result relates to a replace of Path. |
UPDATE | 3 | The result relates to an update of Path. |
The gNMI service semantic version.
Extension | Type | Base | Number | Description |
---|---|---|---|---|
gnmi_service | string | .google.protobuf.FileOptions | 1001 | The gNMI service semantic version. |
The Extension message contains a single gNMI extension.
Field | Type | Description |
---|---|---|
ext (one of) | ||
registered_ext | RegisteredExtension | A registered extension. |
master_arbitration | MasterArbitration |
Well known extensions. |
history | History | History extension. |
The History extension allows clients to request historical data. Its
spec can be found at
https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-history.md
Field | Type | Description |
---|---|---|
request (one of) | ||
snapshot_time | int64 | Nanoseconds since the epoch |
range | TimeRange |
|
MasterArbitration is used to select the master among multiple gNMI clients
with the same Roles. The client with the largest election_id is honored as
the master.
The document about gNMI master arbitration can be found at
https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-master-arbitration.md
The RegisteredExtension message defines an extension which is defined outside
of this file.
Field | Type | Description |
---|---|---|
id | ExtensionID | The unique ID assigned to this extension. |
msg | bytes | The binary-marshalled protobuf extension payload. |
There can be one master for each role. The role is identified by its id.
Field | Type | Description |
---|---|---|
id | string |
More fields can be added if needed, for example, to specify what paths the |
Field | Type | Description |
---|---|---|
start | int64 | Nanoseconds since the epoch |
end | int64 | Nanoseconds since the epoch |
Representation of unsigned 128-bit integer.
RegisteredExtension is an enumeration acting as a registry for extensions
defined by external sources.
Name | Number | Description |
---|---|---|
EID_UNSET | 0 | New extensions are to be defined within this enumeration - their definition |
EID_EXPERIMENTAL | 999 | An experimental extension that may be used during prototyping of a new |
`Any` contains an arbitrary serialized protocol buffer message along with a
URL that describes the type of the serialized message.
Protobuf library provides support to pack/unpack Any values in the form
of utility functions or additional generated methods of the Any type.
Example 1: Pack and unpack a message in C++.
Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
...
}
Example 2: Pack and unpack a message in Java.
Foo foo = ...;
Any any = Any.pack(foo);
...
if (any.is(Foo.class)) {
foo = any.unpack(Foo.class);
}
// or ...
if (any.isSameTypeAs(Foo.getDefaultInstance())) {
foo = any.unpack(Foo.getDefaultInstance());
}
Example 3: Pack and unpack a message in Python.
foo = Foo(...)
any = Any()
any.Pack(foo)
...
if any.Is(Foo.DESCRIPTOR):
any.Unpack(foo)
...
Example 4: Pack and unpack a message in Go
foo := &pb.Foo{...}
any, err := anypb.New(foo)
if err != nil {
...
}
...
foo := &pb.Foo{}
if err := any.UnmarshalTo(foo); err != nil {
...
}
The pack methods provided by protobuf library will by default use
'type.googleapis.com/full.type.name' as the type URL and the unpack
methods only use the fully qualified type name after the last '/'
in the type URL, for example "foo.bar.com/x/y.z" will yield type
name "y.z".
JSON
The JSON representation of an `Any` value uses the regular
representation of the deserialized, embedded message, with an
additional field `@type` which contains the type URL. Example:
package google.profile;
message Person {
string first_name = 1;
string last_name = 2;
}
{
"@type": "type.googleapis.com/google.profile.Person",
"firstName":
"lastName":
}
If the embedded message type is well-known and has a custom JSON
representation, that representation will be embedded adding a field
`value` which holds the custom JSON in addition to the `@type`
field. Example (for message [google.protobuf.Duration][]):
{
"@type": "type.googleapis.com/google.protobuf.Duration",
"value": "1.212s"
}
Field | Type | Description |
---|---|---|
type_url | string |
A URL/resource name that uniquely identifies the type of the serialized |
value | bytes | Must be a valid serialized protocol buffer of the above specified type. |
Describes a message type.
Field | Type | Description |
---|---|---|
name (optional) | string |
|
field (repeated) | FieldDescriptorProto |
|
extension (repeated) | FieldDescriptorProto |
|
nested_type (repeated) | DescriptorProto |
|
enum_type (repeated) | EnumDescriptorProto |
|
extension_range (repeated) | DescriptorProto.ExtensionRange |
|
oneof_decl (repeated) | OneofDescriptorProto |
|
options (optional) | MessageOptions |
|
reserved_range (repeated) | DescriptorProto.ReservedRange |
|
reserved_name (repeated) | string |
Reserved field names, which may not be used by fields in the same message. |
Field | Type | Description |
---|---|---|
start (optional) | int32 | Inclusive. |
end (optional) | int32 | Exclusive. |
options (optional) | ExtensionRangeOptions |
|
Range of reserved tag numbers. Reserved tag numbers may not be used by
fields or extension ranges in the same message. Reserved ranges may
not overlap.
Describes an enum type.
Field | Type | Description |
---|---|---|
name (optional) | string |
|
value (repeated) | EnumValueDescriptorProto |
|
options (optional) | EnumOptions |
|
reserved_range (repeated) | EnumDescriptorProto.EnumReservedRange |
Range of reserved numeric values. Reserved numeric values may not be used |
reserved_name (repeated) | string |
Reserved enum value names, which may not be reused. A given name may only |
Range of reserved numeric values. Reserved values may not be used by
entries in the same enum. Reserved ranges may not overlap.
Note that this is distinct from DescriptorProto.ReservedRange in that it
is inclusive such that it can appropriately represent the entire int32
domain.
Field | Type | Description |
---|---|---|
allow_alias (optional) | bool |
Set this option to true to allow mapping different tag names to the same |
deprecated (optional) | bool |
Is this enum deprecated? |
deprecated_legacy_json_field_conflicts (optional) | bool |
Enable the legacy handling of JSON field name conflicts. This lowercases |
uninterpreted_option (repeated) | UninterpretedOption | The parser stores options it doesn't recognize here. See above. |
Describes a value within an enum.
Field | Type | Description |
---|---|---|
name (optional) | string |
|
number (optional) | int32 |
|
options (optional) | EnumValueOptions |
|
Field | Type | Description |
---|---|---|
deprecated (optional) | bool |
Is this enum value deprecated? |
uninterpreted_option (repeated) | UninterpretedOption | The parser stores options it doesn't recognize here. See above. |
Field | Type | Description |
---|---|---|
uninterpreted_option (repeated) | UninterpretedOption | The parser stores options it doesn't recognize here. See above. |
Describes a field within a message.
Field | Type | Description |
---|---|---|
name (optional) | string |
|
number (optional) | int32 |
|
label (optional) | FieldDescriptorProto.Label |
|
type (optional) | FieldDescriptorProto.Type |
If type_name is set, this need not be set. If both this and type_name |
type_name (optional) | string |
For message and enum types, this is the name of the type. If the name |
extendee (optional) | string |
For extensions, this is the name of the type being extended. It is |
default_value (optional) | string |
For numeric types, contains the original text representation of the value. |
oneof_index (optional) | int32 |
If set, gives the index of a oneof in the containing type's oneof_decl |
json_name (optional) | string |
JSON name of this field. The value is set by protocol compiler. If the |
options (optional) | FieldOptions |
|
proto3_optional (optional) | bool |
If true, this is a proto3 "optional". When a proto3 field is optional, it |
Field | Type | Description |
---|---|---|
ctype (optional) | FieldOptions.CType |
The ctype option instructs the C++ code generator to use a different |
packed (optional) | bool |
The packed option can be enabled for repeated primitive fields to enable |
jstype (optional) | FieldOptions.JSType |
The jstype option determines the JavaScript type used for values of the |
lazy (optional) | bool |
Should this field be parsed lazily? Lazy applies only to message-type |
unverified_lazy (optional) | bool |
unverified_lazy does no correctness checks on the byte stream. This should |
deprecated (optional) | bool |
Is this field deprecated? |
weak (optional) | bool | For Google-internal migration only. Do not use. Default: false |
debug_redact (optional) | bool |
Indicate that the field value should not be printed out when using debug |
retention (optional) | FieldOptions.OptionRetention |
|
target (optional) | FieldOptions.OptionTargetType |
|
uninterpreted_option (repeated) | UninterpretedOption | The parser stores options it doesn't recognize here. See above. |
Describes a complete .proto file.
Field | Type | Description |
---|---|---|
name (optional) | string | file name, relative to root of source tree |
package (optional) | string | e.g. "foo", "foo.bar", etc. |
dependency (repeated) | string | Names of files imported by this file. |
public_dependency (repeated) | int32 | Indexes of the public imported files in the dependency list above. |
weak_dependency (repeated) | int32 |
Indexes of the weak imported files in the dependency list. |
message_type (repeated) | DescriptorProto | All top-level definitions in this file. |
enum_type (repeated) | EnumDescriptorProto |
|
service (repeated) | ServiceDescriptorProto |
|
extension (repeated) | FieldDescriptorProto |
|
options (optional) | FileOptions |
|
source_code_info (optional) | SourceCodeInfo |
This field contains optional information about the original source code. |
syntax (optional) | string |
The syntax of the proto file. |
edition (optional) | string | The edition of the proto file, which is an opaque string. |
The protocol compiler can output a FileDescriptorSet containing the .proto
files it parses.
Field | Type | Description |
---|---|---|
file (repeated) | FileDescriptorProto |
|
Field | Type | Description |
---|---|---|
java_package (optional) | string |
Sets the Java package where classes generated from this .proto will be |
java_outer_classname (optional) | string |
Controls the name of the wrapper Java class generated for the .proto file. |
java_multiple_files (optional) | bool |
If enabled, then the Java code generator will generate a separate .java |
java_generate_equals_and_hash (optional) | bool | This option does nothing. |
java_string_check_utf8 (optional) | bool |
If set true, then the Java2 code generator will generate code that |
optimize_for (optional) | FileOptions.OptimizeMode | Default: SPEED |
go_package (optional) | string |
Sets the Go package where structs generated from this .proto will be |
cc_generic_services (optional) | bool |
Should generic services be generated in each language? "Generic" services |
java_generic_services (optional) | bool | Default: false |
py_generic_services (optional) | bool | Default: false |
php_generic_services (optional) | bool | Default: false |
deprecated (optional) | bool |
Is this file deprecated? |
cc_enable_arenas (optional) | bool |
Enables the use of arenas for the proto messages in this file. This applies |
objc_class_prefix (optional) | string |
Sets the objective c class prefix which is prepended to all objective c |
csharp_namespace (optional) | string | Namespace for generated classes; defaults to the package. |
swift_prefix (optional) | string |
By default Swift generators will take the proto package and CamelCase it |
php_class_prefix (optional) | string |
Sets the php class prefix which is prepended to all php generated classes |
php_namespace (optional) | string |
Use this option to change the namespace of php generated classes. Default |
php_metadata_namespace (optional) | string |
Use this option to change the namespace of php generated metadata classes. |
ruby_package (optional) | string |
Use this option to change the package of ruby generated classes. Default |
uninterpreted_option (repeated) | UninterpretedOption |
The parser stores options it doesn't recognize here. |
Describes the relationship between generated code and its original source
file. A GeneratedCodeInfo message is associated with only one generated
source file, but may contain references to different source .proto files.
Field | Type | Description |
---|---|---|
annotation (repeated) | GeneratedCodeInfo.Annotation |
An Annotation connects some span of text in generated code to an element |
Field | Type | Description |
---|---|---|
path (repeated) | int32 |
Identifies the element in the original source .proto file. This field |
source_file (optional) | string | Identifies the filesystem path to the original source .proto. |
begin (optional) | int32 |
Identifies the starting offset in bytes in the generated code |
end (optional) | int32 |
Identifies the ending offset in bytes in the generated code that |
semantic (optional) | GeneratedCodeInfo.Annotation.Semantic |
|
Field | Type | Description |
---|---|---|
message_set_wire_format (optional) | bool |
Set true to use the old proto1 MessageSet wire format for extensions. |
no_standard_descriptor_accessor (optional) | bool |
Disables the generation of the standard "descriptor()" accessor, which can |
deprecated (optional) | bool |
Is this message deprecated? |
map_entry (optional) | bool |
NOTE: Do not set the option in .proto files. Always use the maps syntax |
deprecated_legacy_json_field_conflicts (optional) | bool |
Enable the legacy handling of JSON field name conflicts. This lowercases |
uninterpreted_option (repeated) | UninterpretedOption | The parser stores options it doesn't recognize here. See above. |
Describes a method of a service.
Field | Type | Description |
---|---|---|
name (optional) | string |
|
input_type (optional) | string |
Input and output type names. These are resolved in the same way as |
output_type (optional) | string |
|
options (optional) | MethodOptions |
|
client_streaming (optional) | bool | Identifies if client streams multiple client messages Default: false |
server_streaming (optional) | bool | Identifies if server streams multiple server messages Default: false |
Field | Type | Description |
---|---|---|
deprecated (optional) | bool |
Is this method deprecated? |
idempotency_level (optional) | MethodOptions.IdempotencyLevel | Default: IDEMPOTENCY_UNKNOWN |
uninterpreted_option (repeated) | UninterpretedOption | The parser stores options it doesn't recognize here. See above. |
Describes a oneof.
Field | Type | Description |
---|---|---|
name (optional) | string |
|
options (optional) | OneofOptions |
|
Field | Type | Description |
---|---|---|
uninterpreted_option (repeated) | UninterpretedOption | The parser stores options it doesn't recognize here. See above. |
Describes a service.
Field | Type | Description |
---|---|---|
name (optional) | string |
|
method (repeated) | MethodDescriptorProto |
|
options (optional) | ServiceOptions |
|
Field | Type | Description |
---|---|---|
deprecated (optional) | bool |
Is this service deprecated? |
uninterpreted_option (repeated) | UninterpretedOption | The parser stores options it doesn't recognize here. See above. |
Encapsulates information about the original source file from which a
FileDescriptorProto was generated.
Field | Type | Description |
---|---|---|
location (repeated) | SourceCodeInfo.Location |
A Location identifies a piece of source code in a .proto file which |
Field | Type | Description |
---|---|---|
path (repeated) | int32 |
Identifies which part of the FileDescriptorProto was defined at this |
span (repeated) | int32 |
Always has exactly three or four elements: start line, start column, |
leading_comments (optional) | string |
If this SourceCodeInfo represents a complete declaration, these are any |
trailing_comments (optional) | string |
|
leading_detached_comments (repeated) | string |
|
A message representing a option the parser does not recognize. This only
appears in options protos created by the compiler::Parser class.
DescriptorPool resolves these when building Descriptor objects. Therefore,
options protos in descriptor objects (e.g. returned by Descriptor::options(),
or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
in them.
Field | Type | Description |
---|---|---|
name (repeated) | UninterpretedOption.NamePart |
|
identifier_value (optional) | string |
The value of the uninterpreted option, in whatever type the tokenizer |
positive_int_value (optional) | uint64 |
|
negative_int_value (optional) | int64 |
|
double_value (optional) | double |
|
string_value (optional) | bytes |
|
aggregate_value (optional) | string |
|
The name of the uninterpreted option. Each string represents a segment in
a dot-separated name. is_extension is true iff a segment represents an
extension (denoted with parentheses in options specs in .proto files).
E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents
"foo.(bar.baz).moo".
Proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
---|---|---|---|---|---|---|---|---|
double | double | double | float | float64 | double | float | Float | |
float | float | float | float | float32 | 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 | int32 | int | integer | Bignum or Fixnum (as required) |
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 | int64 | long | integer/string | Bignum |
uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
bool | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |
Created by Siva Sivakumar / Roman Dodin / srl-labs