Exemplo n.º 1
0
def ldap_provider_configure_group_rules(handle,
                                        ldap_provider_name=None,
                                        authorization=None,
                                        traversal=None,
                                        use_primary_group=None,
                                        target_attr=None,
                                        name=None,
                                        descr=None):

    from ucsmsdk.mometa.aaa.AaaLdapGroupRule import AaaLdapGroupRule

    dn = "sys/ldap-ext/provider-" + ldap_provider_name
    obj = handle.query_dn(dn)
    if obj is None:
        raise ValueError("Ldap Provider does not exist.")

    mo = AaaLdapGroupRule(parent_mo_or_dn=obj)
    if ldap_provider_name is not None:
        mo.ldap_provider_name = ldap_provider_name
    if authorization is not None:
        mo.authorization = authorization
    if traversal is not None:
        mo.traversal = traversal
    if use_primary_group is not None:
        mo.use_primary_group = use_primary_group
    if target_attr is not None:
        mo.target_attr = target_attr
    if name is not None:
        mo.name = name
    if descr is not None:
        mo.descr = descr

    handle.add_mo(mo, True)
    handle.commit()
Exemplo n.º 2
0
def ldap_provider_configure_group_rules(handle, ldap_provider_name=None,
                                        authorization=None, traversal=None,
                                        use_primary_group=None,
                                        target_attr=None, name=None,
                                        descr=None):

    from ucsmsdk.mometa.aaa.AaaLdapGroupRule import AaaLdapGroupRule

    dn = "sys/ldap-ext/provider-" + ldap_provider_name
    obj = handle.query_dn(dn)
    if obj is None:
        raise ValueError("Ldap Provider does not exist.")

    mo = AaaLdapGroupRule(parent_mo_or_dn=obj)
    if ldap_provider_name is not None:
        mo.ldap_provider_name = ldap_provider_name
    if authorization is not None:
        mo.authorization = authorization
    if traversal is not None:
        mo.traversal = traversal
    if use_primary_group is not None:
        mo.use_primary_group = use_primary_group
    if target_attr is not None:
        mo.target_attr = target_attr
    if name is not None:
        mo.name = name
    if descr is not None:
        mo.descr = descr

    handle.add_mo(mo, True)
    handle.commit()
Exemplo n.º 3
0
def ldap_provider_configure_group_rules(handle,
                                        ldap_provider_name,
                                        authorization=None,
                                        traversal=None,
                                        use_primary_group=None,
                                        target_attr=None,
                                        name=None,
                                        descr=None):
    """
    configures group rules of a ldap provider

    Args:
        handle (UcsHandle)
        ldap_provider_name (string): name of ldap provider
        authorization (string): authorization
        traversal (string): traversal
        use_primary_group (string): use_primary_group
        target_attr (string): target_attr
        name (string): name
        descr (string): descr

    Returns:
        AaaLdapGroupRule : Managed Object

    Example:
        ldap_provider_configure_group_rules(handle, name="test_ldap_provider")
    """

    from ucsmsdk.mometa.aaa.AaaLdapGroupRule import AaaLdapGroupRule

    dn = "sys/ldap-ext/provider-" + ldap_provider_name
    obj = handle.query_dn(dn)
    if not obj:
        raise ValueError("Ldap Provider does not exist.")

    mo = AaaLdapGroupRule(parent_mo_or_dn=obj)
    if authorization is not None:
        mo.authorization = authorization
    if traversal is not None:
        mo.traversal = traversal
    if use_primary_group is not None:
        mo.use_primary_group = use_primary_group
    if target_attr is not None:
        mo.target_attr = target_attr
    if name is not None:
        mo.name = name
    if descr is not None:
        mo.descr = descr

    handle.add_mo(mo, True)
    handle.commit()
    return mo
Exemplo n.º 4
0
def ldap_provider_configure_group_rules(handle, ldap_provider_name,
                                        authorization=None, traversal=None,
                                        use_primary_group=None,
                                        target_attr=None, name=None,
                                        descr=None):
    """
    configures group rules of a ldap provider

    Args:
        handle (UcsHandle)
        ldap_provider_name (string): name of ldap provider
        authorization (string): authorization
        traversal (string): traversal
        use_primary_group (string): use_primary_group
        target_attr (string): target_attr
        name (string): name
        descr (string): descr

    Returns:
        AaaLdapGroupRule : Managed Object

    Example:
        ldap_provider_configure_group_rules(handle, name="test_ldap_provider")
    """

    from ucsmsdk.mometa.aaa.AaaLdapGroupRule import AaaLdapGroupRule

    dn = "sys/ldap-ext/provider-" + ldap_provider_name
    obj = handle.query_dn(dn)
    if not obj:
        raise ValueError("Ldap Provider does not exist.")

    mo = AaaLdapGroupRule(parent_mo_or_dn=obj)
    if authorization is not None:
        mo.authorization = authorization
    if traversal is not None:
        mo.traversal = traversal
    if use_primary_group is not None:
        mo.use_primary_group = use_primary_group
    if target_attr is not None:
        mo.target_attr = target_attr
    if name is not None:
        mo.name = name
    if descr is not None:
        mo.descr = descr

    handle.add_mo(mo, True)
    handle.commit()
    return mo