Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph receipt message type and message_id #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module.exports = ->
desc = {}
protocols =
runtime: ['input', 'output']
graph: ['input']
graph: ['input', 'output']
component: ['input', 'output']
network: ['input', 'output']

Expand Down
123 changes: 28 additions & 95 deletions schema/yaml/graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,100 +10,33 @@ output:
description: 'Graph error'
$ref: '/shared/message'

addnode:
id: 'output/addnode'
description: 'Add node to a graph.'
$ref: '../input/addnode'

removenode:
id: 'output/removenode'
description: 'Remove a node from a graph.'
$ref: '../input/removenode'

renamenode:
id: 'output/renamenode'
description: 'Change the ID of a node in the graph'
$ref: '../input/renamenode'

changenode:
id: 'output/changenode'
description: 'Change the metadata associated to a node in the graph'
$ref: '../input/changenode'

addedge:
id: 'output/addedge'
description: 'Add an edge to the graph'
$ref: '../input/addedge'

removeedge:
id: 'output/removeedge'
description: 'Remove an edge from the graph'
$ref: '../input/removeedge'

changeedge:
id: 'output/changeedge'
description: 'Change an edge''s metadata'
$ref: '../input/changeedge'

addinitial:
id: 'output/addinitial'
description: 'Add an IIP to the graph'
$ref: '../input/addinitial'

removeinitial:
id: 'output/removeinitial'
description: 'Remove an IIP from the graph'
$ref: '../input/removeinitial'

addinport:
id: 'output/addinport'
description: 'Add an exported inport to the graph.'
$ref: '../input/addinport'

removeinport:
id: 'output/removeinport'
description: 'Remove an exported port from the graph'
$ref: '../input/removeinport'

renameinport:
id: 'output/renameinport'
description: 'Rename an exported port in the graph'
$ref: '../input/renameinport'

addoutport:
id: 'output/addoutport'
description: 'Add an exported outport to the graph.'
$ref: '../input/addoutport'

removeoutport:
id: 'output/removeoutport'
description: 'Remove an exported port from the graph'
$ref: '../input/removeoutport'

renameoutport:
id: 'output/renameoutport'
description: 'Rename an exported port in the graph'
$ref: '../input/renameoutport'

addgroup:
id: 'output/addgroup'
description: 'Add a group to the graph'
$ref: '../input/addgroup'

removegroup:
id: 'output/removegroup'
description: 'Remove a group from the graph'
$ref: '../input/removegroup'

renamegroup:
id: 'output/renamegroup'
description: 'Rename a group in the graph.'
$ref: '../input/renamegroup'

changegroup:
id: 'output/changegroup'
description: 'Change a group''s metadata'
$ref: '../input/changegroup'
receipt:
id: 'output/receipt'
description: >-
Acknowledge that message reached receiver and whether or not receiver
Copy link
Contributor

@jonnor jonnor Jun 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an incompatible change and I don't see the reason for it?*
The graph operations need to reply with something, and might as well reply with something specific. The reply sent should then contain the id of the request it is a reply to, and this can be used to correlate it.

* and we have like 7 implementations of the protocol, so we should to be cautious with breaking things.

responded successfully. Messages that create or change graphs should
be responded to with receipt messages.
allOf:
- $ref: '/shared/message'
- properties:
protocol:
enum: ['graph']
command:
enum: ['receipt']
payload:
required: ['message_id', 'success']
additionalProperties: false
properties:
message_id:
type: string
description: 'Id of input message'
success:
type: boolean
description: 'Whether or not message was successfully processed'
error:
type: string
description: >-
Error description if original message did not succeed

input:
error:
Expand All @@ -118,7 +51,7 @@ input:
protocol:
enum: ['graph']
command:
enum: ['addnode']
enum: ['clear']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bugfix

payload:
required: ['id']
additionalProperties: false
Expand Down
4 changes: 4 additions & 0 deletions schema/yaml/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ message:
payload:
type: object
description: 'content of message'
id:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. Should we require/suggest this to be a Version 4 UUIDs as defined by RFC 4122?
https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I will update the description to specify that it is expected to be uuid4.

type: string
description: >-
unique id of message, expected to be a uuid v4 as defined by rfc 4122

port:
id: 'port'
Expand Down
Loading