Import a Version of the Model (modelImport)

The modelImport command imports a model from a JSON file (perhaps exported earlier using the modelExport command) to update the latest version of the model, or creates a script that you can use to update the model later.

ttGridAdmin modelImport [-script scriptpath] 
                        [filepath]

Options

The modelImport command has the options:

Option Description

-script scriptpath

Creates a script with the specified name and path. The model is not updated when you run modelImport. Instead, you can run the resulting script later to modify the latest version of the model to conform to the imported version. This allows you to review the changes beforehand.

Without -script, the latest model is updated immediately.

filepath

Path and name of the JSON file from which the representation of the model is read.

If filepath is not specified, input is read from stdin.

Examples

Consider a scenario where you exported the latest version (Version 5) of the model, subsequently made changes to the latest version of the model without applying them, then decided you do not want those changes after all. To undo the changes, import the file you previously exported:

% ttGridAdmin modelImport /sw/tten/grid/models/model5export.json
Model imported

Without the -script option, the model is imported immediately.

With the script option, a script is created that you can run later:

% ttGridAdmin modelImport /sw/tten/grid/models/model5export.json -script 
/sw/tten/grid/models/modelmodscript
Script /sw/tten/grid/models/modelmodscript created.

Here is an example of a resulting script:

% pwd
/sw/tten/grid/models
% more modelmodscript
#!/bin/sh
# Created by ttGridAdmin -modelImport
TIMESTEN_HOME=/sw/tten/grid/ttinstances/gridmgmt
if [ -e $TIMESTEN_HOME/bin/ttenv.sh ]; then
 . $TIMESTEN_HOME/bin/ttenv.sh >/dev/null 2>&1
fi
# TNSNames unchanged
#Host mysys5host...
ttGridAdmin -hostCreate  mysys5host -internalAddress mysys5.example.com -externalAddress mysys5.example.com
ttGridAdmin installationCreate mysys5host.installslc -location 
/sw/tten/grid/ttinstallations/installadc/
ttGridAdmin instanceCreate mysys5host.instance1 -installation installslc 
-location /sw/tten/grid/ttinstances/ -daemonPort 20000 -csPort 21000
#Host mysys3host...
#Host mysys1host...
#Host mysys2host...
#Host mysys4host...
#Dbdef database1
#Connectable unchanged!
#Connectable unchanged!
#DbDef unchanged!
#Dbdef TTGRIDADMIN
#Connectable unchanged!
#Connectable unchanged!
#DbDef unchanged!

Notes

  • The modelImport command compares the latest version of the model with the model being imported.

  • The changes to the latest version of the model are not done in an atomic transaction. Each change is done in a separate transaction, so any failure will result in complications.