ucscsdk/utils/ucscfirmware.py
def schedule_infra_fw_update(handle, domain_group, schedule, user_ack_en=True,
                             fi_6100_6200_ver=None, fi_mini_6300_ver=None,
                             fi_6300_ver=None, catalog_ver=None):
    """
    Schedules infra fw update for the domain group
    Note: infra fw update will happen only for the bundles which are imported
          to UcsCentral

    Args:
        handle (UcscHandle): UcsCentral Connection handle
        schedule(string): Date string in format YYYY-MM-DDTHH:MM:SS
                          eg. 2016-08-30T05:19:05,
                          you can use "now" to trigger immediate fw_update
        domain_group(string): Full domain_group with root/<org_name>/..
        user_ack_en(boolean): Enable/Disable user ack for firmware update
                            By default True
        fi_6100_6200_ver: FI 6100/6200 FW version
        fi_mini_6300_ver: FI Mini 6300 FW version
        fi_6300_ver:      FI 3rd Gen 6300 FW version
        catalog_ver:      Catalog version
    Returns:
        None

    Example:
        schedule_infra_fw_update(handle, domain_group="root", schedule="now")
        schedule_infra_fw_update(handle, domain_group="root",
                                schedule="2016-08-31T22:33:07",
                                fi_mini_6300_ver="3.1(1j)A",
                                catalog_ver="3.1(1)T")
    """
    if schedule == "now":
        date_str = datetime.datetime.today().strftime("%Y-%m-%dT%H:%M:%S")
    else:
        date_str = schedule
        if (datetime.datetime.strptime(date_str, "%Y-%m-%dT%H:%M:%S")
                < datetime.datetime.today()):
            raise UcscValidationException(
                "Schedule can not be past date %s " % schedule)

    domain_group_dn = get_domain_group_dn(handle, domain_group)
    fw_infra_policy_dn = domain_group_dn + "/fw-infra-policy"

    if fi_6100_6200_ver is not None:
        _validate_firmware_bundle(handle, "classic", fi_6100_6200_ver)
        classic_fw_dn = fw_infra_policy_dn + "/fw-family-ucs-classic "
        _add_firmware_infra_pack(handle, classic_fw_dn, fi_6100_6200_ver)

    if fi_mini_6300_ver is not None:
        _validate_firmware_bundle(handle, "mini", fi_mini_6300_ver)
        mini_fw_dn = fw_infra_policy_dn + "/fw-family-ucs-mini"
        _add_firmware_infra_pack(handle, mini_fw_dn, fi_mini_6300_ver)

    if fi_6300_ver is not None:
        _validate_firmware_bundle(handle, "classic-3gen", fi_6300_ver)
        classic_3gen_fw_dn = fw_infra_policy_dn + "/fw-family-ucs-classic-3gen"
        _add_firmware_infra_pack(handle, classic_3gen_fw_dn, fi_6300_ver)

    if catalog_ver is not None:
        _validate_firmware_bundle(handle, "catalog", catalog_ver)
        catalog_pack = FirmwareCatalogPack(parent_mo_or_dn=domain_group_dn,
                                           name="default",
                                           catalog_version=catalog_ver)
        handle.add_mo(catalog_pack, modify_present=True)

    handle.commit()

    admin_state = (TrigSchedConsts.ADMIN_STATE_UNTRIGGERED,
                   TrigSchedConsts.ADMIN_STATE_USER_ACK)[user_ack_en]

    fw_update_sched = TrigSched(parent_mo_or_dn=domain_group_dn,
                                name="infra-fw",
                                admin_state=admin_state,
                                sched_mode=TrigSchedConsts.SCHED_MODE_ADVANCED,
                                sched_type=TrigSchedConsts.SCHED_TYPE_DEFAULT)

    handle.add_mo(fw_update_sched, modify_present=True)
    handle.commit()

    fw_update_sched_window = TrigAbsWindow(parent_mo_or_dn=fw_update_sched.dn,
                                           name="infra-fw",
                                           date=date_str)
    handle.add_mo(fw_update_sched_window, modify_present=True)
    handle.commit()

    Schedules infra fw update for the domain group
    Note: infra fw update will happen only for the bundles which are imported
          to UcsCentral

    Args:
        handle (UcscHandle): UcsCentral Connection handle
        schedule(string): Date string in format YYYY-MM-DDTHH:MM:SS
                          eg. 2016-08-30T05:19:05,
                          you can use "now" to trigger immediate fw_update
        domain_group(string): Full domain_group with root/<org_name>/..
        user_ack_en(boolean): Enable/Disable user ack for firmware update
                            By default True
        fi_6100_6200_ver: FI 6100/6200 FW version
        fi_mini_6300_ver: FI Mini 6300 FW version
        fi_6300_ver:      FI 3rd Gen 6300 FW version
        catalog_ver:      Catalog version
    Returns:
        None

    Example:
        schedule_infra_fw_update(handle, domain_group="root", schedule="now")
        schedule_infra_fw_update(handle, domain_group="root",
                                schedule="2016-08-31T22:33:07",
                                fi_mini_6300_ver="3.1(1j)A",
                                catalog_ver="3.1(1)T")
    
