Example #1
0
    def get_source_provider(source_kind, source, config):
        # VERBOSE(source_kind)
        if source_kind == "azureblob":
            from cloudmesh.storage.provider.azureblob.Provider import \
                Provider as AzureblobProvider
            source_provider = AzureblobProvider(service=source, config=config)
        elif source_kind == "awss3":
            from cloudmesh.storage.provider.awss3.Provider import \
                Provider as AwsProvider
            source_provider = AwsProvider(service=source, config=config)
        elif source_kind == "oracle":
            from cloudmesh.oracle.storage.Provider import \
                Provider as OracleStorageProvider
            source_provider = OracleStorageProvider(service=source,
                                                    config=config)
        elif source_kind == "google":
            from cloudmesh.google.storage.Provider import \
                Provider as GoogleStorageProvider
            source_provider = GoogleStorageProvider(service=source,
                                                    config=config)
        else:
            return Console.error(f"Provider for {source_kind} is not "
                                 f"yet implemented.")

        return source_provider
Example #2
0
def setup(kind):
    config = "~/.cloudmesh/cloudmesh.yaml"
    if kind == "local":
        from cloudmesh.storage.provider.local.Provider import \
            Provider as LocalProvider
        provider = LocalProvider(service=kind)
    elif kind == "box":
        from cloudmesh.storage.provider.box.Provider import \
            Provider as BoxProvider
        provider = BoxProvider(service=kind)
    elif kind == "gdrive":
        from cloudmesh.storage.provider.gdrive.Provider import \
            Provider as GdriveProvider
        provider = GdriveProvider(service=kind)
    elif kind == "azureblob":
        from cloudmesh.storage.provider.azureblob.Provider import \
            Provider as AzureblobProvider
        provider = AzureblobProvider(service=kind)
    elif kind == "awss3":
        from cloudmesh.storage.provider.awss3.Provider import \
            Provider as AwsProvider

        provider = AwsProvider(service=kind)
    else:
        Console.error(f"Storage Provider is not supported: {kind}")
    return provider
Example #3
0
def setup(kind):
    config = "~/.cloudmesh/cloudmesh4.yaml"
    if kind == "local":
        provider = LocalProvider(service=kind, config=config)
    elif kind == "box":
        provider = BoxProvider(service=kind, config=config)
    elif kind == "gdrive":
        provider = GdriveProvider(service=kind, config=config)
    elif kind == "azureblob":
        provider = AzureblobProvider(service=kind, config=config)
    elif kind == "awss3":
        provider = AwsProvider(service=kind, config=config)
    return provider
    def __init__(self, service=None, config="~/.cloudmesh/cloudmesh4.yaml"):

        super(Provider, self).__init__(service=service, config=config)

        if self.kind == "local":
            self.provider = LocalProvider(service=service, config=config)
        elif self.kind == "box":
            self.provider = BoxProvider(service=service, config=config)
        elif self.kind == "gdrive":
            self.provider = GdriveProvider(service=service, config=config)
        elif self.kind == "azureblob":
            self.provider = AzureblobProvider(service=service, config=config)
        elif self.kind == "awss3":
            self.provider = AwsProvider(service=service, config=config)
        elif self.kind == "awsobjectstore":
            self.provider = AwsobjectstoreProvider(service=service,
                                                   config=config)
        else:
            raise ValueError(
                f"Storage provider '{self.kind}' not yet supported")
Example #5
0
    def __init__(self, service=None, config="~/.cloudmesh/cloudmesh4.yaml"):

        super(Provider, self).__init__(service=service, config=config)

        Console.error("PLEASE USE cloudmesh.storage.Provider")

        warnings.warn("deprecated: use cloudmesh.storage.Provider instead", DeprecationWarning)

        if self.kind == "local":
            self.provider = LocalProvider(service=service, config=config)
        elif self.kind == "box":
            self.provider = BoxProvider(service=service, config=config)
        elif self.kind == "gdrive":
            self.provider = GdriveProvider(service=service, config=config)
        elif self.kind == "azureblob":
            self.provider = AzureblobProvider(service=service, config=config)
        elif self.kind == "awss3":
            self.provider = AwsProvider(service=service, config=config)
        else:
            raise ValueError(f"Storage provider '{self.kind}' not yet supported")
Example #6
0
    def __init__(self, service=None, config="~/.cloudmesh/cloudmesh.yaml"):

        super(Provider, self).__init__(service=service, config=config)
        if self.kind == "local":
            from cloudmesh.storage.provider.local.Provider import \
                Provider as LocalProvider
            self.provider = LocalProvider(service=service, config=config)
        elif self.kind == "box":
            from cloudmesh.storage.provider.box.Provider import \
                Provider as BoxProvider
            self.provider = BoxProvider(service=service, config=config)
        elif self.kind == "gdrive":
            from cloudmesh.storage.provider.gdrive.Provider import \
                Provider as GdriveProvider
            self.provider = GdriveProvider(service=service, config=config)
        elif self.kind == "azureblob":
            from cloudmesh.storage.provider.azureblob.Provider import \
                Provider as AzureblobProvider
            self.provider = AzureblobProvider(service=service, config=config)
        elif self.kind == "awss3":
            from cloudmesh.storage.provider.awss3.Provider import \
                Provider as AwsProvider
            self.provider = AwsProvider(service=service, config=config)
        elif self.kind in ['google']:
            from cloudmesh.google.storage.Provider import \
                Provider as GoogleStorageProvider
            self.provider = GoogleStorageProvider(service=service,
                                                  config=config)
        elif self.kind in ['oracle']:
            from cloudmesh.oracle.storage.Provider import \
                Provider as OracleStorageProvider
            self.provider = \
                OracleStorageProvider(service=service, config=config)
        else:
            raise ValueError(
                f"Storage provider '{self.service}' not yet supported")