Skip to content

Plugin Operations

Summary

Included below are all plugin operations that have to do with lua migrations. For regular operation information go here.

Plugin Operation Required Decorator Delphix Engine Operations
Lua Repository Data Migration No upgrade.repository(lua_version, MigrationType.LUA) Upgrade
Lua Source Config Data Migration No upgrade.source_config(lua_version, MigrationType.LUA) Upgrade
Lua Linked Source Data Migration No upgrade.linked_source(lua_version, MigrationType.LUA) Upgrade
Lua Virtual Source Data Migration No upgrade.virtual_source(lua_version, MigrationType.LUA) Upgrade
Lua Snapshot Data Migration No upgrade.snapshot(lua_version, MigrationType.LUA) Upgrade

Lua Repository Data Migration

A Lua Repository Data Migration migrates repository data from an older schema format defined originally from a lua toolkit to an updated schema format defined in the Python plugin.

Required / Optional

Optional.

Warning

You must ensure that all repository data will match your updated repository schema after an upgrade operation. Depending on how your schema has changed, this might imply that you need to write one or more repository data migrations.

Delphix Engine Operations

Signature

def migrate_repository(old_repository)

Decorator

upgrade.repository(lua_version, MigrationType.LUA)

Decorator Arguments

Argument Type Description
lua_version String The lua version of the migration that the upgrade would be migrating from. This is the ID of this migration. The version here is actually just the major and minor version of the lua toolkit therefore each defined migration's lua_version per repository data migration must be unique.
migration_type String This migration type field indicates whether the operation is lua or just a regular data migration. Signify this as LUA so that the major minor version can be used. If not defined, this operation will default to a regular repository data migration.

Function Arguments

Argument Type Description
old_repository Dictionary The plugin-specific data associated with a repository, that conforms to the previous schema defined in lua.

Warning

The function argument old_repository is a Python dictionary, where each property name appears exactly as described in the previous repository schema. This differs from non-upgrade-related operations, where the function arguments are autogenerated classes based on the schema.

Returns

Dictionary
A migrated version of the old_repository input that must conform to the updated repository schema.

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.upgrade.repository("1.1", MigrationType.LUA)
def add_new_flag_to_repo(old_repository):
  new_repository = dict(old_repository)
  new_repository["useNewFeature"] = False
  return new_repository

Lua Source Config Data Migration

A Lua Source Config Data Migration migrates source config data from an older schema format defined originally from a lua toolkit to an updated schema format defined in the Python plugin.

Required / Optional

Optional.

Warning

You must ensure that all source config data will match your source config schema after an upgrade operation. Depending on how your schema has changed, this might imply that you need to write one or more source config data migrations.

Delphix Engine Operations

Signature

def migrate_source_config(old_source_config)

Decorator

upgrade.source_config(lua_version, MigrationType.LUA)

Decorator Arguments

Argument Type Description
lua_version String The lua version of the migration that the upgrade would be migrating from. This is the ID of this migration. The version here is actually just the major and minor version of the lua toolkit therefore each defined migration's lua_version per source config data migration must be unique.
migration_type String This migration type field indicates whether the operation is lua or just a regular data migration. Signify this as LUA so that the major minor version can be used. If not defined, this operation will default to a regular source config data migration.

Function Arguments

Argument Type Description
old_source_config Dictionary The plugin-specific data associated with a source config, that conforms to the previous schema.

Warning

The function argument old_source_config is a Python dictionary, where each property name appears exactly as described in the previous source config schema. This differs from non-upgrade-related operations, where the function arguments are autogenerated classes based on the schema.

Returns

Dictionary
A migrated version of the old_source_config input that must conform to the updated source config schema.

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.upgrade.source_config("1.1", MigrationType.LUA)
def add_new_flag_to_source_config(old_source_config):
  new_source_config = dict(old_source_config)
  new_source_config["useNewFeature"] = False
  return new_source_config

Lua Linked Source Data Migration

A Lua Linked Source Data Migration migrates linked source data from an older schema format defined originally from a lua toolkit to an updated schema format defined in the Python plugin.

Required / Optional

Optional.

Warning

You must ensure that all linked source data will match your linked source schema after an upgrade operation. Depending on how your schema has changed, this might imply that you need to write one or more linked source data migrations.

Delphix Engine Operations

Signature

def migrate_linked_source(old_linked_source)

Decorator

upgrade.linked_source(lua_version, MigrationType.LUA)

Decorator Arguments

