Snapshot export

REST export endpoint

path   /api/snapshot                  (for Hyperon Studio versions 1.6.40 and older)

             /api/snapshot/export   (since 1.6.41 Hyperon Studio version)


method: POST

produces: application/zip

return code:

  • 200 - if successful,
  • 500 - when something went wrong

request body is optional. If the request body is empty, then export will try to fetch an active profile from the given user or all profiles in the system, if the user has no active profile.

In Parameters settings block attribute fromSession might take two values for Snapshot export: 

  • false - exports user's perspective. So it means both published and unpublished user's changes.
  • true - exports only unpublished user's changes.

Request body since hyperon studio version 1.8.14 (still valid, but may change in future versions):

{
   "profiles":["PROFILE_1"],   // which profiles should be used for export. If not present, user's currently selected profile is chosen  
   "domain": {                 // if this node is present, domain will be exported for "PROFILE_1"  
        "fromSession" : false,   // it will export full domain tree   
        "removeElementsNotInSnapshot": false // set the "removeNotInSnapshot" flag in import configuration file config.json    
   },
   "functions": {              // if this node is present, functions will be exported for "PROFILE_1"   
        "fromSession": true ,   // it will export only functions from user's session, which also starts with either "demo." or "test2" prefix  
        "removeElementsNotInSnapshot": false  // if false nothing happens during snapshot import  
        "nameStartsWith": ["demo.", "test2"]
   },
   "parameters": {             // if this node is present, parameters will be exported for "PROFILE_1"  
        "fromSession": false ,  // it will export all parameters, which starts with "demo.motor.coverage"  
        "removeElementsNotInSnapshot": true  //  if true, it will remove all parameters, where snapshot will be imported, that are within boundary defined by "nameStartsWith" and are not in imported snapshot zip.  
        "nameStartsWith": ["demo.motor.coverage"]
   },
   "tags": false ,              // tags will not be exported. Since it is "false", this node can be removed  
   "profile": true              // "PROFILE_1" definition will be exported with context, regions/versions and harmonogram  
}

Request body since Hyperon Studio version 1.6.41

{
   "profiles":["PROFILE_1"],   // which profiles should be used for export. If not present, user's currently selected profile is chosen  
   "domain": {                 // if this node is present, domain will be exported for "PROFILE_1"  
        "fromSession" : false   // it will export full domain tree   
   },
   "functions": {              // if this node is present, functions will be exported for "PROFILE_1"   
        "fromSession": true ,   // it will export only functions from user's session, which also starts with either "demo." or "test2" prefix  
        "removeElementsNotInSnapshot": false  // if false nothing happens during snapshot import  
        "nameStartsWith": ["demo.", "test2"]
   },
   "parameters": {             // if this node is present, parameters will be exported for "PROFILE_1"  
        "fromSession": false ,  // it will export all parameters, which starts with "demo.motor.coverage"  
        "removeElementsNotInSnapshot": true  //  if true, it will remove all parameters, where snapshot will be imported, that are within boundary defined by "nameStartsWith" and are not in imported snapshot zip.  
        "nameStartsWith": ["demo.motor.coverage"]
   },
   "tags": false ,              // tags will not be exported. Since it is "false", this node can be removed  
   "profile": true              // "PROFILE_1" definition will be exported with context, regions/versions and harmonogram  
}
IMPORTANT
The previous request body from version 1.6.38 is still valid and works the same.

request body since hyperon studio version - 1.6.39:

{
   "profiles":["PROFILE_1"],   // which profiles should be used for export. If not present, user's currently selected profile is chosen  
   "domain": {                 // if this node is present, domain will be exported for "PROFILE_1"  
        "fromSession" : false   // it will export full domain tree
   },
   "functions": {              // if this node is present, functions will be exported for "PROFILE_1"   
        "fromSession": true ,   // it will export only functions from user's session, which also starts with either "demo." or "test2" prefix  
        "nameStartsWith": ["demo.", "test2"]
   },
   "parameters": {             // if this node is present, parameters will be exported for "PROFILE_1"  
        "fromSession": false ,  // it will export all parameters, which starts with "demo.motor.coverage"  
        "nameStartsWith": ["demo.motor.coverage"]
   },
   "tags": false ,              // tags will not be exported. Since it is "false", this node can be removed  
   "profile": true              // "PROFILE_1" definition will be exported with context, regions/versions and harmonogram  
}

request body up until hyperon studio version - 1.6.38:

{
   "profiles":["PROFILE_1", "PROFILE_2"],   // which profiles should be used for export. If not present, user's currently selected profile is chosen  
}