Skip to content

Latest commit

 

History

History
266 lines (187 loc) · 7.92 KB

NodeApi.md

File metadata and controls

266 lines (187 loc) · 7.92 KB

hoprd_sdk.NodeApi

All URIs are relative to /

Method HTTP request Description
entry_nodes GET /api/v3/node/entryNodes List all known entry nodes with multiaddrs and eligibility.
info GET /api/v3/node/info Get information about this HOPR Node.
metrics GET /api/v3/node/metrics Retrieve Prometheus metrics from the running node.
peers GET /api/v3/node/peers Lists information for `connected peers` and `announced peers`.
version GET /api/v3/node/version Get release version of the running node.

entry_nodes

dict(str, EntryNode) entry_nodes()

List all known entry nodes with multiaddrs and eligibility.

List all known entry nodes with multiaddrs and eligibility.

Example

from __future__ import print_function
import time
import hoprd_sdk
from hoprd_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_token
configuration = hoprd_sdk.Configuration()
configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# create an instance of the API class
api_instance = hoprd_sdk.NodeApi(hoprd_sdk.ApiClient(configuration))

try:
    # List all known entry nodes with multiaddrs and eligibility.
    api_response = api_instance.entry_nodes()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling NodeApi->entry_nodes: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

dict(str, EntryNode)

Authorization

api_token, bearer_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

info

NodeInfoResponse info()

Get information about this HOPR Node.

Get information about this HOPR Node.

Example

from __future__ import print_function
import time
import hoprd_sdk
from hoprd_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_token
configuration = hoprd_sdk.Configuration()
configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# create an instance of the API class
api_instance = hoprd_sdk.NodeApi(hoprd_sdk.ApiClient(configuration))

try:
    # Get information about this HOPR Node.
    api_response = api_instance.info()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling NodeApi->info: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

NodeInfoResponse

Authorization

api_token, bearer_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

metrics

str metrics()

Retrieve Prometheus metrics from the running node.

Retrieve Prometheus metrics from the running node.

Example

from __future__ import print_function
import time
import hoprd_sdk
from hoprd_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_token
configuration = hoprd_sdk.Configuration()
configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# create an instance of the API class
api_instance = hoprd_sdk.NodeApi(hoprd_sdk.ApiClient(configuration))

try:
    # Retrieve Prometheus metrics from the running node.
    api_response = api_instance.metrics()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling NodeApi->metrics: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

str

Authorization

api_token, bearer_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

peers

NodePeersResponse peers(quality=quality)

Lists information for connected peers and announced peers.

Lists information for connected peers and announced peers. Connected peers are nodes which are connected to the node while announced peers are nodes which have announced to the network. Optionally pass quality parameter to get only peers with higher or equal quality to the specified value.

Example

from __future__ import print_function
import time
import hoprd_sdk
from hoprd_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_token
configuration = hoprd_sdk.Configuration()
configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# create an instance of the API class
api_instance = hoprd_sdk.NodeApi(hoprd_sdk.ApiClient(configuration))
quality = 1.2 # float |  (optional)

try:
    # Lists information for `connected peers` and `announced peers`.
    api_response = api_instance.peers(quality=quality)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling NodeApi->peers: %s\n" % e)

Parameters

Name Type Description Notes
quality float [optional]

Return type

NodePeersResponse

Authorization

api_token, bearer_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

version

NodeVersionResponse version()

Get release version of the running node.

Get release version of the running node.

Example

from __future__ import print_function
import time
import hoprd_sdk
from hoprd_sdk.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_token
configuration = hoprd_sdk.Configuration()
configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer'

# create an instance of the API class
api_instance = hoprd_sdk.NodeApi(hoprd_sdk.ApiClient(configuration))

try:
    # Get release version of the running node.
    api_response = api_instance.version()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling NodeApi->version: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

NodeVersionResponse

Authorization

api_token, bearer_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]