ucscsdk/utils/ucscdomain.py
def domain_assign_to_domaingroup(handle, domain_ip,
                                 domain_group, domain_name=None):
    """
    This method registers Domain to UcsCentral.

    Args:
        handle (UcscHandle): UcsCentral Connection handle
        domain_ip(str): IP of domain, set 'None' if domain_name is valid
        domain_group(string): Full domain_group with root/<org_name>/..
        domain_name(str): Optional Domain name, valid only if domain_ip is None

    Returns:
        None

    Example:
        domain_assign_to_domaingroup(handle, domain_ip="192.168.1.1",
                                     domain_group="root/sample_dom_grp")
    """

    from ucscsdk.mometa.compute.ComputeGroupMembership import\
        ComputeGroupMembership

    domain_group_dn = get_domain_group_dn(handle, domain_group)

    compute_class = handle.query_classid(class_id="ComputeResourceAggrEp")
    compute_dn = compute_class[0].dn

    if domain_ip is None:
        if domain_name is None:
            raise UcscValidationException(
                "Provide either valid domain_ip or domain_name")
        else:
            domain = get_domain(handle, domain_ip=None,
                                domain_name=domain_name)
            domain_ip = domain.address

    domain_assign = ComputeGroupMembership(parent_mo_or_dn=compute_dn,
                                           ip=domain_ip,
                                           group_dn=domain_group_dn)
    handle.set_mo(domain_assign)
    handle.commit()

    return domain_assign

    This method registers Domain to UcsCentral.

    Args:
        handle (UcscHandle): UcsCentral Connection handle
        domain_ip(str): IP of domain, set 'None' if domain_name is valid
        domain_group(string): Full domain_group with root/<org_name>/..
        domain_name(str): Optional Domain name, valid only if domain_ip is None

    Returns:
        None

    Example:
        domain_assign_to_domaingroup(handle, domain_ip="192.168.1.1",
                                     domain_group="root/sample_dom_grp")
    
This method registers Domain to UcsCentral.
This method registers Domain to UcsCentral .
def domain_assign_to_domaingroup(handle, domain_ip,
                                 domain_group, domain_name=None):
    from ucscsdk.mometa.compute.ComputeGroupMembership import\
        ComputeGroupMembership
    domain_group_dn = get_domain_group_dn(handle, domain_group)
    compute_class = handle.query_classid(class_id="ComputeResourceAggrEp")
    compute_dn = compute_class[0].dn
    if domain_ip is None:
        if domain_name is None:
            raise UcscValidationException(
                "Provide either valid domain_ip or domain_name")
        else:
            domain = get_domain(handle, domain_ip=None,
                                domain_name=domain_name)
            domain_ip = domain.address
    domain_assign = ComputeGroupMembership(parent_mo_or_dn=compute_dn,
                                           ip=domain_ip,
                                           group_dn=domain_group_dn)
    handle.set_mo(domain_assign)
    handle.commit()
    return domain_assign
def domain_assign_to_domaingroup ( handle , domain_ip , domain_group , domain_name = None ) : from ucscsdk . mometa . compute . ComputeGroupMembership import ComputeGroupMembership domain_group_dn = get_domain_group_dn ( handle , domain_group ) compute_class = handle . query_classid ( class_id = "ComputeResourceAggrEp" ) compute_dn = compute_class [ 0 ] . dn if domain_ip is None : if domain_name is None : raise UcscValidationException ( "Provide either valid domain_ip or domain_name" ) else : domain = get_domain ( handle , domain_ip = None , domain_name = domain_name ) domain_ip = domain . address domain_assign = ComputeGroupMembership ( parent_mo_or_dn = compute_dn , ip = domain_ip , group_dn = domain_group_dn ) handle . set_mo ( domain_assign ) handle . commit ( ) return domain_assign
This method registers Domain to UcsCentral.
This method registers Domain to UcsCentral .
"""
    This method registers Domain to UcsCentral.

    Args:
        handle (UcscHandle): UcsCentral Connection handle
        domain_ip(str): IP of domain, set 'None' if domain_name is valid
        domain_group(string): Full domain_group with root/<org_name>/..
        domain_name(str): Optional Domain name, valid only if domain_ip is None

    Returns:
        None

    Example:
        domain_assign_to_domaingroup(handle, domain_ip="192.168.1.1",
                                     domain_group="root/sample_dom_grp")
    """
None
handle
UcsCentral Connection handle
UcsCentral Connection handle
domain_ip
IP of domain, set 'None' if domain_name is valid
IP of domain set ' None ' if domain_name is valid
domain_group
Full domain_group with root//
Full domain_group with root //
domain_name
Optional Domain name, valid only if domain_ip is None
Optional Domain name valid only if domain_ip is None
examples
domain_assign_to_domaingroup(handle, domain_ip="192.168.1.1",
domain_group="root/sample_dom_grp")
domain_assign_to_domaingroup ( handle domain_ip = " 192 . 168 . 1 . 1 " domain_group = " root / sample_dom_grp " )