Пример #1
0
def storage_set_object_tags(path, tags, version):
    """ Sets tags for a specified object
        - path - full path to an object in data storage starting with 'cp://' scheme
        - tags - specified as single KEY=VALUE pair or a list of them
        - If a specific tag key already exists for an object - it will be overwritten
    """
    DataStorageOperations.set_object_tags(path, tags, version)
Пример #2
0
def update_policy(name, short_term_storage, long_term_storage, versioning, backup_duration):
    """Update the policy of the given datastorage
    """
    if not backup_duration and versioning:
        backup_duration = click.prompt(
            "How many days backups of the bucket will be stored? (Empty means deletion of the current rule)",
            default="")
    DataStorageOperations.policy(name, short_term_storage, long_term_storage, backup_duration, versioning)
Пример #3
0
def storage_delete_object_tags(path, tags, version):
    """ Sets tags for a specified object
        - path - full path to an object in data storage starting with 'cp://' scheme
        - tags - list of tags to delete
    """
    DataStorageOperations.delete_object_tags(path, tags, version)
Пример #4
0
def storage_get_object_tags(path, version):
    """ Gets tags for a specified object
        - path - full path to an object in data storage starting with 'cp://' scheme
    """
    DataStorageOperations.get_object_tags(path, version)
Пример #5
0
def storage_restore_item(path, version):
    """ Restores file version in a datastorage.
    If version is not specified it will try to restore the latest non deleted version.
    Otherwise a specified version will be restored.
    """
    DataStorageOperations.restore(path, version)
Пример #6
0
def storage_copy_item(source, destination, recursive, force, exclude, include, quiet, skip_existing, tags, file_list):
    """ Copies files from one datastorage to another one
    or between local filesystem and a datastorage (in both directions)
    """
    DataStorageOperations.cp(source, destination, recursive, force,
                             exclude, include, quiet, tags, file_list, skip_existing=skip_existing)
Пример #7
0
def storage_remove_item(path, yes, version, hard_delete, recursive, exclude, include):
    """ Removes file or folder from a datastorage
    """
    DataStorageOperations.storage_remove_item(path, yes, version, hard_delete, recursive, exclude, include)
Пример #8
0
def storage_mk_dir(folders):
    """ Creates a directory in a datastorage
    """
    DataStorageOperations.storage_mk_dir(folders)
Пример #9
0
def storage_list(path, show_details, show_versions, recursive, page, all):
    """Lists storage contents
    """
    DataStorageOperations.storage_list(path, show_details, show_versions, recursive, page, all)
Пример #10
0
def mvtodir(name, directory):
    """Moves a datastorage to a new parent folder
    """
    DataStorageOperations.mvtodir(name, directory)
Пример #11
0
def delete(name, on_cloud, yes):
    """Deletes a datastorage
    """
    DataStorageOperations.delete(name, on_cloud, yes)
Пример #12
0
def create(name, description, short_term_storage, long_term_storage, versioning, backup_duration, type,
           parent_folder, on_cloud, path):
    """Creates a new datastorage
    """
    DataStorageOperations.save_data_storage(name, description, short_term_storage,long_term_storage, versioning,
                                            backup_duration, type, parent_folder, on_cloud, path)