Skip to content

Plugin Operations

Summary

Warning

If a Plugin Operation is Required and is not present, the corresponding Delphix Engine Operation will fail when invoked. The plugin can still be built and uploaded to the Delphix Engine.

Warning

For each operation, the argument names must match exactly. For example, the Repository Discovery operation must have a single argument named source_connection.

Plugin Operation Required Decorator Delphix Engine Operations
Repository
Discovery
Yes discovery.repository() Environment Discovery
Environment Refresh
Source Config
Discovery
Yes discovery.source_config() Environment Discovery
Environment Refresh
Direct Linked Source
Pre-Snapshot
No linked.pre_snapshot() Linked Source Sync
Direct Linked Source
Post-Snapshot
Yes linked.post_snapshot() Linked Source Sync
Direct Linked Source
Source Size
No linked.source_size() N/A
Staged Linked Source
Pre-Snapshot
No linked.pre_snapshot() Linked Source Sync
Staged Linked Source
Post-Snapshot
Yes linked.post_snapshot() Linked Source Sync
Staged Linked Source
Start-Staging
No linked.start_staging() Linked Source Enable
Staged Linked Source
Stop-Staging
No linked.stop_staging() Linked Source Disable
Linked Source Delete
Staged Linked Source
Status
No linked.status() N/A
Staged Linked Source
Worker
No linked.worker() N/A
Staged Linked Source
Mount Specification
Yes linked.mount_specification() Linked Source Sync
Linked Source Enable
Staged Linked Source
Source Size
No linked.source_size() N/A
Virtual Source
Initialize
No virtual.initialize() Virtual Source Create Empty VDB
Virtual Source
Configure
Yes virtual.configure() Virtual Source Provision
Virtual Source Refresh
Virtual Source
Unconfigure
No virtual.unconfigure() Virtual Source Refresh
Virtual Source Delete
Virtual Source
Reconfigure
Yes virtual.reconfigure() Virtual Source Rollback
Virtual Source Enable
Virtual Source
Cleanup
No virtual.cleanup() Virtual Source Delete
Virtual Source
Start
No virtual.start() Virtual Source Start
Virtual Source
Stop
No virtual.stop() Virtual Source Stop
Virtual Source
Pre-Snapshot
No virtual.pre_snapshot() Virtual Source Snapshot
Virtual Source
Post-Snapshot
Yes virtual.post_snapshot() Virtual Source Snapshot
Virtual Source
Mount Specification
Yes virtual.mount_specification() Virtual Source Enable
Virtual Source Provision
Virtual Source Refresh
Virtual Source Rollback
Virtual Source Start
Virtual Source
Status
No virtual.status() Virtual Source Enable
Virtual Source
Source Size
No virtual.source_size() N/A
Repository Data Migration No upgrade.repository(migration_id) Upgrade
Source Config Data Migration No upgrade.source_config(migration_id) Upgrade
Linked Source Data Migration No upgrade.linked_source(migration_id) Upgrade
Virtual Source Data Migration No upgrade.virtual_source(migration_id) Upgrade
Snapshot Data Migration No upgrade.snapshot(migration_id) Upgrade

Repository Discovery

Discovers the set of repositories for a plugin on an environment. For a DBMS, this can correspond to the set of binaries installed on a Unix host.

Required / Optional

Required.

Delphix Engine Operations

Signature

def repository_discovery(source_connection)

Decorator

discovery.repository()

Arguments

Argument Type Description
source_connection RemoteConnection The connection associated with the remote environment to run repository discovery

Returns

A list of RepositoryDefinition objects.

Example

from dlpx.virtualization.platform import Plugin
from generated.defintions import RepositoryDefinition

plugin = Plugin()

@plugin.discovery.repository()
def repository_discovery(source_connection):
  # Initialize the object, filling in all required fields
  repository = RepositoryDefinition(installPath="/usr/bin/install")
  # Set any additional non-required properties
  repository.version = "1.2.3"
  # Return one single repository
  return [repository]

