Refactor cluster.About() data

This commit is contained in:
Ingo Oppermann
2023-07-14 11:22:08 +02:00
parent fd7354286e
commit cefd35f7da
11 changed files with 431 additions and 250 deletions

View File

@@ -4437,12 +4437,6 @@ const docTemplate = `{
"address": {
"type": "string"
},
"cluster_api_address": {
"type": "string"
},
"core_api_address": {
"type": "string"
},
"degraded": {
"type": "boolean"
},
@@ -4452,6 +4446,12 @@ const docTemplate = `{
"id": {
"type": "string"
},
"leader": {
"type": "boolean"
},
"name": {
"type": "string"
},
"nodes": {
"type": "array",
"items": {
@@ -4500,31 +4500,65 @@ const docTemplate = `{
"address": {
"type": "string"
},
"core": {
"$ref": "#/definitions/api.ClusterNodeCore"
},
"created_at": {
"description": "RFC 3339",
"type": "string"
},
"error": {
"type": "string"
},
"id": {
"type": "string"
},
"last_contact": {
"description": "unix timestamp",
"type": "integer"
"last_contact_ms": {
"type": "number"
},
"latency_ms": {
"description": "milliseconds",
"type": "number"
},
"leader": {
"type": "boolean"
},
"name": {
"type": "string"
},
"resources": {
"$ref": "#/definitions/api.ClusterNodeResources"
},
"state": {
"status": {
"type": "string"
},
"uptime_seconds": {
"type": "integer"
},
"version": {
"type": "string"
},
"voter": {
"type": "boolean"
}
}
},
"api.ClusterNodeCore": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"error": {
"type": "string"
},
"last_contact_ms": {
"type": "number"
},
"latency_ms": {
"type": "number"
},
"status": {
"type": "string"
}
}
},
@@ -4580,43 +4614,20 @@ const docTemplate = `{
}
},
"api.ClusterRaft": {
"type": "object",
"properties": {
"server": {
"type": "array",
"items": {
"$ref": "#/definitions/api.ClusterRaftServer"
}
},
"stats": {
"$ref": "#/definitions/api.ClusterRaftStats"
}
}
},
"api.ClusterRaftServer": {
"type": "object",
"properties": {
"address": {
"description": "raft address",
"type": "string"
},
"id": {
"type": "string"
},
"leader": {
"type": "boolean"
},
"voter": {
"type": "boolean"
}
}
},
"api.ClusterRaftStats": {
"type": "object",
"properties": {
"last_contact_ms": {
"type": "number"
},
"log_index": {
"type": "integer"
},
"log_term": {
"type": "integer"
},
"num_peers": {
"type": "integer"
},

View File

@@ -4429,12 +4429,6 @@
"address": {
"type": "string"
},
"cluster_api_address": {
"type": "string"
},
"core_api_address": {
"type": "string"
},
"degraded": {
"type": "boolean"
},
@@ -4444,6 +4438,12 @@
"id": {
"type": "string"
},
"leader": {
"type": "boolean"
},
"name": {
"type": "string"
},
"nodes": {
"type": "array",
"items": {
@@ -4492,31 +4492,65 @@
"address": {
"type": "string"
},
"core": {
"$ref": "#/definitions/api.ClusterNodeCore"
},
"created_at": {
"description": "RFC 3339",
"type": "string"
},
"error": {
"type": "string"
},
"id": {
"type": "string"
},
"last_contact": {
"description": "unix timestamp",
"type": "integer"
"last_contact_ms": {
"type": "number"
},
"latency_ms": {
"description": "milliseconds",
"type": "number"
},
"leader": {
"type": "boolean"
},
"name": {
"type": "string"
},
"resources": {
"$ref": "#/definitions/api.ClusterNodeResources"
},
"state": {
"status": {
"type": "string"
},
"uptime_seconds": {
"type": "integer"
},
"version": {
"type": "string"
},
"voter": {
"type": "boolean"
}
}
},
"api.ClusterNodeCore": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"error": {
"type": "string"
},
"last_contact_ms": {
"type": "number"
},
"latency_ms": {
"type": "number"
},
"status": {
"type": "string"
}
}
},
@@ -4572,43 +4606,20 @@
}
},
"api.ClusterRaft": {
"type": "object",
"properties": {
"server": {
"type": "array",
"items": {
"$ref": "#/definitions/api.ClusterRaftServer"
}
},
"stats": {
"$ref": "#/definitions/api.ClusterRaftStats"
}
}
},
"api.ClusterRaftServer": {
"type": "object",
"properties": {
"address": {
"description": "raft address",
"type": "string"
},
"id": {
"type": "string"
},
"leader": {
"type": "boolean"
},
"voter": {
"type": "boolean"
}
}
},
"api.ClusterRaftStats": {
"type": "object",
"properties": {
"last_contact_ms": {
"type": "number"
},
"log_index": {
"type": "integer"
},
"log_term": {
"type": "integer"
},
"num_peers": {
"type": "integer"
},

View File

@@ -69,16 +69,16 @@ definitions:
properties:
address:
type: string
cluster_api_address:
type: string
core_api_address:
type: string
degraded:
type: boolean
degraded_error:
type: string
id:
type: string
leader:
type: boolean
name:
type: string
nodes:
items:
$ref: '#/definitions/api.ClusterNode'
@@ -110,24 +110,46 @@ definitions:
properties:
address:
type: string
core:
$ref: '#/definitions/api.ClusterNodeCore'
created_at:
description: RFC 3339
type: string
error:
type: string
id:
type: string
last_contact:
description: unix timestamp
type: integer
latency_ms:
description: milliseconds
last_contact_ms:
type: number
latency_ms:
type: number
leader:
type: boolean
name:
type: string
resources:
$ref: '#/definitions/api.ClusterNodeResources'
state:
status:
type: string
uptime_seconds:
type: integer
version:
type: string
voter:
type: boolean
type: object
api.ClusterNodeCore:
properties:
address:
type: string
error:
type: string
last_contact_ms:
type: number
latency_ms:
type: number
status:
type: string
type: object
api.ClusterNodeFiles:
properties:
@@ -165,30 +187,15 @@ definitions:
type: string
type: object
api.ClusterRaft:
properties:
server:
items:
$ref: '#/definitions/api.ClusterRaftServer'
type: array
stats:
$ref: '#/definitions/api.ClusterRaftStats'
type: object
api.ClusterRaftServer:
properties:
address:
description: raft address
type: string
id:
type: string
leader:
type: boolean
voter:
type: boolean
type: object
api.ClusterRaftStats:
properties:
last_contact_ms:
type: number
log_index:
type: integer
log_term:
type: integer
num_peers:
type: integer
state: