コード例 #1
0
ファイル: monitor.py プロジェクト: tpeponas/pypowervm
    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
ファイル: network.py プロジェクト: kairoaraujo/pypowervm
    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
ファイル: network.py プロジェクト: kairoaraujo/pypowervm
    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
ファイル: base_partition.py プロジェクト: tbreeds/pypowervm
 def required(self, val):
     self.set_parm_value(_IO_SLOT_REQ, u.sanitize_bool_for_api(val))
コード例 #8
0
ファイル: storage.py プロジェクト: kairoaraujo/pypowervm
 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
ファイル: test_util.py プロジェクト: kairoaraujo/pypowervm
 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
ファイル: network.py プロジェクト: kairoaraujo/pypowervm
 def tagged(self, is_tagged):
     self.set_parm_value(_VNET_TAG, u.sanitize_bool_for_api(is_tagged))
コード例 #11
0
ファイル: network.py プロジェクト: kairoaraujo/pypowervm
 def has_tag_support(self, new_val):
     self.set_parm_value(_TA_TAG_SUPP, u.sanitize_bool_for_api(new_val))
コード例 #12
0
ファイル: network.py プロジェクト: kairoaraujo/pypowervm
 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
ファイル: monitor.py プロジェクト: tpeponas/pypowervm
 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
ファイル: monitor.py プロジェクト: tpeponas/pypowervm
 def aggregation_enabled(self, value):
     """Metrics Aggregation."""
     self.set_parm_value(_AGG_ENABLED, u.sanitize_bool_for_api(value))
コード例 #17
0
ファイル: monitor.py プロジェクト: tpeponas/pypowervm
 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
ファイル: base_partition.py プロジェクト: tbreeds/pypowervm
 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
ファイル: network.py プロジェクト: kairoaraujo/pypowervm
 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
ファイル: iocard.py プロジェクト: tpeponas/pypowervm
 def auto_pri_failover(self, val):
     self.set_parm_value(_VNICD_AUTO_FB, u.sanitize_bool_for_api(val))
コード例 #31
0
ファイル: storage.py プロジェクト: kairoaraujo/pypowervm
 def _is_thin(self, val):
     """val is boolean."""
     self.set_parm_value(_LU_THIN, u.sanitize_bool_for_api(val))
コード例 #32
0
ファイル: iocard.py プロジェクト: tpeponas/pypowervm
 def flow_ctl(self, val):
     self.set_parm_value(_SRIOVPP_CFG_FLOWCTL, u.sanitize_bool_for_api(val))
コード例 #33
0
ファイル: base_partition.py プロジェクト: tbreeds/pypowervm
 def _bus_grp_required(self, val):
     self.set_parm_value(_ASSOC_IO_SLOT_BUS_GRP,
                         u.sanitize_bool_for_api(val))
コード例 #34
0
ファイル: iocard.py プロジェクト: tpeponas/pypowervm
 def _is_promisc(self, value):
     self.set_parm_value(_SRIOVLP_IS_PROMISC,
                         u.sanitize_bool_for_api(value))
コード例 #35
0
ファイル: base_partition.py プロジェクト: tbreeds/pypowervm
 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
ファイル: test_util.py プロジェクト: tpeponas/pypowervm
 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
ファイル: network.py プロジェクト: kairoaraujo/pypowervm
 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
ファイル: network.py プロジェクト: kairoaraujo/pypowervm
 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
ファイル: network.py プロジェクト: kairoaraujo/pypowervm
    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))