The above command assumes a Repository Schema defined as:

{
  "type": "object",
  "additionalProperties": false,
  "required": ["installPath"],
  "properties": {
    "installPath": { "type": "string" },
    "version": { "type": "string" }
  },
  "identityFields": ["installPath"],
  "nameField": ["installPath"]    
}

Source Config Discovery

Discovers the set of source configs for a plugin for a repository. For a DBMS, this can correspond to the set of unique databases running using a particular installation on a Unix host.

Required / Optional

Required.

Delphix Engine Operations

Signature

def source_config_discovery(source_connection, repository)

Decorator

discovery.source_config()

Arguments

Argument Type Description
source_connection RemoteConnection The connection to the remote environment the corresponds to the repository.
repository RepositoryDefinition The repository to discover source configs for.

Returns

A list of SourceConfigDefinition objects.

Example

from dlpx.virtualization.platform import Plugin
from generated.definitions import SourceConfigDefinition

plugin = Plugin()

@plugin.discovery.source_config()
def source_config_discovery(source_connection, repository):
  source_config = SourceConfigDefinition(name="my_name", port=1000)
  return [source_config]

The above command assumes a Source Config Schema defined as:

{
  "type": "object",
  "additionalProperties": false,
  "required": ["name"],
  "properties": {
    "name": { "type": "string" },
    "port": { "type": "number" }
  },
  "identityFields": ["name"],
  "nameField": ["name"]    
}

Direct Linked Source Pre-Snapshot

Sets up a dSource to ingest data. Only applies when using a Direct Linking strategy.

Required / Optional

Optional

Delphix Engine Operations

Signature

def linked_pre_snapshot(direct_source, repository, source_config, optional_snapshot_parameters)

Decorator

linked.pre_snapshot()

Arguments

Argument Type Description
direct_source DirectSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.
optional_snapshot_parameters SnapshotParametersDefinition The snapshot parameters. The value is None when executed during a snapshot policy.

Returns

None

Example

from dlpx.virtualization.platform import Plugin
from generated.definitions import SourceConfigDefinition

plugin = Plugin()

@plugin.linked.pre_snapshot()
def linked_pre_snapshot(direct_source, repository, source_config):
  pass

Direct Linked Source Post-Snapshot

Captures metadata from a dSource once data has been ingested. Only applies when using a Direct Linking strategy.

Required / Optional

Required.

Delphix Engine Operations

Signature

def linked_post_snapshot(direct_source, repository, source_config, optional_snapshot_parameters)

Decorator

linked.post_snapshot()

Arguments

Argument Type Description
direct_source DirectSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.
optional_snapshot_parameters SnapshotParametersDefinition The snapshot parameters. The value is None when executed during a snapshot policy.

Returns

SnapshotDefinition

Example

from dlpx.virtualization.platform import Plugin
from generated.definitions import SnapshotDefinition

plugin = Plugin()

@plugin.linked.post_snapshot()
def linked_post_snapshot(direct_source, repository, source_config, optional_snapshot_parameters):
  snapshot = SnapshotDefinition()
  snapshot.transaction_id = 1000
  return snapshot

The above command assumes a Snapshot Schema defined as:

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "transactionId": { "type": "integer" }
  }
}

Direct Linked Source Size

Determines the database size of a dSource once data has been ingested. Only applies when using a Direct Linking strategy.

Required / Optional

Optional.

Delphix Engine Operations

  • N/A

Signature

def linked_source_size(direct_source, repository, source_config)

Decorator

linked.source_size()

Arguments

Argument Type Description
direct_source DirectSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

Positive Numeric

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.linked.source_size()
def linked_source_size(direct_source, repository, source_config):
  database_size = 0
  # Implementation to fetch the database size.
  return database_size

Staged Linked Source Pre-Snapshot

Sets up a dSource to ingest data. Only applies when using a Staged Linking strategy.

Required / Optional

Optional.

