rbd_from_configuration, DEFAULT_CLUSTER_NAME, DEFAULT_USER_ID, DEFAULT_CEPF_CONF_PATH, DEFAULT_STORAGE_POOL ) def api_factory(cluster_id, test_case=None, **kwargs): cluster_name = DEFAULT_CLUSTER_NAME if "cluster_name" in kwargs: cluster_name = kwargs["cluster_name"] user_id = DEFAULT_USER_ID if "user_id" in kwargs: user_id = kwargs["user_id"] ceph_conf_path = DEFAULT_CEPF_CONF_PATH if "ceph_conf_path" in kwargs: ceph_conf_path = kwargs["ceph_conf_path"] storage_pool = DEFAULT_STORAGE_POOL if "storage_pool" in kwargs: storage_pool= kwargs["storage_pool"] return rbd_from_configuration(cluster_name=cluster_name, user_id=user_id, ceph_conf_path=ceph_conf_path, storage_pool=storage_pool) FLOCKER_BACKEND = BackendDescription( name=u"ceph_flocker_driver", needs_reactor=False, needs_cluster_id=True, api_factory=api_factory, deployer_type=DeployerType.block)
from twisted.python.filepath import FilePath from flocker.node import BackendDescription, DeployerType from flocker.node.agents.loopback import LoopbackBlockDeviceAPI DUMMY_API = LoopbackBlockDeviceAPI(FilePath(b"/tmp/foo"), u"") def api_factory(cluster_id, **kwargs): """ Factory for ``IBlockDeviceAPI``. :return: ``LoopbackBlockDeviceAPI`` instance. """ # We get custom arguments from /etc/flocker/agent.yml's backend # section: if kwargs != {"custom": u"arguments!"}: raise AssertionError("Didn't get correct arguments passed in") # A real implementation would create new IBlockDeviceAPI and return it # here, based on the given arguments: return DUMMY_API # The backend provided by this plugin: FLOCKER_BACKEND = BackendDescription( name=u"dummybackend", # Not actually used for 3rd party plugins needs_reactor=False, needs_cluster_id=True, api_factory=api_factory, deployer_type=DeployerType.block)
from flocker.node import BackendDescription, DeployerType from eqlx_flocker_plugin.eqlx import EqlxBlockDeviceAPI def api_factory(cluster_id, **kwargs): return EqlxBlockDeviceAPI( cluster_id=cluster_id, username=kwargs[u"username"], password=kwargs[u"password"], eqlx_ip=kwargs["eqlx_ip"], compute_instance_id=kwargs[u'compute_instance_id']) FLOCKER_BACKEND = BackendDescription( name=u'eqlx_flocker_plugin', needs_reactor=False, needs_cluster_id=True, api_factory=api_factory, #required_config={"username","password", "eqlx_ip"}, deployer_type=DeployerType.block)
if 'hosts' in kwargs: hosts = kwargs['hosts'] dbhost = 'localhost' if 'database' in kwargs: dbhost = kwargs['database'] lock_path = '/tmp' if 'lockdir' in kwargs: lock_path = kwargs['lockdir'] log_file = None if 'logfile' in kwargs: log_file = kwargs['logfile'] return vmax_from_configuration(cluster_id=cluster_id, protocol=protocol, hosts=hosts, dbhost=dbhost, lock_path=lock_path, log_file=log_file) FLOCKER_BACKEND = BackendDescription( name= u"emc_vmax_flocker_plugin", # name isn't actually used for 3rd party plugins needs_reactor=False, needs_cluster_id=True, api_factory=api_factory, deployer_type=DeployerType.block)
from flocker.node import BackendDescription, DeployerType from sspd_flocker_driver.sspd_blockdevice import sspd_flocker_api_setup def api_factory(**kwargs): ''' Current Assumptions: 1. Node can't be configured with more then one LUN on Array. 2. LUN's WWN needs to be provided with configuration of Flocker 3. Create of Volume is validation of LD Exists on Array and then discover and login to iSCSI. 4. Delete of Volume is validation of LD Exists and Disconnect iSCSI. ''' return sspd_flocker_api_setup(sspdMgnHost=kwargs['sspdMgnHost'], sspdMgnUser=kwargs['sspdUser'], sspdMgnPassword=kwargs['sspdPassword'], sspdDataHost=kwargs['sspdDataHost'], sspdDeviceName=kwargs['sspdDeviceName'], ssdpDeviceWWN=kwargs['sspdDeviceWWN']) FLOCKER_BACKEND = BackendDescription(name=u"saratoga_speed_flocker_plugin", needs_reactor=False, needs_cluster_id=False, api_factory=api_factory, deployer_type=DeployerType.block)
# You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ############################################################################## from flocker.node import BackendDescription, DeployerType from ibm_storage_flocker_driver.ibm_storage_blockdevice import ( get_ibm_storage_backend_by_conf, ) from ibm_storage_flocker_driver.lib.constants import \ MANDATORY_CONFIGURATIONS_IN_YML_FILE def api_factory(cluster_id, **kwargs): return get_ibm_storage_backend_by_conf(cluster_id, kwargs) FLOCKER_BACKEND = BackendDescription( name=u"ibm_storage_flocker_driver", needs_reactor=False, needs_cluster_id=True, required_config=MANDATORY_CONFIGURATIONS_IN_YML_FILE, api_factory=api_factory, deployer_type=DeployerType.block, )