Skip to main content

API Reference

Services

  • HubClientService: The hub client of the node hosting the grpc api. So if you're connecting to the grpc api of a nanoping client, this service will be used to on behalf of the nanoping client which then will be the node in question when calling the methods.
  • HubServerService: If the grpc hosting node is connected to a hub server, or if the node is hosting the hub server, this service can be used to get the information about the nodes connected to the hub server.
  • LoggingService: The logging service is used to get the log message produced by the services running on a node. The logging service is running on every node connected to the hub. So a node id is required for every method call to specify the node that the request is intended for.
  • NetworkInstances: The network instance service is to fetch network instances and information about their associated pipelines. Network instances cannot be created, edited, or deleted by the API. Network instances is managed by the associated Network and the instances is created automatically by the network whenever a node is included in the Network configuration.
  • PipelinesService: The pipelines service is used to manage the pipelines of a node hosting the service, such as the nanoping client. The service can be used to create, update, delete, start, and stop pipelines. The service also provides the ability to to fetch logs and telemetry data of pipeline runs. Since this service runs on multiple nodes, every method requires the node_id of the node that the request is intended for.
  • ResourcesService: The resources service is used to get the metrics of the system a node is running on. The metrics include things such as CPU usage, memory, storage, etc. The service is running on every node connected to the hub. So a node id is required for every method call to specify the node that the request is intended for.

HubClientService

Located in hub_client.proto

The hub client of the node hosting the grpc api. So if you're connecting to the grpc api of a nanoping client, this service will be used to on behalf of the nanoping client which then will be the node in question when calling the methods.

Method NameRequest TypeResponse TypeDescription
getLocalNodeIdGetLocalNodeIdRequestGetLocalNodeIdResponseGet the node id of the local node hosting the grpc api weather it is authenticated with a hub server or not.
getNodeGetNodeRequestGetNodeResponseGet information about the node hosting the grpc api.
setNodeSetNodeRequestSetNodeResponseSet information about the node hosting the grpc api.
authenticateByRequestAuthenticateByRequestRequestAuthenticateByRequestResponseAuthenticate by request of the local node. Will give an 'Unauthenticated' status code if the client was rejected by the hub server or a 'DeadlineExceeded' status code if the hub server did not respond in time. If authentication is successful, the client will persist the access token and the nanoping node will automatically authenticate with the hub server on startup.
disconnectDisconnectRequestDisconnectResponseDisconnect the node from the hub server.
streamConnectionStateStreamConnectionStateRequestStreamConnectionStateResponse streamConnection state of the node to the hub server. Will send the current state when opening the stream.

AuthenticateByRequestRequest

FieldTypeLabelDescription
hub_server_addressstringHttp/https address of the hub server. Example: http://localhost:8769

AuthenticateByRequestResponse

DisconnectRequest

DisconnectResponse

GetLocalNodeIdRequest

GetLocalNodeIdResponse

FieldTypeLabelDescription
node_idstringThe hub node id of the node hosting the grpc api.
is_authenticatedboolTrue if the node is authenticated to a hub server.

GetNodeRequest

FieldTypeLabelDescription
node_idstringThe id of the node to get information about.

GetNodeResponse

FieldTypeLabelDescription
nodeNodeThe node information about the node hosting the grpc api.

SetNodeRequest

FieldTypeLabelDescription
node_idstringThe id of the node to set information about.
namestringThe name of the node
metadataNodeMetadataThe metadata of the node

SetNodeResponse

FieldTypeLabelDescription
nodeNodeThe local node information

StreamConnectionStateRequest

StreamConnectionStateResponse

FieldTypeLabelDescription
stateConnectionState

ConnectionState

NameNumberDescription
UNAUTHENTICATED0The node is not authenticated to the hub server.
DISCONNECTED1The node is connected to the hub server.
CONNECTED2The node is disconnected from the hub server.

Node

