#
# Copyright (c) 2019 by Delphix. All rights reserved.
#
# flake8: noqa
from __future__ import print_function

import logging

from dlpx.virtualization.platform import Plugin

logger = logging.getLogger()
logger.setLevel(logging.NOTSET)

staged = Plugin()


# Renamed source_connection to connection to test if named arg check detects.
@staged.discovery.repository()
def repository_discovery(connection):
    return []


@staged.discovery.source_config()
def source_config_discovery(source_connection, repository):
    return []


@staged.linked.mount_specification()
def staged_mount_specification(staged_source, repository):
    return None
示例#2
0
#
# Copyright (c) 2021 by Delphix. All rights reserved.
#

from dlpx.virtualization.platform import Mount, MountSpecification, Plugin
from operations import discovery, restore, provision, postSnapshot, enable, disable, start, stop, status

from generated.definitions import (
    RepositoryDefinition,
    SourceConfigDefinition,
    SnapshotDefinition,
)

plugin = Plugin()


#
# Below is an example of the repository discovery operation.
#
# NOTE: The decorators are defined on the 'plugin' object created above.
#
# Mark the function below as the operation that does repository discovery.
@plugin.discovery.repository()
def repository_discovery(source_connection):
    #
    # This is an object generated from the repositoryDefinition schema.
    # In order to use it locally you must run the 'build -g' command provided
    # by the SDK tools from the plugin's root directory.
    #

    return discovery.find_repos(source_connection)
#
# Copyright (c) 2019 by Delphix. All rights reserved.
#
# flake8: noqa
from dlpx.virtualization.platform import Plugin, Status

vfiles = Plugin()


@vfiles.discovery.repository()
def repository_discovery(source_connection):
    return []


@vfiles.discovery.source_config()
def source_config_discovery(source_connection, repository):
    return []


@vfiles.linked.pre_snapshot()
def direct_pre_snapshot(direct_source, repository, source_config):
    return


@vfiles.linked.post_snapshot()
def direct_post_snapshot(direct_source, repository, source_config):
    return None


@vfiles.virtual.configure()
def configure(virtual_source, repository, snapshot):
示例#4
0
#
# Copyright (c) 2019 by Delphix. All rights reserved.
#
# flake8: noqa
from dlpx.virtualization.platform import Plugin, Status

direct = Plugin()


@direct.discovery.repository()
def repository_discovery(source_connection):
    return []


@direct.discovery.source_config()
def source_config_discovery(source_connection, repository):
    return []


@direct.linked.pre_snapshot()
def direct_pre_snapshot(direct_source, repository, source_config):
    return


@direct.linked.post_snapshot()
def direct_post_snapshot(direct_source, repository, source_config):
    return None


@direct.virtual.configure()
def configure(virtual_source, repository, snapshot):
示例#5
0
 def my_plugin():
     from dlpx.virtualization.platform import Plugin
     yield Plugin()