postgresai 0.16.0-rc.4 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +154 -0
- package/dist/bin/postgres-ai.js +2911 -255
- package/package.json +12 -3
- package/schemas/A002.schema.json +63 -0
- package/schemas/A003.schema.json +73 -0
- package/schemas/A004.schema.json +81 -0
- package/schemas/A007.schema.json +71 -0
- package/schemas/A013.schema.json +61 -0
- package/schemas/D001.schema.json +71 -0
- package/schemas/D004.schema.json +136 -0
- package/schemas/F001.schema.json +73 -0
- package/schemas/F002.schema.json +108 -0
- package/schemas/F003.schema.json +138 -0
- package/schemas/F004.schema.json +125 -0
- package/schemas/F005.schema.json +131 -0
- package/schemas/F009.schema.json +155 -0
- package/schemas/G001.schema.json +135 -0
- package/schemas/G003.schema.json +90 -0
- package/schemas/H001.schema.json +141 -0
- package/schemas/H002.schema.json +129 -0
- package/schemas/H004.schema.json +128 -0
- package/schemas/I001.schema.json +149 -0
- package/schemas/K001.schema.json +161 -0
- package/schemas/K003.schema.json +163 -0
- package/schemas/K004.schema.json +110 -0
- package/schemas/K005.schema.json +110 -0
- package/schemas/K006.schema.json +110 -0
- package/schemas/K007.schema.json +110 -0
- package/schemas/K008.schema.json +110 -0
- package/schemas/M001.schema.json +119 -0
- package/schemas/M002.schema.json +110 -0
- package/schemas/M003.schema.json +128 -0
- package/schemas/N001.schema.json +161 -0
- package/schemas/query.schema.json +62 -0
- package/CHANGELOG.md +0 -11
- package/bin/postgres-ai.ts +0 -5578
- package/bun.lock +0 -258
- package/bunfig.toml +0 -20
- package/lib/aas-onboard.ts +0 -251
- package/lib/auth-server.ts +0 -285
- package/lib/checkup-api.ts +0 -526
- package/lib/checkup-dictionary.ts +0 -103
- package/lib/checkup-summary.ts +0 -338
- package/lib/checkup.ts +0 -2261
- package/lib/config.ts +0 -171
- package/lib/init.ts +0 -1152
- package/lib/instances.ts +0 -245
- package/lib/issues.ts +0 -1060
- package/lib/mcp-server.ts +0 -667
- package/lib/metrics-loader.ts +0 -134
- package/lib/pkce.ts +0 -79
- package/lib/reports.ts +0 -373
- package/lib/storage.ts +0 -367
- package/lib/supabase.ts +0 -826
- package/lib/util.ts +0 -134
- package/packages/postgres-ai/README.md +0 -26
- package/packages/postgres-ai/bin/postgres-ai.js +0 -27
- package/packages/postgres-ai/package.json +0 -27
- package/scripts/embed-checkup-dictionary.ts +0 -115
- package/scripts/embed-metrics.ts +0 -160
- package/scripts/generate-release-notes.ts +0 -668
- package/test/PERMISSION_CHECK_TEST_SUMMARY.md +0 -139
- package/test/aas-onboard.test.ts +0 -301
- package/test/auth.test.ts +0 -287
- package/test/checkup.integration.test.ts +0 -413
- package/test/checkup.test.ts +0 -3626
- package/test/compose-cmd.test.ts +0 -120
- package/test/config-consistency.test.ts +0 -352
- package/test/init.integration.test.ts +0 -438
- package/test/init.test.ts +0 -1816
- package/test/issues.cli.test.ts +0 -1162
- package/test/issues.test.ts +0 -456
- package/test/mcp-server.test.ts +0 -2530
- package/test/monitoring.test.ts +0 -746
- package/test/permission-check-sql.test.ts +0 -116
- package/test/reports.cli.test.ts +0 -793
- package/test/reports.test.ts +0 -977
- package/test/schema-validation.test.ts +0 -231
- package/test/storage.test.ts +0 -935
- package/test/supabase.test.ts +0 -709
- package/test/targets-add-config.test.ts +0 -28
- package/test/test-utils.ts +0 -190
- package/test/upgrade.test.ts +0 -1056
- package/test/util.test.ts +0 -44
- package/tsconfig.json +0 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postgresai",
|
|
3
|
-
"version": "0.16.0
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "postgres_ai CLI",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"private": false,
|
|
@@ -18,8 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
20
20
|
".": "./dist/bin/postgres-ai.js",
|
|
21
|
-
"./cli": "./dist/bin/postgres-ai.js"
|
|
21
|
+
"./cli": "./dist/bin/postgres-ai.js",
|
|
22
|
+
"./schemas/*.schema.json": "./schemas/*.schema.json"
|
|
22
23
|
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/",
|
|
26
|
+
"instances.demo.yml",
|
|
27
|
+
"schemas/",
|
|
28
|
+
"sql/"
|
|
29
|
+
],
|
|
23
30
|
"type": "module",
|
|
24
31
|
"engines": {
|
|
25
32
|
"node": ">=18"
|
|
@@ -28,7 +35,9 @@
|
|
|
28
35
|
"embed-metrics": "bun run scripts/embed-metrics.ts",
|
|
29
36
|
"embed-checkup-dictionary": "bun run scripts/embed-checkup-dictionary.ts",
|
|
30
37
|
"embed-all": "bun run embed-metrics && bun run embed-checkup-dictionary",
|
|
31
|
-
"
|
|
38
|
+
"sync-schemas": "node scripts/sync-schemas.mjs",
|
|
39
|
+
"build": "bun run sync-schemas && bun run embed-all && bun build ./bin/postgres-ai.ts --outdir ./dist/bin --target node && node -e \"const fs=require('fs');const f='./dist/bin/postgres-ai.js';fs.writeFileSync(f,fs.readFileSync(f,'utf8').replace('#!/usr/bin/env bun','#!/usr/bin/env node'))\" && cp -r ./sql ./dist/sql && cp ../instances.demo.yml ./instances.demo.yml",
|
|
40
|
+
"prepack": "npm run sync-schemas",
|
|
32
41
|
"prepublishOnly": "npm run build",
|
|
33
42
|
"start": "bun ./bin/postgres-ai.ts --help",
|
|
34
43
|
"start:node": "node ./dist/bin/postgres-ai.js --help",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "A002 report schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["checkId", "checkTitle", "timestamptz", "nodes", "results"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"contract_version": { "type": ["string", "null"] },
|
|
9
|
+
"summary": { "type": "object", "additionalProperties": false, "required": ["status", "message"], "properties": { "status": { "enum": ["ok", "warning", "info"] }, "message": { "type": "string" } } },
|
|
10
|
+
"version": { "type": ["string", "null"] },
|
|
11
|
+
"build_ts": { "type": ["string", "null"] },
|
|
12
|
+
"generation_mode": { "type": ["string", "null"] },
|
|
13
|
+
"checkId": { "const": "A002" },
|
|
14
|
+
"checkTitle": { "const": "Postgres major version" },
|
|
15
|
+
"timestamptz": { "type": "string" },
|
|
16
|
+
"nodes": { "$ref": "#/$defs/nodes" },
|
|
17
|
+
"results": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"minProperties": 1,
|
|
20
|
+
"additionalProperties": { "$ref": "#/$defs/nodeResult" }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"$defs": {
|
|
24
|
+
"nodes": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["primary", "standbys"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"primary": { "type": "string" },
|
|
30
|
+
"standbys": { "type": "array", "items": { "type": "string" } }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"postgresVersion": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["version", "server_version_num", "server_major_ver", "server_minor_ver"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"version": { "type": "string" },
|
|
39
|
+
"server_version_num": { "type": "string" },
|
|
40
|
+
"server_major_ver": { "type": "string" },
|
|
41
|
+
"server_minor_ver": { "type": "string" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"data": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["version"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"version": { "$ref": "#/$defs/postgresVersion" }
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"nodeResult": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"required": ["data"],
|
|
56
|
+
"properties": {
|
|
57
|
+
"data": { "$ref": "#/$defs/data" }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "A003 report schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["checkId", "checkTitle", "timestamptz", "nodes", "results"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"contract_version": { "type": ["string", "null"] },
|
|
9
|
+
"summary": { "type": "object", "additionalProperties": false, "required": ["status", "message"], "properties": { "status": { "enum": ["ok", "warning", "info"] }, "message": { "type": "string" } } },
|
|
10
|
+
"version": { "type": ["string", "null"] },
|
|
11
|
+
"build_ts": { "type": ["string", "null"] },
|
|
12
|
+
"generation_mode": { "type": ["string", "null"] },
|
|
13
|
+
"checkId": { "const": "A003" },
|
|
14
|
+
"checkTitle": { "const": "Postgres settings" },
|
|
15
|
+
"timestamptz": { "type": "string" },
|
|
16
|
+
"nodes": { "$ref": "#/$defs/nodes" },
|
|
17
|
+
"results": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"minProperties": 1,
|
|
20
|
+
"additionalProperties": { "$ref": "#/$defs/nodeResult" }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"$defs": {
|
|
24
|
+
"nodes": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["primary", "standbys"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"primary": { "type": "string" },
|
|
30
|
+
"standbys": { "type": "array", "items": { "type": "string" } }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"postgresVersion": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["version", "server_version_num", "server_major_ver", "server_minor_ver"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"version": { "type": "string" },
|
|
39
|
+
"server_version_num": { "type": "string" },
|
|
40
|
+
"server_major_ver": { "type": "string" },
|
|
41
|
+
"server_minor_ver": { "type": "string" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"setting": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["setting", "unit", "category", "context", "vartype", "pretty_value"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"setting": { "type": "string" },
|
|
50
|
+
"unit": { "type": "string" },
|
|
51
|
+
"category": { "type": "string" },
|
|
52
|
+
"context": { "type": "string" },
|
|
53
|
+
"vartype": { "type": "string" },
|
|
54
|
+
"pretty_value": { "type": "string" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"data": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": { "$ref": "#/$defs/setting" }
|
|
60
|
+
},
|
|
61
|
+
"nodeResult": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"required": ["data"],
|
|
65
|
+
"properties": {
|
|
66
|
+
"data": { "$ref": "#/$defs/data" },
|
|
67
|
+
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "A004 report schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["checkId", "checkTitle", "timestamptz", "nodes", "results"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"contract_version": { "type": ["string", "null"] },
|
|
9
|
+
"summary": { "type": "object", "additionalProperties": false, "required": ["status", "message"], "properties": { "status": { "enum": ["ok", "warning", "info"] }, "message": { "type": "string" } } },
|
|
10
|
+
"version": { "type": ["string", "null"] },
|
|
11
|
+
"build_ts": { "type": ["string", "null"] },
|
|
12
|
+
"generation_mode": { "type": ["string", "null"] },
|
|
13
|
+
"checkId": { "const": "A004" },
|
|
14
|
+
"checkTitle": { "const": "Cluster information" },
|
|
15
|
+
"timestamptz": { "type": "string" },
|
|
16
|
+
"nodes": { "$ref": "#/$defs/nodes" },
|
|
17
|
+
"results": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"minProperties": 1,
|
|
20
|
+
"additionalProperties": { "$ref": "#/$defs/nodeResult" }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"$defs": {
|
|
24
|
+
"nodes": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["primary", "standbys"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"primary": { "type": "string" },
|
|
30
|
+
"standbys": { "type": "array", "items": { "type": "string" } }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"postgresVersion": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["version", "server_version_num", "server_major_ver", "server_minor_ver"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"version": { "type": "string" },
|
|
39
|
+
"server_version_num": { "type": "string" },
|
|
40
|
+
"server_major_ver": { "type": "string" },
|
|
41
|
+
"server_minor_ver": { "type": "string" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"clusterMetric": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["value", "unit", "description"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"value": { "type": "string" },
|
|
50
|
+
"unit": { "type": "string" },
|
|
51
|
+
"description": { "type": "string" }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"data": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"required": ["general_info", "database_sizes"],
|
|
58
|
+
"properties": {
|
|
59
|
+
"general_info": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": { "$ref": "#/$defs/clusterMetric" }
|
|
62
|
+
},
|
|
63
|
+
"database_sizes": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": { "type": "number" }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"nodeResult": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"additionalProperties": false,
|
|
72
|
+
"required": ["data"],
|
|
73
|
+
"properties": {
|
|
74
|
+
"data": { "$ref": "#/$defs/data" },
|
|
75
|
+
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "A007 report schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["checkId", "checkTitle", "timestamptz", "nodes", "results"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"contract_version": { "type": ["string", "null"] },
|
|
9
|
+
"summary": { "type": "object", "additionalProperties": false, "required": ["status", "message"], "properties": { "status": { "enum": ["ok", "warning", "info"] }, "message": { "type": "string" } } },
|
|
10
|
+
"version": { "type": ["string", "null"] },
|
|
11
|
+
"build_ts": { "type": ["string", "null"] },
|
|
12
|
+
"generation_mode": { "type": ["string", "null"] },
|
|
13
|
+
"checkId": { "const": "A007" },
|
|
14
|
+
"checkTitle": { "const": "Altered settings" },
|
|
15
|
+
"timestamptz": { "type": "string" },
|
|
16
|
+
"nodes": { "$ref": "#/$defs/nodes" },
|
|
17
|
+
"results": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"minProperties": 1,
|
|
20
|
+
"additionalProperties": { "$ref": "#/$defs/nodeResult" }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"$defs": {
|
|
24
|
+
"nodes": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["primary", "standbys"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"primary": { "type": "string" },
|
|
30
|
+
"standbys": { "type": "array", "items": { "type": "string" } }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"postgresVersion": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["version", "server_version_num", "server_major_ver", "server_minor_ver"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"version": { "type": "string" },
|
|
39
|
+
"server_version_num": { "type": "string" },
|
|
40
|
+
"server_major_ver": { "type": "string" },
|
|
41
|
+
"server_minor_ver": { "type": "string" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"alteredSetting": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["value", "unit", "category", "pretty_value"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"value": { "type": "string" },
|
|
50
|
+
"unit": { "type": "string" },
|
|
51
|
+
"category": { "type": "string" },
|
|
52
|
+
"pretty_value": { "type": "string" }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"data": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": { "$ref": "#/$defs/alteredSetting" }
|
|
58
|
+
},
|
|
59
|
+
"nodeResult": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"required": ["data"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"data": { "$ref": "#/$defs/data" },
|
|
65
|
+
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "A013 report schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["checkId", "checkTitle", "timestamptz", "nodes", "results"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"contract_version": { "type": ["string", "null"] },
|
|
9
|
+
"summary": { "type": "object", "additionalProperties": false, "required": ["status", "message"], "properties": { "status": { "enum": ["ok", "warning", "info"] }, "message": { "type": "string" } } },
|
|
10
|
+
"version": { "type": ["string", "null"] },
|
|
11
|
+
"build_ts": { "type": ["string", "null"] },
|
|
12
|
+
"generation_mode": { "type": ["string", "null"] },
|
|
13
|
+
"checkId": { "const": "A013" },
|
|
14
|
+
"checkTitle": { "const": "Postgres minor version" },
|
|
15
|
+
"timestamptz": { "type": "string" },
|
|
16
|
+
"nodes": { "$ref": "#/$defs/nodes" },
|
|
17
|
+
"results": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"minProperties": 1,
|
|
20
|
+
"additionalProperties": { "$ref": "#/$defs/nodeResult" }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"$defs": {
|
|
24
|
+
"nodes": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["primary", "standbys"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"primary": { "type": "string" },
|
|
30
|
+
"standbys": { "type": "array", "items": { "type": "string" } }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"postgresVersion": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["version", "server_version_num", "server_major_ver", "server_minor_ver"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"version": { "type": "string" },
|
|
39
|
+
"server_version_num": { "type": "string" },
|
|
40
|
+
"server_major_ver": { "type": "string" },
|
|
41
|
+
"server_minor_ver": { "type": "string" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"data": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["version"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"version": { "$ref": "#/$defs/postgresVersion" }
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"nodeResult": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"required": ["data"],
|
|
56
|
+
"properties": {
|
|
57
|
+
"data": { "$ref": "#/$defs/data" }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "D001 report schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["checkId", "checkTitle", "timestamptz", "nodes", "results"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"contract_version": { "type": ["string", "null"] },
|
|
9
|
+
"summary": { "type": "object", "additionalProperties": false, "required": ["status", "message"], "properties": { "status": { "enum": ["ok", "warning", "info"] }, "message": { "type": "string" } } },
|
|
10
|
+
"version": { "type": ["string", "null"] },
|
|
11
|
+
"build_ts": { "type": ["string", "null"] },
|
|
12
|
+
"generation_mode": { "type": ["string", "null"] },
|
|
13
|
+
"checkId": { "const": "D001" },
|
|
14
|
+
"checkTitle": { "const": "Logging settings" },
|
|
15
|
+
"timestamptz": { "type": "string" },
|
|
16
|
+
"nodes": { "$ref": "#/$defs/nodes" },
|
|
17
|
+
"results": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"minProperties": 1,
|
|
20
|
+
"additionalProperties": { "$ref": "#/$defs/nodeResult" }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"$defs": {
|
|
24
|
+
"nodes": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["primary", "standbys"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"primary": { "type": "string" },
|
|
30
|
+
"standbys": { "type": "array", "items": { "type": "string" } }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"postgresVersion": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["version", "server_version_num", "server_major_ver", "server_minor_ver"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"version": { "type": "string" },
|
|
39
|
+
"server_version_num": { "type": "string" },
|
|
40
|
+
"server_major_ver": { "type": "string" },
|
|
41
|
+
"server_minor_ver": { "type": "string" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"setting": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["setting", "unit", "category", "context", "vartype", "pretty_value"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"setting": { "type": "string" },
|
|
50
|
+
"unit": { "type": "string" },
|
|
51
|
+
"category": { "type": "string" },
|
|
52
|
+
"context": { "type": "string" },
|
|
53
|
+
"vartype": { "type": "string" },
|
|
54
|
+
"pretty_value": { "type": "string" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"data": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": { "$ref": "#/$defs/setting" }
|
|
60
|
+
},
|
|
61
|
+
"nodeResult": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"required": ["data"],
|
|
65
|
+
"properties": {
|
|
66
|
+
"data": { "$ref": "#/$defs/data" },
|
|
67
|
+
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "D004 report schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["checkId", "checkTitle", "timestamptz", "nodes", "results"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"contract_version": { "type": ["string", "null"] },
|
|
9
|
+
"summary": { "type": "object", "additionalProperties": false, "required": ["status", "message"], "properties": { "status": { "enum": ["ok", "warning", "info"] }, "message": { "type": "string" } } },
|
|
10
|
+
"version": { "type": ["string", "null"] },
|
|
11
|
+
"build_ts": { "type": ["string", "null"] },
|
|
12
|
+
"generation_mode": { "type": ["string", "null"] },
|
|
13
|
+
"checkId": { "const": "D004" },
|
|
14
|
+
"checkTitle": { "const": "pg_stat_statements and pg_stat_kcache settings" },
|
|
15
|
+
"timestamptz": { "type": "string" },
|
|
16
|
+
"nodes": { "$ref": "#/$defs/nodes" },
|
|
17
|
+
"results": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"minProperties": 1,
|
|
20
|
+
"additionalProperties": { "$ref": "#/$defs/nodeResult" }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"$defs": {
|
|
24
|
+
"nodes": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": ["primary", "standbys"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"primary": { "type": "string" },
|
|
30
|
+
"standbys": { "type": "array", "items": { "type": "string" } }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"postgresVersion": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["version", "server_version_num", "server_major_ver", "server_minor_ver"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"version": { "type": "string" },
|
|
39
|
+
"server_version_num": { "type": "string" },
|
|
40
|
+
"server_major_ver": { "type": "string" },
|
|
41
|
+
"server_minor_ver": { "type": "string" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"setting": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["setting", "unit", "category", "context", "vartype", "pretty_value"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"setting": { "type": "string" },
|
|
50
|
+
"unit": { "type": "string" },
|
|
51
|
+
"category": { "type": "string" },
|
|
52
|
+
"context": { "type": "string" },
|
|
53
|
+
"vartype": { "type": "string" },
|
|
54
|
+
"pretty_value": { "type": "string" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"pgssSampleQuery": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"required": ["queryid", "user", "database", "calls"],
|
|
61
|
+
"properties": {
|
|
62
|
+
"queryid": { "type": "string" },
|
|
63
|
+
"user": { "type": "string" },
|
|
64
|
+
"database": { "type": "string" },
|
|
65
|
+
"calls": { "type": "number" }
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"pgssStatus": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"required": ["extension_available", "metrics_count", "total_calls", "sample_queries"],
|
|
72
|
+
"properties": {
|
|
73
|
+
"extension_available": { "type": "boolean" },
|
|
74
|
+
"metrics_count": { "type": "number" },
|
|
75
|
+
"total_calls": { "type": "number" },
|
|
76
|
+
"sample_queries": { "type": "array", "items": { "$ref": "#/$defs/pgssSampleQuery" } },
|
|
77
|
+
"error": { "type": "string" }
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"kcacheSampleQuery": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"additionalProperties": false,
|
|
83
|
+
"required": ["queryid", "user", "exec_total_time"],
|
|
84
|
+
"properties": {
|
|
85
|
+
"queryid": { "type": "string" },
|
|
86
|
+
"user": { "type": "string" },
|
|
87
|
+
"exec_total_time": { "type": "number" }
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"kcacheStatus": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"additionalProperties": false,
|
|
93
|
+
"required": [
|
|
94
|
+
"extension_available",
|
|
95
|
+
"metrics_count",
|
|
96
|
+
"total_exec_time",
|
|
97
|
+
"total_user_time",
|
|
98
|
+
"total_system_time",
|
|
99
|
+
"sample_queries"
|
|
100
|
+
],
|
|
101
|
+
"properties": {
|
|
102
|
+
"extension_available": { "type": "boolean" },
|
|
103
|
+
"metrics_count": { "type": "number" },
|
|
104
|
+
"total_exec_time": { "type": "number" },
|
|
105
|
+
"total_user_time": { "type": "number" },
|
|
106
|
+
"total_system_time": { "type": "number" },
|
|
107
|
+
"sample_queries": { "type": "array", "items": { "$ref": "#/$defs/kcacheSampleQuery" } },
|
|
108
|
+
"error": { "type": "string" }
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"data": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"additionalProperties": false,
|
|
114
|
+
"required": ["settings", "pg_stat_statements_status", "pg_stat_kcache_status"],
|
|
115
|
+
"properties": {
|
|
116
|
+
"settings": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"additionalProperties": { "$ref": "#/$defs/setting" }
|
|
119
|
+
},
|
|
120
|
+
"pg_stat_statements_status": { "$ref": "#/$defs/pgssStatus" },
|
|
121
|
+
"pg_stat_kcache_status": { "$ref": "#/$defs/kcacheStatus" }
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"nodeResult": {
|
|
125
|
+
"type": "object",
|
|
126
|
+
"additionalProperties": false,
|
|
127
|
+
"required": ["data"],
|
|
128
|
+
"properties": {
|
|
129
|
+
"data": { "$ref": "#/$defs/data" },
|
|
130
|
+
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|