After you have specified the values for the basic information in the device pack configuration XML file, specify the values for the input file information in the appropriate section of the same device pack configuration XML file.
Navigate to each of the following sections. For each section, specify the values for the device pack that you want to generate:
<Type></Type>
Specifies the type of data file to provide to this application.
The current supported type is CSV only (case insensitive).
Default: CSV
Example:
<Type>CSV</Type>
<Compression></Compression>
Specifies the type of compression used (if any) for a device or EMS while creating input files.
The following information describes the supported compression types:
This type is used if the input file is created without any compression.
This type is used if the input file is compressed in zip format.
This type is used if the input file is compressed in gzip format.
If the value is not TEXT, then the device pack decompresses (unzips) the downloaded files before processing.
Note: Because only a single level of decompression is supported, input files from a device or EMS can be compressed one time.
Example:
<Compression>TEXT</Compression>
<Paths>
<Path deltaTime="900"></Path>
<Path deltaTime="300"></Path>
</Paths>
Specifies the absolute path of the directory that contains the sample input CSV data files for this application.
The application uses the files in <Path> to generate a device pack. The input files for the application must be identical to the input files that the device or EMS created. You copy the input files from the device or EMS to the system where the application is installed.
Note: Do not modify the file name or the file content after you copy. Keep the file name and the file content identical to the file name and the file content on the device or EMS from which you created them. Modifying the files causes the generated device pack to not work correctly when it is installed and downloads actual files.
If the CSV data files are in multiple directories, then add as many occurrences of <Path></Path> as needed.
This value must not be empty.
The default extension of the data files is *.csv; for example:
/opt/data/one (selects all *.csv files from this directory)
/opt/data/two/*.sts (selects all CSV files that have an extension of *.sts)
The attribute deltaTime specifies the time in seconds by which the input files are generated.
To create a single device pack that can poll the generated files at different time intervals, provide each set of files in a different <Path> with its deltaTime. During the installation of the generated device pack, you are prompted for the target directory for each deltaTime attribute provided.
A target directory is the actual directory on the device or EMS from which this device pack continues to download the CSV files after it is installed.
This value must be a positive integer.
This value must not be empty.
Default: 900
Note: Once the generated device pack is deployed, it automatically connects to the device or EMS and downloads the files.
Example:
<Paths>
<Path deltaTime="900">/opt/dataFor15mins/InputCSVFiles</Path>
<Path deltaTime="300">/opt/dataFor5mins/InputCSVFiles</Path>
</Paths>
<Delimiter></Delimiter
Specifies the delimiter in the CSV files.
The delimiter can be any character of any length.
This value must not be empty.
Default: Comma (,)
Example:
<Delimiter>,</Delimiter>
<CSVFile>
<Header fileNamePattern=”” isHeaderInFile="true" dataStartsFrom=""></Header>
<Header fileNamePattern=”” isHeaderInFile="true" dataStartsFrom=""></Header>
</CSVFile>
Note: This section is an important part of the configuration information that allows the application to map a data value to a name successfully.
Specifies the regular expression that identifies the header of a CSV file. The first line of the CSV file that matches the value of <Header> is considered the header for the CSV file.
The attribute fileNamePattern specifies a file name identifier.
If the fileNamePattern attribute is provided, then the value of <Header> is only used for files whose name matches this fileNamePattern.
If the fileNamePattern attribute is empty, then the value of <Header> is used for all files that do not match any fileNamePattern.
If <Header> is not in the file, do the following actions:
Example 1:
<Header fileNamePattern=”.*ethernet.*” isHeaderInFile="true" dataStartsFrom="">System Name,System IP,Date,BitsIn,BitsOut</Header>
In this example, the application checks for files whose name matches fileNamePattern=.*ethernet.*. For all the matched files, the application reads the value of isHeaderInFile to determine that <Header> is in the file. Then for each line in the file, the application tries to match the value of <Header>, which is System Name,System IP,Date,BitsIn,BitsOut. The line that matches this value is the header in the file.
All lines before this header are considered comments. All lines after this header are considered data.
Example 2:
<Header fileNamePattern=”.*ethernet.*” isHeaderInFile="false" dataStartsFrom="">System Name,System IP,Date,BitsIn,BitsOut</Header>
In this example, the application checks for files whose name matches fileNamePattern=.*ethernet.*. For all the matched files, the application reads the value of isHeaderInFile to determine that <Header> is NOT in the file. To get the header for this CSV file, the application uses the value of <Header>, which is System Name,System IP,Date,BitsIn,BitsOut.
If the value of the attribute dataStartsFrom is empty, the first nonempty line in the file is data.
Example 3:
<Header fileNamePattern=”.*ethernet.*” isHeaderInFile="false" dataStartsFrom="3">System Name,System IP,Date,BitsIn,BitsOut</Header>
In this example, the action of the application is the same as in example 2, except that the application reads the first two lines as comments. All subsequent lines are considered data.
If the CSV files have a header, then we recommend that you paste the complete header as a value of the <Header> element. Do not delete any character while pasting otherwise the application fails to match.
If the CSV files do not have a header, then we recommend that you consult the vendor documentation of that device (or EMS), or any such guide that provides information about the format of the data the device or EMS generates.
Note: Without any header information, no device pack is generated.
<MaxFileCount></MaxFileCount>
Restricts the application so that the specified number of files to be read from <Paths> is not exceeded.
Note: This restriction does not apply to a generated device pack. To limit the number of files for a generated device pack, provide the value when you deploy the device pack.
MaxFileCount must be a positive integer or empty.
Specifying empty processes all files.
Default: Empty
<MaxFileSize></MaxFileSize>
Restricts the application so that files that exceed this limit are not processed.
Note: This restriction does not apply to a generated device pack, which processes files of all sizes. We recommend that you split up the input files if they are larger than 10 MB.
MaxFileSize must be a positive integer or empty.
The MaxFileSize unit is kilobyte (KB).
Specifying empty processes files of all sizes.
Default: Empty
After you have specified the input file information, specify the device pack elements information.
|
Copyright © 2014 CA.
All rights reserved.
|
|