Skip to content

Commit 0ec20e5

Browse files
committed
trace: Use shared definition for graph/secret
1 parent eeb774e commit 0ec20e5

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

schema/yaml/shared.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ $schema: 'http://json-schema.org/draft-04/schema#'
22
title: 'Shared'
33
description: 'Shared schema fragments'
44

5+
secret:
6+
id: secret
7+
description: access token to authorize the client
8+
type: string
9+
graph_id:
10+
id: graph_id
11+
description: Graph identifier the message targets
12+
type: string
13+
514
message:
615
id: 'message'
716
description: 'protocol message'

schema/yaml/trace.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ output:
2020
$ref: '../input/clear'
2121

2222
dump:
23+
id: 'output/dump'
2324
allOf:
2425
- $ref: '/shared/message'
2526
- properties:
@@ -31,9 +32,7 @@ output:
3132
required: ['graph', 'type', 'flowtrace']
3233
additionalProperties: false
3334
properties:
34-
graph:
35-
description: Graph identifier for network to trace
36-
type: string
35+
graph: { $ref: '/shared/graph_id' }
3736
type:
3837
description: String describing type of trace.
3938
type: string
@@ -57,12 +56,8 @@ input:
5756
required: ['secret', 'graph']
5857
additionalProperties: false
5958
properties:
60-
secret:
61-
description: access token to authorize the user
62-
type: string
63-
graph:
64-
description: Graph identifier for network to trace
65-
type: string
59+
secret: { $ref: '/shared/secret' }
60+
graph: { $ref: '/shared/graph_id' }
6661
buffersize:
6762
description: '(optional) Size of tracing buffer to keep. In bytes'
6863
type: integer
@@ -81,8 +76,8 @@ input:
8176
required: ['secret', 'graph']
8277
additionalProperties: false
8378
properties:
84-
secret: access token to authorize the user
85-
graph: Graph identifier for network to trace
79+
secret: { $ref: '/shared/secret' }
80+
graph: { $ref: '/shared/graph_id' }
8681

8782
dump:
8883
description: 'Trigger dumping of the current tracing buffer, to return it back to server.'
@@ -98,8 +93,8 @@ input:
9893
required: ['secret', 'graph', 'type']
9994
additionalProperties: false
10095
properties:
101-
secret: access token to authorize the user
102-
graph: Graph identifier for network to trace
96+
secret: { $ref: '/shared/secret' }
97+
graph: { $ref: '/shared/graph_id' }
10398
type:
10499
description: Type/format of trace to output
105100
type: string
@@ -117,6 +112,7 @@ input:
117112
enum: ['clear']
118113
payload:
119114
required: ['secret', 'graph']
115+
additionalProperties: false
120116
properties:
121-
secret: access token to authorize the user
122-
graph: Graph identifier for network to trace
117+
secret: { $ref: '/shared/secret' }
118+
graph: { $ref: '/shared/graph_id' }

0 commit comments

Comments
 (0)