Delphix Engine Operations

Signature

def linked_pre_snapshot(staged_source, repository, source_config, optional_snapshot_parameters)

Decorator

linked.pre_snapshot()

Arguments

Argument Type Description
staged_source StagedSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.
optional_snapshot_parameters SnapshotParametersDefinition The snapshot parameters. The value is None when executed during a snapshot policy.

Returns

None

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.linked.pre_snapshot()
def linked_pre_snapshot(staged_source, repository, source_config, optional_snapshot_parameters):
  pass

Staged Linked Source Post-Snapshot

Captures metadata from a dSource once data has been ingested. Only applies when using a Staged Linking strategy.

Required / Optional

Required.

Delphix Engine Operations

Signature

def linked_post_snapshot(staged_source, repository, source_config, optional_snapshot_parameters)

Decorator

linked.post_snapshot()

Arguments

Argument Type Description
staged_source StagedSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.
optional_snapshot_parameters SnapshotParametersDefinition The snapshot parameters. The value is None when executed during a snapshot policy.

Returns

SnapshotDefinition

Example

from dlpx.virtualization.platform import Plugin
from generated.definitions import SnapshotDefinition

plugin = Plugin()

@plugin.linked.post_snapshot()
def linked_post_snapshot(staged_source, repository, source_config, optional_snapshot_parameters):
  snapshot = SnapshotDefinition()
  if optional_snapshot_parameters is not None and optional_snapshot_parameters.resync:
    snapshot.transaction_id = 1000
  else:
    snapshot.transaction_id = 10
  return snapshot

The above command assumes a Snapshot Schema defined as:

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "transactionId": { "type": "integer" }
  }
}

Staged Linked Source Start-Staging

Sets up a Staging Source to ingest data. Only applies when using a Staged Linking strategy. Required to implement for Delphix Engine operations:

Required / Optional

Optional.

Delphix Engine Operations

Signature

def start_staging(staged_source, repository, source_config)

Decorator

linked.start_staging()

Arguments

Argument Type Description
staged_source StagedSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

None

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.linked.start_staging()
def start_staging(staged_source, repository, source_config):
  pass

Staged Linked Source Stop-Staging

Quiesces a Staging Source to pause ingestion. Only applies when using a Staged Linking strategy.

Required / Optional

Optional.

Delphix Engine Operations

Signature

def stop_staging(staged_source, repository, source_config)

Decorator

linked.stop_staging()

Arguments

Argument Type Description
staged_source StagedSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

None

Examples

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.linked.stop_staging()
def stop_staging(staged_source, repository, source_config):
  pass

Staged Linked Source Status

Determines the status of a Staging Source to show end users whether it is healthy or not. Only applies when using a Staged Linking strategy.

Required / Optional

Optional.
If not implemented, the platform assumes that the status is Status.ACTIVE

Delphix Engine Operations

N/A

Signature

def linked_status(staged_source, repository, source_config)

Decorator

linked.status()

Arguments

Argument Type Description
staged_source StagedSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

Status
Status.ACTIVE if the plugin operation is not implemented.

Example

from dlpx.virtualization.platform import Plugin
from dlpx.virtualization.platform import Status

plugin = Plugin()

@plugin.linked.status()
def linked_status(staged_source, repository, source_config):
  return Status.ACTIVE

Staged Linked Source Worker

Monitors the status of a Staging Source on a reqular interval. It can be used to fix up any errors on staging if it is not functioning as expected. Only applies when using a Staged Linking strategy.

Required / Optional

Optional.

Delphix Engine Operations

N/A

Signature

def worker(staged_source, repository, source_config)

Decorator

linked.worker()

Arguments

Argument Type Description
staged_source StagedSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

None

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.linked.worker()
def worker(staged_source, repository, source_config):
  pass

Staged Linked Source Mount Specification

Returns configurations for the mounts associated for data in staged source. The ownership_specification is optional. If not specified, the platform will default the ownership settings to the environment user used for the Delphix Operation.

