Help Center/ Cloud Data Migration/ API Reference/ Public Data Structures/ Source Job Parameters/ From FTP/SFTP/NAS (to Be Brought Offline)/SFS (to Be Brought Offline)
Updated on 2022-09-15 GMT+08:00

From FTP/SFTP/NAS (to Be Brought Offline)/SFS (to Be Brought Offline)

Sample JSON File

"from-config-values": {
        "configs": [
          {
            "inputs": [
              {
                "name": "fromJobConfig.inputDirectory",
                "value": "/sftpfrom/from_sftp.csv"
              },
              {
                "name": "fromJobConfig.inputFormat",
                "value": "CSV_FILE"
              },
              {
                "name": "fromJobConfig.columnList",
                "value": "1&2&3&4&5&6&7&8&9&10&11&12"
              },
              {
                "name": "fromJobConfig.fieldSeparator",
                "value": ","
              },
              {
                "name": "fromJobConfig.regexSeparator",
                "value": "false"
              },
              {
                "name": "fromJobConfig.firstRowAsHeader",
                "value": "false"
              },
              {
                "name": "fromJobConfig.encodeType",
                "value": "UTF-8"
              },
              {
                "name": "fromJobConfig.fromCompression",
                "value": "NONE"
              },
              {
                "name": "fromJobConfig.splitType",
                "value": "FILE"
              }
            ],
            "name": "fromJobConfig"
          }
        ]
      }

Parameter Description

Source link job parameters of FTP and SFTP are the same. Table 1 describes the parameters.
Table 1 Source link job parameters of file systems

Parameter

Mandatory

Type

Description

fromJobConfig.inputDirectory

Yes

String

Path for storing files to be extracted. You can enter a maximum of 50 file paths, which are separated by vertical bars (|). You can also customize the separators. For example, FROM/example.csv|FROM/b.txt.

fromJobConfig.inputFormat

Yes

Enumeration

File format required for data transmission. Currently, the following file formats are supported:
  • CSV_FILE: CSV format, used to migrate files to data tables
  • JSON_FILE: JSON format, used to migrate files to data tables
  • BINARY_FILE: Files (even not in binary format) will be directly transferred without resolution. It is applicable to file copy.

If you select BINARY_FILE, the migration destination must also be a file system.

fromJobConfig.lineSeparator

No

String

Line feed character in the file. For example, \n. By default, \n, \r, or \r\n is automatically identified.

fromJobConfig.columnList

No

String

Numbers of columns to be extracted. Use & to separate column numbers in ascending order. For example, 1&3&5.

fromJobConfig.lineSeparator

No

String

Line feed character. This parameter is valid only when the file format is CSV_FILE. The default value is \r\n.

fromJobConfig.fieldSeparator

No

String

Field delimiter. This parameter is valid only when the file format is CSV_FILE. The default value is ,.

fromJobConfig.quoteChar

No

Boolean

