Service Metadata

December 23, 2022 ยท View on GitHub

Service metadata reported through opensergo. API. V1. MetadataService. ReportMetadata method. The input type is ReportMetadataRequest, the output type is ReportMetadataReply.

Service contract information is defined in 'protobuf' format service_contract.proto.

ReportMetadataRequest

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
1app_namestringrequiredname of application
2nodeNoderequiredinfomation of the node
3service_metadataServiceMetadata arrayrequiredservice metadata of application

ReportMetadataReply

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Currently ReportMetadataReply does not have any field.

ServiceMetadata

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
1listening_addressesSocketAddress arrayrequiredlistening address of service
2protocolsstring arrayrequiredsupported communication protocols
3service_contractServiceContractrequiredservice contract

Notation of communication protocol

In order to clearly express the access mode supported by the service, the overall service access mode is represented by <communication-protocol>://<ip>:<port>.

Currently, reserved communication protocols include http, dubbo, tri, grpc, and thrift.

ServiceContract

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
1servicesServiceDescriptor arrayrequiredIncluded service definitions
2typesTypeDescriptor arrayrequiredmessage type definitions used by services

ServiceDescriptor

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
1namestringrequiredservice name, must be unique in the application
2methodsMethodDescriptor arrayrequired
3descriptionstringoptionalservice Description

MethodDescriptor

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
1namestringrequiredmethod name, must be unique in the service
2input_typesstring arrayrequiredThe input type name of the method, the type definition can be found in Servicecontract.types
3output_typesstring arrayrequiredThe type name of the method's output argument can be found in servicecontract.types
5client_streamingbooloptionalIdentifies if client streams multiple client messages
6server_streamingbooloptionalIdentifies if server streams multiple server messages
7descriptionstringoptionaldescription of method
8http_pathsstring arrayoptionalpaths of http
9http_methodsstring arrayoptionalmethos of http

TypeDescriptor

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
1namestringrequiredtype name, must be unique in ServiceContract
2fieldsFieldDescriptor arrayrequireddefinitions of fields

FieldDescriptor

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
1namestringrequiredfield name, must be unique in the type
3numberint32requiredfield number of the field, used for serialization
5typeFieldDescriptor.Typerequiredtype of field
6type_namestringoptionalwhen type is TYPE_MESSAGE, type_name is message name
7descriptionstringoptionaldescription of field

FieldDescriptor.Type

Field number 1-256 are reserved for future expansion of the OpenSergo protocol

This type is enum, and represents the type of the field.

Field numberField nameDescription
0TYPE_UNSPECIFIEDdefault value, indicating that no type is specified
1TYPE_DOUBLEdouble
2TYPE_FLOATfloat
3TYPE_INT64int64
4TYPE_UINT64uint64
5TYPE_INT32int32
6TYPE_FIXED64fixed64
7TYPE_FIXED32fixed32
8TYPE_BOOLbool
9TYPE_STRINGstring
11TYPE_MESSAGEmessage, custom compound type
12TYPE_BYTESbytes
13TYPE_UINT32uint32
14TYPE_ENUMenum
15TYPE_SFIXED32sfixed32
16TYPE_SFIXED64sfixed64
17TYPE_SINT32sint32
18TYPE_SINT64sint64

Node

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
1identifierNodeIdentifierrequiredidentify the node
4localityLocalityoptionalidentify the region where a node deployed
5tagstringoptionalservice tag of a node
6clusterstringoptionalcluster where the node deployed
7envstringoptionalenvironment where the node deployed

NodeIdentifier

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
1host_namestringrequiredhostname of machine/pod
2piduint32requiredprocess id
3start_timestampgoogle.protobuf.Timestamprequiredstart time of the process, the process ID may be reused

SocketAddress

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
1addressstringrequiredIP address of the listener, must be IP addresses that are visible outside the machine. 0.0.0.0 and 127.0.0.1 cannot be accessed externally
2port_valueuint32requiredport number

Locality

Field number 1-32 are reserved for future expansion of the OpenSergo protocol

Field numberField nameTypeOptionalDescription
2regionstringrequiredregion where the node is deployed
3zonestringrequiredzone where the node is deployed