Updated on 2024-01-16 GMT+08:00

To OBS

Sample JSON File

"to-config-values": {
        "configs": [
          {
            "inputs": [
              {
                "name": "toJobConfig.bucketName",
                "value": "cdm"
              },
              {
                "name": "toJobConfig.outputDirectory",
                "value": "/obsfrom/advance/"
              },
              {
                "name": "toJobConfig.outputFormat",
                "value": "CSV_FILE"
              },
              {
                "name": "toJobConfig.fieldSeparator",
                "value": ","
              },
              {
                "name": "toJobConfig.writeToTempFile",
                "value": "false"
              },
              {
                "name": "toJobConfig.validateMD5",
                "value": "false"
              },
              {
                "name": "toJobConfig.recordMD5Result",
                "value": "false"
              },
              {
                "name": "toJobConfig.encodeType",
                "value": "UTF-8"
              },
              {
                "name": "toJobConfig.markerFile",
                "value": "finish.txt"
              },
              {
                "name": "toJobConfig.duplicateFileOpType",
                "value": "REPLACE"
              },
              {
                "name": "toJobConfig.columnList",
                "value": "1&2"
              },
              {
                "name": "toJobConfig.quoteChar",
                "value": "false"
              },
              {
                "name": "toJobConfig.encryption",
                "value": "NONE"
              },
              {
                "name": "toJobConfig.copyContentType",
                "value": "false"
              }
            ],
            "name": "toJobConfig"
          }
        ]
      }

Parameter Description

Parameter

Mandatory

Type

Description

toJobConfig.bucketName

Yes

String

OBS bucket name. For example, cdm.

toJobConfig.outputDirectory

Yes

String

Path to which data is written. For example, data_dir.

toJobConfig.outputFormat

Yes

Enumeration

File format required for data writes (except the binary format). Currently, the following file formats are supported:
  • CSV_FILE: Write data in CSV format.
  • BINARY_FILE: Files are directly transferred without resolving the content. CDM writes the file without changing the file format.

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

toJobConfig.fieldSeparator

No

String

Column delimiter. This parameter is valid only when toJobConfig.outputFormat is CSV_FILE. The default value is ,.

toJobConfig.lineSeparator

No

String

Line feed character. This parameter is valid only when toJobConfig.outputFormat is CSV_FILE. The default value is \r\n.

toJobConfig.writeFileSize

No

String

Whether to fragment multiple files by size so that the files are exported in proper size. The unit is MB. This parameter is valid when the migration source is a database.

toJobConfig.duplicateFileOpType

No

Enumeration

Method for processing duplicate files. If the name and size of a file are the same as those of another file, the file is regarded as a duplicate file. Duplicate files can be processed in the following ways:
  • REPLACE: Replace duplicate files.
  • SKIP: Skip duplicate files.
  • ABANDON: Stop the job when any duplicate file is found.

toJobConfig.columnList

No

String

List of fields to be extracted. Use & to separate field names. For example, id&gid&name.

toJobConfig.encryption

No

Enumeration

Whether to encrypt the uploaded data and the encryption method. The options are as follows:
  • NONE: Directly write data without encryption.
  • KMS: Use KMS in Data Encryption Workshop (DEW) for encryption. If KMS encryption is enabled, MD5 verification for data cannot be performed.

toJobConfig.kmsID

No

String

Key used for encryption during data upload. You must create a key in KMS before data upload.

toJobConfig.projectID

No

String

ID of the project to which the KMS key belongs.

toJobConfig.writeToTempFile

No

Boolean

The binary file is written to a .tmp file first. After the migration is successful, run the rename or move command at the migration destination to restore the file.

toJobConfig.validateMD5

No

Boolean

Whether to verify the MD5 value. MD5 verification cannot be used together with KMS encryption. MD5 values can be verified only when files are transferred in binary format.

Calculate the MD5 value of the source file and verify it with the MD5 value returned by OBS. If an MD5 file exists on the source end, directly read the MD5 file and verify the MD5 file with the MD5 value returned by OBS.

toJobConfig.recordMD5Result

No

Boolean

Whether to record the verification result when the MD5 value is verified

toJobConfig.recordMD5Link

No

String

OBS link where the bucket to which the MD5 verification result is written resides

toJobConfig.recordMD5Bucket

No

String

OBS bucket to which the MD5 verification result is written

toJobConfig.recordMD5Directory

No

String

Directory to which the MD5 verification result is written

toJobConfig.encodeType

No

String

Encoding type. For example, UTF_8 or GBK.

toJobConfig.markerFile

No

String

Whether to generate a marker file with a custom name in the destination directory after a job is executed successfully. If you do not specify a file name, this function is disabled by default.

toJobConfig.copyContentType

No

Boolean

This parameter is displayed only when toJobConfig.outputFormat is BINARY_FILE and both the migration source and destination are object storage.

If you set this parameter to Yes, the Content-Type attribute of the source file is copied during object file migration. This function is mainly used for static website migration

The Content-Type attribute cannot be written to Archive buckets. Therefore, if you set this parameter to Yes, the migration destination must be a non-Archive bucket.

toJobConfig.quoteChar

No

Boolean

This parameter is available only when toJobConfig.outputFormat is CSV_FILE. It is used when database tables are migrated to file systems.

If you set this parameter to Yes and a field in the source data table contains a field delimiter or line separator, CDM uses double quotation marks (") as the quote character to quote the field content as a whole to prevent a field delimiter from dividing a field into two fields, or a line separator from dividing a field into different lines. For example, if the hello,world field in the database is quoted, it will be exported to the CSV file as a whole.

toJobConfig.firstRowAsHeader

No

Boolean

This parameter is available only when toJobConfig.outputFormat is CSV_FILE. When a table is migrated to a CSV file, CDM does not migrate the heading line of the table by default. If this parameter is set to Yes, CDM writes the heading line of the table to the file.