FieldTypeLabelDescription
idstringUnique id of the node.
namestringHuman readable name of the node.
servicesNodeServicerepeatedServices accessible on the node.
metadataNodeMetadataMetadata of the node.

NodeMetadata

FieldTypeLabelDescription
itemsNodeMetadata.ItemsEntryrepeatedMap of metadata items.

NodeMetadata.ItemsEntry

FieldTypeLabelDescription
keystring
valueNodeMetadataItem

NodeMetadataItem

FieldTypeLabelDescription
bytes_valuebytes
string_valuestring
int_valueint64
uint_valueuint64
double_valuedouble
float_valuefloat
bool_valuebool

NodeService

Types of services.

NameNumberDescription
HUB_SERVER0
RESOURCES1
LOGGING2
PIPELINES3

HubServerService

Located in hub_server.proto

If the grpc hosting node is connected to a hub server, or if the node is hosting the hub server, this service can be used to get the information about the nodes connected to the hub server.

Method NameRequest TypeResponse TypeDescription
getNodesGetNodesRequestGetNodesResponseGet the nodes connected to the hub server. See the 'GetNodesRequest' for further information of how to query with metadata and service filters
authenticationByRequestsAuthenticationByRequestAnswer streamAuthenticationByRequestRequest streamStream authentication by requests sent to the hub server, and answer requests by accepting or rejecting them.

AuthenticationByRequestAnswer

FieldTypeLabelDescription
request_iduint64The request id of the authentication by request.
acceptboolAccept or reject the authentication by request.

AuthenticationByRequestRequest

FieldTypeLabelDescription
nodeNodeThe node information about the node that sent the authentication by request.
request_iduint64The request id of the authentication by request.

GetNodesRequest

Request to get the nodes connected to the hub server. All filters given works in combination as an 'AND' operation.

FieldTypeLabelDescription
metadata_filtersGetNodesRequest.MetadataFiltersEntryrepeatedWill filter the nodes by the given metadata filters. If more than one filter is added the combination will act as an 'AND' operation. So if two or more filters is used, all the filters must match for a node to be included in the response. These filters are optional and can be left empty.
service_filtersNodeServicerepeatedWill filter the nodes by the given service filters. If more than one filter is added the combination will act as an 'AND' operation. So if two or more filters is used, all the filters must match for a node to be included in the response. These filters are optional and can be left empty.

GetNodesRequest.MetadataFiltersEntry

FieldTypeLabelDescription
keystring
valueNodeMetadataItem

GetNodesRequestMetadataFilter

FieldTypeLabelDescription
keystring
valueNodeMetadataItem

GetNodesResponse

FieldTypeLabelDescription
nodesNoderepeatedThe nodes connected to the hub server.

LoggingService

Located in logging.proto

The logging service is used to get the log message produced by the services running on a node. The logging service is running on every node connected to the hub. So a node id is required for every method call to specify the node that the request is intended for.

Method NameRequest TypeResponse TypeDescription
openLogStreamOpenLogStreamRequestMessages stream

Message

A single logging message

FieldTypeLabelDescription
timestampgoogle.protobuf.Timestamp
levelLevel
messagestring
datastring

Messages

A collection of logging messages

FieldTypeLabelDescription
messagesMessagerepeated

OpenLogStreamRequest

A request to open a stream to receive logging messages

FieldTypeLabelDescription
node_idstring
optionsOptions

Options

Logging stream options

FieldTypeLabelDescription
linesint64

Level

Logging levels for the pipeline logging messages

NameNumberDescription
STATE0
DEBUG1
INFO2
WARNING3
ERROR4
FATAL5

BoolMetric

Metadata for boolean metrics

FieldTypeLabelDescription
valuebool
descriptionstring
unitstring

Collection

Collection of metrics

FieldTypeLabelDescription
pathstring
metricsCollection.MetricsEntryrepeated

Collection.MetricsEntry

