Пример #1
0
    def stm_enabled(self, value):
        """Short Term Monitoring.

        Short Term metrics can affect the performance of workloads.  Not
        recommended for production workload.
        """
        self.set_parm_value(_STM_ENABLED, u.sanitize_bool_for_api(value))
Пример #2
0
    def bld(cls, adapter, pvid, vlan_ids, vswitch, trunk_pri=1):
        """Create the TrunkAdapter element that can be used for SEA creation.

        The returned adapter uses the "next available high slot" option,
        meaning that the API will attempt to assign the next available slot
        number that's higher than all the existing assigned slot numbers.

        :param adapter: A pypowervm.adapter.Adapter (for traits, etc.)
        :param pvid: The primary VLAN ID (ex. 1) for the Network Bridge.
        :param vlan_ids: Additional VLAN ids for the trunk adapters.
        :param vswitch: The vswitch wrapper to retrieve ID and href.
        :param trunk_pri: Trunk priority of this adapter. Defaults to 1.
        :returns: A new TrunkAdapter ElementWrapper that represents the new
                  TrunkAdapter.
        """
        ta = super(TrunkAdapter, cls)._bld(adapter)

        ta._required(True)
        ta.pvid = pvid
        ta.tagged_vlans = vlan_ids
        ta.has_tag_support = True if vlan_ids else False
        ta._vswitch_id(vswitch.switch_id)
        ta._trunk_pri(trunk_pri)

        # UseNextAvailableSlotID field - High only if available
        unasi_field = (_TA_USE_NEXT_AVAIL_HIGH_SLOT
                       if adapter.traits.has_high_slot else
                       _TA_USE_NEXT_AVAIL_SLOT)
        ta.set_parm_value(unasi_field, u.sanitize_bool_for_api(True))
        ta._associated_vswitch_uri(vswitch.related_href)

        return ta
Пример #3
0
    def bld(cls, adapter, pvid, vlan_ids, vswitch, trunk_pri=1):
        """Create the TrunkAdapter element that can be used for SEA creation.

        The returned adapter uses the "next available high slot" option,
        meaning that the API will attempt to assign the next available slot
        number that's higher than all the existing assigned slot numbers.

        :param adapter: A pypowervm.adapter.Adapter (for traits, etc.)
        :param pvid: The primary VLAN ID (ex. 1) for the Network Bridge.
        :param vlan_ids: Additional VLAN ids for the trunk adapters.
        :param vswitch: The vswitch wrapper to retrieve ID and href.
        :param trunk_pri: Trunk priority of this adapter. Defaults to 1.
        :returns: A new TrunkAdapter ElementWrapper that represents the new
                  TrunkAdapter.
        """
        ta = super(TrunkAdapter, cls)._bld(adapter)

        ta._required(True)
        ta.pvid = pvid
        ta.tagged_vlans = vlan_ids
        ta.has_tag_support = True if vlan_ids else False
        ta._vswitch_id(vswitch.switch_id)
        ta._trunk_pri(trunk_pri)

        # UseNextAvailableSlotID field - High only if available
        unasi_field = (_TA_USE_NEXT_AVAIL_HIGH_SLOT
                       if adapter.traits.has_high_slot
                       else _TA_USE_NEXT_AVAIL_SLOT)
        ta.set_parm_value(unasi_field, u.sanitize_bool_for_api(True))
        ta._associated_vswitch_uri(vswitch.related_href)

        return ta
Пример #4
0
    def is_mover_service_partition(self, value):
        """Set the Mover Service Partition designation.

        :param value: Boolean indicating whether the VIOS should be designated
                      as a Mover Service Partition.
        """
        self.set_parm_value(_VIO_MVR_SVC_PARTITION,
                            u.sanitize_bool_for_api(value))
Пример #5
0
    def _use_next_avail_slot_id(self, unasi):
        """Use next available (high) slot ID.

        :param unasi: Boolean value to set (True or False)
        """
        unasi_field = (_TA_USE_NEXT_AVAIL_HIGH_SLOT if
                       self.traits.has_high_slot else _TA_USE_NEXT_AVAIL_SLOT)
        self.set_parm_value(unasi_field, u.sanitize_bool_for_api(unasi))