Required / Optional

Required.

Delphix Engine Operations

Signature

def linked_mount_specification(staged_source, repository)

Decorator

linked.mount_specification()

Arguments

Argument Type Description
staged_source StagedSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.

Returns

MountSpecification

Example

Info

ownership_specification only applies to Unix hosts.

from dlpx.virtualization.platform import Plugin
from dlpx.virtualization.platform import Mount
from dlpx.virtualization.platform import MountSpecification
from dlpx.virtualization.platform import OwenershipSpecification
from generated.definitions import SnapshotDefinition

plugin = Plugin()

@plugin.linked.mount_specification()
def linked_mount_specification(staged_source, repository):
  mount = Mount(staged_source.staged_connection.environment, "/some/path")
  ownership_spec = OwenershipSpecification(repository.uid, repository.gid)

  return MountSpecification([mount], ownership_spec)

Staged Linked Source Size

Determines the database size of a Staging Source once data has been ingested. Only applies when using a Staged Linking strategy.

Required / Optional

Optional.

Delphix Engine Operations

  • N/A

Signature

def linked_source_size(staged_source, repository, source_config)

Decorator

linked.source_size()

Arguments

Argument Type Description
staged_source StagedSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

Positive Numeric

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.linked.source_size()
def linked_source_size(staged_source, repository, source_config):
  database_size = 0
  # Implementation to fetch the database size.
  return database_size

Virtual Source Initialize

Initializes a brand-new empty VDB. As with all VDBs, this new dataset will have access to mounted Delphix Engine storage, but of course there will be no data there at first.

The job of the plugin is to do whatever is necessary to set up a new dataset from scratch. For example, this might involve running a CREATE DATABASE command. This is an optional operation -- users will not be allowed to create empty VDBs for plugins that choose not to implement this operation.

As with the configure operation, this initialize operation must return source config parameters that represent the new dataset.

Required / Optional

Optional.

Delphix Engine Operations

Signature

def initialize(virtual_source, repository)

Decorator

virtual.initialize()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.

Returns

SourceConfigDefinition

Example

from dlpx.virtualization.platform import Plugin
from generated.defintions import SourceConfigDefinition

plugin = Plugin()

@plugin.virtual.initialize()
def initialize(virtual_source, repository):
  source_config = SourceConfigDefinition(name="config_name")
  return source_config

The above command assumes a SourceConfig Schema defined as:

{
  "type": "object",
  "required": ["name"],
  "additionalProperties": false,
  "properties": {
    "name": { "type": "string" }
  },
  "identityFields": ["name"],
  "nameField": ["name"]
}

Virtual Source Configure

Configures the data in a particular snapshot to be usable on a target environment. For database data files, this may mean recovering from a crash consistent format or backup. For application files, this may mean reconfiguring XML files or rewriting hostnames and symlinks.

Required / Optional

Required.

Delphix Engine Operations

Signature

def configure(virtual_source, snapshot, repository)

Decorator

virtual.configure()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
snapshot SnapshotDefinition The snapshot of the data set to configure.
repository RepositoryDefinition The repository associated with this source.

Returns

SourceConfigDefinition

Example

from dlpx.virtualization.platform import Plugin
from generated.defintions import SourceConfigDefinition

plugin = Plugin()

@plugin.virtual.configure()
def configure(virtual_source, repository, snapshot):
  source_config = SourceConfigDefinition(name="config_name")
  return source_config

The above command assumes a SourceConfig Schema defined as:

{
  "type": "object",
  "required": ["name"],
  "additionalProperties": false,
  "properties": {
    "name": { "type": "string" }
  },
  "identityFields": ["name"],
  "nameField": ["name"]
}

Virtual Source Unconfigure

Prepares for the removal of virtual source data from a target host. Depending on your dataset, this might involve unregistering this dataset from the DBMS, modifying/deleting config files on the remote host, etc.

