Exemple #1
0
def create_qtree_pycl(volume_name: str, vserver_name: str,
                      qtree_name: str) -> None:
    """Creates a new quota tree in a volume"""

    data = {
        'name': qtree_name,
        'volume': {
            'name': volume_name
        },
        'svm': {
            'name': vserver_name
        },
        'security_style': 'unix',
        'unix_permissions': 744,
        'export_policy_name': 'default',
        'qos_policy': {
            'max_throughput_ops': 1000
        }
    }
    qtree = Qtree(**data)
    try:
        qtree.post()
        print("Qtree %s created successfully" % qtree.name)
    except NetAppRestError as err:
        print("Error: QTree was not created: %s" % err)
    return
Exemple #2
0
def create_qtree(qtree_name: str, volume_name: str, vserver_name: str) -> None:
    """Creates a new volume in a SVM"""
    print("Creating QTree...")
    data = {
        "name": qtree_name,
        "svm": {
            "name": vserver_name
        },
        "volume": {
            "name": volume_name
        }
    }

    qtree = Qtree(**data)

    try:
        qtree.post()
        print("qtree %s created successfully" % qtree.name)
    except NetAppRestError as err:
        print("qtree create: %s" % err)
    return