6.14 Import
The Import definitions and their example are shown below. For details about Import, see “Importing custom table records”.
| Label | Default value | Required* | Description | ||
|---|---|---|---|---|---|
| apiVersion: | Yes | API version Specify 1.0. |
|||
| kind: | Yes | Specify "import". | |||
| type: | No | Specify "resource". It indicates a new definition to be added to the operational function of Ops I. |
|||
| name: | Yes | Internal name of the Catalog definition. "name" should follow the conventions shown below:
|
|||
| label: | Yes | Display name of the operational function to be written in the YAML file | |||
| description: | No | Detailed description of this YAML file | |||
| includes: | No | List the related YAML files for use in this YAML file.
Tips
|
|||
| - kind: | Yes | Type of YAML file to be loaded | |||
| name: | Yes | Internal name of YAML file to be loaded | |||
| targetTable: | Yes | Table name of the custom table to import The following characters are allowed:
|
|||
| columnMappings: | Yes | Mapping columns between the CSV file to be uploaded and the custom table If inheriting from another table, define the parent table's fields here as well. For the default columns of the custom table, you can specify "id", "created_on", "updated_on", "created_by", "updated_by", and "sys_customer". |
|||
| - source: | Yes | Column names in the CSV file to be uploaded The following characters are allowed:
|
|||
| target: | Yes | Table name of the custom table The following characters are allowed:
|
|||
| coalesce: | false | No | Setting of the column identifiers for the CSV file to be uploaded This is set to determine whether to update existing records or create new ones. If a record in the custom table has the same value as the column set as the identifier in the CSV file, that record is updated; if not, a new record is created in the custom table.
|
||
| validation: | No | Specify validation check. | |||
| - format: | No | Specify "regex". | |||
| pattern: | No | Validation check format Example: "^[A-Z0-9-]+$" |
|||
<Definition example>
apiVersion: 1.0
kind: import
## Meta data
type: resource
name: vm_import_definition
label: vm_import_definition
description: Import definition for the VM lending ledger table / Import definition for the VM lending ledger table
## Include datamodel
## Include the datamodel manifest.
includes:
- kind: datamodel
name: rent_vm_datamodel
## Specify table name
## specify the table name
targetTable: rent_vm_table
## Field mapping
## mappings for the fields
columnMappings:
- source: "number"
target: "app_number"
validation:
format: regex
pattern: "^[A-Z0-9-]+$"
- source: "name"
target: "vm_name"
coalesce: true
- source: "start"
target: "start_date"
- source: "end"
target: "end_date"
Tips