It's important to clean up anything VDB-specific from the target host during this operation. For example, if you've stored such data in the scratch path, then you should delete it during unconfigure.

Required / Optional

Optional.

Delphix Engine Operations

Signature

def unconfigure(virtual_source, repository, source_config)

Decorator

virtual.unconfigure()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

None

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.virtual.unconfigure()
def unconfigure(virtual_source, repository, source_config):
  pass

Virtual Source Reconfigure

Re-configures the data for a virtual source to point to the data in a prior snapshot for the virtual source. For database data files, this may mean recovering from a crash consistent format or backup of a new snapshot. For application files, this may mean reconfiguring XML files or rewriting hostnames and symlinks.

Required / Optional

Required.

Delphix Engine Operations

Signature

def reconfigure(virtual_source, repository, source_config, snapshot)

Decorator

virtual.reconfigure()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
snapshot SnapshotDefinition The snapshot of the data set to configure.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

SourceConfigDefinition

Example

from dlpx.virtualization.platform import Plugin
from generated.definitions import SourceConfigDefinition

plugin = Plugin()

@plugin.virtual.reconfigure()
def reconfigure(virtual_source, repository, source_config, snapshot):
  return SourceConfigDefinition(name="updated_config_name")

The above command assumes a SourceConfig Schema defined as:

{
  "type": "object",
  "required": ["name"],
  "additionalProperties": false,
  "properties": {
    "name": { "type": "string" }
  },
  "identityFields": ["name"],
  "nameField": ["name"]
}

Virtual Source Cleanup

Intended to allow a final cleanup during a delete operation, unlike unconfigure which can be used to signal a temporary dissassociation with a database.

Cleanup is called during the delete flow after unconfigure.

Required / Optional

Optional.

Delphix Engine Operations

Signature

def cleanup(virtual_source, repository, source_config)

Decorator

virtual.cleanup()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

None

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.virtual.cleanup()
def cleanup(virtual_source, repository, source_config):
  pass

Virtual Source Start

Executed whenever the data should be placed in a "running" state.

Required / Optional

Optional.

Delphix Engine Operations

Signature

def start(virtual_source, repository, source_config)

Decorator

virtual.start()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

None

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.virtual.start()
def start(virtual_source, repository, source_config):
  pass

Virtual Source Stop

Executed whenever the data needs to be shut down. Required to implement for Delphix Engine operations:

Required / Optional

Optional.

Delphix Engine Operations

Signature

def stop(virtual_source, repository, source_config)

Decorator

virtual.stop()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

None

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.virtual.stop()
def stop(virtual_source, repository, source_config):
  pass

Virtual Source Pre-Snapshot

Prepares the virtual source for taking a snapshot of the data.

Required / Optional

Optional.

Delphix Engine Operations

Signature

def virtual_pre_snapshot(virtual_source, repository, source_config)

Decorator

virtual.pre_snapshot()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

None

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.virtual.pre_snapshot()
def virtual_pre_snapshot(virtual_source, repository, source_config):
  pass

Virtual Source Post-Snapshot

Captures metadata after a snapshot.

Required / Optional

Required.

Delphix Engine Operations

Signature

def virtual_post_snapshot(virtual_source, repository, source_config)

Decorator

virtual.post_snapshot()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

SnapshotDefinition

Example

from dlpx.virtualization.platform import Plugin
from generated.defintions import SnapshotDefinition

plugin = Plugin()

@plugin.virtual.post_snapshot()
def virtual_post_snapshot(virtual_source, repository, source_config):
  snapshot = SnapshotDefinition()
  snapshot.transaction_id = 1000
  return snapshot

The above command assumes a Snapshot Schema defined as:

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "transactionId": { "type": "string" }
  }
}

Virtual Source Mount Specification

Returns configurations for the mounts associated for data in virtual source. The ownership_specification is optional. If not specified, the platform will default the ownership settings to the environment user used for the Delphix Operation.

Required / Optional

Required.

Delphix Engine Operations

Signature