FieldTypeLabelDescription
keystring
valueMetric

Constant

A constant used when the value is fixed

FieldTypeLabelDescription
uint64uint64
int64int64
float64double
booleanbool
stringstring
descriptionstring
unitstring

Enum8Metric

Metadata for enumerated metrics

FieldTypeLabelDescription
valueuint32
descriptionstring
valuesEnum8Metric.ValuesEntryrepeatedMapping from index to enum info
unitstring

Enum8Metric.EnumValue

FieldTypeLabelDescription
namestring
descriptionstring

Enum8Metric.ValuesEntry

FieldTypeLabelDescription
keyuint32
valueEnum8Metric.EnumValue

Float32Metric

Metadata for 32-bit floating-point metrics

FieldTypeLabelDescription
valuefloat
descriptionstring
kindKind
unitstring
minfloat
maxfloat

Float64Metric

Metadata for 64-bit floating-point metrics

FieldTypeLabelDescription
valuedouble
descriptionstring
kindKind
unitstring
mindouble
maxdouble

Int32Metric

Metadata for signed 32-bit metrics

FieldTypeLabelDescription
valueint32
descriptionstring
kindKind
unitstring
minint32
maxint32

Int64Metric

Metadata for signed 64-bit metrics

FieldTypeLabelDescription
valueint64
descriptionstring
kindKind
unitstring
minint64
maxint64

Metric

Metadata for a single metric

FieldTypeLabelDescription
constantConstant
uint64UInt64Metric
int64Int64Metric
uint32UInt32Metric
int32Int32Metric
float64Float64Metric
float32Float32Metric
booleanBoolMetric
enum8Enum8Metric

UInt32Metric

Metadata for unsigned 32-bit metrics

FieldTypeLabelDescription
valueuint32
descriptionstring
kindKind
unitstring
minuint32
maxuint32

UInt64Metric

Metadata for unsigned 64-bit metrics

FieldTypeLabelDescription
valueuint64
descriptionstring
kindKind
unitstring
minuint64
maxuint64

Kind

NameNumberDescription
GAUGE0Indicates that the metric value can both increase and decrease
COUNTER1Indicates that the metric value can only increase

NetworkInstances

Located in networks.proto

The network instance service is to fetch network instances and information about their associated pipelines. Network instances cannot be created, edited, or deleted by the API. Network instances is managed by the associated Network and the instances is created automatically by the network whenever a node is included in the Network configuration.

Method NameRequest TypeResponse TypeDescription
getNetworkInstancesGetNetworkInstancesRequestGetNetworkInstancesResponseGet all network instances
streamNetworkInstancesStreamNetworkInstancesRequestStreamNetworkInstanceEvent streamStream changes of network instances. Everytime a network instance is created, updated, or deleted, a event message is sent to the stream.

GetNetworkInstancesRequest

FieldTypeLabelDescription
node_idstringThe ID of the node to fetch network instances from.

GetNetworkInstancesResponse

FieldTypeLabelDescription
network_instancesNetworkInstancerepeatedThe network instances of the node.

NetworkInstance

FieldTypeLabelDescription
idstringThe ID of the Network Instance.
network_idstringThe ID of the associated Network.
network_namestringThe name of the associated Network.
pipeline_idsstringrepeatedThe IDs of the pipelines that are associated and managed by the Network Instance.

StreamNetworkInstanceCreateEvent

FieldTypeLabelDescription
network_instanceNetworkInstance

StreamNetworkInstanceDeleteEvent

FieldTypeLabelDescription
network_instanceNetworkInstance

StreamNetworkInstanceEvent

FieldTypeLabelDescription
createStreamNetworkInstanceCreateEvent
updateStreamNetworkInstanceUpdateEvent
deleteStreamNetworkInstanceDeleteEvent

StreamNetworkInstanceUpdateEvent

FieldTypeLabelDescription
network_instanceNetworkInstance

