Code Integration Scenarios
R Convenience Functions
"Level 1" functions
"Level 2" functions
Web Services
These manipulation only the metadata, stored in Synapse.
Note: It is assumed that code versions are represented by refererences.
Create Code
Code Block |
---|
POST https://repo-staging.sagebase.org/repo/v1/code
{"parentId":"1234", "srcRepoId":"4567", "srcRepoLoc":"/trunk/analysisProject/R"}
|
Note: "parentId" is the ID of a Synapse Project; "srcRepoId" is the ID of a Source Repository object.
Successful Response:
Code Block |
---|
HTTP/1.1 201 Created
{"id":"8901", "parentId":"1234", "srcRepoId":"4567", "srcRepoLoc":"/trunk/analysisProject/R"}
|
Get Code
Code Block |
---|
GET https://repo-staging.sagebase.org/repo/v1/code/8901
|
Successful Response:
Code Block |
---|
HTTP/1.1 200 OK
{"id":"8901", "parentId":"1234", "srcRepoId":"4567", "srcRepoLoc":"/trunk/analysisProject/R"}
|
Update Code
Code Block |
---|
PUT https://repo-staging.sagebase.org/repo/v1/code/8901
{"id":"8901", "parentId":"5432", "srcRepoId":"4567", "srcRepoLoc":"/trunk/analysisProject/R"}
|
Successful Response:
Code Block |
---|
HTTP/1.1 200 OK
{"id":"8901", "parentId":"5432", "srcRepoId":"4567", "srcRepoLoc":"/trunk/analysisProject/R"}
|
Delete Code
Code Block |
---|
DELETE https://repo-staging.sagebase.org/repo/v1/code/8901
|
Successful Response:
Code Block |
---|
HTTP/1.1 204 No Content
|
...
The development cycle for preexisting code: The code is Downloaded from Synapse, and Loaded into the R session. The user repeatedly Runs, Edits and reLoads the code. When satisfied, she may Store the code back to Synapse. To help capture provenance, the Load and Store functions put the Code's ID and version into the current Step. For the provenance record to be accurate, the user must Store prior to running.
Discover, retrieve, load and run code
A user, browsing Synapse, sees a piece of code of interest (mentioned in a discussion or used in an analysis), and clicks on it. She sees:
entity.3733 <- downloadEntity(3733)
and begins by executing this in R.
Develop new code, then Store