Python API: samAdmin v8_1_5 samAdmin.addParamSuite()
|  |
This is the python interface to the command 'samadmin add param suite'.
Command Description:
Add a whole dictionary of ParamCategory and ParamType
definitions to the database. Ignore any duplicates (i.e.,
if it's already there, don't panic). Just suck in a
dictionary and add it to the db.
Also, register all of the newly-added paramCategory/paramType
combinations to the list of valid dimensions.
The dictionary to be passed must be in the following
syntax:
paramSuite = { 'ParamCategoryName1' :
{ 'pc1_ParamTypeName1' : specification_of_dataTypeOf_pc1ParamTypeName1,
'pc1_ParamTypeName2' : specification_of_dataTypeOf_pc1ParamTypeName2,
...
},
'ParamCategoryName2' :
{ ... }
The ParamCategory names are strings.
The ParamTypeName names are strings.
The dataType specification must adhere to the rules
described in the online help for the "samadmin add data type"
command.
Example:
# a file named MyParams.py:
from SamStruct.SamSize import SamSize
from SamStruct.SamTime import SamTime
from SamStruct.ApplicationFamily import ApplicationFamily
paramSuite = { 'Global' :
{'userName' : 'string',
'date' : SamTime,
'size' : SamSize,
'application' : ApplicationFamily},
'Local' :
{'nodeName' : 'string',
'cmEnergy' : 'float',
}
}
from SamAdmin import samAdmin
samAdmin.addParamSuite(paramSuite=paramSuite)
Or, from the command line:
samadmin add param suite --param-file=./MyParams.py
If a paramType is already registered in the SAM database,
and your input data contains a different dataType than was
originally listed, you must use the --updateDataTypes flag
to update the dataType in the database; otherwise, the
dataType will NOT be changed to the new dataType.
Python Usage:
from SamAdmin import samAdmin
result = samAdmin.addParamSuite(...)
Return value:
Arguments are passed as keyword-value pairs, as in:
myfunc(arg1='myarg', arg2='anotherarg', d=1)
Argument Keyword Description:
(*) indicates that this keyword is required
>>> indicates that either the API object or the CLI equivalent (<<<) is required
====================================================================================================================================
KEYWORD DATA TYPE DESCRIPTION
------------------------------------------------------------------------------------------------------------------------------------
c SamBoolean automatically close all servants after each method call
connect string oracle username/password for connecting to this database
corbaCallTimeout int time in seconds for CORBA method calls to return before timing out (default: 0; zero implies no timeout)
d SamBoolean debug mode
paramFile string file containing the definition of an object named paramSuite
paramSuite SamDictionaryIdlStruct two-level nested dictionary of valid paramCategories, paramTypes, and their dataTypes
retryInterval int retry interval base in seconds; will multiply this base times retryCount (default: 5)
retryJitter int retry jitter, random jitter added to base retry interval times retryCount (default: 5)
retryMaxCount int number of times to retry CORBA calls for retriable exceptions (default: 25; zero implies no retries)
s SamBoolean retrySilently mode (do not issue messages to stderr on proxy retries)
t SamBoolean time-it mode (print additional info on timings)
updateDataTypes SamBoolean update dataType specification where new data is different from existing data
v SamBoolean verbose mode
====================================================================================================================================
Must have at least one of:
(param-file, param-suite)
Mutually exclusive keywords:
(param-file || param-suite)
Environment Defaults:
c = os.environ['SAM_PYAPI_AUTO_CLOSE_SERVANTS']
connect = os.environ['SAM_ORACLE_CONNECT']
corbaCallTimeout = os.environ['SAM_PYAPI_CORBA_CALL_TIMEOUT']
retryInterval = os.environ['SAM_PYAPI_RETRY_INTERVAL']
retryJitter = os.environ['SAM_PYAPI_RETRY_JITTER']
retryMaxCount = os.environ['SAM_PYAPI_RETRY_MAX_COUNT']
s = os.environ['SAM_PYAPI_RETRY_SILENTLY']
See Also: