Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / migrate_plus / migrate_example_advanced / config / install / migrate_plus.migration.wine_role_json.yml
1 # This migration demonstrates importing from a monolithic JSON file.
2 id: wine_role_json
3 label: JSON feed of roles (positions)
4 migration_group: wine
5 migration_tags:
6   - advanced example
7 source:
8   # We use the JSON source plugin.
9   plugin: url
10   data_fetcher_plugin: http
11   data_parser_plugin: json
12   # The data_parser normally limits the fields passed on to the source plugin
13   # to fields configured to be used as part of the migration. To support more
14   # dynamic migrations, the JSON data parser supports including the original
15   # data for the current row. Simply include the 'include_raw_data' flag set
16   # to `true` to enable this. This option is disabled by default to minimize
17   # memory footprint for migrations that do not need this capability.
18   # include_raw_data: true
19   # Normally, this is one or more fully-qualified URLs or file paths. Because
20   # we can't hardcode your local URL, we provide a relative path here which
21   # hook_install() will rewrite to a full URL for the current site.
22   urls:
23     - /migrate_example_advanced_position?_format=json
24   # An xpath-like selector corresponding to the items to be imported.
25   item_selector: position
26   # Under 'fields', we list the data items to be imported. The first level keys
27   # are the source field names we want to populate (the names to be used as
28   # sources in the process configuration below). For each field we're importing,
29   # we provide a label (optional - this is for display in migration tools) and
30   # an xpath for retrieving that value. It's important to note that this xpath
31   # is relative to the elements retrieved by item_selector.
32   fields:
33     -
34       name: machine_name
35       label: 'Unique position identifier'
36       selector: sourceid
37     -
38       name: friendly_name
39       label: 'Position name'
40       selector: name
41   # Under 'ids', we identify source fields populated above which will uniquely
42   # identify each imported item. The 'type' makes sure the migration map table
43   # uses the proper schema type for stored the IDs.
44   ids:
45     machine_name:
46       type: string
47 process:
48   # Note that the source field names here (machine_name and friendly_name) were
49   # defined by the 'fields' configuration for the source plugin above.
50   id: machine_name
51   label: friendly_name
52 destination:
53   plugin: entity:user_role
54 migration_dependencies: {}
55 dependencies:
56   enforced:
57     module:
58       - migrate_example_advanced