Пример #6
0
    def _use_next_avail_slot_id(self, unasi):
        """Use next available (high) slot ID.

        :param unasi: Boolean value to set (True or False)
        """
        unasi_field = (_TA_USE_NEXT_AVAIL_HIGH_SLOT
                       if self.traits.has_high_slot
                       else _TA_USE_NEXT_AVAIL_SLOT)
        self.set_parm_value(unasi_field, u.sanitize_bool_for_api(unasi))
Пример #7
0
 def required(self, val):
     self.set_parm_value(_IO_SLOT_REQ, u.sanitize_bool_for_api(val))
Пример #8
0
 def _use_next_slot(self, use):
     """Use next available (not high) slot."""
     self.set_parm_value(_NEXT_SLOT, u.sanitize_bool_for_api(use))
Пример #9
0
 def test_sanitize_bool_for_api(self):
     self.assertEqual('true', util.sanitize_bool_for_api(True))
     self.assertEqual('false', util.sanitize_bool_for_api(False))
     self.assertEqual('true', util.sanitize_bool_for_api('True'))
     self.assertEqual('false', util.sanitize_bool_for_api('False'))
Пример #10
0
 def tagged(self, is_tagged):
     self.set_parm_value(_VNET_TAG, u.sanitize_bool_for_api(is_tagged))
Пример #11
0
 def has_tag_support(self, new_val):
     self.set_parm_value(_TA_TAG_SUPP, u.sanitize_bool_for_api(new_val))
Пример #12
0
 def _is_primary(self, val):
     self.set_parm_value(_SEA_PRIMARY, u.sanitize_bool_for_api(val))
Пример #13
0
 def _is_thin(self, val):
     """val is boolean."""
     self.set_parm_value(_LU_THIN, u.sanitize_bool_for_api(val))
Пример #14
0
 def compute_ltm_enabled(self, value):
     """Compute Long Term Monitoring."""
     self.set_parm_value(_COMP_LTM_ENABLED, u.sanitize_bool_for_api(value))
Пример #15
0
    def _failover(self, value):
        """Private setter for the failover attr.

        Determined by backing adapters on NetworkBridge creation.
        """
        self.set_parm_value(_NB_FAILOVER, u.sanitize_bool_for_api(value))
Пример #16
0
 def aggregation_enabled(self, value):
     """Metrics Aggregation."""
     self.set_parm_value(_AGG_ENABLED, u.sanitize_bool_for_api(value))
Пример #17
0
 def ltm_enabled(self, value):
     """Long Term Monitoring."""
     self.set_parm_value(_LTM_ENABLED, u.sanitize_bool_for_api(value))
Пример #18
0
 def tagged(self, is_tagged):
     self.set_parm_value(_VNET_TAG, u.sanitize_bool_for_api(is_tagged))
Пример #19
0
 def _required(self, value):
     self.set_parm_value(_TA_REQUIRED, u.sanitize_bool_for_api(value))
Пример #20
0
 def _has_dedicated(self, val):
     """Expects 'true' (string) for dedicated or 'false' for shared."""
     self.set_parm_value(_PC_HAS_DED_PROCS, u.sanitize_bool_for_api(val))
Пример #21
0
 def restrictedio(self, value):
     self.set_parm_value(_LPAR_RESTRICTED_IO,
                         u.sanitize_bool_for_api(value))
Пример #22
0
 def _bus_grp_required(self, val):
     self.set_parm_value(_ASSOC_IO_SLOT_BUS_GRP,
                         u.sanitize_bool_for_api(val))
Пример #23
0
 def has_tag_support(self, new_val):
     self.set_parm_value(_TA_TAG_SUPP, u.sanitize_bool_for_api(new_val))
Пример #24
0
 def required(self, val):
     self.set_parm_value(_IO_SLOT_REQ, u.sanitize_bool_for_api(val))
Пример #25
0
 def load_balance(self, value):
     self.set_parm_value(_NB_LOADBALANCE, u.sanitize_bool_for_api(value))
Пример #26
0
 def is_service_partition(self, value):
     """Set if this is the service partition."""
     self.set_parm_value(_BP_SVC_PARTITION, u.sanitize_bool_for_api(value))
