usage: adr.bat import [-h] [--disable_encoding_check] [--session_guid [session_guid]] [--session_date [date]] [--session_hostname [hostname]] [--session_platform [platform]] [--session_application [application]] [--session_version [version]] [--session_tags [tag_string]] [--dataset_guid [dataset_guid]] [--dataset_filename [filename]] [--dataset_dirname [directory]] [--dataset_format [format]] [--dataset_parts [count]] [--dataset_elements [count]] [--dataset_tags [tag_string]] [--data_guid [item_guid]] [--data_date [date]] [--data_sequence [number]] [--data_name [name]] [--data_source [name]] [--data_tags [tag_string]] [--data_categories [categoryA [categoryB ...]]] [--ext_image [ext ...]] [--ext_movie [ext ...]] [--ext_table [ext ...]] [--ext_scene [ext ...]] [--ext_file [ext ...]] [--ext_text [ext ...]] [--ext_html [ext ...]] [--table_col_labels] [--table_row_labels] [--table_numeric] [--table_delimiter [char]] [--table_quote_char [char]] [--verbose] [--test] [--print_options] adr_server_url [file|directory ...] Import data items from disk into the ADR server. positional arguments: adr_server_url ADR server URL. Example: http://nexus:cei@127.0.0.1:8000 file|directory File and directory names to import options: -h, --help show this help message and exit --disable_encoding_check Disable the implicit check for UTF-8 encoding of uploaded files --session_guid [session_guid] GUID of an existing Ansys Dynamic Reporting session to use for new data items --session_date [date] Creation date for the created session --session_hostname [hostname] Hostname for the created session --session_platform [platform] Platform name for the created session --session_application [application] Application name for the created session --session_version [version] Version for the created session --session_tags [tag_string] Tags for the created session --dataset_guid [dataset_guid] GUID of an existing Ansys Dynamic Reporting dataset to use for new data items --dataset_filename [filename] Filename for the created dataset --dataset_dirname [directory] Directory name for the created dataset --dataset_format [format] Format for the created dataset --dataset_parts [count] Number of parts for the created dataset --dataset_elements [count] Number of elements for the created dataset --dataset_tags [tag_string] Tags for the created dataset --data_guid [item_guid] GUID for newly imported items (note only useful when importing a single data item, use with caution) --data_date [date] Creation date for created data items (__timestamp__ is the file timestamp) --data_sequence [number] Sequence number for the created data items --data_name [name] Name for created data items (__file__ is the file basename) --data_source [name] Source for created data items (__file__ is the file basename) --data_tags [tag_string] Tags for created data items --data_categories [categoryA [categoryB ...]] List of space-separated categories to assign the item to. --ext_image [ext ...] Filename extensions to be imported as image. Default: ['png', 'jpg'] --ext_movie [ext ...] Filename extensions to be imported as movie. Default: ['mp4'] --ext_table [ext ...] Filename extensions to be imported as table. Default: ['csv'] --ext_scene [ext ...] Filename extensions to be imported as scene. Default: ['stl', 'ply', 'csf', 'avz', 'scdoc', 'dsco'] --ext_file [ext ...] Filename extensions to be imported as file. Default: [] --ext_text [ext ...] Filename extensions to be imported as text. Default: ['txt'] --ext_html [ext ...] Filename extensions to be imported as html. Default: ['htm', 'html'] --table_col_labels Input csv files will have a column label row --table_row_labels Input csv files will have a row label column --table_numeric Table items generated from .csv files will have strictly numeric content --table_delimiter [char] The delimiter in csv files --table_quote_char [char] The quote character in csv files --verbose Enable verbose mode --test Validate the operation, but do not perform it --print_options Print import configuration option values
The tool allows you to upload data from files into an Ansys Dynamic Reporting database. This is similar to uploading files into data items in the Ansys Dynamic Reporting web interface. The tool provides options for specifying files or directories to upload and defining exactly how the data should be incorporated into the existing data on the ADR server. These include specification of session, dataset, tags, what data item type-specific file extensions should be uploaded as, and how tables should be handled.
Item file uploads for csv, txt and
html files must be strictly UTF-8 encoded. On upload, there
is a check for UTF-8 encoding which is used to force this requirement. This
check is enabled by default and uploads fail if this check fails. You can
disable this check using --disable_encoding_check
if you feel that
your file is correctly encoded.
The tool takes a list of files and/or directories as arguments. When a
directory is specified, the tool recursively visits its contents, uploading all
files that match the file extensions specified with the --ext_*
options.
Argument/Option | Description |
---|---|
Arguments | |
adr_server_url | Specifies the hostname, port, username and password of the
ADR server to import the data items into. For example:
http://nexus:cei@127.0.0.1:8000 specifies a server
running on the local machine (127.0.0.1) on port 8000. The
username is nexus and the password is
cei. |
file | directory ... | Specifies the name of a specific file to import or the name of a directory whose files should be imported. This argument may be repeated as needed. The tool recurses into the directory, looking for files with the matching extensions to import. |
Options | |
-h, --help | Displays the usage message and exits. |
--session_guid [GUID] | The Globally Unique Identifier (GUID) of the session to
associated the data with. If omitted, a new session is created
and assigned a new GUID. This new session GUID is then
associated with the data. The additional --session_* command-line options are provided to specify
attributes of the new session. |
--session_date [date] | The creation date for the created session. This option is
ignored if an existing session GUID is used instead of creating
a new session. If omitted, the current time stamp is used. The
format of the date is that parsed by the Python
dateutil.parser.parse method, which is able to
parse most known formats. |
--session_hostname [hostname] | The host name to associate with the created session. This option is ignored if an existing session GUID is specified. The default is the host name of the system the tool is run on. |
--session_platform [platform] | The platform (operating system) name to associate with the created session. This option is ignored if an existing session GUID is specified. The default is the platform of the system the tool is run on. |
--session_application [application] | The application name to associate with the created session. This option is ignored if an existing session GUID is specified. The default is adr_data_import. |
--session_version [version] | The version to associate with the created session. This option is ignored if an existing session GUID is specified. The default is the version number of the tool. |
--session_tags [tag string] | A space-separated list of tags to associate with the created
session. This option is ignored if an existing session GUID is
specified. The default is empty (no session tags). Session tags,
dataset tags, and data item tags are distinct and separate. It
is a common mistake to specify --session_tags when
--data_tags is intended. |
--dataset_guid [GUID] | The GUID of the dataset to associate the data with. If
omitted, a new dataset is created and assigned a new GUID. This
new dataset GUID is then associated with the data. The
additional --dataset_* command-line
options are provided to specify attributes of the new
dataset. |
--dataset_filename [file name] | The file name for the created dataset. This option is ignored if an existing dataset GUID is specified. The default file name is unspecified. |
--dataset_dirname [directory name] | The directory name for the created dataset. This option is ignored if an existing dataset GUID is specified. The default directory name is the working directory used when the ADR data import tool was run. |
--dataset_format [format] | The format for the created dataset as a string. This option is ignored if an existing dataset GUID is specified. The default format string is unspecified. |
--dataset_parts [count] | The number of parts in the created dataset. This is only useful when 3D scene data is imported. This option is ignored if an existing dataset GUID is specified. The default is 0. |
--dataset_elements [count] | The number of elements in the created dataset. This is only useful when 3D scene data is imported. This option is ignored if an existing dataset GUID is specified. The default is 0. |
--dataset_tags [tag string] | A space-separated list of tags to associate with the created
dataset. This option is ignored if an existing dataset GUID is
specified. The default is empty (no dataset tags). Session tags,
dataset tags, and data item tags are distinct and separate. It
is a common mistake to specify --dataset_tags when
--data_tags is intended. |
--data_date [date] | The creation date for the created data items. The format of
the date is that parsed by the Python
dateutil.parser.parse method, which is able to
parse most known formats. If the string
"__timestamp__" is specified for the date, the
creation date used is each data file. The default is now, the
time when the tool was run. |
--data_sequence [sequence number] | The sequence number for the created data items. This is used if data items can be considered in a specific ordered sequence. The default sequence number is 0. |
--data_name [name] | The name for the created data items as a string. If
"__file__" is specified, the name is of each data
file. The default is "__file__". |
--data_source [source] | The source of the data as a string. The default is "data_import". Set this to track where data comes from. |
--data_tags [tag string] | A space-separated list of tags to associate with the data
items. The default is empty (no data item tags). Session tags,
dataset tags, and data item tags are distinct and separate. It
is a common mistake to specify --session_tags or
--dataset_tags when --data_tags is
intended. See Tagging (tag). |
--disable_encoding_check | Item file uploads for csv, txt and html files must be strictly UTF-8 encoded. On upload, there is a check for UTF-8 encoding which is used to force this requirement. This check is enabled by default and uploads fail if this check fails. You can disable this check using this option if you feel that your file is correctly encoded. |
|
The By default, *.png and *.jpg map to image items, *.mp4 maps to animation items, *.csv maps to table items, *.stl, *.ply, *.csf, and *.avz map to scene items. File items, string items, tree items, and HTML items have no explicit mapping. If you do not provide arguments after an option, file extensions are not mapped to that data item type. |
| Specifies that imported tables should consider the first column and first row, respectively, as labels for the table. If either of these options are omitted, it indicates that the column (or row) has no labels in the data file. |
--table_numeric | Indicates that table data should be changed into numeric data types instead of strings (the default). |
--table_delimiter [char] | The character that separates cell items from each other in an table input file. By default, the separator is a comma. Specifying nothing for this option causes each line to be imported as a single cell item. |
--table_quote_char [char] | The character that delimits quoted text in cell items in a table input file. By default, the quote character is a single quote ('). This allows the table delimiter to be used within a single cell. Specifying nothing for this option causes no special parsing for quoted strings. |
--verbose | Displays additional status and progress information during the operation. |
--print_options | Prints out the selected command line options. |
--test | Simulates the operation without actually performing it. This
is helpful when debugging command lines, especially when used in
conjunction with the --verbose option. |