зеркало из https://github.com/nymtech/nym-directory
319 строки
8.3 KiB
YAML
319 строки
8.3 KiB
YAML
basePath: '{{.BasePath}}'
|
|
definitions:
|
|
models.Error:
|
|
properties:
|
|
error:
|
|
type: string
|
|
type: object
|
|
models.HostInfo:
|
|
properties:
|
|
host:
|
|
type: string
|
|
pubKey:
|
|
type: string
|
|
required:
|
|
- pubKey
|
|
type: object
|
|
models.MixHostInfo:
|
|
properties:
|
|
host:
|
|
type: string
|
|
layer:
|
|
type: integer
|
|
pubKey:
|
|
type: string
|
|
required:
|
|
- layer
|
|
- pubKey
|
|
type: object
|
|
models.MixMetric:
|
|
properties:
|
|
pubKey:
|
|
type: string
|
|
received:
|
|
type: integer
|
|
sent:
|
|
required:
|
|
- sent
|
|
type: object
|
|
required:
|
|
- pubKey
|
|
type: object
|
|
models.MixProviderHostInfo:
|
|
properties:
|
|
host:
|
|
type: string
|
|
pubKey:
|
|
type: string
|
|
registeredClients:
|
|
items:
|
|
$ref: '#/definitions/models.RegisteredClient'
|
|
type: array
|
|
required:
|
|
- pubKey
|
|
type: object
|
|
models.RegisteredClient:
|
|
properties:
|
|
pubKey:
|
|
type: string
|
|
required:
|
|
- pubKey
|
|
type: object
|
|
models.Topology:
|
|
properties:
|
|
cocoNodes:
|
|
type: object
|
|
mixNodes:
|
|
type: object
|
|
mixProviderNodes:
|
|
type: object
|
|
type: object
|
|
host: '{{.Host}}'
|
|
info:
|
|
contact: {}
|
|
description: This is a temporarily centralized directory/PKI/metrics API to allow
|
|
us to get the other Nym node types running. Its functionality will eventually
|
|
be folded into other parts of Nym.
|
|
license:
|
|
name: Apache 2.0
|
|
url: https://github.com/nymtech/directory-server/license
|
|
termsOfService: http://swagger.io/terms/
|
|
title: Nym Directory API
|
|
version: "1.0"
|
|
paths:
|
|
/api/healthcheck:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Returns a 200 if the directory server is available.
|
|
operationId: healthCheck
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200": {}
|
|
summary: Lets the directory server tell the world it's alive
|
|
tags:
|
|
- healthcheck
|
|
/api/metrics/mixes:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: You'd never want to run this in production, but for demo and debug
|
|
purposes it gives us the ability to generate useful visualisations of network
|
|
traffic.
|
|
operationId: listMixMetrics
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/models.MixMetric'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
summary: Lists mixnode activity in the past 1 second
|
|
tags:
|
|
- metrics
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: You'd never want to run this in production, but for demo and debug
|
|
purposes it gives us the ability to generate useful visualisations of network
|
|
traffic.
|
|
operationId: createMixMetric
|
|
parameters:
|
|
- description: object
|
|
in: body
|
|
name: object
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/models.MixMetric'
|
|
type: object
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201": {}
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
summary: Create a metric detailing how many messages a given mixnode sent and
|
|
received
|
|
tags:
|
|
- metrics
|
|
/api/presence/coconodes:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Nym Coconut nodes can ping this method to let the directory server
|
|
know they're up. We can then use this info to create topologies of the overall
|
|
Nym network.
|
|
operationId: addCocoNode
|
|
parameters:
|
|
- description: object
|
|
in: body
|
|
name: object
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/models.HostInfo'
|
|
type: object
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201": {}
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
summary: Lets a coconut node tell the directory server it's alive
|
|
tags:
|
|
- presence
|
|
/api/presence/mixnodes:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Nym mixnodes can ping this method to let the directory server know
|
|
they're up. We can then use this info to create topologies of the overall
|
|
Nym network.
|
|
operationId: addMixNode
|
|
parameters:
|
|
- description: object
|
|
in: body
|
|
name: object
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/models.MixHostInfo'
|
|
type: object
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201": {}
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
summary: Lets mixnode a node tell the directory server it's alive
|
|
tags:
|
|
- presence
|
|
/api/presence/providers:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Nym mix providers can ping this method to let the directory server
|
|
know they're up. We can then use this info to create topologies of the overall
|
|
Nym network.
|
|
operationId: addMixProvider
|
|
parameters:
|
|
- description: object
|
|
in: body
|
|
name: object
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/models.MixProviderHostInfo'
|
|
type: object
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201": {}
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
summary: Lets a mixnode tell the directory server it's alive
|
|
tags:
|
|
- presence
|
|
/api/presence/topology:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Nym nodes periodically ping the directory server to register that
|
|
they're alive. This method provides a list of nodes which have been most recently
|
|
seen.
|
|
operationId: topology
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/models.Topology'
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/models.Error'
|
|
type: object
|
|
summary: Lists which Nym mixnodes, providers, and coconodes are alive
|
|
tags:
|
|
- presence
|
|
swagger: "2.0"
|