StreamNetworkInstancesRequest

FieldTypeLabelDescription
node_idstringThe ID of the node to stream for network instances from.

PipelinesService

Located in pipelines.proto

The pipelines service is used to manage the pipelines of a node hosting the service, such as the nanoping client. The service can be used to create, update, delete, start, and stop pipelines. The service also provides the ability to to fetch logs and telemetry data of pipeline runs. Since this service runs on multiple nodes, every method requires the node_id of the node that the request is intended for.

Method NameRequest TypeResponse TypeDescription
getPipelinesGetPipelinesRequestGetPipelinesResponseGet all pipelines
getPipelineByIdGetPipelineByIdRequestGetPipelineByIdResponseGet a pipeline by its ID
getPipelineByNameGetPipelineByNameRequestGetPipelineByNameResponseGet a pipeline by its name
getPipelineByRunIdGetPipelineByRunIdRequestGetPipelineByRunIdResponseGet a pipeline by its run ID
createPipelineCreatePipelineRequestCreatePipelineResponseCreate a new pipeline
updatePipelineUpdatePipelineRequestUpdatePipelineResponseUpdate an existing pipeline
deletePipelineDeletePipelineRequestDeletePipelineResponseDelete a pipeline
startPipelineStartPipelineRequestStartPipelineResponseStart a pipeline. A new run is created and the run ID is returned.
stopPipelineStopPipelineRequestStopPipelineResponseStop a pipeline by either its ID, name, or the pipeline run ID.
streamPipelinesStreamPipelinesRequestStreamPipelinesEvent streamStream changes of pipelines. Everytime a pipeline is created, updated, or deleted, a event message is sent to the stream. When a pipeline is started or stopped, an update event messages is sent to the stream.
openLogStreamOpenLogStreamRequestLogStreamMessages streamOpen a stream to receive logging messages of a pipeline run.
openTelemetryStreamOpenTelemetryStreamRequestTelemetrySample streamOpen a stream to receive telemetry samples of a pipeline run.

CreatePipelineRequest

FieldTypeLabelDescription
node_idstring
namestringThe name of the pipeline
json_configstringThe JSON configuration of the pipeline
restart_policyRestartPolicyThe restart policy of the pipeline. Leave not-set for default value RestartPolicyNever.
default_logging_levelnanopinggrpc.logging.Level
instructions_timeoutint32

CreatePipelineResponse

FieldTypeLabelDescription
pipelinePipeline

DeletePipelineRequest

FieldTypeLabelDescription
node_idstring
idstring

DeletePipelineResponse

GetPipelineByIdRequest

FieldTypeLabelDescription
node_idstring
idstring

GetPipelineByIdResponse

FieldTypeLabelDescription
pipelinePipeline

GetPipelineByNameRequest

FieldTypeLabelDescription
node_idstring
namestring

GetPipelineByNameResponse

FieldTypeLabelDescription
pipelinePipeline

GetPipelineByRunIdRequest

FieldTypeLabelDescription
node_idstring
idstring

GetPipelineByRunIdResponse

FieldTypeLabelDescription
pipelinePipeline

GetPipelinesRequest

FieldTypeLabelDescription
node_idstring

GetPipelinesResponse

FieldTypeLabelDescription
pipelinesPipelinerepeated

Kpi

FieldTypeLabelDescription
idstring
fieldstring
errorstring
none_valuebool
string_valuestring
uint64_valueuint64
int64_valueint64
uint32_valueuint32
int32_valueint32
float64_valuedouble
float32_valuefloat
bool_valuebool
enum8_valueuint32

LogStreamMessages

FieldTypeLabelDescription
messagesnanopinggrpc.logging.Messagerepeated

OpenLogStreamRequest

FieldTypeLabelDescription
node_idstring
run_idstring
optionsnanopinggrpc.logging.Options

OpenTelemetryStreamRequest

FieldTypeLabelDescription
node_idstring
run_idstring

