Classes¶
DirectSource¶
Represents a Linked Source object and its properties when using a Direct Linking strategy.
from dlpx.virtualization.platform import DirectSource
direct_source = DirectSource(guid, connection, parameters)
Fields¶
| Field | Type | Description |
|---|---|---|
| guid | String | Unique Identifier for the source. |
| connection | RemoteConnection | Connection for the source environment. |
| parameters | LinkedSourceDefinition | User input as per the LinkedSource Schema. |
StagedSource¶
Represents a Linked Source object and its properties when using a Staged Linking strategy.
from dlpx.virtualization.platform import StagedSource
staged_source = StagedSource(guid, source_connection, parameters, mount, staged_connection, mounts)
Fields¶
| Field | Type | Description |
|---|---|---|
| guid | String | Unique Identifier for the source. |
| source_connection | RemoteConnection | Connection for the source environment. |
| parameters | LinkedSourceDefinition | User input as per the LinkedSource Schema. |
| mount | Mount | Mount point associated with the source. |
| staged_connection | RemoteConnection | Connection for the staging environment. |
| mounts | list[Mount] | Mount points associated with the source. |
mount vs mounts
Both mount and mounts will not be present in the StagedSource object. Fields are populated based on number of mountSpecification object provided from linked_mount_specification decorator.
- When only one mountSpecification object is provided,
mountwill be present.- When more than one mountSpecification object is provided,
mountswill be present.
VirtualSource¶
Represents a Virtual Source object and its properties.
from dlpx.virtualization.platform import VirtualSource
virtual_source = VirtualSource(guid, connection, parameters, mounts)
Fields¶
| Field | Type | Description |
|---|---|---|
| guid | String | Unique Identifier for the source. |
| connection | RemoteConnection | Connection for the source environment. |
| parameters | VirtualSourceDefinition | User input as per the VirtualSource Schema. |
| mounts | list[Mount] | Mount points associated with the source. |
RemoteConnection¶
Represents a connection to a source.
from dlpx.virtualization.common import RemoteConnection
connection = RemoteConnection(environment, user)
Fields¶
| Field | Type | Description |
|---|---|---|
| environment | RemoteEnvironment | Environment for the connection. |
| user | RemoteUser | User for the connection. |
Status¶
An enum used to represent the state of a linked or virtual source and whether it is functioning as expected.
Values¶
| Value | Description |
|---|---|
| ACTIVE | Source is healthy and functioning as expected. |
| INACTIVE | Source is not functioning as expected. |
Mount¶
Represents a mount exported and mounted to a remote host.
Fields¶
| Field | Type | Description |
|---|---|---|
| remote_environment | RemoteEnvironment or Reference | Environment for the connection. |
| mount_path | String | The path on the remote host that has the mounted data set. |
| shared_path | String | Optional. The path of the subdirectory of the data set to mount to the remote host. |
OwnershipSpecification¶
Represents how to set the ownership for a data set. This only applies to Unix Hosts.
from dlpx.virtualization.platform import OwnershipSpecification
ownership_specification = OwnershipSpecification(uid, gid)
Fields¶
| Field | Type | Description |
|---|---|---|
| uid | Integer | The user id to set the ownership of the data set to. |
| gid | Integer | The group id to set the ownership of the data set to. |
MountSpecification¶
Represents properties for the mount associated with an exported data set.
from dlpx.virtualization.platform import MountSpecification
mount_specification = MountSpecification([mount], ownership_specification)
Fields¶
| Field | Type | Description |
|---|---|---|
| mounts | list[Mount] | The list of mounts to export the data sets to. |
| ownership_specification | OwnershipSpecification | Optional. Control the ownership attributes for the data set. It defaults to the environment user of the remote environment if it is not specified. |
RemoteEnvironment¶
Represents a remote environment.
from dlpx.virtualization.common import RemoteEnvironment
environment = RemoteEnvironment(name, reference, host)
Fields¶
| Field | Type | Description |
|---|---|---|
| name | String | Name of the environment. |
| reference | String | Unique identifier for the environment. |
| host | RemoteHost | Host that belongs to the environment. |
RemoteHost¶
Represents a remote host, can be Unix or Windows.
from dlpx.virtualization.common import RemoteHost
host = RemoteHost(name, reference, binary_path, scratch_path)
Fields¶
| Field | Type | Description |
|---|---|---|
| name | String | Host address. |
| reference | String | Unique identifier for the host. |
| binary_path | String | Path to Delphix provided binaries on the host, which are present in the toolkit pushed to the remote host like dlpx_db_exec, dlpx_pfexec, etc. This property is only available for Unix hosts. |
| scratch_path | String | Path to scratch area on the host. See details here. |
RemoteUser¶
Represents a user on a remote host.
Fields¶
| Field | Type | Description |
|---|---|---|
| name | String | User name. |
| reference | String | Unique identifier for the user. |
Credentials¶
Abstract class representing credentials that include a user name. Instances of this class are returned by the retrieve_credentials library call.
from dlpx.virtualization import libs
from dlpx.virtualization.common import Credentials
from dlpx.virtualization.platform import Plugin
plugin = Plugin()
@plugin.virtual.stop()
def my_virtual_stop(virtual_source, repository, source_config):
credentials = libs.retrieve_credentials(virtual_source.parameters.credentials_supplier)
assert isinstance(credentials, Credentials)
environment_vars = {
"DATABASE_USERNAME" : credentials.username
}
...
Fields¶
| Field | Type | Description |
|---|---|---|
| username | String | User name. Empty string if not present. |
KeyPairCredentials¶
Concrete subclass of Credentials that represents key-pair credentials. Instances of this class may returned by the retrieve_credentials library call.
from dlpx.virtualization import libs
from dlpx.virtualization.common import KeyPairCredentials
from dlpx.virtualization.platform import Plugin
plugin = Plugin()
@plugin.virtual.stop()
def my_virtual_stop(virtual_source, repository, source_config):
credentials = libs.retrieve_credentials(virtual_source.parameters.key_pair_supplier)
assert isinstance(credentials, KeyPairCredentials)
environment_vars = {
"DATABASE_USERNAME" : credentials.username,
"DATABASE_PRIVATE_KEY" : credentials.private_key,
"DATABASE_PUBLIC_KEY" : credentials.public_key
}
...
Fields¶
| Field | Type | Description |
|---|---|---|
| username | String | User name. Empty string if not present. |
| private_key | String | Private key. |
| public_key | String | Public key corresponding to private key. Empty string if not present. |
PasswordCredentials¶
Concrete subclass of Credentials that represents password credentials. Instances of this class may returned by the retrieve_credentials library call.
from dlpx.virtualization import libs
from dlpx.virtualization.common import PasswordCredentials
from dlpx.virtualization.platform import Plugin
plugin = Plugin()
@plugin.virtual.stop()
def my_virtual_stop(virtual_source, repository, source_config):
credentials = libs.retrieve_credentials(virtual_source.parameters.password_supplier)
assert isinstance(credentials, PasswordCredentials)
environment_vars = {
"DATABASE_USERNAME" : credentials.username,
"DATABASE_PASSWORD" : credentials.password
}
...
Fields¶
| Field | Type | Description |
|---|---|---|
| username | String | User name. Empty string if not present. |
| password | String | Password. |