Schedules infra fw update for the domain group
Note: infra fw update will happen only for the bundles which are imported
to UcsCentral
Schedules infra fw update for the domain group Note : infra fw update will happen only for the bundles which are imported to UcsCentral
def schedule_infra_fw_update(handle, domain_group, schedule, user_ack_en=True,
                             fi_6100_6200_ver=None, fi_mini_6300_ver=None,
                             fi_6300_ver=None, catalog_ver=None):
    if schedule == "now":
        date_str = datetime.datetime.today().strftime("%Y-%m-%dT%H:%M:%S")
    else:
        date_str = schedule
        if (datetime.datetime.strptime(date_str, "%Y-%m-%dT%H:%M:%S")
                < datetime.datetime.today()):
            raise UcscValidationException(
                "Schedule can not be past date %s " % schedule)
    domain_group_dn = get_domain_group_dn(handle, domain_group)
    fw_infra_policy_dn = domain_group_dn + "/fw-infra-policy"
    if fi_6100_6200_ver is not None:
        _validate_firmware_bundle(handle, "classic", fi_6100_6200_ver)
        classic_fw_dn = fw_infra_policy_dn + "/fw-family-ucs-classic "
        _add_firmware_infra_pack(handle, classic_fw_dn, fi_6100_6200_ver)
    if fi_mini_6300_ver is not None:
        _validate_firmware_bundle(handle, "mini", fi_mini_6300_ver)
        mini_fw_dn = fw_infra_policy_dn + "/fw-family-ucs-mini"
        _add_firmware_infra_pack(handle, mini_fw_dn, fi_mini_6300_ver)
    if fi_6300_ver is not None:
        _validate_firmware_bundle(handle, "classic-3gen", fi_6300_ver)
        classic_3gen_fw_dn = fw_infra_policy_dn + "/fw-family-ucs-classic-3gen"
        _add_firmware_infra_pack(handle, classic_3gen_fw_dn, fi_6300_ver)
    if catalog_ver is not None:
        _validate_firmware_bundle(handle, "catalog", catalog_ver)
        catalog_pack = FirmwareCatalogPack(parent_mo_or_dn=domain_group_dn,
                                           name="default",
                                           catalog_version=catalog_ver)
        handle.add_mo(catalog_pack, modify_present=True)
    handle.commit()
    admin_state = (TrigSchedConsts.ADMIN_STATE_UNTRIGGERED,
                   TrigSchedConsts.ADMIN_STATE_USER_ACK)[user_ack_en]
    fw_update_sched = TrigSched(parent_mo_or_dn=domain_group_dn,
                                name="infra-fw",
                                admin_state=admin_state,
                                sched_mode=TrigSchedConsts.SCHED_MODE_ADVANCED,
                                sched_type=TrigSchedConsts.SCHED_TYPE_DEFAULT)
    handle.add_mo(fw_update_sched, modify_present=True)
    handle.commit()
    fw_update_sched_window = TrigAbsWindow(parent_mo_or_dn=fw_update_sched.dn,
                                           name="infra-fw",
                                           date=date_str)
    handle.add_mo(fw_update_sched_window, modify_present=True)
    handle.commit()
