Skip to content

Plugin Operations

Warning

If a Plugin Operations 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
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
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
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

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):  
  repository = RepositoryDefinition()
  repository.installPath = "/usr/bin/install"
  repository.version = "1.2.3"
  return [repository]

The above command assumes a Repository Schema defined as:

{
  "type": "object",
  "additionalProperties": false,
  "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()
  source_config.name = "my_name"
  source_config.port = 10000
  return [source_config]

The above command assumes a Source Config Schema defined as:

{
  "type": "object",
  "additionalProperties": false,
  "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)

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.

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)

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.

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):
  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" }
  }
}

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, 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.
snapshot_parameters SnapshotParametersDefinition The snapshot parameters.

Returns

None

Example

from dlpx.virtualization.platform import Plugin

plugin = Plugin()

@plugin.linked.pre_snapshot()
def linked_pre_snapshot(staged_source, repository, source_config, 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, 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.
snapshot_parameters SnapshotParametersDefinition The snapshot parameters.

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, snapshot_parameters):
  snapshot = SnapshotDefinition()
  if 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)

The above command assumes a Repository Schema defined as:

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "uid": { "type": "integer" },
    "gid": { "type": "integer" }
  }
}

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):
  name = "config_name"
  source_config = SourceConfigDefinition()
  source_config.name = 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

Quiesces the virtual source on a target environment. For database data files, shutting down and unregistering a database on a host.

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 configure(virtual_source, repository, source_config, snapshot):
  name = "updated_config_name"
  source_config = SourceConfigDefinition()
  source_config.name = 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 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)

The above command assumes a Repository Schema defined as:

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "uid": { "type": "integer" },
    "gid": { "type": "integer" }
  }
}

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