Пример #27
0
 def _required(self, value):
     self.set_parm_value(_TA_REQUIRED, u.sanitize_bool_for_api(value))
Пример #28
0
 def _has_dedicated(self, val):
     """Expects 'true' (string) for dedicated or 'false' for shared."""
     self.set_parm_value(_PC_HAS_DED_PROCS, u.sanitize_bool_for_api(val))
Пример #29
0
    def rr_enabled(self, value):
        """Turn Remote Restart on or off.

        LPAR must be powered off.
        """
        self.set_parm_value(_LPAR_RR, u.sanitize_bool_for_api(value))
Пример #30
0
 def auto_pri_failover(self, val):
     self.set_parm_value(_VNICD_AUTO_FB, u.sanitize_bool_for_api(val))
Пример #31
0
 def _is_thin(self, val):
     """val is boolean."""
     self.set_parm_value(_LU_THIN, u.sanitize_bool_for_api(val))
Пример #32
0
 def flow_ctl(self, val):
     self.set_parm_value(_SRIOVPP_CFG_FLOWCTL, u.sanitize_bool_for_api(val))
Пример #33
0
 def _bus_grp_required(self, val):
     self.set_parm_value(_ASSOC_IO_SLOT_BUS_GRP,
                         u.sanitize_bool_for_api(val))
Пример #34
0
 def _is_promisc(self, value):
     self.set_parm_value(_SRIOVLP_IS_PROMISC,
                         u.sanitize_bool_for_api(value))
Пример #35
0
 def is_service_partition(self, value):
     """Set if this is the service partition."""
     self.set_parm_value(_BP_SVC_PARTITION, u.sanitize_bool_for_api(value))
Пример #36
0
 def test_sanitize_bool_for_api(self):
     self.assertEqual('true', util.sanitize_bool_for_api(True))
     self.assertEqual('false', util.sanitize_bool_for_api(False))
     self.assertEqual('true', util.sanitize_bool_for_api('True'))
     self.assertEqual('false', util.sanitize_bool_for_api('False'))
Пример #37
0
 def srr_enabled(self, value):
     self.set_parm_value(_LPAR_SRR, u.sanitize_bool_for_api(value),
                         attrib=pc.ATTR_KSV120)
Пример #38
0
 def srr_enabled(self, value):
     self.set_parm_value(_LPAR_SRR, u.sanitize_bool_for_api(value),
                         attrib=pc.ATTR_SCHEMA120)
Пример #39
0
 def _use_next_slot(self, use):
     """Use next available (not high) slot."""
     self.set_parm_value(_VADPT_NEXT_SLOT, u.sanitize_bool_for_api(use))
Пример #40
0
 def is_tagged_vlan_supported(self, new_val):
     """Parameter new_val is a bool (True or False)."""
     self.set_parm_value(_VADPT_TAGGED_VLAN_SUPPORT,
                         u.sanitize_bool_for_api(new_val))
Пример #41
0
 def is_tagged_vlan_supported(self, new_val):
     """Parameter new_val is a bool (True or False)."""
     self.set_parm_value(_VADPT_TAGGED_VLAN_SUPPORT,
                         u.sanitize_bool_for_api(new_val))
Пример #42
0
 def _is_primary(self, val):
     self.set_parm_value(_SEA_PRIMARY, u.sanitize_bool_for_api(val))
Пример #43
0
    def rr_enabled(self, value):
        """Turn Remote Restart on or off.

        LPAR must be powered off.
        """
        self.set_parm_value(_LPAR_RR, u.sanitize_bool_for_api(value))
Пример #44
0
 def load_balance(self, value):
     self.set_parm_value(_NB_LOADBALANCE, u.sanitize_bool_for_api(value))
Пример #45
0
 def restrictedio(self, value):
     self.set_parm_value(_LPAR_RESTRICTED_IO,
                         u.sanitize_bool_for_api(value))
Пример #46
0
    def _failover(self, value):
        """Private setter for the failover attr.

        Determined by backing adapters on NetworkBridge creation.
        """
        self.set_parm_value(_NB_FAILOVER, u.sanitize_bool_for_api(value))