Argument Type Description
lua_version String The lua version of the migration that the upgrade would be migrating from. This is the ID of this migration. The version here is actually just the major and minor version of the lua toolkit therefore each defined migration's lua_version per linked source data migration must be unique.
migration_type String This migration type field indicates whether the operation is lua or just a regular data migration. Signify this as LUA so that the major minor version can be used. If not defined, this operation will default to a regular linked source data migration.

Function Arguments

Argument Type Description
old_linked_source Dictionary The plugin-specific data associated with a linked source, that conforms to the previous schema.

Warning

The function argument old_linked_source is a Python dictionary, where each property name appears exactly as described in the previous linked source schema. This differs from non-upgrade-related operations, where the function arguments are autogenerated classes based on the schema.

Returns

Dictionary
A migrated version of the old_linked_source input that must conform to the updated linked source schema.

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.upgrade.linked_source("1.1", MigrationType.LUA)
def add_new_flag_to_dsource(old_linked_source):
  new_linked_source = dict(old_linked_source)
  new_linked_source["useNewFeature"] = False
  return new_linked_source

Lua Virtual Source Data Migration

A Lua Virtual Source Data Migration migrates virtual source data from an older schema format defined originally from a lua toolkit to an updated schema format defined in the Python plugin.

Required / Optional

Optional.

Warning

You must ensure that all virtual source data will match your virtual source schema after an upgrade operation. Depending on how your schema has changed, this might imply that you need to write one or more virtual source data migrations.

Delphix Engine Operations

Signature

def migrate_virtual_source(old_virtual_source)

Decorator

upgrade.virtual_source(lua_version, MigrationType.LUA)

Decorator Arguments

Argument Type Description
lua_version String The lua version of the migration that the upgrade would be migrating from. This is the ID of this migration. The version here is actually just the major and minor version of the lua toolkit therefore each defined migration's lua_version per virtual source data migration must be unique.
migration_type String This migration type field indicates whether the operation is lua or just a regular data migration. Signify this as LUA so that the major minor version can be used. If not defined, this operation will default to a regular virtual source data migration.

Function Arguments

Argument Type Description
old_virtual_source Dictionary The plugin-specific data associated with a virtual source, that conforms to the previous schema.

Warning

The function argument old_virtual_source is a Python dictionary, where each property name appears exactly as described in the previous virtual source schema. This differs from non-upgrade-related operations, where the function arguments are autogenerated classes based on the schema.

Returns

Dictionary
A migrated version of the old_virtual_source input that must conform to the updated virtual source schema.

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.upgrade.virtual_source("1.1", MigrationType.LUA)
def add_new_flag_to_vdb(old_virtual_source):
  new_virtual_source = dict(old_virtual_source)
  new_virtual_source["useNewFeature"] = False
  return new_virtual_source

Lua Snapshot Data Migration

A Lua Snapshot Data Migration migrates snapshot data from an older schema format defined originally from a lua toolkit to an updated schema format defined in the Python plugin.

Required / Optional

Optional.

Warning

You must ensure that all snapshot data will match your snapshot schema after an upgrade operation. Depending on how your schema has changed, this might imply that you need to write one or more snapshot migrations.

Delphix Engine Operations

Signature

def migrate_snapshot(old_snapshot)

Decorator

upgrade.snapshot(lua_version, MigrationType.LUA)

Decorator Arguments

Argument Type Description
lua_version String The lua version of the migration that the upgrade would be migrating from. This is the ID of this migration. The version here is actually just the major and minor version of the lua toolkit therefore each defined migration's lua_version per snapshot data migration must be unique.
migration_type String This migration type field indicates whether the operation is lua or just a regular data migration. Signify this as LUA so that the major minor version can be used. If not defined, this operation will default to a regular snapshot data migration.

Function Arguments

Argument Type Description
old_snapshot Dictionary The plugin-specific data associated with a snapshot, that conforms to the previous schema.

Warning

The function argument old_snapshot is a Python dictionary, where each property name appears exactly as described in the previous snapshot schema. This differs from non-upgrade-related operations, where the function arguments are autogenerated classes based on the schema.

Returns

Dictionary
A migrated version of the old_snapshot input that must conform to the updated snapshot schema.

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.upgrade.snapshot("1.1", MigrationType.LUA)
def add_new_flag_to_snapshot(old_snapshot):
  new_snapshot = dict(old_snapshot)
  new_snapshot["useNewFeature"] = False
  return new_snapshot