def schedule_infra_fw_update ( handle , domain_group , schedule , user_ack_en = True , fi_6100_6200_ver = None , fi_mini_6300_ver = None , fi_6300_ver = None , catalog_ver = None ) : if schedule == "now" : date_str = datetime . datetime . today ( ) . strftime ( "%Y-%m-%dT%H:%M:%S" ) else : date_str = schedule if ( datetime . datetime . strptime ( date_str , "%Y-%m-%dT%H:%M:%S" ) < datetime . datetime . today ( ) ) : raise UcscValidationException ( "Schedule can not be past date %s " % schedule ) domain_group_dn = get_domain_group_dn ( handle , domain_group ) fw_infra_policy_dn = domain_group_dn + "/fw-infra-policy" if fi_6100_6200_ver is not None : _validate_firmware_bundle ( handle , "classic" , fi_6100_6200_ver ) classic_fw_dn = fw_infra_policy_dn + "/fw-family-ucs-classic " _add_firmware_infra_pack ( handle , classic_fw_dn , fi_6100_6200_ver ) if fi_mini_6300_ver is not None : _validate_firmware_bundle ( handle , "mini" , fi_mini_6300_ver ) mini_fw_dn = fw_infra_policy_dn + "/fw-family-ucs-mini" _add_firmware_infra_pack ( handle , mini_fw_dn , fi_mini_6300_ver ) if fi_6300_ver is not None : _validate_firmware_bundle ( handle , "classic-3gen" , fi_6300_ver ) classic_3gen_fw_dn = fw_infra_policy_dn + "/fw-family-ucs-classic-3gen" _add_firmware_infra_pack ( handle , classic_3gen_fw_dn , fi_6300_ver ) if catalog_ver is not None : _validate_firmware_bundle ( handle , "catalog" , catalog_ver ) catalog_pack = FirmwareCatalogPack ( parent_mo_or_dn = domain_group_dn , name = "default" , catalog_version = catalog_ver ) handle . add_mo ( catalog_pack , modify_present = True ) handle . commit ( ) admin_state = ( TrigSchedConsts . ADMIN_STATE_UNTRIGGERED , TrigSchedConsts . ADMIN_STATE_USER_ACK ) [ user_ack_en ] fw_update_sched = TrigSched ( parent_mo_or_dn = domain_group_dn , name = "infra-fw" , admin_state = admin_state , sched_mode = TrigSchedConsts . SCHED_MODE_ADVANCED , sched_type = TrigSchedConsts . SCHED_TYPE_DEFAULT ) handle . add_mo ( fw_update_sched , modify_present = True ) handle . commit ( ) fw_update_sched_window = TrigAbsWindow ( parent_mo_or_dn = fw_update_sched . dn , name = "infra-fw" , date = date_str ) handle . add_mo ( fw_update_sched_window , modify_present = True ) handle . commit ( )
Schedules infra fw update for the domain group
Note: infra fw update will happen only for the bundles which are imported
to UcsCentral
Schedules infra fw update for the domain group Note : infra fw update will happen only for the bundles which are imported to UcsCentral
"""
    Schedules infra fw update for the domain group
    Note: infra fw update will happen only for the bundles which are imported
          to UcsCentral

    Args:
        handle (UcscHandle): UcsCentral Connection handle
        schedule(string): Date string in format YYYY-MM-DDTHH:MM:SS
                          eg. 2016-08-30T05:19:05,
                          you can use "now" to trigger immediate fw_update
        domain_group(string): Full domain_group with root/<org_name>/..
        user_ack_en(boolean): Enable/Disable user ack for firmware update
                            By default True
        fi_6100_6200_ver: FI 6100/6200 FW version
        fi_mini_6300_ver: FI Mini 6300 FW version
        fi_6300_ver:      FI 3rd Gen 6300 FW version
        catalog_ver:      Catalog version
    Returns:
        None

    Example:
        schedule_infra_fw_update(handle, domain_group="root", schedule="now")
        schedule_infra_fw_update(handle, domain_group="root",
                                schedule="2016-08-31T22:33:07",
                                fi_mini_6300_ver="3.1(1j)A",
                                catalog_ver="3.1(1)T")
    """
None
handle
UcsCentral Connection handle
UcsCentral Connection handle
domain_group
Full domain_group with root//
Full domain_group with root //
schedule
Date string in format YYYY-MM-DDTHH:MM:SS
eg.
Date string in format YYYY - MM - DDTHH : MM : SS eg .
user_ack_en
Enable/Disable user ack for firmware update
By default True
Enable / Disable user ack for firmware update By default True
fi_6100_6200_ver
None
fi_mini_6300_ver
FI Mini 6300 FW version
FI Mini 6300 FW version
fi_6300_ver
FI 3rd Gen 6300 FW version
FI 3rd Gen 6300 FW version
catalog_ver
None
examples
None