...
URL | HTTP Type | Description |
---|---|---|
/{versionable-entityType}/{entityId}/version | POSTPUT | Create a new version of a given version-able entity. The user should provide a versionLabel and Synapse will auto-generate a new versionNumber. When this called on a version-able entity, the annotations of the current entity will be copied and applied to the newly created version. |
/{versionable-entityType}/{entityId}/version | GET | Returns a list of all versions of this entity. This will be a paginated list with a default sort on versionNumber descending |
/{versionable-entityType}/{entityId}/version/{versionNumber} | GET | Get a particular version of a version-able entity using the given id and version number. Note that the specific version fetched cannot be used to update the current version. Instead, promote it to the current version. |
/{versionable-entityType}/{entityId}/version/{versionNumber} | PUT | Not supported! Only the current version of an entity can be updated using the existing API. |
/{versionable-entityType}/{entityId}/version/{versionNumber} | DELETE | Delete a particular version of a version-able entity using the given id and version number. |
/{versionable-entityType}/{entityId}/version/{versionNumber}/annotations | GET | Get the annotations of a particular version of a version-able entity using the given id and version number. |
/{versionable-entityType}/{entityId}/version/{versionNumber}/annotations | PUT | Not Supported! You can only change the annotations of the current version. |
/{versionable-entityType}/{entityId}/promoteVersion/{versionNumber} | POST | Promote the specified versionNumber to be the current version. Effectively, this just changes the number of that version to be current + 1. |
...
To promote a specific version we must provide the version number. Note: you can promote the current version of an entity, but it is a no-op
Request
Code Block |
---|
curl -i -H sessionToken:YourSessionToken -H Accept:application/json -X DELETE https://repo-staging.sagebase.org/repo/v1/location/17338/promoteVersion/1 |
Response
Expand | ||
---|---|---|
|
Finally List Versions Again
...
Currently supported data types:
<data type> |
---|
dataset |
layer |
project |
foldercode |
file |
phenotypedata |
genotypedata |
expressiondata |
robject |
summary |
genomicdata |
entity |
Request
Code Block |
---|
curl -i -H sessionToken:YourSessionToken -H Accept:application/json 'https://repo-staging.sagebase.org/repo/v1/query?query=select+*+from+dataset+limit+3+offset+1' |
...
Code Block |
---|
SELECT * FROM layer WHERE layer.parentId == <parentId> [LIMIT <#>] [OFFSET <#>] |
...
Code Block |
---|
SELECT * FROM layer WHERE layer.parentId == <parentId> ORDER BY <field name> [ASC|DESC] [LIMIT <#>] [OFFSET <#>] |
...
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Get the descendants of an entity
Note that the query for descendants is based on secondary indices which are eventually consistent. You may not be able to see the complete list of descendants immediately.
Get all the descendants of an entity
Get all the descendants of an entity. The results are paginated. Use the optional query parameter limit to set the maximum page size. The default page size is 20. To fetch the next page, find the last entity (descendant) on the current page and use its ID to set the query parameter lastEntityId. Here is an example:
Code Block | ||||
---|---|---|---|---|
| ||||
curl -i -H sessionToken:<yourToken> -H Accept:application/json 'https://repo.prod.sagebase.org/repo/v1/entity/<entityID>/descendants&limit=2' |
Code Block | ||||
---|---|---|---|---|
| ||||
{
"idList": [
{
"id": "syn111"
},
{
"id": "syn112"
}
]
}
|
Code Block | ||||
---|---|---|---|---|
| ||||
curl -i -H sessionToken:<yourToken> -H Accept:application/json 'https://repo.prod.sagebase.org/repo/v1/entity/<entityID>/descendants?limit=20&lastEntityId=syn112' |
Code Block | ||||
---|---|---|---|---|
| ||||
{
"idList": [
{
"id": "syn113"
},
{
"id": "syn114"
},
{
"id": "syn115"
}
]
}
|
Get the descendants of a specific generation
Get all the descendants that are exactly n generations away. The children is generation 1. Children's children are generation 2. So on and so forth. The results are paginated in the same manner. To fetch the next page, find the last entity (descendant) on the current page and use its ID to set the query parameter lastEntityId. Here is an example:
Code Block | ||||
---|---|---|---|---|
| ||||
curl -i -H sessionToken:<yourToken> -H Accept:application/json 'https://repo.prod.sagebase.org/repo/v1/entity/<entityID>/descendants/2' |
Code Block | ||||
---|---|---|---|---|
| ||||
{
"idList": [
{
"id": "syn114"
},
{
"id": "syn115"
}
]
} |
References
Find reference to any version of an entity
...