def virtual_mount_specification(virtual_source, repository)

Decorator

virtual.mount_specification()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.

Returns

MountSpecification

Example

Info

ownership_specification only applies to Unix hosts.

from dlpx.virtualization.platform import Plugin
from dlpx.virtualization.platform import Mount
from dlpx.virtualization.platform import MountSpecification
from dlpx.virtualization.platform import OwenershipSpecification
from generated.definitions import SnapshotDefinition

plugin = Plugin()

@plugin.virtual.mount_specification()
def virtual_mount_specification(virtual_source, repository):
  mount = Mount(virtual_source.connection.environment, "/some/path")
  ownership_spec = OwenershipSpecification(repository.uid, repository.gid)

  return MountSpecification([mount], ownership_spec)

Virtual Source Status

Determines the status of a Virtual Source to show end users whether it is healthy or not.

Required / Optional

Optional.
If not implemented, the platform assumes that the status is Status.ACTIVE.

Delphix Engine Operations

Signature

def virtual_status(virtual_source, repository, source_config)

Decorator

virtual.status()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

Status
Status.ACTIVE if the plugin operation is not implemented.

Example

from dlpx.virtualization.platform import Plugin
from dlpx.virtualization.platform import Status

plugin = Plugin()

@plugin.virtual.status()
def virtual_status(virtual_source, repository, source_config):
  return Status.ACTIVE

Virtual Source Size

Determines the database size of a Virtual Source once data has been ingested.

Required / Optional

Optional.

Delphix Engine Operations

  • N/A

Signature

def virtual_source_size(virtual_source, repository, source_config)

Decorator

virtual.source_size()

Arguments

Argument Type Description
virtual_source VirtualSource The source associated with this operation.
repository RepositoryDefinition The repository associated with this source.
source_config SourceConfigDefinition The source config associated with this source.

Returns

Positive Numeric

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.virtual.source_size()
def virtual_source_size(virtual_source, repository, source_config):
  database_size = 0
  # Implementation to fetch the database size.
  return database_size

Repository Data Migration

A Repository Data Migration migrates repository data from an older schema format to an updated schema format.

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(migration_id)

Decorator Arguments

Argument Type Description
migration_id String The ID of this migration. An ID is a string containing one or more positive integers separated by periods. Each ID must be unique. More details here.

Function Arguments

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

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("2019.12.15")
def add_new_flag_to_repo(old_repository):
  new_repository = dict(old_repository)
  new_repository["useNewFeature"] = False
  return new_repository

Source Config Data Migration

A Source Config Data Migration migrates source config data from an older schema format to an updated schema format.

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(migration_id)

Decorator Arguments

Argument Type Description
migration_id String The ID of this migration. An ID is a string containing one or more positive integers separated by periods. Each ID must be unique. More details here.

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("2019.12.15")
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

Linked Source Data Migration

A Linked Source Data Migration migrates linked source data from an older schema format to an updated schema format.

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(migration_id)

Decorator Arguments

Argument Type Description
migration_id String The ID of this migration. An ID is a string containing one or more positive integers separated by periods. Each ID must be unique. More details here.

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("2019.12.15")
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

Virtual Source Data Migration

A Virtual Source Data Migration migrates virtual source data from an older schema format to an updated schema format.

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(migration_id)

Decorator Arguments

Argument Type Description
migration_id String The ID of this migration. An ID is a string containing one or more positive integers separated by periods. Each ID must be unique. More details here.

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("2019.12.15")
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

Snapshot Data Migration

A Snapshot Data Migration migrates snapshot data from an older schema format to an updated schema format.

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(migration_id)

Decorator Arguments

Argument Type Description
migration_id String The ID of this migration. An ID is a string containing one or more positive integers separated by periods. Each ID must be unique. More details here.

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("2019.12.15")
def add_new_flag_to_snapshot(old_snapshot):
  new_snapshot = dict(old_snapshot)
  new_snapshot["useNewFeature"] = False
  return new_snapshot