-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for resolver endpoint
Closes #1088
- Loading branch information
Showing
6 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/resolve: | ||
post: | ||
summary: Perform path based lookup of nodes in the Flywheel hierarchy | ||
description: | | ||
This will perform a deep lookup of a node (i.e. group/project/session/acquisition) and its children, | ||
including any files. The query path is an array of strings in the following order (by default): | ||
* group id | ||
* project label | ||
* session label | ||
* acquisition label | ||
An ID can be used instead of a label by formatting the string as `<id:project_id>`. The full path | ||
to the node, and the node's children will be included in the response. | ||
operationId: resolve_path | ||
parameters: | ||
- name: body | ||
in: body | ||
required: true | ||
schema: | ||
$ref: schemas/input/resolver.json | ||
responses: | ||
'200': | ||
description: '' | ||
schema: | ||
$ref: schemas/output/resolver.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"definitions": { | ||
"resolver-input": { | ||
"type": "object", | ||
"properties": { | ||
"path": { | ||
"type": "array", | ||
"minLength": 1, | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": ["path"] | ||
}, | ||
"resolver-output": { | ||
"type": "object", | ||
"properties": { | ||
"path": { "$ref": "#/definitions/resolver-node-list" }, | ||
"children": { "$ref": "#/definitions/resolver-node-list" } | ||
}, | ||
"required": ["path"] | ||
}, | ||
"resolver-node": { | ||
"type": "object", | ||
"properties": { | ||
"node_type": { | ||
"type": "string" | ||
} | ||
}, | ||
"discriminator": "node_type", | ||
"required": ["node_type"] | ||
}, | ||
"resolver-node-list": { | ||
"type": "array", | ||
"items": { "$ref": "#/definitions/resolver-node" } | ||
}, | ||
"group-node": { | ||
"allOf": [ | ||
{"$ref":"#/definitions/resolver-node"}, | ||
{"$ref":"group.json#/definitions/group-output"} | ||
], | ||
"x-discriminator-value": "group" | ||
}, | ||
"project-node": { | ||
"allOf": [ | ||
{"$ref":"#/definitions/resolver-node"}, | ||
{"$ref":"project.json#/definitions/project-output"} | ||
], | ||
"x-discriminator-value": "project" | ||
}, | ||
"session-node": { | ||
"allOf": [ | ||
{"$ref":"#/definitions/resolver-node"}, | ||
{"$ref":"session.json#/definitions/session-output"} | ||
], | ||
"x-discriminator-value": "session" | ||
}, | ||
"acquisition-node": { | ||
"allOf": [ | ||
{"$ref":"#/definitions/resolver-node"}, | ||
{"$ref":"acquisition.json#/definitions/acquisition-output"} | ||
], | ||
"x-discriminator-value": "acquisition" | ||
}, | ||
"file-node": { | ||
"allOf": [ | ||
{"$ref":"#/definitions/resolver-node"}, | ||
{"$ref":"file.json#/definitions/file-output"} | ||
], | ||
"x-discriminator-value": "file" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"type": "object", | ||
"allOf": [{"$ref": "../definitions/resolver.json#/definitions/resolver-input"}], | ||
"example": { | ||
"path": ["scitran", "Neuroscience"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"type":"object", | ||
"allOf": [{ "$ref": "../definitions/resolver.json#/definitions/resolver-output" }], | ||
"example": { | ||
"path": [ | ||
{ | ||
"node_type": "group", | ||
"_id": "scitran", | ||
"label": "Scitran", | ||
"permissions": [ | ||
{ | ||
"access": "admin", | ||
"_id": "[email protected]" | ||
} | ||
], | ||
"created": "2016-08-19T11:41:15.360000+00:00", | ||
"modified": "2016-08-19T11:41:15.360000+00:00" | ||
}, | ||
{ | ||
"node_type": "project", | ||
"_id": "57e452791cff88b85f9f9c97", | ||
"label": "Neuroscience", | ||
"group": "scitran", | ||
"created": "2016-09-22T21:51:53.151000+00:00", | ||
"modified": "2016-09-22T21:51:53.151000+00:00", | ||
"public": false, | ||
"permissions": [{ | ||
"access": "admin", | ||
"_id": "[email protected]" | ||
}] | ||
} | ||
], | ||
"children": [ | ||
{ | ||
"node_type": "session", | ||
"_id": "57e01cccb1dc04000fb83f03", | ||
"label": "control_1", | ||
"group": "scitran", | ||
"created": "2016-09-19T17:13:48.164000+00:00", | ||
"subject": { | ||
"code": "ex4784", | ||
"_id": "57e01cccb1dc04000fb83f02" | ||
}, | ||
"modified": "2016-09-19T17:13:48.164000+00:00", | ||
"project": "57e01cccf6b5d5edbcb4e1cf", | ||
"public": false, | ||
"permissions": [{ | ||
"access": "admin", | ||
"_id": "[email protected]" | ||
}] | ||
}, | ||
{ | ||
"node_type": "file", | ||
"origin": { | ||
"method": "importer", | ||
"type": "device", | ||
"id": "importer_Admin_Import", | ||
"name": "Admin Import" | ||
}, | ||
"mimetype": "application/zip", | ||
"measurements": [], | ||
"hash": "v0-sha384-dd3c97bfe0ad1fcba75ae6718c6e81038c59af4f447f5db194d52732efa4f955b28455db02eb64cad3e4e55f11e3679f", | ||
"name": "4784_1_1_localizer_dicom.zip", | ||
"tags": [], | ||
"created": "2016-09-21T14:56:09.943000+00:00", | ||
"modified": "2016-09-21T14:56:09.943000+00:00", | ||
"modality": null, | ||
"info": {}, | ||
"type": "dicom", | ||
"size": 989933 | ||
} | ||
] | ||
} | ||
} |