Command Usage: sam v8_1_5 sam get destination
|  |
Command Description:
This command returns the appropriate path wherein a file should
be stored in the Fermilab enstore robot, based on the file
metadata, the work group under which the file will be stored,
and the Experiment's configuration of the Autodest server.
For files which have not yet been declared to SAM, you must include
either a metadata description file and its path (CLI) or a SamDataFile object
(API) so that "get destination" can calculate the path.
sam get destination --descriptionFile=/full/path/to/myMetadata.py
The metadata description file must contain one SamDataFile object which
describes the metadata to be entered into the database:
# myMetadata.py:
from SamFile.SamDataFile import SamDataFile
myMetadata = SamDataFile(fileName='raw_physics_file_name_here',
fileType='importedCollider',
group='my_physics_group_here',
...)
You may also get the destination for files which have already been
declared to SAM, using the --fileName or --fileId options:
sam get destination --fileName=myFileNameAlreadyDeclaredInSam
sam get destination --fileId=10001
In the API, you may pass in a metadata object rather than a
description file:
myMetadata = SamDataFile(fileName='raw_physics_file_name_here',
fileType='importedCollider',
group='my_physics_group',
...}
sam.getDestination(metadata=myMetadata)
Or, you may pass in the fileName or fileId of a file that has
already been declared to SAM:
sam.getDestination(fileName='existing_data_file_name')
sam.getDestination(fileId=12345)
For additional information about file metadata, see the output
from the commands:
sam get registered filetypes
sam describe metadata requirements --filetype=<fileTypeHere>
sam describe metadata attributes
Usage:
sam get destination [--options] [-flags]
sam get autodestination [--options] [-flags]
sam get auto destination [--options] [-flags]
Where:
--options:
--corbaCallTimeout=<value> # time in seconds for CORBA method calls to return before timing out (default: 0; zero implies no timeout)
--descriptionFile=<value> # name of the python file containing the metadata for the file
--fileId=<value> # DB-assigned ID number of the file of interest
--fileName=<value> # name of the file of interest
--retryInterval=<value> # retry interval base in seconds; will multiply this base times retryCount (default: 5)
--retryJitter=<value> # retry jitter, random jitter added to base retry interval times retryCount (default: 5)
--retryMaxCount=<value> # number of times to retry CORBA calls for retriable exceptions (default: 25; zero implies no retries)
-flags:
-c # automatically close all servants after each method call
-d # debug mode
-s # retrySilently mode (do not issue messages to stderr on proxy retries)
-t # time-it mode (print additional info on timings)
-v # verbose mode
Synonymous Options:
--descrip=<value> # synonym for --descriptionFile=<value>
Must specify at least one of:
--fileName=<value> OR --fileId=<value> OR --descriptionFile=<value>
Mutually Exclusive Options:
--fileName=<value> OR --fileId=<value> OR --descriptionFile=<value>
Required Data Types:
corbaCallTimeout : int
descriptionFile : string
fileId : long
fileName : string
retryInterval : int
retryJitter : int
retryMaxCount : int
You may omit "-c" if the $SAM_PYAPI_AUTO_CLOSE_SERVANTS environmental variable is set.
You may omit "--corbaCallTimeout=<value>" if the $SAM_PYAPI_CORBA_CALL_TIMEOUT environmental variable is set.
You may omit "--retryInterval=<value>" if the $SAM_PYAPI_RETRY_INTERVAL environmental variable is set.
You may omit "--retryJitter=<value>" if the $SAM_PYAPI_RETRY_JITTER environmental variable is set.
You may omit "--retryMaxCount=<value>" if the $SAM_PYAPI_RETRY_MAX_COUNT environmental variable is set.
You may omit "-s" if the $SAM_PYAPI_RETRY_SILENTLY environmental variable is set.
UNIX ExitStatus:
Success : 0
Unhandled exceptions : 127
See Also: