Snapshot export

Profile export

Exporting profiles in Hyperon Studio

To export profiles in the Hyperon Studio, go to Tools → Snapshot Export, check Profile checkbox, choose profiles that should be exported and click the Export button. A popup window will appear. When the export is finished and no errors occurred, click the Download button to download snapshot in the zip file. If any error during export happens, the error message will be shown and the Download button will be unavailable to click.

To add the definition of the context for each exported profile also select the Context checkbox.

It is not possible to select the Context checkbox without selecting the Profile checkbox. Context definition can only be exported together with the profile definition.

Exporting profiles via REST

Exporting only profiles (without other elements like parameters or domain) is not currently possible. It will be available soon. To see  how to export the whole snapshot via REST endpoint, see the REST export endpoint.

The REST endpoint gives the option to select which profiles to include in the export. If some target profiles are selected, the resulting ZIP will contain the following elements:

  1. elements attached (directly or indirectly - through regions and region versions) to any of the selected profiles, for example:
    • selected profiles
    • regions and versions of the regions within selected profiles
    • functions or parameters attached to any version of a region within one of the selected profiles
    • etc.
  2. global elements - elements not attached to any profile (directly or indirectly), but which could be attached to a profile (for example global functions or global parameters)
  3. elements not attachable to profile, for example, tags.

If the list of selected profiles is not provided, the export result will contain elements from all profiles, as well as elements referred to in points 2. and 3. of the list above.

Profile File system structure

In the snapshot ZIP file, any directories with names starting with '@' have special meaning. They define the structure of the snapshot file. Names of other directories (not starting with '@') are part of import data. For example, they may be interpreted as profile names, region names or version numbers, depending on where they are in the directory structure.

Directory structure

The part of the directory tree of the snapshot zip file related to profiles has the following structure:

/ (root directory of ZIP file)
|
+--Other optional content (directories or files)
|
+–-@profiles/
   +--PROFILE1/
   |  +--context.def
   |  +--@regions/
   |     +--REGION1/
   |     |  +--REGION1.info
   |     |  +--schedule_REGION1.csv
   |     |  +--@versions/
   |     |     +--VERSION1.ver
   |     |     +-- *.ver files for versions inside region REGION1 other than VERSION1...
   |     +-- other regions inside profile PROFILE1...
   +-- other profiles...

@profiles/ directory

Located in atop-level zip file directory and contains the profile content. Inside there is a subdirectory for each profile, with the same name as the name of the profile. Except for the individual profile subdirectories, the @profiles/ folder is not supposed to contain any other files or directories.

Each subdirectory associated with a particular profile contains:

  • @regions/ subdirectory with content describing regions within the profile
  • context.def - text file with the definition of context associated with the profile, with standard format of the context description.

@regions/ directory

Located inside the individual profile directory. It contains a subdirectory for each region within the profile, with the same name as the name of the region.

Each subdirectory associated with a particular region contains:

  • @versions/ subdirectory with content describing versions of the profile
  • region.info file with information about the region. Currently, the file is empty, but in future releases, some content may be added.
  • schedule.csv file with information about the time schedule for versions of the region.

Apart from the content listed above, the @regions folder should not contain any other files or directories.

@versions/ directory

Located inside individual region directory. It contains a file <version_number>.ver</version_number> for each version of the region (<version_number></version_number> should be substituted with the number of the version. Usually, versions are numbered with integer numbers "1", "2",... but it is possible to use other strings, like "version1"). Currently, the file <version_number>.ver</version_number> is empty, but some content may be added in future releases. Except for the *.ver files the @versions directory should not contain any other files or directories.

Definition of file structure

Context definition file

The context definition files are located inside each individual profile directory and have the name context.def. The content conforms to the standard format of the context description.

Region info file

The region info files are located inside each individual region directory and have the name <region_code>.info</region_code>. Currently, the files are empty, but in future releases, some content may be added.

Version info file

The version info files are located in the @versions directory and have the name <version_number>.ver</version_number>. Currently, the files are empty, but in future releases, some content may be added.

File defining region schedule

Files defining the time schedule for the regions are located in individual region folders and are named schedule_<region_code>.csv</region_code>. Example content is shown below:

#schedule for REG_WITH_DESC   
number ; description ; valid from ; valid to ; editable to
NO_DESC_VER; ;2018-11-22 09:58:44; ;2018-11-22 09:48:44
2;Different;2018-11-21 09:58:43;2018-11-22 09:58:44;2018-11-21 09:48:43
1;Draft;2018-11-20 09:58:42;2018-11-21 09:58:43;2018-11-20 09:48:42

It is a semicolon-separated text file encoded with UTF-8.

First line starting with # contains a description of the content.

Second line contains column headers.

Each subsequent line contains an element of the time schedule of the region. Elements should be sorted by the start date (column valid from) in descending order.

IMPORTANT
If elements are not sorted by the start date in descending order, some rows of the schedule will not be imported. In this case, the results of the import will contain a warning message about incorrect dates.

The columns (from left to right) contain:

  • number - number of the version,
  • description - description of the version; it is included only for information and does not affect the descriptions of region versions in the database,
  • valid from - date-time for the start of the period when this version is in force.
  • valid to - Date-time for the end of the period when this version is in force. Included only for information, does not affect the import. The actual end of the period when the version is in force is always the start of the next period.
  • editable to - date-time for the end of the period when the schedule entry is editable.

The format of date-time fields is "yyyy-MM-dd HH:mm:ss", where:

  • yyyy - 4-digit year,
  • MM - 2-digit month,
  • dd - 2-digit day of the month,
  • HH - 2-digit hour (from "00" to "23"),
  • mm - 2-digit minutes,
  • ss - 2-digit seconds.