Pipeline

A pipeline is an executable composition of network components.

FieldTypeLabelDescription
idstringID of a pipeline
namestringThe name of the pipeline
startedboolWhether the pipeline is running right now or not
current_runstring
json_configstringThe JSON configuration of the pipeline
config_compatabilityConfigCompatabilityA read-only field of the compatibility of the pipeline configuration.
restart_policyRestartPolicyThe restart policy of the pipeline
default_logging_levelnanopinggrpc.logging.LevelThe default logging level of the pipeline
instructions_timeoutint32The amount of time in seconds before considering a pipeline instruction as timed out

RestartPolicy

Restart policy of a pipeline

FieldTypeLabelDescription
neverRestartPolicyNever
alwaysRestartPolicyAlways
on_failureRestartPolicyOnFailure

RestartPolicyAlways

Restart policy of a pipeline that determines a pipeline to restart always when stopped or an error happens.

FieldTypeLabelDescription
max_restartsint32The maximum number of restarts allowed for the pipeline. If 0 the pipeline will keep retrying forever.

RestartPolicyNever

Restart policy of a pipeline that determines a pipeline not to restart when stopped or an error happens.

RestartPolicyOnFailure

Restart policy of a pipeline that determines a pipeline to restart only when an error happens.

FieldTypeLabelDescription
max_restartsint32The maximum number of restarts allowed for the pipeline. If 0 the pipeline will keep retrying forever.

StartPipelineRequest

FieldTypeLabelDescription
node_idstring
idstring
namestring

StartPipelineResponse

FieldTypeLabelDescription
run_idstring

StopPipelineRequest

FieldTypeLabelDescription
node_idstring
idstring
namestring
run_idstring

StopPipelineResponse

StreamPipelinesCreateEvent

FieldTypeLabelDescription
pipelinePipeline

StreamPipelinesDeleteEvent

FieldTypeLabelDescription
pipelinePipeline

StreamPipelinesEvent

FieldTypeLabelDescription
createStreamPipelinesCreateEvent
updateStreamPipelinesUpdateEvent
deleteStreamPipelinesDeleteEvent

StreamPipelinesRequest

FieldTypeLabelDescription
node_idstring

StreamPipelinesUpdateEvent

FieldTypeLabelDescription
pipelinePipeline

TelemetrySample

FieldTypeLabelDescription
metric_collectionsnanopinggrpc.metrics.Collectionrepeated
kpisKpirepeated
timestampgoogle.protobuf.Timestamp

UpdatePipelineRequest

FieldTypeLabelDescription
node_idstring
idstringThe ID of the pipeline
namestringThe name of the pipeline
json_configstringThe JSON configuration of the pipeline
restart_policyRestartPolicyThe restart policy of the pipeline.
default_logging_levelnanopinggrpc.logging.LevelThe default logging level of the pipeline.
instructions_timeoutint32The amount of time in seconds before considering a pipeline instruction as timed out.

UpdatePipelineResponse

FieldTypeLabelDescription
pipelinePipeline

ConfigCompatability

Enum to represent the compatibility of the pipeline configuration

NameNumberDescription
COMPATIBLE0
INCOMPATIBLE1If the nanoping client version is older than the pipeline configuration version the configuration is considered incompatible

ResourcesService

Located in resources.proto

The resources service is used to get the metrics of the system a node is running on. The metrics include things such as CPU usage, memory, storage, etc. The service is running on every node connected to the hub. So a node id is required for every method call to specify the node that the request is intended for.

Method NameRequest TypeResponse TypeDescription
openMetricsStreamOpenMetricsStreamRequestMetricsSample stream

MetricsSample

FieldTypeLabelDescription
timestampgoogle.protobuf.Timestamp
collectionsnanopinggrpc.metrics.Collectionrepeated

OpenMetricsStreamRequest

FieldTypeLabelDescription
node_idstring