Skip to content

Protocol Documentation

Table of Contents

Top

onos/topo/topo.proto

CreateRequest

Field Type Label Description
object Object

CreateResponse

Field Type Label Description
object Object

DeleteRequest

Field Type Label Description
id string
revision uint64

DeleteResponse

Entity

Entity represents any "thing" that is represented in the topology

Field Type Label Description
kind_id string user-defined entity kind
src_relation_ids string repeated these lists are maintained by the system and are provided as read-only values for clients
tgt_relation_ids string repeated

EqualFilter

Field Type Label Description
value string

Event

Event is a topo operation event

Field Type Label Description
type EventType
object Object

Filter

Field Type Label Description
equal EqualFilter
not NotFilter
in InFilter
key string optional key

Filters

Field Type Label Description
kind_filter Filter
label_filters Filter repeated
relation_filter RelationFilter
object_types Object.Type repeated
with_aspects string repeated

GetRequest

Field Type Label Description
id string

GetResponse

Field Type Label Description
object Object

InFilter

Field Type Label Description
values string repeated

Kind

Kind represents an archetype of an object, i.e. entity or relation

Field Type Label Description
name string Friendly name of the kind

ListRequest

DEPRECATED

Field Type Label Description
filters Filters
sort_order SortOrder

ListResponse

DEPRECATED

Field Type Label Description
objects Object repeated

NotFilter

Field Type Label Description
inner Filter

Object

Object is an one of the following: a kind (archetype of entity or relation), an entity, a relation

Field Type Label Description
uuid string
id string
revision uint64
type Object.Type
entity Entity
relation Relation
kind Kind
aspects Object.AspectsEntry repeated Map of aspects as typed values; for kind, these represent expected aspects and their default values
labels Object.LabelsEntry repeated Arbitrary labels for classification/search

Object.AspectsEntry

Field Type Label Description
key string
value google.protobuf.Any

Object.LabelsEntry

Field Type Label Description
key string
value string

QueryRequest

Field Type Label Description
filters Filters

QueryResponse

Field Type Label Description
object Object

Relation

Relation represents any "relation" between two entitites in the topology.

Field Type Label Description
kind_id string user defined relation kind
src_entity_id string
tgt_entity_id string

RelationFilter

Filter for targets of given relation kinds and given source ids; optionally, filters by specified target kind

Field Type Label Description
src_id string
relation_kind string
target_kind string
scope RelationFilterScope
target_id string

UpdateRequest

Field Type Label Description
object Object

UpdateResponse

Field Type Label Description
object Object

WatchRequest

Field Type Label Description
filters Filters
noreplay bool

WatchResponse

Field Type Label Description
event Event

EventType

EventType is a topo operation event type

Name Number Description
NONE 0
ADDED 1
UPDATED 2
REMOVED 3

Object.Type

Name Number Description
UNSPECIFIED 0
ENTITY 1
RELATION 2
KIND 3

RelationFilterScope

Name Number Description
TARGETS_ONLY 0 Indicates only the target entities are desired when searching by src_id, or source entities when searching by target_id
ALL 1 Indicated source, target entities and all relations are desired
SOURCE_AND_TARGETS 2 Indicates only source and target entities are desired, regardless of search criteria
RELATIONS_ONLY 3 Indicates only relations are desired; no entities
RELATIONS_AND_TARGETS 4 Indicates only relations and target entities desired when searching by src_id, or relations and source entities when searching by target_id

SortOrder

Name Number Description
UNORDERED 0
ASCENDING 1
DESCENDING 2

Topo

EntityService provides an API for managing entities.

Method Name Request Type Response Type Description
Create CreateRequest CreateResponse Create a new topology object
Get GetRequest GetResponse Get an object from topology
Update UpdateRequest UpdateResponse Update an existing topology object
Delete DeleteRequest DeleteResponse Delete an object from topology
Query QueryRequest QueryResponse stream Query gets a stream of requested objects
List ListRequest ListResponse DEPRECATED: List gets a list of requested objects
Watch WatchRequest WatchResponse stream Watch returns a stream of topo change notifications

Scalar Value Types

.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)