Whether to use the encircling symbol. If this parameter is set to true, the field delimiters in the encircling symbol are regarded as a part of the string value. Currently, the default encircling symbol of CDM is double quotation mark (").

fromJobConfig.regexSeparator

No

Boolean

Whether to use the regular expression to separate fields. This parameter is valid only when the file format is CSV_FILE.

fromJobConfig.regex

No

String

Regular expression. This parameter is valid only when the regular expression is used to separate fields.

fromJobConfig.firstRowAsHeader

No

Boolean

Whether to regard the first line as the heading line. This parameter is valid only when the file format is CSV_FILE. When you migrate a CSV file to a table, CDM writes all data to the table by default. If this parameter is set to true, CDM uses the first line of the CSV file as the heading line and does not write the line to the destination table.

fromJobConfig.fromCompression

No

Enumeration

Compression format. This parameter is valid only when the file format is CSV_FILE or JSON. The options are as follows:
  • NONE: Files in all formats are transferred.
  • GZIP: Files in gzip format are transferred.
  • ZIP: Files in Zip format are transferred.

fromJobConfig.jsonReferenceNode

No

String

Reference node. This parameter is valid when the file format is JSON_FILE. Resolve data on the JSON node. If the data corresponding to the node is a JSON array, the system extracts data from the array in the same mode. Nested JSON nodes are separated by periods (.). For example, data.list.

fromJobConfig.encodeType

No

String

Encoding type. For example, UTF_8 or GBK.

fromJobConfig.fromFileOpType

No

Enumeration

Source file processing mode. After a job is completed, operations on the source file can be performed. The source file can be renamed or deleted.

fromJobConfig.useMarkerFile

No

Boolean

Whether to start a job by a marker file. A job is started only when a marker file for starting the job exists in the source path. Otherwise, the job will be suspended for a period of time specified by fromJobConfig.waitTime.

fromJobConfig.markerFile

No

String

Name of the marker file for starting a job. After a marker file is specified, the task is executed only when the file exists in the source path. If the marker file is not specified, this function is disabled by default. For example, ok.txt.

fromJobConfig.waitTime

No

String

Period of waiting for a marker file. If you set Start Job by Marker File to Yes but no marker file exists in the source path, the job fails upon suspension timeout.

If you set this parameter to 0 and no marker file exists in the source path, the job will fail immediately.

Unit: second

fromJobConfig.filterType

No

Enumeration

Filter type. Possible values are as follows:
  • WILDCARD: Enter a wildcard character to filter paths or files. CDM will migrate the paths or files that meet the filter condition.
  • TIME: Specify a time filter. CDM will migrate the files modified after the specified time point.

fromJobConfig.pathFilter

No

String

Path filter, which is configured when the filter type is WILDCARD. It is used to filter the file directories. For example, *input.

fromJobConfig.fileFilter

No

String

File filter, which is configured when the filter type is WILDCARD. It is used to filter files in the specified directory. Use commas (,) to separate multiple files. For example, *.csv,*.txt.

fromJobConfig.startTime

No

String

If you set Filter Type to Time Filter, and specify a point in time for this parameter, only the files modified after the specified time are transferred. The time format must be yyyy-MM-dd HH:mm:ss.

This parameter can be set to a macro variable of date and time. For example, ${timestamp(dateformat(yyyy-MM-dd HH:mm:ss,-90,DAY))} indicates that only files generated within the latest 90 days are migrated.

fromJobConfig.endTime

No

String

If you set Filter Type to Time Filter, and specify a point in time for this parameter, only the files modified before the specified time are transferred. The time format must be yyyy-MM-dd HH:mm:ss.

This parameter can be set to a macro variable of date and time. For example, ${timestamp(dateformat(yyyy-MM-dd HH:mm:ss))} indicates that only the files whose modification time is earlier than the current time are migrated.

fromJobConfig.fileSeparator

No

String

File separator. If you enter multiple file paths in fromJobConfig.inputDirectory, CDM uses the file separator to separate files. The default value is |.

fromJobConfig.decryption

No

Enumeration

Whether to decrypt the encrypted file before export and the decryption method. The options are as follows:
  • NONE: Do not decrypt but directly export the file.
  • AES-256-GCM: Use the AES-256-GCM (NoPadding) algorithm to decrypt the file and then export the file.

fromJobConfig.dek

No

String

Data decryption key. The key is a string of 64-bit hexadecimal numbers and must be the same as the data encryption key toJobConfig.dek configured during encryption. If the encryption and decryption keys are inconsistent, the system does not report an exception, but the decrypted data is incorrect.

fromJobConfig.iv

No

String

Initialization vector required for decryption. The initialization vector is a string of 32-bit hexadecimal numbers and must be the same as the initialization vector toJobConfig.iv configured during encryption. If the initialization vectors are inconsistent, the system does not report an exception, but the decrypted data is incorrect.

fromJobConfig.md5FileSuffix

No

String

Check whether the files extracted by CDM are consistent with those in the migration source.